@andresmassello/uscha 1.51.1 → 1.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/README.md +24 -5
  2. package/package.json +3 -2
  3. package/uscha-kit/.claude/skills/uscha-adr-refine/SKILL.md +203 -161
  4. package/uscha-kit/.claude/skills/uscha-characterize/SKILL.md +40 -0
  5. package/uscha-kit/.claude/skills/uscha-devloop/SKILL.md +40 -0
  6. package/uscha-kit/.claude/skills/uscha-discovery/SKILL.md +203 -161
  7. package/uscha-kit/.claude/skills/uscha-mirador/SKILL.md +192 -161
  8. package/uscha-kit/.claude/skills/uscha-mirador/mirador-render.py +16 -8
  9. package/uscha-kit/.claude/skills/uscha-reverse-discovery/SKILL.md +42 -0
  10. package/uscha-kit/.claude/skills/uscha-rubric/SKILL.md +119 -79
  11. package/uscha-kit/.claude/skills/uscha-status/SKILL.md +24 -0
  12. package/uscha-kit/.claude/skills/uscha-sysdoc/SKILL.md +128 -88
  13. package/uscha-kit/.claude-plugin/plugin.json +2 -2
  14. package/uscha-kit/.codex-plugin/plugin.json +2 -2
  15. package/uscha-kit/INSTALL.md +3 -0
  16. package/uscha-kit/README.md +1 -1
  17. package/uscha-kit/VERSION +1 -1
  18. package/uscha-kit/install-uscha.py +77 -43
  19. package/uscha-kit/skills/uscha-adr-refine/SKILL.md +203 -161
  20. package/uscha-kit/skills/uscha-characterize/SKILL.md +40 -0
  21. package/uscha-kit/skills/uscha-devloop/SKILL.md +40 -0
  22. package/uscha-kit/skills/uscha-discovery/SKILL.md +203 -161
  23. package/uscha-kit/skills/uscha-mirador/SKILL.md +192 -161
  24. package/uscha-kit/skills/uscha-mirador/mirador-render.py +16 -8
  25. package/uscha-kit/skills/uscha-reverse-discovery/SKILL.md +42 -0
  26. package/uscha-kit/skills/uscha-rubric/SKILL.md +119 -79
  27. package/uscha-kit/skills/uscha-status/SKILL.md +24 -0
  28. package/uscha-kit/skills/uscha-sysdoc/SKILL.md +128 -88
  29. package/uscha-kit/uscha.config.json +1 -1
  30. package/uscha-kit/CHANGELOG-1.10.0.md +0 -84
  31. package/uscha-kit/CHANGELOG-1.11.0.md +0 -67
  32. package/uscha-kit/CHANGELOG-1.12.0.md +0 -46
  33. package/uscha-kit/CHANGELOG-1.13.0.md +0 -33
  34. package/uscha-kit/CHANGELOG-1.14.0.md +0 -42
  35. package/uscha-kit/CHANGELOG-1.15.0.md +0 -58
  36. package/uscha-kit/CHANGELOG-1.16.0.md +0 -55
  37. package/uscha-kit/CHANGELOG-1.17.0.md +0 -44
  38. package/uscha-kit/CHANGELOG-1.18.0.md +0 -42
  39. package/uscha-kit/CHANGELOG-1.19.0.md +0 -41
  40. package/uscha-kit/CHANGELOG-1.2.2.md +0 -16
  41. package/uscha-kit/CHANGELOG-1.2.3.md +0 -20
  42. package/uscha-kit/CHANGELOG-1.2.4.md +0 -10
  43. package/uscha-kit/CHANGELOG-1.2.5.md +0 -23
  44. package/uscha-kit/CHANGELOG-1.2.6.md +0 -11
  45. package/uscha-kit/CHANGELOG-1.2.7.md +0 -15
  46. package/uscha-kit/CHANGELOG-1.2.8.md +0 -24
  47. package/uscha-kit/CHANGELOG-1.2.9.md +0 -4
  48. package/uscha-kit/CHANGELOG-1.20.0.md +0 -29
  49. package/uscha-kit/CHANGELOG-1.21.0.md +0 -33
  50. package/uscha-kit/CHANGELOG-1.22.0.md +0 -60
  51. package/uscha-kit/CHANGELOG-1.23.0.md +0 -75
  52. package/uscha-kit/CHANGELOG-1.24.0.md +0 -50
  53. package/uscha-kit/CHANGELOG-1.25.0.md +0 -55
  54. package/uscha-kit/CHANGELOG-1.26.0.md +0 -70
  55. package/uscha-kit/CHANGELOG-1.27.0.md +0 -45
  56. package/uscha-kit/CHANGELOG-1.28.0.md +0 -35
  57. package/uscha-kit/CHANGELOG-1.29.0.md +0 -20
  58. package/uscha-kit/CHANGELOG-1.3.0.md +0 -74
  59. package/uscha-kit/CHANGELOG-1.30.0.md +0 -46
  60. package/uscha-kit/CHANGELOG-1.31.0.md +0 -59
  61. package/uscha-kit/CHANGELOG-1.32.0.md +0 -50
  62. package/uscha-kit/CHANGELOG-1.33.0.md +0 -46
  63. package/uscha-kit/CHANGELOG-1.34.0.md +0 -55
  64. package/uscha-kit/CHANGELOG-1.35.0.md +0 -30
  65. package/uscha-kit/CHANGELOG-1.36.0.md +0 -33
  66. package/uscha-kit/CHANGELOG-1.37.0.md +0 -41
  67. package/uscha-kit/CHANGELOG-1.38.0.md +0 -11
  68. package/uscha-kit/CHANGELOG-1.39.0.md +0 -14
  69. package/uscha-kit/CHANGELOG-1.4.0.md +0 -68
  70. package/uscha-kit/CHANGELOG-1.40.0.md +0 -16
  71. package/uscha-kit/CHANGELOG-1.40.1.md +0 -11
  72. package/uscha-kit/CHANGELOG-1.40.2.md +0 -13
  73. package/uscha-kit/CHANGELOG-1.41.0.md +0 -18
  74. package/uscha-kit/CHANGELOG-1.41.1.md +0 -53
  75. package/uscha-kit/CHANGELOG-1.41.2.md +0 -34
  76. package/uscha-kit/CHANGELOG-1.41.3.md +0 -30
  77. package/uscha-kit/CHANGELOG-1.42.0.md +0 -41
  78. package/uscha-kit/CHANGELOG-1.43.0.md +0 -37
  79. package/uscha-kit/CHANGELOG-1.44.0.md +0 -90
  80. package/uscha-kit/CHANGELOG-1.44.1.md +0 -26
  81. package/uscha-kit/CHANGELOG-1.45.0.md +0 -58
  82. package/uscha-kit/CHANGELOG-1.46.0.md +0 -50
  83. package/uscha-kit/CHANGELOG-1.46.1.md +0 -35
  84. package/uscha-kit/CHANGELOG-1.47.0.md +0 -45
  85. package/uscha-kit/CHANGELOG-1.48.0.md +0 -35
  86. package/uscha-kit/CHANGELOG-1.48.1.md +0 -55
  87. package/uscha-kit/CHANGELOG-1.48.2.md +0 -47
  88. package/uscha-kit/CHANGELOG-1.49.0.md +0 -45
  89. package/uscha-kit/CHANGELOG-1.5.0.md +0 -64
  90. package/uscha-kit/CHANGELOG-1.50.0.md +0 -52
  91. package/uscha-kit/CHANGELOG-1.50.1.md +0 -52
  92. package/uscha-kit/CHANGELOG-1.50.2.md +0 -62
  93. package/uscha-kit/CHANGELOG-1.51.0.md +0 -44
  94. package/uscha-kit/CHANGELOG-1.51.1.md +0 -33
  95. package/uscha-kit/CHANGELOG-1.6.0.md +0 -57
  96. package/uscha-kit/CHANGELOG-1.7.0.md +0 -74
  97. package/uscha-kit/CHANGELOG-1.8.0.md +0 -46
  98. package/uscha-kit/CHANGELOG-1.9.0.md +0 -112
