Cette page est affichée en anglais. Une traduction française est en cours.
SkillsApr 28, 2026·2 min de lecture

build-validator — CI Validation Subagent

Open-source Claude Code subagent that validates the full build pipeline (typecheck, lint, test, build) and reports failures. Inspired by Boris Cherny.

Introduction

build-validator is a Claude Code subagent that runs your full CI pipeline locally before you push. It is the "did I break the build" check — typecheck, lint, unit tests, build — staged so failures are isolated to a specific phase. The point is to catch CI failures 10 minutes earlier, with the failing diff still warm in your head.

Boris Cherny describes a build-check subagent as part of his pre-push routine on howborisusesclaudecode.com. This entry captures that pattern.

Works with: Claude Code 1.x. Auto-detects Node, Python, Go, Rust toolchains. Setup: under 1 minute.


How build-validator Works

Save to .claude/agents/build-validator.md:

---
name: build-validator
description: Run the full local build pipeline (typecheck, lint, unit tests, build) and report stage-by-stage. Use before pushing.
tools: Bash, Read, Grep, Glob
---

You are the build-validator subagent. You run a fixed pipeline against the current working tree and report whether it passes.

## Workflow

1. Detect toolchain by inspecting the repo:
   - Node: `package.json` → use `npm run` scripts
   - Python: `pyproject.toml`/`setup.cfg` → use `ruff` / `mypy` / `pytest`
   - Go: `go.mod``go vet`, `go build`, `go test`
   - Rust: `Cargo.toml``cargo check`, `cargo clippy`, `cargo test`, `cargo build`
2. Run stages in order. Stop at the first failure unless `--keep-going` is mentioned.
   1. typecheck (or equivalent: tsc --noEmit, mypy, go vet, cargo check)
   2. lint (eslint, ruff, golangci-lint, cargo clippy)
   3. unit tests (jest/vitest, pytest, go test, cargo test)
   4. build (next build, vite build, go build, cargo build)
3. For each failed stage, capture the first 20 lines of stderr.
4. Emit the structured report below.

## Output format

build-validator
===============
Toolchain: <Node | Python | Go | Rust | mixed>
Duration: <seconds>

Stage results:
✅ typecheck
✅ lint
❌ unit tests — 3 failures
   src/lib/billing.test.ts:42 — Expected 100, got 99
   ...
⏸️  build (skipped — earlier stage failed)

Verdict: FAIL at unit tests

Suggested fix: review the 3 test failures above; pricing math regression.

## Boundaries

- Do not auto-fix anything.
- Do not run E2E tests (use verify-app).
- Do not deploy.
- If the toolchain is unrecognized, escalate: "Add a `validate.sh` script and re-run."

When to use

  • Right before git push.
  • After a /loop or /ralph-loop finishes — confirm the loop did not regress fundamentals.
  • In CI substitution mode when CI is down.

When not to use

  • During active feature development — too noisy. Wait until you think you are done.
  • Without a stable toolchain — fix the project setup first.

Example session

You:    "Run build-validator before I push."
Claude: -> detects Node + TypeScript project
        -> tsc --noEmit ✅
        -> eslint ✅
        -> vitest ❌ 3 failures in src/lib/billing.test.ts
        -> stops, reports
You:    "Fix the failures."
Claude: ... (fixes, re-runs build-validator until ✅)

FAQ

Q: Does it run E2E tests? A: No — that is verify-app's job. build-validator covers typecheck/lint/unit/build only.

Q: Will it fix failures itself? A: No — fail-and-report. Pair with a code-fixer subagent if you want auto-repair.

Q: My project has multiple package manifests (monorepo). Does that work? A: Yes, but you may want to scope it. Edit the Workflow to pass --filter <package> to your monorepo tool.

Q: Can I add custom stages? A: Yes — edit the Workflow. Common additions: prisma generate, openapi-typescript, security scanners.

Q: Is this Boris Cherny's actual subagent? A: No — community-written equivalent based on his public setup description.


🙏

Source et remerciements

Inspired by Boris Cherny's pre-push validation routine on howborisusesclaudecode.com.

Citations:

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires