dev-create-b4push-script

Create a before-push validation script (b4push) and project-level b4push skill. Analyzes the project, identifies check steps (quality, build, test, doc site, e2e), generates scripts/run-b4push.sh, adds package.json entry, creates .claude/skills/b4push/skill.md. Use when: (1) User says 'create b4push', 'add b4push', 'before push script', (2) Setting up a new project's CI/validation workflow.

6 stars

Best use case

dev-create-b4push-script is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Create a before-push validation script (b4push) and project-level b4push skill. Analyzes the project, identifies check steps (quality, build, test, doc site, e2e), generates scripts/run-b4push.sh, adds package.json entry, creates .claude/skills/b4push/skill.md. Use when: (1) User says 'create b4push', 'add b4push', 'before push script', (2) Setting up a new project's CI/validation workflow.

Teams using dev-create-b4push-script should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/dev-create-b4push-script/SKILL.md --create-dirs "https://raw.githubusercontent.com/Takazudo/claude-resources/main/skills/dev-create-b4push-script/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/dev-create-b4push-script/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How dev-create-b4push-script Compares

Feature / Agentdev-create-b4push-scriptStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Create a before-push validation script (b4push) and project-level b4push skill. Analyzes the project, identifies check steps (quality, build, test, doc site, e2e), generates scripts/run-b4push.sh, adds package.json entry, creates .claude/skills/b4push/skill.md. Use when: (1) User says 'create b4push', 'add b4push', 'before push script', (2) Setting up a new project's CI/validation workflow.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Create B4Push Script

Generate a comprehensive before-push validation script for the current project.

## Workflow

### 1. Analyze the project

Read `package.json` to understand:

- Package manager (pnpm/npm/yarn) - check lockfiles
- Available scripts: `check`, `build`, `test`, `lint`, `format`, `typecheck`
- Whether there's a doc site (look for `doc/`, `docs/`, `website/` directories with their own package.json)
- Whether there are e2e tests (playwright, cypress)
- Whether there are data generation scripts (e.g., `generate-*` scripts in doc)

### 2. Determine steps

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).

### 3. Create the shell script

Create `scripts/run-b4push.sh` based on the template in `assets/run-b4push-template.sh`.

Key patterns:

- `set -euo pipefail` for strict error handling
- `FAILURES=()` array - continues all steps even if some fail
- `step()`, `pass()`, `fail()` helper functions
- Subshell execution `(cd "$DIR" && command)` to isolate directory changes
- `ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"` for reliable path resolution
- Summary section with elapsed time and failure list
- Exit 0 on success, exit 1 on any failure

Make the script executable: `chmod +x scripts/run-b4push.sh`

### 4. Add package.json script

Add to `package.json`:

```json
{
  "scripts": {
    "b4push": "./scripts/run-b4push.sh"
  }
}
```

### 5. Create project-level b4push skill

Create `.claude/skills/b4push/skill.md` based on `assets/b4push-skill-template.md`.

Customize:

