Uscha
Spec-driven development for LLM coding agents. You bring the idea, the method builds
the rest. Uscha gives a coding agent a spec to build against, a QA loop that converges
instead of looping forever, and a deterministic ledger that records what was measured —
never what was claimed.
The agent executes · the method governs · evidence decides · the human approves.
uscha.dev — the method, the five rules, the skills, the library
(the diamond thesis, how-it-works diagrams, essay, 2-day dev course, reference, paper).
New here? Start with First use: from install to one measured result
— one machine, one small repo, one criterion closed by a real test, and the merge left to you
(en español).
npx --yes @andresmassello/uscha@latest install --target claude # Claude Code
npx --yes @andresmassello/uscha@latest install --target codex # Codex
npx --yes @andresmassello/uscha@latest install --target cursor # Cursor
npx --yes @andresmassello/uscha@latest install --target copilot # VS Code / GitHub Copilot
npx --yes @andresmassello/uscha@latest install --target gemini # Gemini CLI
npx --yes @andresmassello/uscha@latest install --target cline # Cline
npx --yes @andresmassello/uscha@latest install --target pi # pi (Earendil)
npx --yes @andresmassello/uscha@latest install --target all # every target at once
npx --yes @andresmassello/uscha@latest doctor --target all
The nine skills implement the Agent Skills standard, so the last five targets are the same
skills placed under each agent's own documented root. Honest scope: only Claude Code and Codex
have been exercised against a real agent — for the rest, that they load is a documented
expectation, not a measurement. What is measured is that the files land where each agent
documents reading them and that doctor reads them back. INV-GOLDEN-01 is mechanically
enforced only on Claude Code (a blocking PreToolUse hook); everywhere else doctor reports it
as advisory rather than implying a guard it cannot see.
(both stays a legacy alias for codex+claude.) Then, in your project:
npx --yes @andresmassello/uscha@latest init
Requires Python 3.8+ on the machine (the engine is Python stdlib — no pip installs, no
runtime dependencies). The npm package is a thin router; the canonical installer is
uscha-kit/install-uscha.py. init also writes a minimal, per-repo-type .gitignore when the
project has none (kit 2.4.0) — it never lists reports/, the ledger's own evidence.
The kit declares no dependencies and installs none. Since kit 2.7.0 (ADR-052) install ends
with an extras report and the installer's doctor repeats it as an advisory section: how
the dev loop's QA tools (code-review, judgment-day, improve, the kit default order) resolve
on the target machine — through the engine's own resolver, so code-review reads "assumed,
harness-provided, not measured" — and whether the optional engram (uscha does not require it)
is present, with the commands to add it. Present means usable from Claude: the engram plugin
installed and enabled, or an MCP server named engram in the Claude configuration; a bare
binary on PATH reads "binary found, not wired into Claude". The MCP check reads only the Claude
configuration, for --target codex too. It only reports: it installs nothing, asks nothing and
runs none of the commands it prints, and it never changes an exit code.
Kit v2.20.1 · uscha.dev ·
changelog
(the per-release changelogs live in the repo, not in the npm tarball)
The problem it solves
An agent will tell you the tests pass. It will tell you the feature is done. It is often
right — and when it is wrong, you find out in production.
Uscha refuses to take the agent's word for anything. Every claim that matters has to be
backed by a report the agent did not write: a JUnit file, a coverage report, a linter's
output. For tests that is enforced, not hoped for (2.10.0): the engine runs the test command
your project DECLARED (test-run), records the run, and its gates honor only the JUnit and
coverage files that run wrote — a report written, copied or edited by anyone else is not
evidence. What stays trusted is the declared command itself: a config line a reviewer reads. Facts block; guesses advise. A checkbox ticked by hand is recorded as
narrated and does not close a criterion. A test named after that criterion, green, in a
report a recorded test-run wrote — that closes it.
The result is a readiness score you can actually trust, because you can click any number
and see which file, which test, and when.
What you get
Nine skills that drive the method end to end:
| Skill |
What it does |
/uscha-discovery |
Idea → spec package (CONTEXT, SPEC, ADRs, CONSTITUTION, ACCEPTANCE) |
/uscha-adr-refine |
Known feature → ADR + ACCEPTANCE, by interrogating you first |
/uscha-reverse-discovery |
Existing system → facts + typed candidates in quarantine; never promoted without a human verdict (brownfield) |
/uscha-characterize |
Capture a golden suite of current behavior before touching it |
/uscha-devloop |
Plan → build → severity-gated QA loop → PR (stops at the merge) |
/uscha-rubric |
Grade the non-testable (conventions, ergonomics) against a versioned rubric |
/uscha-sysdoc |
Generate a system deck from the ledger |
/uscha-mirador |
Bird's-eye HTML dashboard: readiness, trail, acceptance, loops |
/uscha-status |
One-line progress readout, in chat |
A measurement engine (qa_ledger.py, 69 subcommands, Python stdlib) that ingests
evidence from 11 language stacks — maven, gradle, ant, python, node, go, rust, dotnet,
cpp, swift, flutter — and computes a readiness score with hard caps and visible provenance.
Compatibility matrix
The target and install-path columns mirror TARGETS/SKILL_ROOTS in the installer. The
exercised column is editorial, not generated: last updated 2026-09-20 (ADR-049).
| target |
agent |
installs to |
INV-GOLDEN-01 |
exercised against a real agent |
codex |
Codex |
~/plugins/uscha |
advisory |
yes |
claude |
Claude Code |
~/.claude/skills |
enforced (PreToolUse hook, best-effort) |
yes |
pi |
pi (Earendil) |
~/.agents/skills |
advisory |
no — placement + read-back only |
cursor |
Cursor |
~/.cursor/skills |
advisory |
no — placement + read-back only |
copilot |
VS Code / Copilot |
~/.copilot/skills |
advisory |
no — placement + read-back only |
gemini |
Gemini CLI |
~/.gemini/skills |
advisory |
no — placement + read-back only |
cline |
Cline |
~/.cline/skills |
advisory |
no — placement + read-back only |
"Exercised" is the column that matters. For every target but Claude Code and Codex, what
is measured is that the nine skills land where that agent documents reading them and that
doctor reads them back — that they load is a documented expectation, not a measurement.
INV-GOLDEN-01 is mechanically attempted only where a blocking pre-tool hook exists; everywhere
else doctor reports advisory rather than implying a guard it cannot see.
| OS |
how it is verified |
status |
| Linux |
CI matrix (py3.8 + py3.13) + local WSL |
measured |
| Windows |
CI matrix (py3.8 + py3.13) + native local |
measured |
| macOS |
CI matrix (py3.8 + py3.13), real runners |
measured |
The loop, in short
- Model first.
/uscha-discovery (new) or /uscha-adr-refine (known feature) writes
the spec package. No code until the package exists.
- Build.
/uscha-devloop implements against the SPEC, with tests as a guardrail.
- QA loop. Independent review passes (maker ≠ checker) run until the change
converges — findings at or above the severity gate are fixed, the rest go to
ISSUES-DEFERRED.md with their evidence. Since 2.11.0 the engine witnesses each review
(review-start stamps the tree it starts on): a gated finding closes only on a later clean
review of different source, or -- since 2.14.0 -- by the deferral of its own id, confirmed by a
human (ADR-060); and the last review of each tool must have seen the code on disk now
(ADR-056). Since 2.16.0, with review_tiers declared, the review effort follows the change:
a tier from path globs, a scope assigned at review-start, a fix re-reviewed on its diff by
the tool it outdated, findings counted once, and a round cap (ADR-062). Converge, don't
chase zero.
- Readiness. One score, one screen: acceptance (measured) 30 · static gate 20 ·
ADR 15 · coverage 15 · convergence 10 · integration 10, with hard caps that say why
they bit and whether the threshold was your requirement or the kit's default.
- You decide. The agent proposes, measures and stops at the PR. Merging is a human act,
and so is lifting an escalation: since 2.12.0 those commands need
--human/--note and
refuse inside Claude Code's shell, and a hook keeps a PR a draft while the gate is red
(ADR-058).
What makes it different
- Measured beats narrated. An acceptance criterion closes on a green test that carries
its name — never on a checkbox. Stale evidence (a report whose run measured a different
source tree) and unwitnessed evidence (a report no recorded
test-run wrote) are
discarded, not honored — re-derived every time a gate reads them.
- Absence is not success. A gate that never ran scores
UNMEASURED, which is
deliberately not the same as a measured zero — and it is not silently forgiven either.
- Receipts. Every number in the dashboard traces to its evidence: which testcase, which
report, which timestamp.
- Anti-ceremony. Gates stay quiet by default and collapse into one verdict line. The
method is enforced by the engine, not by asking the agent to be disciplined.
- Model-agnostic. The engine never reads tokens, model names or vendor telemetry. Any
model-reported number enters through an adapter, never the engine.
- Field truth for greenfield. In a new system every test payload was invented by the
agent that wrote the code, so
corpus-run scores a corpus of REAL inputs against the
real command and persists the percentage as a fact — advisory until the project
declares a budget, a blocking gate once it does (ADR-046).
- Evidence is executed, not narrated. The smoke run is a report the project's tool
writes, not a paragraph an agent types (unlike test reports, a smoke report is still read
by path — not yet witnessed by a recorded run, ADR-055):
smoke-ingest reads {"checks": [{"name", "ok", ...}]}, a failed check blocks like any fact gate, and an empty or malformed
report is refused rather than scored (ADR-047).
The diamond — specs are the source code, end to end
Uscha closes a cycle most spec-driven tools only walk halfway. The spec package plus its
behavior ledger is the canonical asset of a system; the code is a regenerable build artifact.
An LLM compiles the package into code under a validated contract; reverse discovery decompiles
existing code back into curated specs — passing, mandatorily, through the one step no
automatic tool can perform: a human verdict.
THE ASSET (solid) ── it appreciates with every model generation
┌───────────────────────────────────────────────────────────────┐
│ SPEC PACKAGE + BEHAVIOR LEDGER + IR │
│ SPEC · ADRs · ACCEPTANCE · CONSTITUTION │
│ verdicts: preserve · fix · undefined │
└──────────────┬─────────────────────────────▲──────────────────┘
│ │
FORWARD │ │ REVERSE
the LLM compiles │ │ reverse discovery
▼ │
┌─────────────────────────────────────┐ ┌─────────┴─────────────────────┐
│ compile-validate — output contract, │ │ CURATION · the human gate │
│ mechanical only, model-blind │ │ candidate ─▶ verdict ─▶ ledger │
│ withheld ORACLE — authored BEFORE │ │ no verdict → PR blocked, │
│ compiling, never in the prompt │ │ the candidate is NAMED │
└─────────────────┬───────────────────┘ └─────────▲─────────────────────┘
│ │
▼ │
┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐ ┌─────────────┴─────────────────────┐
CODE (dashed) — build artifact, │ discover · golden capture │
regenerable, disposable ───▶│ candidates: typed evidence │
└ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘ │ + confidence │
└───────────────────────────────────┘
▲ also enters here: any LEGACY
system (= 100% drift)
round trip · bench-roundtrip — how much of the asset the reverse organs re-anchor
from the compiled code: 0.815 measured (12 archetypes) — names AND behaviour
What each arrow is, in the engine (69 subcommands, all measured):