/build:precommitfrom build
Runs precommit checks and build validation via git test run HEAD after code changes. Handles battery-aware skipping, failure fixup commits, and blocked-validation reporting.
Ships in build. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Skip the build on battery power. Resolve <plugin-root> first: in Claude Code use ${CLAUDE_PLUGIN_ROOT}; in Codex use the plugin root that contains this skills/precommit/SKILL.md file.
<plugin-root>/scripts/check-battery || { echo "⚡ Skipping precommit on battery power"; exit 0; }
git test run HEAD --retest --verbose --verbose
Validate with git test run HEAD --retest --verbose --verbose, using a timeout of at least 10 minutes. It runs the test configured via git test add, typically formatting, builds, tests, and other checks.
git:commit skill before running it, staging only the current task's files and never git add -u. Don't wait for git test run to refuse the dirty tree.--forget-results or run git test forget-results. Either one deletes every stored result in the repository, not just the named commit's. --retest already re-runs the named commit.just precommit or another direct build command. Running on the committed tree caches the result against the commit. An eager validation commit is fine; the caller can reset, squash, or fix it up later.git test run with permitted execution before requesting escalation; it refreshes the index and writes .git/index.lock before the configured command starts. If it succeeds, use that result.approval_policy=never, don't request escalation or bypass the policy. If no permitted execution can complete the command, report committed-tree validation as blocked with the command and permission error. Other checks don't establish that committed-tree validation passed.If git test is not configured for this repository, say so and suggest the build:test-setup skill.
Fix the failures, then commit the fixes with git commit --fixup=HEAD before running precommit again, staging only the files you changed for the fix (never git add -u) as the git:commit skill describes, because git test run HEAD refuses a dirty tree and the fixup folds into the original commit on the next rebase. Repeat until precommit exits 0.
Start the final message with one of:
git test run HEAD and escalation is unavailable or denied. Include the command and permission error, and report other checks separately without claiming precommit passed.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
6 skills in this plugin
/dev-serverStart or restart a project dev server on a specific or discovered port, wait until it is ready, and monitor it for automatic recovery. Use when the user asks to start, restart, keep alive, watch, or monitor a development server./fixRun git-test precommit checks and fix failures without committing, or fix the errors described in a provided build log. Use when asked to fix build, test, lint, typecheck, or precommit failures./test-allRun git-test on every local branch that contains upstream, fix failures in a subagent that folds each fix into the breaking commit, and loop until all commits pass. Use when asked to run or fix test-all./test-branchTest every commit in the current branch with git-test, delegate failures to a fix subagent, fold the fixes in with test-fix, and loop until all commits pass. Use when asked to test or fix the branch./test-setupConfigure git-test for the current repository so the test-branch and test-all skills work. Use when git test is missing or the user asks to set up branch testing.npx claudepluginhub motlin/claude-code-plugins --plugin buildOther plugins' skills for the same job