From claude-resources
Generates a before-push validation script (b4push) that runs quality, build, test, doc, and e2e checks. Sets up a project-level skill for automatic invocation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-resources:dev-create-b4push-scriptThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate a comprehensive before-push validation script for the current project.
Generate a comprehensive before-push validation script for the current project.
Read package.json to understand:
check, build, test, lint, format, typecheckdoc/, docs/, website/ directories with their own package.json)generate-* scripts in doc)Common step patterns (adapt to project):
| Step | Command | When to include |
|---|---|---|
| Code quality | pnpm check or pnpm lint && pnpm format | Always |
| TypeScript build | pnpm build | If build script exists |
| Unit tests | pnpm test | If test script exists |
| Doc data generation | cd doc && pnpm run generate-* | If doc site has generate scripts |
| Doc quality checks | cd doc && pnpm run check | If doc site has check script |
| Doc site build | cd doc && pnpm build | If doc site exists |
| E2E tests | Start server + run playwright | If e2e tests exist |
For projects with e2e tests, add server lifecycle management (start, wait for ready, run tests, kill).
Create scripts/run-b4push.sh based on the template in assets/run-b4push-template.sh.
Key patterns:
set -euo pipefail for strict error handlingFAILURES=() array - continues all steps even if some failstep(), pass(), fail() helper functions(cd "$DIR" && command) to isolate directory changesROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)" for reliable path resolutionMake the script executable: chmod +x scripts/run-b4push.sh
Add to package.json:
{
"scripts": {
"b4push": "./scripts/run-b4push.sh"
}
}
Create .claude/skills/b4push/skill.md based on assets/b4push-skill-template.md.
Customize:
pnpm check:fix, cd doc && pnpm check:fix)The skill should have user-invocable: true and allowed-tools: [Bash]. The description must include triggers for automatic invocation on big changes, PR completion, etc.
Run pnpm b4push to verify all steps execute correctly. Fix any issues found.
These projects have working b4push setups:
npx claudepluginhub takazudo/claude-resources --plugin claude-resourcesSets up before-push validation scripts and GitHub Actions CI for any project. Analyzes structure, creates run-b4push.sh, adds package.json checks, and configures workflows.
Verifies and publishes changes—pushes, opens PRs, watches CI until green. Runs typecheck, build, test, lint, a web quality gate, review, and a bisectable commit pipeline.