validate-code
Validate Code
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.
45lint
Run linting and formatting checks. Use when user asks to "run linter", "/lint", "check linting", "fix lint errors", or requests code linting/formatting. Don't use for running tests, type-checking only, or projects without a lint script in package.json.
40tdd
Guides test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants test-first development, or requests TDD workflow. Don't use for writing tests after implementation, adding tests to existing untested code, or one-off test fixes.
40commit
Create git commits following repository style. Use when user asks to "create a commit", "commit changes", "/commit", or requests committing code to git. Don't use for pushing code, creating pull requests, or reviewing changes.
38coverage
Check test coverage for unstaged changes. Use when user asks to "check coverage", "/coverage", or wants to see which unstaged changes lack test coverage. Don't use for projects without lcov coverage output, running the full test suite without coverage, or checking coverage of already-committed changes.
38