2-day intensive course

uscha

Measured development with LLM coding agents

Day 1 — Foundations + Discovery (new project)
Day 2 — Reverse-Discovery + Migration + Adoption (existing system)

Instructor: Andrés Massello · uscha.dev

Day 1

Agenda — Foundations + Discovery

Morning

  • Why uscha exists
  • Open loop vs. measured graph
  • The five rules (in depth)
  • Core artifacts and the QA-LEDGER

Afternoon

  • The Discovery skill in detail
  • End-to-end greenfield example
  • From idea → SPEC → ACCEPTANCE → first measured loop
  • Hands-on pattern + questions

The problem

Most teams using coding agents still operate in an open loop:

Open loop

  • The agent decides the path
  • The agent grades itself as "done"
  • Claims live in the chat
  • No external contradiction

Consequence

  • Tests can get weakened
  • Production becomes the first real gate
  • Unacceptable when software moves money or people

Field note · Real case 001

Human: "Check the QA errors."

The agent diagnosed, edited tests and production code in the same turn, ran the build and declared "design closed" — with zero human decision points.

The execution was competent.
The governance failed.

That is exactly the hole uscha closes.

Two paradigms

Open loop

  • The agent chooses the path
  • The agent asks itself "are we done?"
  • The narration = the truth

Measured graph

  • The human defines the possible paths
  • Every gate is answered with evidence
  • Loops are caged → they escalate to the human
uscha is the measured graph.

"Gates that read FACTS block.
Those that GUESS over prose advise."

Central mechanism: a deterministic ledger that separates
what was measured from what was narrated.

The spine — five rules

  1. No code without SPEC + ACCEPTANCE
  2. The truth lives in versioned files
  3. The human always approves the merge
  4. Tests must assert
  5. Migrations are anchored with a golden

Non-negotiable. Everything else derives from these.

1 No code without SPEC + ACCEPTANCE

The agent is not allowed to invent the definition of "done".

SPEC.md

What and why. Constraints, non-goals, interfaces.

ACCEPTANCE.md

Concrete, testable criteria for "done".

2 The truth lives in versioned files

If it is not in the repository, the method does not treat it as true.

3 The human always approves the merge

The pipeline stops at the merge gate. No exceptions. The agent prepares and measures; the human decides.

4 Tests must assert

A test that asserts nothing is not a test. The gate is never weakened so the agent can pass.

5 Migrations are anchored with a golden

Current behavior is captured mechanically before changing anything. The agent never authors .approved files.

Core artifacts and the QA-LEDGER

  • SPEC.md · ACCEPTANCE.md
  • ADR/ — decisions
  • Golden suites
  • RUBRIC.md

QA-LEDGER.json

A deterministic record of measurements, never of claims. Zero runtime dependencies. 11 language stacks.

The chat is ephemeral. The ledger is the source of truth.

The trail — idea → production

idea discovery spec adr build qa loop verify human gate production

Loops exist but are bounded. They escalate when they cannot converge.

Day 1 · Core skill

/uscha-discovery

Turns a vague idea into a complete, versioned SPEC + ACCEPTANCE package through structured interrogation.

What it does

  • Asks clarifying questions, one at a time
  • Surfaces constraints and non-goals
  • Forces concrete acceptance criteria
  • Writes the artifacts into the repository

What it never does

  • Write implementation code
  • Silently invent requirements
  • Skip human approval of the package
End-to-end example · Greenfield

New feature: "Refund Policy Engine"

A small, realistic service in a retail/payments context.

Starting point (vague idea):
"We need something that decides whether a refund is allowed based on purchase date, product category and customer tier."

We will walk the full measured trail from this idea to the first gated implementation.

Step 1 — Run Discovery

1

Invoke /uscha-discovery with the vague idea.

2

The agent interrogates: time windows? categories? tier rules? edge cases? non-goals?

3

The human answers (or corrects).

4

The agent writes SPEC.md + ACCEPTANCE.md into the repository.

5

The human reviews and approves the package before any code.

No code has been written yet. The definition of "done" is already closed.

Example · SPEC.md (excerpt)

# Refund Policy Engine

Goal: Decide refund eligibility for a completed order.

Inputs: order_id, request_timestamp

Rules (initial):

- Standard: ≤ 30 days from purchase

- Premium tier: ≤ 60 days

- "Digital" category: never refundable after download