- Step list with project-specific descriptions
- Estimated duration
- Fix commands specific to the project (e.g., `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.

### 6. Test

Run `pnpm b4push` to verify all steps execute correctly. Fix any issues found.

## Reference projects

These projects have working b4push setups:

- **mdx-formatter**: 6 steps (quality, build, test, doc data, doc quality, doc build), ~40s
- **zmod**: 9 steps including e2e with production server, ~3-4 min
- **zpanels**: Dual-track (quick 3 steps ~3-5 min, full 6+ steps with e2e ~10-15 min)

Related Skills

pr-recreate

6
from Takazudo/claude-resources

Recreate a PR with clean commit history when it has too many messy commits. Use when: (1) User says 'recreate pr' or 'clean up pr history', (2) A PR has accumulated try-and-error commits and needs a fresh start, (3) User wants to squash messy history into clean logical commits.

dev-figma-script-install

6
from Takazudo/claude-resources

Provide Figma capture script installation guidance for web projects. Use when: (1) User wants to set up Figma capture in a web dev project, (2) User says 'figma script install', 'add figma capture', 'figma setup', (3) User wants to enable browser-to-Figma capture in their dev environment

b4push-wisdom

6
from Takazudo/claude-resources

Guide for setting up before-push validation (b4push) and CI checking. Covers analyzing project structure, creating run-b4push.sh, adding package.json entry, creating project-specific b4push skill, setting up GitHub Actions CI. Use when: (1) User says 'set up b4push', 'add CI', 'before push checks', (2) Setting up a new project's validation workflow, (3) User wants CI + local validation.

zudoesa-articlify

6
from Takazudo/claude-resources

Convert conversation context into an esa article via the zudoesa-writer subagent. ONLY invoke when the user explicitly asks — NEVER proactively propose. Triggers: 'write esa article', 'esa記事', 'esaに書いて', 'articlify for esa', or /zudoesa-articlify. Gathers context, creates a writing brief, delegates to the writer subagent.

zudoesa-apply-voice

6
from Takazudo/claude-resources

Apply Takazudo's esa writing voice and vocabulary rules to text. Use when: (1) User wants to write/rewrite text in Takazudo's esa style, (2) User says 'apply voice', 'esa voice', 'esa文体で', 'esa風に書いて', '文体を適用', (3) User provides text to transform to esa style. Reads writing-style.md and vocabulary-rule.md from takazudo-esa-writing repo and applies the rules.

zudocg-articlify

6
from Takazudo/claude-resources

Convert conversation context into a CodeGrid article via the zudocg-writer subagent. ONLY invoke when the user explicitly asks — NEVER proactively propose. Triggers: 'write codegrid article', 'CodeGrid記事', 'codegridに書いて', 'articlify for codegrid', or /zudocg-articlify. Gathers context, creates a writing brief, delegates to the writer subagent.

zudocg-apply-voice

6
from Takazudo/claude-resources

Apply Takazudo's CodeGrid writing voice and vocabulary rules to text. Use when: (1) User wants to write/rewrite text in Takazudo's CodeGrid style, (2) User says 'apply voice', 'codegrid voice', 'codegrid文体で', 'codegrid風に書いて', '文体を適用', (3) User provides text to transform to CodeGrid style. Reads writing-style.md and vocabulary-rule.md from takazudo-codegrid-writing repo and applies the rules.

zpaper-articlify

6
from Takazudo/claude-resources

Convert conversation context into a zpaper blog article via the zpaper-writer subagent. ONLY invoke when the user explicitly asks — NEVER proactively propose. Triggers: 'write zpaper article', 'zpaper記事', 'zpaperに書いて', 'articlify for zpaper', or /zpaper-articlify. Gathers context, creates a writing brief, delegates to the writer subagent.

zpaper-apply-voice

6
from Takazudo/claude-resources

Apply Takazudo's zpaper blog writing voice and vocabulary rules to text. Use when: (1) User wants to write/rewrite text in Takazudo's zpaper style, (2) User says 'apply voice', 'zpaper voice', 'zpaper文体で', 'zpaper風に書いて', 'ブログ文体を適用', (3) User provides text to transform to zpaper style. Reads writing-style.md and vocabulary-rule.md from the zpaper repo and applies the rules.

xlsx

6
from Takazudo/claude-resources

Spreadsheet creation, editing, and analysis. Use when working with .xlsx, .xlsm, .csv, .tsv files for: (1) Creating spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modifying existing spreadsheets while preserving formulas, (4) Data analysis and visualization, (5) Recalculating formulas.

x

6
from Takazudo/claude-resources

Facade for development workflows. Routes on two axes: plan-first vs implement-now (escalates to /big-plan -a when the request needs research / decomposition / has unclear scope — the appended -a makes the plan chain into implementation in-session), then single vs multi on the ready-to-build fast paths (/x-as-pr single-topic, /x-wt-teams multi-topic parallel). Use when: (1) User says '/x' followed by dev instructions, (2) User wants to start development without choosing the workflow skill, (3) User says 'dev', 'implement', or 'build' with a task. Default option: -v (verify-ui). Review-loop (-l) is opt-in — without -l the downstream skill runs a single /deep-review pass. Forwards -a (autonomy/auto-chain) and -m (merge at the end + cleanup + CI watch) through every route; auto-fix of raised findings (-f) and issue-raising (-ri) are downstream defaults, with -nf/--no-fix and -nori/--no-raise-issues as the forwarded opt-outs. -a and -m are orthogonal — full hands-off end-to-end is -a -m.

x-wt-teams

6
from Takazudo/claude-resources

Parallel multi-topic development using git worktrees, base branches, and Claude Code agent teams. Use when: (1) User wants to work on multiple related features in parallel, (2) User mentions 'worktree', 'base branch', 'parallel development', 'split into topics', or 'multi-topic'. FULLY AUTONOMOUS — creates worktrees, spawns teams, coordinates everything. Also supports Super-Epic child mode for [Epic] issues from /big-plan with '**Super-epic:** #N' markers (targets the super-epic base branch instead of main).