From build
Runs precommit checks and build validation via git test, with battery-aware skipping and automatic fix-and-retry on failures.
How this skill is triggered — by the user, by Claude, or both
Slash command
/build:precommitThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**CRITICAL**: Before running any build or test commands, check if the machine is on battery power:
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)git test run refuses because the worktree has unstaged, staged, or uncommitted changes, do not substitute just precommit or another direct build command. Commit the changes under test first, then rerun git test run HEAD --retest --verbose --verbose so the result is cached against a commit.git test run. The caller can reset, squash, or fix up the commit later, but skipping git test run loses the cache benefit this workflow depends on.git test run; it refreshes the index and writes .git/index.lock before the configured command starts.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 |
npx claudepluginhub motlin/claude-code-plugins --plugin buildRuns pre-commit checks in sequence: lint:fix, build, then test. Detects project ecosystem (Node, Python, Rust, Go, Java, Ruby) and runs appropriate tools. Falls back to a runner script if available.
Runs pre-commit workflow: audits staged files for 'any' types, empty catch blocks, console.logs, bugs; executes full test suite; reports commit readiness.
Runs quick validation, pytest suite, and smoke tests before staging and committing Python changes with conventional commit messages. Use when ready to commit.