Test and build automation tools that loop until all commits pass
- version
- 1.42.0
- GitHub stars
- 20
Install
/plugin install build@motlin-claude-code-pluginsRun it inside Claude Code after adding the marketplace with /plugin marketplace add motlin/claude-code-plugins.
Contents
Discovered from sourceSkills 1
Precommit and Build Validation
Battery check
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
Run precommit
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.
- Commit the current task's changes with the
git:commitskill before running it, staging only the current task's files and nevergit add -u. Don't wait forgit test runto refuse the dirty tree. - Never pass
--forget-resultsor rungit test forget-results. Either one deletes every stored result in the repository, not just the named commit's.--retestalready re-runs the named commit. - Never substitute
just precommitor 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. - Try
git test runwith permitted execution before requesting escalation; it refreshes the index and writes.git/index.lockbefore the configured command starts. If it succeeds, use that result. - If the sandbox blocks it, request escalation only when the active policy allows it. Under
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 failures
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.
Report
Start the final message with one of:
- "⚡ Skipped precommit checks (on battery power)"
- "✅ Precommit checks passed"
- "✅ Precommit checks passed (after fixing [brief description])"
- "⛔ Committed-tree validation blocked": permissions prevent
git test run HEADand escalation is unavailable or denied. Include the command and permission error, and report other checks separately without claiming precommit passed.
Hooks 1
Sponsors
Details
- Marketplace
- motlin/claude-code-plugins
- Source
- plugins/build
- Author
- Craig Motlin
- Category
- Productivity
More from motlin/claude-code-plugins
All 30- builtin-tasksv1.14.0
- burnv1.42.0
- codev1.42.0
- code-walkthroughv1.42.0
- demov1.42.0
- ghostty-titlesv1.42.0
- gitv1.42.0
- git-guardsv1.42.0
- githubv1.42.0
- herdr-rebootv1.42.0
- herdr-titlesv1.42.0
- investigation-reportv1.42.0
- iterm2-titlesv1.14.0
- javav1.42.0
- justfilev1.42.0
- markdown-tasksv1.42.0
- narrationv1.42.0
- offline-claude-code-guidev1.14.0
- orchestrationv1.42.0
- plans-dashboardv1.42.0
- plugin-and-skill-devv1.42.0
- pushoverv1.14.0
- recapv1.42.0
- stop-phrase-guardv1.42.0
