plugins/build/skills/precommit/SKILL.md
Running precommit checks and build validation. ALWAYS use after ANY code changes.
npx skillsauth add motlin/claude-code-plugins precommitInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
CRITICAL: Before running any build or test commands, check if the machine is on battery power:
${CLAUDE_PLUGIN_ROOT}/scripts/check-battery || { echo "⚡ Skipping precommit on battery power"; exit 0; }
git test run HEAD --retest --verbose --verbose
Run git test run HEAD --retest --verbose --verbose to validate code:
git test add (typically autoformatting, builds, tests, and other quality checks)If git test is not configured for this repository, clearly explain the situation and suggest running /build:test-setup to configure it.
When precommit fails (due to: type checking errors, test failures, linting issues, build errors):
Your final message MUST start with one of:
| Task | Use |
| ----------------------- | ------------------------------------ |
| Run precommit and fix | build:precommit-runner agent |
| Test all branch commits | /build:test-branch command |
| Test and autosquash | build:build-fixer-autosquash agent |
tools
This skill should be used after completing any task, before returning control to the user. Always run this skill — it handles the case where there's nothing to do.
development
Commit message format and git workflow rules. ALWAYS use this skill for every git commit — no exceptions — and whenever rewording an existing commit message.
tools
CLI guidelines. Use whenever using the Bash tool, which is almost always. Also use when you see "command not found: __zoxide_z" errors.
tools
Maven CLI invocation patterns. Use whenever running `mvn` commands in Java/Maven projects. Covers when `-am` is required, why `-o` (offline) mode hides bugs in multi-worktree setups, and how to verify compile/test cleanly without trusting stale `~/.m2` artifacts.