precommit
Precommit
Workflow
- Read
package.jsonto identify available scripts - Format + lint fix: run
npm run lint-fixornpm run lint:fix(whichever exists) - Lint + types: run
npm run lint(runstsc --noEmit+ eslint) - Tests: run
npm test - Report overall PASS or FAIL with file:line error references
Rules
- Always auto-fix before reporting errors
- Run lint-fix → lint check → test sequentially
- If lint-fix fails, still run lint check and tests; report all failures at the end
- Report errors as
file:linereferences - Never commit, stage, or push anything
Error Handling
- If no
package.json→ report and stop - If neither
lint-fixnorlint:fixscript exists → skip fix, still runlint - If
lintscript missing → skip lint entirely, note it was skipped - If
testscript missing → skip tests, note it was skipped - If all scripts missing → report nothing to run, stop
- If tests time out → report and suggest increasing
--testTimeoutin runner config - If runner crashes (exit code other than 0 or 1) → report crash output and stop
More from helderberto/skills
explain-code
Explains code with visual diagrams and analogies. Use when explaining how code works, teaching about a codebase, or when the user asks "how does this work?" Don't use for modifying code, fixing bugs, or generating new implementations.
45ship
Commit and push changes using atomic commits. Use when user asks to "ship", "commit and push", or requests committing and pushing changes. Don't use for creating pull requests or reviewing changes before committing.
45safe-repo
Check for sensitive data in repository. Use when user asks to "check for sensitive data", "/safe-repo", or wants to verify no company/credential data is in the repository. Don't use for general code review, adding .gitignore entries, or scanning non-git directories.
41perf-audit
Audit frontend bundle size and performance. Use when user asks to "audit performance", "/perf-audit", "analyze bundle", "check bundle size", or wants to find performance bottlenecks. Don't use for backend performance, database query optimization, or projects without a frontend build step.
29i18n
Audit internationalization coverage and find hardcoded strings. Use when user asks to "check i18n", "/i18n", "find hardcoded strings", "check translations", or wants to verify translation coverage. Don't use for backend string extraction, non-frontend code, or projects without an i18n library.
29create-pull-request
Create GitHub pull requests. Use when user asks to "create a pull request", "open a pull request", "open a PR", "make a PR", "submit a PR", "push a PR", "/create-pull-request", or requests creating a pull request. Don't use for reviewing PRs, merging branches, or committing local changes.
28