package/README.md CHANGED
@@ -7,13 +7,30 @@ never what was claimed.
7
7
 
8
8
  > The tool executes · the method governs · evidence decides · the human approves.
9
9
 
10
+ **[uscha.dev](https://uscha.dev)** — the method, the five rules, the skills, the library
11
+ (essay, 2-day dev course, reference, paper).
12
+
10
13
  ```bash
11
- npx --yes @andresmassello/uscha@latest install --target claude
12
- npx --yes @andresmassello/uscha@latest doctor --target claude
14
+ npx --yes @andresmassello/uscha@latest install --target claude # Claude Code
15
+ npx --yes @andresmassello/uscha@latest install --target codex # Codex
16
+ npx --yes @andresmassello/uscha@latest install --target cursor # Cursor
17
+ npx --yes @andresmassello/uscha@latest install --target copilot # VS Code / GitHub Copilot
18
+ npx --yes @andresmassello/uscha@latest install --target gemini # Gemini CLI
19
+ npx --yes @andresmassello/uscha@latest install --target cline # Cline
20
+ npx --yes @andresmassello/uscha@latest install --target pi # pi (Earendil)
21
+ npx --yes @andresmassello/uscha@latest install --target all # every target at once
22
+
23
+ npx --yes @andresmassello/uscha@latest doctor --target all
13
24
  ```
14
25
 
15
- `--target codex` for Codex, `--target pi` for pi (Earendil), `--target all` for all three
16
- (`both` stays a legacy alias for codex+claude). Then, in your project:
26
+ The nine skills implement the **Agent Skills** standard, so the last five targets are the same
27
+ skills placed under each agent's own documented root. Honest scope: only Claude Code and Codex
28
+ have been exercised against a real agent — for the rest, that they load is a *documented
29
+ expectation, not a measurement*. What is measured is that the files land where each agent
30
+ documents reading them and that `doctor` reads them back. INV-GOLDEN-01 is mechanically
31
+ enforced only on Claude Code (a blocking PreToolUse hook); everywhere else `doctor` reports it
32
+ as `advisory` rather than implying a guard it cannot see.
33
+ (`both` stays a legacy alias for codex+claude.) Then, in your project:
17
34
 
18
35
  ```bash
19
36
  npx --yes @andresmassello/uscha@latest init
@@ -23,7 +40,9 @@ Requires **Python 3.8+** on the machine (the engine is Python stdlib — no pip
23
40
  runtime dependencies). The npm package is a thin router; the canonical installer is
24
41
  `uscha-kit/install-uscha.py`.
25
42
 
26
- **Kit v1.51.1** <!-- uscha:version --> · [changelog](uscha-kit/CHANGELOG-1.51.1.md)
43
+ **Kit v1.53.0** <!-- uscha:version --> · [uscha.dev](https://uscha.dev) ·
44
+ [changelog](https://github.com/andresmassello/uscha/blob/main/uscha-kit/CHANGELOG-1.53.0.md)
45
+ (the per-release changelogs live in the repo, not in the npm tarball)
27
46
 
28
47
  ---
29
48
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andresmassello/uscha",
3
- "version": "1.51.1",
3
+ "version": "1.53.0",
4
4
  "description": "Spec-driven development for LLM coding agents: 9 skills + a stdlib evidence engine. Facts block, guesses advise; the human approves.",
5
5
  "bin": {
6
6
  "uscha": "bin/uscha.js",
@@ -13,6 +13,7 @@
13
13
  "!uscha-kit/**/__pycache__/",
14
14
  "!uscha-kit/**/*.pyc",
15
15
  "!uscha-kit/**/*.pyo",
16
+ "!uscha-kit/CHANGELOG-*.md",
16
17
  "README.md",
17
18
  "LICENSE"
18
19
  ],
@@ -20,7 +21,7 @@
20
21
  "type": "git",
21
22
  "url": "git+https://github.com/andresmassello/uscha.git"
22
23
  },
23
- "homepage": "https://github.com/andresmassello/uscha#readme",
24
+ "homepage": "https://uscha.dev",
24
25
  "bugs": {
25
26
  "url": "https://github.com/andresmassello/uscha/issues"
26
27
  },
@@ -1,161 +1,203 @@
1
- ---
2
- name: uscha-adr-refine
3
- description: >
4
- Turn a rough idea into a development-ready ADR set + ACCEPTANCE.md by INTERROGATING
5
- before generating. Runs a structured Socratic interview (problem, implicit decisions,
6
- behavior incl. failure modes, inviolable constraints, out-of-scope, Definition of
7
- Done, dependencies), refuses to emit artifacts until the gaps are closed, then
8
- distills the conversation into docs/adr/ADR-NNN.md files and an ACCEPTANCE.md. The
9
- front-half counterpart to dev-loop. Invoke for "refine the ADR", "let's spec this
10
- before coding", "ayudame a definir esto antes de desarrollar".
11
- allowed-tools: Read, Write, Glob, Grep
12
- disable-model-invocation: false
13
- ---
14
-
15
- # adr-refine — interview, then distill
16
-
17
- You convert a rough idea into a development-ready specification. You do this in two
18
- phases. **You are NOT a generator. You are an interrogator that distills.** The value
19
- is in the questions, not in agreeing.
20
-
21
- ## Non-negotiable principles
22
-
23
- 1. **Interrogate, don't agree.** Your job in Phase A is to surface what the human left
24
- implicit and to find the holes not to validate. A refinement where you agreed with
25
- everything failed.
26
- 2. **Converge, don't run out of questions.** The interview ends on an objective
27
- criterion (below), not when the human seems tired or you run out of ideas. This
28
- mirrors dev-loop's "converge, don't chase zero" — the same discipline at the front.
29
- 3. **Do not emit artifacts until convergence.** No ADR, no ACCEPTANCE.md until every
30
- exit condition is met. If asked to "just write it" early, name the open gaps first.
31
- 4. **One topic at a time.** Never dump 20 questions. Walk the agenda below, a focused
32
- batch at a time, and reflect back what you heard before moving on.
33
- 5. **Record deferrals as explicit assumptions.** If the human says "you decide" on a
34
- consequential decision, push back once with the trade-off; if they still defer,
35
- record it as an explicit assumption in the ADR, never as a silent default.
36
-
37
- ## Phase A — The interview (agenda)
38
-
39
- Start from the human's initial context. Work the agenda in order; skip a topic only if
40
- it's already fully answered. Keep a running list of OPEN GAPS and resolved decisions.
41
-
42
- 1. **Problem and why now.** What job does this remove? What does it cost to NOT do
43
- it (money, time, risk)? If "why now" has no answer, the priority is suspect.
44
- 2. **Implicit decisions.** Surface the choices the request assumed: sync vs async,
45
- storage, protocol, idempotency, transactional boundaries, who owns state. For each,
46
- force an explicit decision and at least one considered alternative.
47
- 3. **Behavior.** Happy path first, then the DIRTY cases: provider/timeout failures,
48
- retries and backoff, 4xx vs 5xx, concurrency, partial/terminal states, what must NOT
49
- happen. A feature without its failure behavior is half-specified.
50
- 4. **Inviolable constraints (→ `CONSTITUTION.md`).** Domain + security + operation
51
- rules that cannot be broken (money to the cent, numbering without gaps, never cross
52
- environments/credentials, secrets never logged, auth/authz, data retention). Write/extend
53
- `CONSTITUTION.md` (one invariant per line, CWE ref where it maps); these feed the
54
- dev-loop severity gate and a breach is a BLOCKER. **An ADR may never contradict the
55
- CONSTITUTION** if a decision would, it's escalated, not recorded.
56
- 5. **Out of scope.** Explicit boundaries, with forward references ("X goes to a later
57
- spec"). What you exclude is as important as what you include.
58
- 6. **Definition of Done + how we measure success.** Concrete, checkable acceptance criteria
59
- (tests green, documented, metrics published, runbook) AND success metrics (p95,
60
- cost ceiling, zero orphaned records). Each item must be verifiable, not a feeling.
61
- 7. **Dependencies.** Which other specs/systems/credentials this needs to exist first.
62
-
63
- After each batch, reflect: "Decided: / Still open: …". Move on only when the
64
- current topic is closed.
65
-
66
- ## Convergence exit conditions (ALL must hold)
67
-
68
- - Every decision has a rationale and at least one considered alternative.
69
- - Every failure mode named has a defined behavior.
70
- - Out-of-scope is explicit.
71
- - The Definition of Done exists and every item is checkable.
72
- - No OPEN GAP you raised remains unresolved (resolved = decided OR recorded as an
73
- explicit assumption).
74
-
75
- State plainly when you've converged ("Closed: every decision has a rationale, the failures
76
- have behavior, the scope has a boundary and the DoD is verifiable.") before Phase B.
77
-
78
- ## Phase B — Distill the artifacts
79
-
80
- Only after convergence. Produce (and, if any new project-wide invariant surfaced in
81
- step 4, append it to **`CONSTITUTION.md`** — never let an inviolable rule slip into an
82
- ADR where it could later be "traded away"):
83
-
84
- 1. **One ADR per decision worth recording** at `docs/adr/ADR-NNN-<slug>.md`, format:
85
-
86
- ```markdown
87
- # ADR-NNN: <title of the decision>
88
- ## Status: Accepted
89
- <!-- Use Status: Experiment only for a bounded hypothesis with feedback/review criteria. -->
90
- ## Context
91
- <the problem + the considered options: A) B) C) …>
92
- ## Decision
93
- <the chosen option>
94
- ## Reasons
95
- - <why, point by point>
96
- ## Consequences
97
- + <the good>
98
- - <the cost / what it forces on us>
99
- <!-- If Status: Experiment, also include:
100
- ## Hypothesis
101
- ## Feedback Signal
102
- ## Review By: YYYY-MM-DD (or ## Review Trigger)
103
- ## Promote Criteria
104
- ## Rollback / Supersede Criteria
105
- -->
106
- ## Implementation Plan
107
- - Affected paths: <files/dirs>
108
- - Patterns: <pattern to follow>
109
- - Tests: <which tests prove the decision>
110
- ## Verification
111
- - [ ] <criterion checkable by an agent>
112
- ```
113
-
114
- Number ADRs continuing from the highest existing one in `docs/adr/` (glob first).
115
- Negative decisions count: "what we are NOT going to use and why" is a valid ADR.
116
- Experimental decisions count only when they are explicit hypotheses with feedback signal,
117
- review date/trigger, promote criteria and rollback/supersede criteria. Do not use
118
- `Status: Experiment` as a polite way to avoid deciding.
119
-
120
- 2. **`ACCEPTANCE.md`** at the repo root (or the path in `uscha.config.json` →
121
- `defaults.acceptance_file`). This is the file dev-loop's readiness measures it MUST
122
- exist and be checkable:
123
-
124
- ```markdown
125
- # Acceptance — <feature>
126
- ## Definition of Done
127
- - [ ] AC-01 — <verifiable criterion>
128
- - [ ] AC-02 — <verifiable criterion>
129
- ## How we measure success
130
- - <objective metric: p95, cost, zero orphans, …>
131
- ## Out of scope
132
- - <boundary> → <future spec>
133
- ## Recorded decisions
134
- - ADR-NNN — <title>
135
- ```
136
-
137
- **Where to write:** with file tools available (Claude Code), write the files to disk.
138
- In a chat-only context, print each file in a fenced block, clearly labeled with its
139
- target path, ready to paste — and remind the human these go to `docs/adr/` and the repo
140
- root before running dev-loop.
141
-
142
- **Tracked-markdown protocol:** if any target `.md` already exists and is tracked, ask
143
- for its current version before overwriting — never silently replace.
144
-
145
- ## Handoff to dev-loop
146
-
147
- Close with the handoff prompt so the build phase starts by planning, not improvising:
148
-
149
- > "Read the ADR set and ACCEPTANCE.md. Before touching code: 1) summarize the plan of
150
- > files to create/modify, 2) confirm which decisions were left implicit, 3)
151
- > show me the first test you would write."
152
-
153
- Two-command flow end to end: `/uscha-adr-refine` → (ADR set + ACCEPTANCE.md) → `/uscha-devloop`.
154
-
155
- ## Anti-patterns (do not do)
156
-
157
- - Generate an ADR from a one-line request without interviewing.
158
- - Accept "do it however you want" on a consequential decision without recording the
159
- assumption.
160
- - Write an ACCEPTANCE item that isn't objectively checkable ("that it works well").
161
- - Emit artifacts before the convergence conditions are met.
1
+ ---
2
+ name: uscha-adr-refine
3
+ description: >
4
+ Turn a rough idea into a development-ready ADR set + ACCEPTANCE.md by INTERROGATING
5
+ before generating. Runs a structured Socratic interview (problem, implicit decisions,
6
+ behavior incl. failure modes, inviolable constraints, out-of-scope, Definition of
7
+ Done, dependencies), refuses to emit artifacts until the gaps are closed, then
8
+ distills the conversation into docs/adr/ADR-NNN.md files and an ACCEPTANCE.md. The
9
+ front-half counterpart to dev-loop. Invoke for "refine the ADR", "let's spec this
10
+ before coding", "ayudame a definir esto antes de desarrollar".
11
+ allowed-tools: Read, Write, Glob, Grep
12
+ disable-model-invocation: false
13
+ ---
14
+
15
+ # adr-refine — interview, then distill
16
+
17
+ You convert a rough idea into a development-ready specification. You do this in two
18
+ phases. **You are NOT a generator. You are an interrogator that distills.** The value
19
+ is in the questions, not in agreeing.
20
+
21
+ ## Orientation markers (non-negotiable)
22
+
23
+ The operator must never have to ask "where am I?" or "what happens now?". Two markers, always.
24
+ They are navigation, not ceremony: one line per turn, one block at the end.
25
+
26
+ **Open every turn with a breadcrumb**, then the content:
27
+
28
+ `[uscha · adr-refine · <step> <target>]`
29
+
30
+ - `<step>` `Q<n>` for a question, `pass <n>` for a loop iteration, `step <n>` otherwise.
31
+ Count what has actually happened. **Never write a denominator** (`Q4/12`): this phase
32
+ converges, its length is not known in advance, and an invented total is exactly the kind of
33
+ narrated number the method forbids. **When the ledger already measures the count** (the QA
34
+ loop's `loop_count`), use the measured number never keep a parallel tally of your own.
35
+ - `<target>` the artifact this turn feeds (`SPEC`, `ADR-003`, `ACCEPTANCE`, `LEDGER`,
36
+ `RECEIVED`, ...). Drop `→ <target>` only when the turn genuinely feeds none.
37
+
38
+ **Close with the close block ONCE, when the skill finishes** — not on every turn. Ending
39
+ without it is a defect, even when the phase converged cleanly:
40
+
41
+ ```
42
+ [uscha · adr-refine · CLOSED]
43
+ Produced: <files actually written, or "nothing">
44
+ Blocks: <what stands between here and the next phase, or "nothing">
45
+ Next: <the next action, and why it is that one>
46
+ Run: <the exact command or skill to invoke>
47
+ ```
48
+
49
+ This is **not** the implementation handoff some skills also emit: that one is a prompt for
50
+ whoever implements next, this one is navigation for the human operator, and both can appear.
51
+
52
+ `Blocks` and `Next` are **derived from the state you just produced** — never copied from a
53
+ fixed route, **including any `Flow:` line in this file**. Those lines are the nominal path;
54
+ open ADR experiments, an unclosed spike, an unapproved golden or a red gate all change what
55
+ genuinely comes next, and the derived answer wins. If the next phase cannot start yet, name it
56
+ and say exactly what unblocks it.
57
+
58
+ Keep the CONTENT in the conversation's language, but keep the labels (`CLOSED`, `Produced`,
59
+ `Blocks`, `Next`, `Run`) verbatim they are the method's vocabulary and the smoke checks them.
60
+
61
+ ## Non-negotiable principles
62
+
63
+ 1. **Interrogate, don't agree.** Your job in Phase A is to surface what the human left
64
+ implicit and to find the holes — not to validate. A refinement where you agreed with
65
+ everything failed.
66
+ 2. **Converge, don't run out of questions.** The interview ends on an objective
67
+ criterion (below), not when the human seems tired or you run out of ideas. This
68
+ mirrors dev-loop's "converge, don't chase zero" the same discipline at the front.
69
+ 3. **Do not emit artifacts until convergence.** No ADR, no ACCEPTANCE.md until every
70
+ exit condition is met. If asked to "just write it" early, name the open gaps first.
71
+ 4. **One topic at a time.** Never dump 20 questions. Walk the agenda below, a focused
72
+ batch at a time, and reflect back what you heard before moving on.
73
+ 5. **Record deferrals as explicit assumptions.** If the human says "you decide" on a
74
+ consequential decision, push back once with the trade-off; if they still defer,
75
+ record it as an explicit assumption in the ADR, never as a silent default.
76
+
77
+ ## Phase A — The interview (agenda)
78
+
79
+ Start from the human's initial context. Work the agenda in order; skip a topic only if
80
+ it's already fully answered. Keep a running list of OPEN GAPS and resolved decisions.
81
+
82
+ 1. **Problem and why now.** What job does this remove? What does it cost to NOT do
83
+ it (money, time, risk)? If "why now" has no answer, the priority is suspect.
84
+ 2. **Implicit decisions.** Surface the choices the request assumed: sync vs async,
85
+ storage, protocol, idempotency, transactional boundaries, who owns state. For each,
86
+ force an explicit decision and at least one considered alternative.
87
+ 3. **Behavior.** Happy path first, then the DIRTY cases: provider/timeout failures,
88
+ retries and backoff, 4xx vs 5xx, concurrency, partial/terminal states, what must NOT
89
+ happen. A feature without its failure behavior is half-specified.
90
+ 4. **Inviolable constraints (→ `CONSTITUTION.md`).** Domain + security + operation
91
+ rules that cannot be broken (money to the cent, numbering without gaps, never cross
92
+ environments/credentials, secrets never logged, auth/authz, data retention). Write/extend
93
+ `CONSTITUTION.md` (one invariant per line, CWE ref where it maps); these feed the
94
+ dev-loop severity gate and a breach is a BLOCKER. **An ADR may never contradict the
95
+ CONSTITUTION** — if a decision would, it's escalated, not recorded.
96
+ 5. **Out of scope.** Explicit boundaries, with forward references ("X goes to a later
97
+ spec"). What you exclude is as important as what you include.
98
+ 6. **Definition of Done + how we measure success.** Concrete, checkable acceptance criteria
99
+ (tests green, documented, metrics published, runbook) AND success metrics (p95,
100
+ cost ceiling, zero orphaned records). Each item must be verifiable, not a feeling.
101
+ 7. **Dependencies.** Which other specs/systems/credentials this needs to exist first.
102
+
103
+ After each batch, reflect: "Decided: … / Still open: …". Move on only when the
104
+ current topic is closed.
105
+
106
+ ## Convergence — exit conditions (ALL must hold)
107
+
108
+ - Every decision has a rationale and at least one considered alternative.
109
+ - Every failure mode named has a defined behavior.
110
+ - Out-of-scope is explicit.
111
+ - The Definition of Done exists and every item is checkable.
112
+ - No OPEN GAP you raised remains unresolved (resolved = decided OR recorded as an
113
+ explicit assumption).
114
+
115
+ State plainly when you've converged ("Closed: every decision has a rationale, the failures
116
+ have behavior, the scope has a boundary and the DoD is verifiable.") before Phase B.
117
+
118
+ ## Phase B Distill the artifacts
119
+
120
+ Only after convergence. Produce (and, if any new project-wide invariant surfaced in
121
+ step 4, append it to **`CONSTITUTION.md`** never let an inviolable rule slip into an
122
+ ADR where it could later be "traded away"):
123
+
124
+ 1. **One ADR per decision worth recording** at `docs/adr/ADR-NNN-<slug>.md`, format:
125
+
126
+ ```markdown
127
+ # ADR-NNN: <title of the decision>
128
+ ## Status: Accepted
129
+ <!-- Use Status: Experiment only for a bounded hypothesis with feedback/review criteria. -->
130
+ ## Context
131
+ <the problem + the considered options: A) … B) … C) …>
132
+ ## Decision
133
+ <the chosen option>
134
+ ## Reasons
135
+ - <why, point by point>
136
+ ## Consequences
137
+ + <the good>
138
+ - <the cost / what it forces on us>
139
+ <!-- If Status: Experiment, also include:
140
+ ## Hypothesis
141
+ ## Feedback Signal
142
+ ## Review By: YYYY-MM-DD (or ## Review Trigger)
143
+ ## Promote Criteria
144
+ ## Rollback / Supersede Criteria
145
+ -->
146
+ ## Implementation Plan
147
+ - Affected paths: <files/dirs>
148
+ - Patterns: <pattern to follow>
149
+ - Tests: <which tests prove the decision>
150
+ ## Verification
151
+ - [ ] <criterion checkable by an agent>
152
+ ```
153
+
154
+ Number ADRs continuing from the highest existing one in `docs/adr/` (glob first).
155
+ Negative decisions count: "what we are NOT going to use and why" is a valid ADR.
156
+ Experimental decisions count only when they are explicit hypotheses with feedback signal,
157
+ review date/trigger, promote criteria and rollback/supersede criteria. Do not use
158
+ `Status: Experiment` as a polite way to avoid deciding.
159
+
160
+ 2. **`ACCEPTANCE.md`** at the repo root (or the path in `uscha.config.json` →
161
+ `defaults.acceptance_file`). This is the file dev-loop's readiness measures — it MUST
162
+ exist and be checkable:
163
+
164
+ ```markdown
165
+ # Acceptance — <feature>
166
+ ## Definition of Done
167
+ - [ ] AC-01 — <verifiable criterion>
168
+ - [ ] AC-02 — <verifiable criterion>
169
+ ## How we measure success
170
+ - <objective metric: p95, cost, zero orphans, …>
171
+ ## Out of scope
172
+ - <boundary> → <future spec>
173
+ ## Recorded decisions
174
+ - ADR-NNN — <title>
175
+ ```
176
+
177
+ **Where to write:** with file tools available (Claude Code), write the files to disk.
178
+ In a chat-only context, print each file in a fenced block, clearly labeled with its
179
+ target path, ready to paste — and remind the human these go to `docs/adr/` and the repo
180
+ root before running dev-loop.
181
+
182
+ **Tracked-markdown protocol:** if any target `.md` already exists and is tracked, ask
183
+ for its current version before overwriting — never silently replace.
184
+
185
+ ## Handoff to dev-loop
186
+
187
+ Close with the handoff prompt so the build phase starts by planning, not improvising:
188
+
189
+ > "Read the ADR set and ACCEPTANCE.md. Before touching code: 1) summarize the plan of
190
+ > files to create/modify, 2) confirm which decisions were left implicit, 3)
191
+ > show me the first test you would write."
192
+
193
+ Two-command flow end to end: `/uscha-adr-refine` → (ADR set + ACCEPTANCE.md) → `/uscha-devloop`.
194
+
195
+ That route is the **nominal** one, not the answer: the `Next:`/`Run:` you emit in the close block are DERIVED from the state you actually produced, and override it whenever an open experiment, an unclosed spike, an unapproved golden or a red gate stands in between.
196
+
197
+ ## Anti-patterns (do not do)
198
+
199
+ - Generate an ADR from a one-line request without interviewing.
200
+ - Accept "do it however you want" on a consequential decision without recording the
201
+ assumption.
202
+ - Write an ACCEPTANCE item that isn't objectively checkable ("that it works well").
203
+ - Emit artifacts before the convergence conditions are met.
@@ -18,6 +18,46 @@ return, you encode the same partial understanding that loses logic silently. **Y
18
18
  what the code DOES, mechanically, by running it — never what it should do.** You may write
19
19
  the capture harness; you may NOT create, rename, or edit any `.approved` file.
20
20
 
21
+ ## Orientation markers (non-negotiable)
22
+
23
+ The operator must never have to ask "where am I?" or "what happens now?". Two markers, always.
24
+ They are navigation, not ceremony: one line per turn, one block at the end.
25
+
26
+ **Open every turn with a breadcrumb**, then the content:
27
+
28
+ `[uscha · characterize · <step> → <target>]`
29
+
30
+ - `<step>` — `Q<n>` for a question, `pass <n>` for a loop iteration, `step <n>` otherwise.
31
+ Count what has actually happened. **Never write a denominator** (`Q4/12`): this phase
32
+ converges, its length is not known in advance, and an invented total is exactly the kind of
33
+ narrated number the method forbids. **When the ledger already measures the count** (the QA
34
+ loop's `loop_count`), use the measured number — never keep a parallel tally of your own.
35
+ - `<target>` — the artifact this turn feeds (`SPEC`, `ADR-003`, `ACCEPTANCE`, `LEDGER`,
36
+ `RECEIVED`, ...). Drop `→ <target>` only when the turn genuinely feeds none.
37
+
38
+ **Close with the close block ONCE, when the skill finishes** — not on every turn. Ending
39
+ without it is a defect, even when the phase converged cleanly:
40
+
41
+ ```
42
+ [uscha · characterize · CLOSED]
43
+ Produced: <files actually written, or "nothing">
44
+ Blocks: <what stands between here and the next phase, or "nothing">
45
+ Next: <the next action, and why it is that one>
46
+ Run: <the exact command or skill to invoke>
47
+ ```
48
+
49
+ This is **not** the implementation handoff some skills also emit: that one is a prompt for
50
+ whoever implements next, this one is navigation for the human operator, and both can appear.
51
+
52
+ `Blocks` and `Next` are **derived from the state you just produced** — never copied from a
53
+ fixed route, **including any `Flow:` line in this file**. Those lines are the nominal path;
54
+ open ADR experiments, an unclosed spike, an unapproved golden or a red gate all change what
55
+ genuinely comes next, and the derived answer wins. If the next phase cannot start yet, name it
56
+ and say exactly what unblocks it.
57
+
58
+ Keep the CONTENT in the conversation's language, but keep the labels (`CLOSED`, `Produced`,
59
+ `Blocks`, `Next`, `Run`) verbatim — they are the method's vocabulary and the smoke checks them.
60
+
21
61
  ## Inputs
22
62
 
23
63
  - **Target module** + a **corpus source**: a path to input fixtures, or a reference to
@@ -26,6 +26,46 @@ two tiers: **measured** records (snapshots, ingest-gate, log-gate — parsed fro
26
26
  artifacts; these can block) and **self-reported** agent counts (log-step — narration
27
27
  recorded for the retrospective; a measured red always overrides a narrated green).
28
28
 
29
+ ## Orientation markers (non-negotiable)
30
+
31
+ The operator must never have to ask "where am I?" or "what happens now?". Two markers, always.
32
+ They are navigation, not ceremony: one line per turn, one block at the end.
33
+
34
+ **Open every turn with a breadcrumb**, then the content:
35
+
36
+ `[uscha · devloop · <step> → <target>]`
37
+
38
+ - `<step>` — `Q<n>` for a question, `pass <n>` for a loop iteration, `step <n>` otherwise.
39
+ Count what has actually happened. **Never write a denominator** (`Q4/12`): this phase
40
+ converges, its length is not known in advance, and an invented total is exactly the kind of
41
+ narrated number the method forbids. **When the ledger already measures the count** (the QA
42
+ loop's `loop_count`), use the measured number — never keep a parallel tally of your own.
43
+ - `<target>` — the artifact this turn feeds (`SPEC`, `ADR-003`, `ACCEPTANCE`, `LEDGER`,
44
+ `RECEIVED`, ...). Drop `→ <target>` only when the turn genuinely feeds none.
45
+
46
+ **Close with the close block ONCE, when the skill finishes** — not on every turn. Ending
47
+ without it is a defect, even when the phase converged cleanly:
48
+
49
+ ```
50
+ [uscha · devloop · CLOSED]
51
+ Produced: <files actually written, or "nothing">
52
+ Blocks: <what stands between here and the next phase, or "nothing">
53
+ Next: <the next action, and why it is that one>
54
+ Run: <the exact command or skill to invoke>
55
+ ```
56
+
57
+ This is **not** the implementation handoff some skills also emit: that one is a prompt for
58
+ whoever implements next, this one is navigation for the human operator, and both can appear.
59
+
60
+ `Blocks` and `Next` are **derived from the state you just produced** — never copied from a
61
+ fixed route, **including any `Flow:` line in this file**. Those lines are the nominal path;
62
+ open ADR experiments, an unclosed spike, an unapproved golden or a red gate all change what
63
+ genuinely comes next, and the derived answer wins. If the next phase cannot start yet, name it
64
+ and say exactly what unblocks it.
65
+
66
+ Keep the CONTENT in the conversation's language, but keep the labels (`CLOSED`, `Produced`,
67
+ `Blocks`, `Next`, `Run`) verbatim — they are the method's vocabulary and the smoke checks them.
68
+
29
69
  ## Non-negotiable principles
30
70
 
31
71
  1. **Converge, don't chase zero.** Block only on findings at or above the severity