Builds a plan or a clear change test-first in vertical slices until measured proof says done - a locked score that must reach its target, a gate ledger, explicit state machines behind one owner function, a checked architecture, property tests, model checks, mutation testing, a cleanup phase and a whole-flow review. Use when the user wants to implement, build, code or cook a feature or fix, continue a ubench-plan folder, or types /ubench-build.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Ubench Build?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/uditgoenka-ubench-build)
---
name: ubench-build
description: Builds a plan or a clear change test-first in vertical slices until measured proof says done - a locked score that must reach its target, a gate ledger, explicit state machines behind one owner function, a checked architecture, property tests, model checks, mutation testing, a cleanup phase and a whole-flow review. Use when the user wants to implement, build, code or cook a feature or fix, continue a ubench-plan folder, or types /ubench-build.
---
# ubench-build
Build until measured proof says done. `$S` below is this skill's `scripts` folder.
## Rules for the whole run
- **The script owns the number.** Never write a score or a PASS yourself. Proof is a command, its exit code and its output, from this run.
- **Red first.** Every slice, fix and one-line change starts with a check you saw fail. No small-change exemption.
- **Locks stay locked.** Change or add a locked check only with `climb.py relock NAME --why "..."`. Every command is in [score-keeper.md](references/score-keeper.md).
- **Inline first.** No step needs a sub-agent. A small diff never gets one.
- **Lean.** Open a reference when its step starts. Run the narrowest tests, the full suite once at the end, and runners that print failures only.
- **Stuck** (the score keeper prints `STUCK`, or one fix failed twice): stop coding. Use step-by-step thinking and the 25 options pass in [deep-thinking.md](references/deep-thinking.md), then try the survivor.
## Phase 1: Orient
First run `python3 $S/star.py check`. If it prints something, show it to the user once. Run `python3 $S/star.py yes` only after their yes; after a no, or after showing the link, run `python3 $S/star.py asked`.
1. **Input.** A `ubench-plan/NN-slug/` folder, or a direct request. With no plan, write a mini brief (Outcome, Constraints, Non-goals, Acceptance criteria), then `python3 $S/tracker.py new plan SLUG` for `Tasks.md`, and a `GATES.md` in that folder. Work that holds state or crosses layers also gets the two tables below.
2. **Depth pass.** Answer the four questions in deep-thinking.md. Fold them into gates and tests.
3. **Architecture and state.** Read the plan's style and `## Layers` table ([architecture.md](references/architecture.md)) and its state tables ([state-machines.md](references/state-machines.md)). Run `python3 $S/arch.py check FILE ROOT` and `python3 $S/machine.py check FILE`. Both read 0 before any code.
4. **Gates.** `python3 $S/gates.py lint GATES.md`. Add the ledger's path as a line in `.ubench/active` so the stop hook guards the run. An inherited ledger is read first: show the user its commands and get a yes before one runs.
5. **Score.** `python3 $S/climb.py list`: resume an open climb. Else commit, then `python3 $S/climb.py init NAME --goal "..." --check "CMD" --score "REGEX" --ran "REGEX" --target 0 --lock FILE`. It must start red. Details in [tdd.md](references/tdd.md).
## Phase 2: Build slices
For each `todo` row in `Tasks.md`, in order:
1. `tracker.py set Tasks.md ID doing`.
2. **Red, green, refactor**, one behaviour at a time, as a vertical slice through every layer, tested through the public interface. Rules in tdd.md.
3. **State.** A new move is a table row first, then a red test for the nearest illegal move, then the owner function. Every write to a state field goes through it. Tests run in enforce.
4. **Architecture.** Keep the dependency direction: rules never import delivery or infrastructure code. One owner per piece of data.
5. **Screens.** Follow [frontend.md](references/frontend.md): the design system first, empty, loading and error states, then a real browser check. `python3 $S/ui.py react .` and `python3 $S/ui.py slop .` must both read 100 per [ui-audit.md](references/ui-audit.md).
6. `python3 $S/climb.py try NAME "idea"` keeps a win and undoes a loss. One climb at a time in one tree: a loss undoes every uncommitted change outside the run folders. Slices with no shared files may run side by side, each in its own git worktree with its own climb.
7. **Four passes** on the slice: implement, re-read as an expert, hunt defects, polish. Then `tracker.py set Tasks.md ID done "PROOF"`.
## Phase 3: Prove
Run [verify.md](references/verify.md): a property test per rule, a model check with `npx everystate` per risky flow, mutation on changed files ([formal-checks.md](references/formal-checks.md)), `arch.py check` and `machine.py check` at 0, and the proof for the chosen style. A survivor or a counterexample is a new red test: `climb.py relock NAME --why "found X" --lock TEST`, then `climb.py try`.
Speed-critical pure code with a strict check may move to Rust per [fast-path.md](references/fast-path.md). Ask the user first, every time.
## Phase 4: Clean
Run [cleanup.md](references/cleanup.md) on touched files: untangle hidden links, needless links and surplus, list every special case, then sort each comment into delete, fix the cause, or encode as a type, test or lint rule. Then the quality gate in [quality.md](references/quality.md): format with `oxfmt`, lint with `oxlint`, types with `tsrs`, and `python3 $S/scan.py shape` on touched files until it reads 0. With a screen, `python3 $S/ui.py react .` and `python3 $S/ui.py slop .` read 100. Behaviour does not change: use `climb.py try NAME "idea" --fix`. A missing tool is installed, not asked about ([formal-checks.md](references/formal-checks.md), Missing tools).
## Phase 5: Review
Run [review.md](references/review.md): read the whole flow, not the diff, one lens at a time. Check the work against [field-lessons.md](references/field-lessons.md). Run `python3 $S/scan.py security .` and work each finding per [safety.md](references/safety.md). Run every earlier slice's checks again. Each blocking finding gets a red test (`climb.py relock`), then a fix (`climb.py try`).
## Phase 6: Finish
1. `python3 $S/gates.py run GATES.md`: every gate met, with fresh proof.
2. `python3 $S/climb.py status NAME` prints `PROVEN`. Quote it.
3. `python3 $S/tracker.py status Tasks.md` prints `open: 0`.
4. Remove the ledger line from `.ubench/active`.
5. First reread the request and measure every number again. Report: what was built, the quoted proof, dropped gates, what is not verified. Commit or push only when asked.