First install
As a developer new to ubench, I want one command to install it, so that my agent can call the skills today.
Run ./install.sh from the ubench folder, then show me the skills folder it wrote to.Playbook
Pick a skill. Copy the prompt. Open a step only when you need it.
Read this first. Five minutes.
Copy this prompt
Install ubench: git clone https://github.com/uditgoenka/ubench && cd ubench && ./install.sh
Then list the four ubench skills you can call, and tell me which one fits this task: <describe your task>.As a developer new to ubench, I want one command to install it, so that my agent can call the skills today.
Run ./install.sh from the ubench folder, then show me the skills folder it wrote to.As a developer with a task in mind, I want to know which skill fits, so that I do not plan when I should hunt bugs.
Here is my task: <task>. Which ubench skill fits, and why? Answer in two lines.As a developer coming back after a break, I want to see open runs, so that I pick up where I stopped.
/ubench-build List my open ubench runs and where each one stopped.As a reviewer, I want every 'done' to point at a printed line, so that I never take an agent's word for it.
Before you say done, show me the exact command and the line it printed that proves it.As a lead, I want every bug in one CSV with how to reproduce it, so that no bug lives only in chat.
Start a bugs.csv for this repo. One row per bug: area, issue, how to reproduce, fix commit, prevention.On a large release we ran the new rules in shadow first and logged every would-be block. We switched to enforce only when the log was empty. Then we re-ran every test in enforce, because some had only ever passed in shadow.
/ubench-build Add <rule> in shadow mode first. Log every case it would block. Switch to enforce only when the log is empty, then re-run the tests in enforce.Each of the 678 rows in our release tracker has a prevention field. Most of them name a test that now runs in CI. A fix with no guard comes back.
For each bug we fixed today, name the test or check that stops it coming back, and add it if it is missing.ubench is four skills for coding agents: plan, build, hunt bugs and convert. Each one ends in a line a script printed, not a claim the agent wrote.
One clone and one script. It copies the four skills into your agent's skills folder. Python 3 is the only need.
git clone https://github.com/uditgoenka/ubench
cd ubench && ./install.shType the skill name in your agent, then say what you want in plain words.
/ubench-plan add team invites to the billing page
/ubench-build ubench-plan/01-team-invites
/ubench-bug-hunter the checkout flow
/ubench-convert src/Every skill ships its own scripts folder. The docs call it $S. You can run any script yourself, outside the agent.
S=~/.claude/skills/ubench-bug-hunter/scripts
python3 $S/scan.py security .
python3 $S/ui.py react .climb.py holds a check the agent cannot edit. It runs the check after every change, keeps a change that lowers the score and undoes one that raises it.
python3 $S/climb.py init invites --check "pytest tests/invites" --score "failed: (\d+)" --target 0 --lock tests/invites
python3 $S/climb.py try invites "send the invite email"
python3 $S/climb.py status invitesEach run writes to a numbered folder in your repo, such as ubench-plan/01-team-invites/. A new session reads it and carries on.
Pick by what you have, not by size.
You have an idea, no code yet.
Copy this prompt
/ubench-plan I want to build <idea>. Users: <who>. Must have: <3 things>. Out of scope: <things>.
Grill me with numbered questions before you write the plan. Stop only when the plan check prints 0 problems.As a founder, I want my idea turned into a brief, stories and a test plan, so that the build has a clear finish line.
/ubench-plan New product: <one line>. Ask me questions first, then write the full plan folder.As a developer on an existing app, I want a plan that fits the code I have, so that the feature does not fight the structure.
/ubench-plan Add <feature> to this repo. Read the current structure first and keep its borders.As a developer with tricky statuses, I want every state and move in a table, so that no status can get stuck.
/ubench-plan List every status <thing> can have as a state machine table, then run machine.py check on it.As a developer, I want status fields that change in many places found, so that I can give each one a single owner.
/ubench-plan Find every field that acts as a status. List every place that writes it, then draw it as a state machine table.As a founder, I want the plan to say what we will not build, so that the build does not grow while we work.
/ubench-plan Add a 'not doing' list to this plan, and the reason for each item.Our worst bugs came from many files writing the same status field directly. The fix was one owner function per state, which checks every move against a table and rejects moves the table does not allow.
/ubench-plan For <entity>, design one owner function that makes every status change. List the allowed moves as a table and reject the rest.Before a big merge we wrote down the rollback steps and took a fresh backup a few minutes before each deploy. Nothing was left to guess at 2 a.m.
/ubench-plan Write the merge order, the backup step before each deploy, and the exact rollback for each step.Turns a request into a checked plan. It writes no product code.
Plan first. arch.py fresh tells the planner there is no code yet, so it proposes a default stack you can refuse.
/ubench-plan a booking app for small clinics
# answer the question rounds, then
/ubench-build ubench-plan/01-booking-appIn an existing repo the planner reads today's style, words and state tables first. The plan fits them.
Sample brief, not from a real run. 01-brief.md is the contract. You confirm it, then it is locked: later steps cannot quietly change the goal.
## Outcome
Team owners can invite people by email.
## Constraints
Invites expire after 7 days.
## Non-goals
No bulk CSV import.
## Acceptance criteria
- An invite link works once.
- An expired link shows a clear error.Sample questions, not from a real run. The planner asks numbered questions, each with a recommended answer. You can reply 'yes to all' or change one. It never asks what it can read in the code.
1. Who can send invites? Recommended: owners and admins.
2. What happens to a second invite to the same email? Recommended: resend the first.
3. Does accepting need a login? Recommended: yes, or sign up first.Name the forces first: team size, how often parts change, what must never break. Then pick the simplest style that carries them.
One table in the plan says which folder is which layer and what it may import. arch.py checks the real imports against it.
## Layers
| layer | folders | may import |
|----------|----------------|------------------|
| delivery | app/, api/ | rules, infra |
| rules | lib/billing/ | (nothing) |
| infra | lib/db/ | rules |Every thing with a status gets a table: states, events, guards and the moves between them. machine.py finds holes: a state with no way out, an end state nothing reaches.
## Machine: Invite
start: sent
end: accepted, expired
| from | event | guard | to |
|------|---------|----------------|----------|
| sent | accept | token is valid | accepted |
| sent | timeout | | expired |Each machine has one function that changes its status. Nothing else writes that field. This stops two code paths from disagreeing about the state.
A finished plan folder has these files. ubench-build reads them in this order.
The plan is done when the script says so, not when the agent says so.
python3 $S/climb.py status plan-team-invites
# done only when this prints PROVENYou have a plan or a clear change.
Copy this prompt
/ubench-build Build the plan in ubench-plan/<NN-slug>/ one vertical slice at a time, test first.
Lock the check before writing code. Do not call anything done until climb.py status prints PROVEN.As a developer with a ubench plan, I want it built slice by slice, so that each piece is proven before the next starts.
/ubench-build Continue ubench-plan/<NN-slug>/ from the next open task.As a developer with a one-line ask, I want a failing test first, so that I know the change really did something.
/ubench-build Change: <what>. Write the failing test first, then the fix.As a developer shipping UI, I want React and screen slop found, so that the UI does not ship with known faults.
/ubench-build Run ui.py react . and ui.py slop . on the changed screens and fix what they print.As a maintainer, I want old exceptions to only ever go down, so that the codebase gets cleaner with every PR.
/ubench-build Add an architecture test with an allowlist of current violations. It fails if the list grows. Then remove one entry at a time.As an operator, I want deploy to stop when a setting is missing, so that users never meet a half-configured app.
/ubench-build Make startup refuse to run when any required setting is missing, and list every expected key in a test.We did not fix every raw write in one go. An architecture test held an allowlist of the old ones, and the list could only shrink. Each PR removed a few, and CI blocked any new one.
/ubench-build Add a ratchet test: it records today's violations of <rule>, fails on any new one, and fails if a fixed one is not removed from the list.Some tests passed because they mocked the very logger or join that was broken. We rewrote them to go through the real code, so a broken change now fails CI.
/ubench-build Find tests in <area> that mock the code under test. Rewrite the important ones to use the real path.Builds the plan in vertical slices. Every slice starts with a test you saw fail.
A slice is a thin cut through every layer: route, rule, database, screen. It starts with a test that fails for the right reason.
python3 $S/tracker.py set Tasks.md T3 doing
# write the failing test, see it fail
python3 $S/climb.py try invites "T3: accept link marks invite used"
python3 $S/tracker.py set Tasks.md T3 done "climb step 4: 3 -> 2"GATES.md lists every command that must pass. A stop hook will not let the agent end the run while one fails.
python3 $S/gates.py lint GATES.md
python3 $S/gates.py run GATES.mdDesign system first. Then empty, loading and error states. Then a real browser check. Both screen scans must read 100.
python3 $S/ui.py react .
python3 $S/ui.py slop .Tests you wrote can share your blind spots. These three find what they miss.
Behaviour stays the same. The shape scan reads 0 on touched files, and the security scan is worked through finding by finding.
python3 $S/scan.py shape src/invites
python3 $S/scan.py security .
python3 $S/gates.py run GATES.mdCode misbehaves, or you do not trust it.
Copy this prompt
/ubench-bug-hunter Hunt bugs in <area or repo>. Rank areas by harm: money, sends, data, access.
Stay read-only on real data. Reproduce each suspect with a command before you call it a bug, record every one in bugs.csv, and ask me before fixing.As a developer with a bug report, I want the cause proven before a fix, so that the fix does not just hide it.
/ubench-bug-hunter Bug: <what users see>. Reproduce it with a failing command, then find the cause.As a lead taking over code, I want the worst bugs ranked by harm, so that I fix the costly ones first.
/ubench-bug-hunter Audit this repo. Map every state, rank areas by harm, hunt the top three.As a developer with jobs and queues, I want double clicks and retries tested, so that nothing runs twice.
/ubench-bug-hunter Check <flow> for races: two actors, a retry, a crash in the middle.As an operator, I want missing settings caught at startup, so that a deploy never runs with half its config.
/ubench-bug-hunter List every setting the app reads. Check which ones have no default and are not checked at startup.As a developer, I want held or paused jobs that never wake up found, so that work does not stall without a sound.
/ubench-bug-hunter Find every state a job can enter but never leave. For each one, show the query that counts how many are stuck.Read-only counts on real data found bugs that no test showed: rows in a status that should already have moved on. Each count that was not zero became a bug with a reproduction.
/ubench-bug-hunter Write read-only queries that count combinations the rules forbid. Each count above zero is a suspect. Do not change any data.One error filled the logs thousands of times. It was a single race, and every retry repeated it. Fixing the first collision ended the storm.
/ubench-bug-hunter This error repeats many times in the logs: <error>. Find the first time it happened and the race behind it, not the retries.Finds real bugs. A suspect is not a bug until it has a reproduction someone else can run.
Four commands, no agent needed. Run them on any repo to see where you stand.
python3 $S/scan.py shape src
python3 $S/scan.py security .
python3 $S/ui.py react .
python3 $S/ui.py slop .Each scan ends in one count and, for screens, a score out of 100. High findings first, then medium.
List every stateful thing, every place that writes its status, and every job, queue, timer and outside call. Bugs live where two of these meet.
Every suspect is a row in bugs.csv. It becomes a bug only with a command that fails now and passes once fixed.
python3 $S/tracker.py bug bugs.csv area=billing issue="cancel never recorded"
python3 $S/tracker.py bugset bugs.csv B1 status=reproduced how_reproduced="pytest tests/test_cancel.py"A scanner reads patterns, not intent. When a finding is wrong, add an ignore line with the reason. The count stays honest and the next run skips it.
Answer six questions about the cause before any edit. Fix where every caller passes through. The tracker refuses 'fixed' while the reproduction still fails.
python3 $S/climb.py try hunt "B1: handle customer.subscription.deleted"
python3 $S/tracker.py bugset bugs.csv B1 status=fixedWe ran the scripts on shadcn-ui/taxonomy at commit 298a885 (2026-04-20), a public Next.js app. Every output line below is copied from that run.
git clone https://github.com/shadcn-ui/taxonomy
cd taxonomy && git checkout 298a885One high finding and six medium. The high one is a false alarm: the effect at components/toc.tsx:43 cleans up with unobserve().
$ python3 ui.py react .high state/effect-no-cleanup components/toc.tsx:43 the effect starts an observer and never stops itmedium state/index-key components/main-nav.tsx:34medium state/index-key components/mobile-nav.tsx:32medium state/index-key components/nav.tsx:27medium state/index-key components/sidebar-nav.tsx:19medium state/index-key components/sidebar-nav.tsx:46medium state/index-key components/toc.tsx:94files: 131react problems: 7react score: 66/100
Four focus rings removed with nothing in their place, and transition-all on many components.
$ python3 ui.py slop .high a11y/focus-hidden components/ui/command.tsx:49high a11y/focus-hidden components/ui/popover.tsx:22medium motion/no-calm-mode components/billing-form.tsx:1medium motion/animate-everything components/ui/sheet.tsx:48low look/side-bar components/callout.tsx:17files: 97ui problems: 16ui score: 15/100
Nothing found, and nothing hidden by a baseline. A clean result prints the same way as a bad one.
$ python3 scan.py security .files: 168 in baseline: 0security problems: 0
machine.py checks a table, not code. This table was written by reading the code in app/api/webhooks/stripe/route.ts, which handles only checkout.session.completed and invoice.payment_succeeded. We added the end state cancelled. Nothing reaches it, so no subscription in this app ever ends.
## Machine: Subscription
start: free
end: cancelled
stored: free, active
| from | event | guard | to |
|--------|----------------------------|------------|--------|
| free | checkout.session.completed | has userId | active |
| active | invoice.payment_succeeded | | active |$ python3 machine.py check subscription.mdSubscription: 2 moves, 3 problem(s)PROBLEM end state 'cancelled' is not in the tablePROBLEM state 'active' can never reach an end statePROBLEM state 'free' can never reach an end statemachine problems: 3
Everything is hard to change.
Copy this prompt
/ubench-convert Evaluate this codebase and propose a target structure.
Measure it first, name the core issues by root cause, write the before and after with a boundary table, and wait for my approval at every phase.As a team lead, I want clear borders between areas, so that one change stops breaking three others.
/ubench-convert Measure this repo and draw the borders it should have. No code changes yet.As a maintainer, I want dead and duplicate code listed, so that we delete it with proof nothing breaks.
/ubench-convert Write a slop kill list for this repo with the proof for each item.As a lead, I want the move split into issues, so that the team can ship it in small steps.
/ubench-convert Turn the approved before and after into ordered issues, smallest first.As a lead, I want the move done area by area, with each one merged and proven, so that we can stop at any point.
/ubench-convert Split the move into areas. For each one, list the files, the tests that prove it and the order to merge.As a new team member, I want the architecture diagrams to match the code, so that I can trust them.
/ubench-convert After each area, re-pin the diagrams to the current commit and list anything that no longer matches.We built the change area by area as local commits, each with its own proof. Then we shipped it as one release, so users never saw half a migration.
/ubench-convert Plan each area as its own commit with its own check. Ship them together only when every check passes.We counted raw writes, owners and allowlist entries before we started and after each area. The numbers showed the progress, and opinions did not decide it.
/ubench-convert Measure <metrics> now, write them down, and re-measure after each area.Measures a whole codebase and moves it to a sound structure. Same language, same behaviour, less code.
Run ubench-convert on the root. It writes architecture-redesign/ in a numbered folder, then hands it to plan and build.
/ubench-convert .00-scope.md names the root, what is out, and the exact measure commands. Once you agree it is locked, so before and after are measured the same way.
Each pain is traced back to its cause with file:line evidence. Often one fix sits behind many problems: a status written from five places, one module everything imports.
No code moves until a test of today's behaviour is green. Then a move that changes behaviour turns that test red at once.
Dead code, copies, special cases, tests that cannot fail, suppressions and stale comments. Each item goes, or stays with a written reason.
06-roadmap.md lists areas in order. Each area: pin its behaviour, move it behind its owner, delete what the kill list names, clean. Then you approve the next one.
The same commands run before the first move and after each area. The size aim is up to 50% fewer lines. It is a report, never a bar.
python3 $S/arch.py check 04-before-after.md .
python3 $S/scan.py shape src
# add one row to 04-before-after.md per area: boundary, shape, lines