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-plugins

Run it inside Claude Code after adding the marketplace with /plugin marketplace add motlin/claude-code-plugins.

Contents

Discovered from source

Skills 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: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.
  • Never pass --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.
  • Never substitute 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.
  • Try 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.
  • 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 HEAD and 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