Non-goals: payment execution, inventory restock, UI

Constraints: pure decision function, deterministic, no side effects

Example · ACCEPTANCE.md (excerpt)

1. Given a standard customer with a 15-day-old order → eligible = true

2. Given a standard customer with a 35-day-old order → eligible = false

3. Given a premium customer with a 45-day-old order → eligible = true

4. Given any Digital-category order after the download flag → eligible = false

5. The function is pure: same inputs always produce the same output

6. Every acceptance case is expressed as an automated test that asserts

These become the ledger's first real gates.

Step 2 — First measured devloop

discovery spec + acceptance devloop human gate

The agent can never close the story alone. Evidence + a human are required.

End of Day 1

What we accomplished today

We turned a vague idea into versioned SPEC + ACCEPTANCE,
then ran the first measured development loop
that cannot close without evidence and human approval.

Tomorrow: the same rigor applied to existing systems.

Day 2

Reverse-Discovery
+ Migration

Measured gates applied to systems that already exist
and already matter.

Day 2

Agenda — Reverse-Discovery and Migration

Morning

  • Why migration is different
  • /uscha-characterize
  • /uscha-reverse-discovery
  • End-to-end migration example

Afternoon

  • Safe evolution under golden suites
  • Team adoption patterns
  • Common mistakes and success signals
  • Practice + wrap-up

Why migration is the highest-value path

Never change a behavior you have not measured first.
Core skill

/uscha-characterize

Freezes current behavior as a golden suite before any modification.

What it produces

  • Mechanical capture of observed outputs (.received)
  • An approved baseline the agent cannot rewrite
  • A regression net for future changes

Rule reminder

The skill emits .received and STOPS. The agent is forbidden from authoring .approved files — only the human promotes the golden.

Core skill

/uscha-reverse-discovery

Extracts facts from an existing system when documentation is missing, stale or wrong.

End-to-end example · Migration

Legacy: "Simple Discount Calculator"

Starting reality:
An existing module used in production for years. Sparse tests. Business rules live partly in code comments and tribal knowledge. The team wants to let coding agents improve it safely.

We will characterize → reverse-discover → add a measured improvement → keep the golden intact.

Migration Step 1 — Characterize

1

Select the module (or a critical set of functions).

2

Run /uscha-characterize.

3

The golden suite is generated from observed behavior (.received).

4

The human reviews and promotes the golden (or adjusts the inputs).

From this moment on, any deviation from the golden becomes visible evidence in the ledger.

Migration Step 2 — Reverse-Discovery

Now we extract the real rules the code implements.

Observed facts (example):

- 10% discount if cart > $100

- Extra 5% if the customer is "gold"

- Digital products never receive the cart-value discount

- The discount is applied before tax

- Rounding: banker's rounding to 2 decimals

With these facts, the human writes the new SPEC if we decide to evolve the module.

Migration Step 3 — Measured evolution

characterize reverse-discovery new SPEC + ACCEPTANCE devloop human gate

The golden is sacred

Allowed

  • The human updates the golden after a deliberate, reviewed change
  • New behavior is added with new acceptance cases

Forbidden

  • The agent rewriting .approved files
  • Silently changing expected outputs so tests pass
  • Deleting golden cases without a human decision

This is how you let agents touch production systems without losing control.

Adopting uscha in a team

  1. Start with one critical module — not the whole monorepo
  2. Characterize first, always
  3. Make the human gate visible — and not optional
  4. Train on the five rules, not on the CLI
  5. Use the ledger in stand-ups — "what does the evidence show?"

Culture change > tool installation.

Common mistakes

How you know it's working

Hands-on pattern (Day 2)

  1. Pick a small existing function or module
  2. Run /uscha-characterize → produce the .received and promote the golden
  3. Run /uscha-reverse-discovery → extract the real rules
  4. Write a minimal SPEC + ACCEPTANCE for a safe improvement
  5. Execute inside /uscha-devloop
  6. Inspect the ledger: regressions + new measurements
  7. The human approves or rejects the merge

Resources

The method builds the rest

Measured beats narrated.
Facts block. Guesses advise.
Humans approve.

Day 1 — Discovery turned an idea into measured gates.

Day 2 — Reverse-discovery + characterization let us evolve existing systems without losing control.

Andrés Massello · uscha.dev · info@uscha.dev

Questions and discussion