@ericrisco/rsc 0.1.43 → 0.1.45

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 (97) hide show
  1. package/README.md +1 -1
  2. package/manifest.json +110 -86
  3. package/package.json +1 -1
  4. package/scripts/lib/domains.js +1 -1
  5. package/scripts/skill-migration-brief.md +104 -0
  6. package/skills/ab-testing/SKILL.md +9 -41
  7. package/skills/accessibility/SKILL.md +5 -7
  8. package/skills/ads/SKILL.md +9 -24
  9. package/skills/agent-eval/SKILL.md +7 -33
  10. package/skills/agent-safety/SKILL.md +7 -14
  11. package/skills/ai-media/SKILL.md +4 -20
  12. package/skills/analytics/SKILL.md +8 -30
  13. package/skills/analyze/SKILL.md +24 -59
  14. package/skills/angular/SKILL.md +12 -25
  15. package/skills/api-connector-builder/SKILL.md +10 -27
  16. package/skills/api-design/SKILL.md +7 -14
  17. package/skills/article-writing/SKILL.md +1 -18
  18. package/skills/astro/SKILL.md +36 -54
  19. package/skills/author-skill/SKILL.md +41 -74
  20. package/skills/author-skill/evals/README.md +5 -5
  21. package/skills/author-skill/evals/cases.yaml +8 -8
  22. package/skills/author-skill/references/description-recipe.md +25 -26
  23. package/skills/author-skill/references/eval-authoring.md +1 -1
  24. package/skills/author-skill/references/rsc-conventions.md +1 -1
  25. package/skills/automation-flows/SKILL.md +6 -16
  26. package/skills/automation-strategy/SKILL.md +1 -9
  27. package/skills/aws-essentials/SKILL.md +6 -23
  28. package/skills/backups/SKILL.md +1 -7
  29. package/skills/bash-scripting/SKILL.md +5 -9
  30. package/skills/bookkeeping/SKILL.md +2 -10
  31. package/skills/brand-identity/SKILL.md +18 -44
  32. package/skills/brand-voice/SKILL.md +4 -31
  33. package/skills/building-agents/SKILL.md +20 -103
  34. package/skills/business-intelligence/SKILL.md +9 -23
  35. package/skills/calendar-scheduling/SKILL.md +11 -27
  36. package/skills/case-studies/SKILL.md +3 -8
  37. package/skills/chatbot/SKILL.md +6 -23
  38. package/skills/chrome-extension/SKILL.md +2 -2
  39. package/skills/clarify/SKILL.md +31 -72
  40. package/skills/clickhouse-analytics/SKILL.md +2 -8
  41. package/skills/client-onboarding/SKILL.md +17 -19
  42. package/skills/cloudflare/SKILL.md +3 -8
  43. package/skills/code-review/SKILL.md +10 -23
  44. package/skills/codebase-onboarding/SKILL.md +2 -7
  45. package/skills/cold-outreach/SKILL.md +9 -30
  46. package/skills/community/SKILL.md +4 -31
  47. package/skills/competitor-watch/SKILL.md +20 -35
  48. package/skills/compliance/SKILL.md +10 -37
  49. package/skills/compose-multiplatform/SKILL.md +1 -1
  50. package/skills/constitution/SKILL.md +8 -35
  51. package/skills/content-engine/SKILL.md +4 -16
  52. package/skills/context-budget/SKILL.md +3 -21
  53. package/skills/continuous-learning/SKILL.md +10 -40
  54. package/skills/contracts/SKILL.md +6 -17
  55. package/skills/coolify/SKILL.md +8 -14
  56. package/skills/cost-tracking/SKILL.md +3 -11
  57. package/skills/course-builder/SKILL.md +17 -45
  58. package/skills/course-storytelling/SKILL.md +26 -94
  59. package/skills/cpp/SKILL.md +26 -71
  60. package/skills/csharp-dotnet/SKILL.md +19 -38
  61. package/skills/customer-support/SKILL.md +14 -37
  62. package/skills/dashboard/SKILL.md +6 -26
  63. package/skills/data-cleaning/SKILL.md +37 -63
  64. package/skills/data-policy/SKILL.md +8 -21
  65. package/skills/data-scraper/SKILL.md +1 -7
  66. package/skills/debug/SKILL.md +10 -49
  67. package/skills/deployment/SKILL.md +38 -101
  68. package/skills/design/SKILL.md +34 -116
  69. package/skills/fable-operator/SKILL.md +1 -4
  70. package/skills/fastapi/SKILL.md +50 -82
  71. package/skills/flutter/SKILL.md +41 -89
  72. package/skills/go/SKILL.md +57 -105
  73. package/skills/harness/SKILL.md +52 -68
  74. package/skills/implement/SKILL.md +1 -1
  75. package/skills/init/SKILL.md +152 -168
  76. package/skills/marketing/SKILL.md +30 -80
  77. package/skills/nextjs/SKILL.md +42 -116
  78. package/skills/orient/SKILL.md +25 -20
  79. package/skills/parallel/SKILL.md +9 -75
  80. package/skills/plan/SKILL.md +92 -165
  81. package/skills/postgresdb/SKILL.md +52 -72
  82. package/skills/presentations/SKILL.md +49 -87
  83. package/skills/python/SKILL.md +23 -72
  84. package/skills/react/SKILL.md +19 -67
  85. package/skills/review/SKILL.md +22 -52
  86. package/skills/rust/SKILL.md +40 -115
  87. package/skills/sdd-init/SKILL.md +9 -14
  88. package/skills/secure-coding/SKILL.md +80 -109
  89. package/skills/ship/SKILL.md +25 -55
  90. package/skills/tasks/SKILL.md +37 -61
  91. package/skills/typescript/SKILL.md +22 -55
  92. package/skills/verify/SKILL.md +8 -32
  93. package/skills/viral-score/SKILL.md +122 -0
  94. package/skills/viral-score/evals/README.md +16 -0
  95. package/skills/viral-score/evals/cases.yaml +50 -0
  96. package/skills/vue-nuxt/SKILL.md +45 -106
  97. package/skills/worktrees/SKILL.md +24 -69
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: parallel
3
- description: "Use when you have two or more genuinely independent pieces of work and want to fan them out across subagents instead of doing them one after another — disjoint scope, no shared files or state, no ordering dependency, then gather and reconcile the results. Triggers: 'do these in parallel', 'fan this out', 'split this across subagents', 'run these at the same time', 'these tasks are independent, parallelize them', 'dispatch agents for each module', 'hazlo en paralelo', 'reparte esto en subagentes', 'a la vez'. The on-demand SDD helper that implement calls when its task list has disjoint clusters; it owns the partition→dispatch→gather→reconcile discipline. NOT for sequential or data-dependent steps (serialize those), NOT the TDD loop itself (that stays inside implement), NOT git isolation (that's worktrees)."
3
+ description: "Use when two or more pieces of work are genuinely independent — disjoint files, no shared state, no ordering edge — and should fan out across subagents, then be gathered and reconciled under a combined test suite. Decides WHAT can run concurrently; NOT the isolation it runs in (that is `worktrees`), NOT the per-unit TDD loop (that is `implement`)."
4
4
  tags: [parallel, subagents, fanout]
5
5
  recommends: []
6
6
  profiles: [core, full]
@@ -11,7 +11,7 @@ origin: risco
11
11
 
12
12
  *Parallelism is a property of the work, not a wish. Prove the pieces are disjoint, dispatch one subagent per piece with a self-contained brief, then gather and reconcile before anyone calls it done.*
13
13
 
14
- This is an **on-demand process skill** in the SDD chain. You reach it from `implement` (or any phase) when the work in front of you splits into pieces that could each be handed to a different person who never talks to the others. It owns one discipline: **partition → dispatch → gather → reconcile**. It does *not* own the work inside each piece — a subagent building a module still runs its own red → green → refactor loop from `implement`; this skill only orchestrates the fan-out.
14
+ This is an **on-demand process skill** in the SDD chain. You reach it from `implement` (or any phase) when the work in front of you splits into pieces that could each be handed to a different person who never talks to the others. It owns one discipline: **partition → dispatch → gather → reconcile**. It does *not* own the work inside each piece — a subagent building a module still runs its own red → green → refactor loop from `implement`; this skill only orchestrates the fan-out. It also does not own the *place* the work runs: a clean branch or checkout to work in is `worktrees`. `parallel` decides **what can run at the same time**; `worktrees` provides **the isolation it runs in**.
15
15
 
16
16
  The whole value is in the gate at the front. Run work in parallel only when it is *actually* independent. Forcing parallelism onto coupled work does not make it faster — it makes it a merge disaster, and the time you save dispatching you lose tenfold reconciling. Most of this skill is about earning the right to parallelize.
17
17
 
@@ -75,12 +75,7 @@ Each subagent still owns its own discipline inside its scope — TDD via `implem
75
75
 
76
76
  **Per-unit model tier (when routing is enabled).** `parallel` has *no fixed tier* — this is the most concrete place per-phase model routing pays off. When `models.enabled: true` in `02-DOCS/wiki/sdd/config.yaml`, give each unit the tier of the *kind of work it does*, not one tier for the whole fan-out: an implement-type unit → `balanced`, a scan/research/boilerplate unit → `light`, a unit doing genuine design or root-cause reasoning → `heavy`. Resolve the tier to a concrete model via `models.tiers` and **dispatch that subagent on that model** (e.g. Claude Code's `model` field on the Task/subagent) — real routing, independent of the session model. If routing is off or no profile exists, dispatch on the session model and say nothing. Full protocol: `../sdd/references/model-routing.md`.
77
77
 
78
- **The `developer` agent is the default worker.** rsc installs a `developer` subagent pinned to the **balanced** tier (Sonnet by default; the user's onboarding choice in `.rsc/developer.json`, never `light`). For implement-type units, **dispatch to the `developer` agent** (e.g. Claude Code `subagent_type: developer`) — that's the deliberate cost cap the user asked for. Only escalate a genuinely heavy unit (real design / root-cause) to a heavy model, and only when routing is enabled; otherwise the `developer` agent's balanced model is the floor and the ceiling.
79
-
80
- **Model is REQUIRED on every dispatch.** Set each subagent's model explicitly. An omitted model
81
- silently inherits the session's model — usually the most expensive one — and that is how a fan-out's
82
- cost quietly explodes. The `developer` agent already pins balanced; if you dispatch a raw subagent,
83
- name its tier.
78
+ **Set the model on every dispatch — an omitted model silently inherits the session's, usually the most expensive one, and that is how a fan-out's cost quietly explodes.** rsc installs a `developer` subagent pinned to the **balanced** tier (Sonnet by default; the user's onboarding choice in `.rsc/developer.json`, never `light`). For implement-type units, **dispatch to the `developer` agent** (e.g. Claude Code `subagent_type: developer`) — that's the deliberate cost cap the user asked for. Only escalate a genuinely heavy unit (real design / root-cause) to a heavy model, and only when routing is enabled; otherwise balanced is the floor and the ceiling. If you dispatch a raw subagent instead, name its tier explicitly.
84
79
 
85
80
  ### The unit report contract (statuses & escalation)
86
81
 
@@ -96,9 +91,7 @@ change something first: add the missing interface/constraint, fix the dependency
96
91
  tier for a genuinely hard unit. An identical re-run burns budget without progress. A `BLOCKED` unit
97
92
  is a partition signal too: if it blocked on another unit, the two were not independent — re-partition.
98
93
 
99
- ### Skill resolution feedback
100
-
101
- Every subagent result must report:
94
+ Every subagent result must also report:
102
95
 
103
96
  ```yaml
104
97
  skill_resolution:
@@ -114,15 +107,7 @@ The orchestrator folds these into the final parallel result. If a unit claims it
114
107
 
115
108
  Wait for **all** units to report. Collect each one's diff, test output, and any decisions. Do not start merging the fast ones while slow ones are still running — partial merges create the exact shared-state races you partitioned to avoid. Check each result against its brief's done-check *before* it touches the integration branch: a unit that came back not-actually-done gets sent back, not merged hopefully.
116
109
 
117
- **Per-unit review gate (before merge).** For each non-trivial unit, run a fresh-eyes review of *that
118
- unit's diff alone* before it joins the integration branch — the same gate `implement` runs per task
119
- (full brief: `../implement/references/per-task-review.md`). Package the unit's diff as a file
120
- (`../implement/scripts/review-package <BASE> <HEAD>`), dispatch a fresh reviewer (NOT the unit's own
121
- implementer) with the diff path + the unit's done-check + its frozen interface, and fold
122
- `Critical`/`Important` findings back before merging. **Anti-pre-judging:** never tell the reviewer
123
- what not to flag or pre-rate severity. This is the cheap per-unit pass; the *combined* adversarial
124
- review over the whole merged diff is still `review`'s job at the end (RECONCILE only proves the seam
125
- compiles and tests green).
110
+ **Per-unit review gate (before merge).** For each non-trivial unit, run the same fresh-eyes review `implement` runs per task, over *that unit's diff alone* — package it with `../implement/scripts/review-package <BASE> <HEAD>` and dispatch a reviewer that is **not** the unit's own implementer, given the diff path, the unit's done-check, and its frozen interface; never pre-rate severity or tell it what to skip. Fold `Critical`/`Important` findings back before merging. Full protocol: `../implement/references/per-task-review.md`. This is the cheap per-unit pass; the *combined* adversarial review over the whole merged diff is still `review`'s job at the end (RECONCILE only proves the seam compiles and tests green).
126
111
 
127
112
  ### 4. RECONCILE — merge, then prove the seam holds
128
113
 
@@ -135,28 +120,7 @@ This is where parallel work is actually finished. In order:
135
120
 
136
121
  Only after the combined suite is green is the parallel batch done. Hand the merged, green result back to the phase that called you (usually `implement`, heading for `verify`).
137
122
 
138
- ## The accompaniment dial — how loud while fanning out
139
-
140
- Read the level from `02-DOCS/wiki/harness/user-profile.md` and match it. The dial changes how much you narrate the orchestration; it never changes the independence test or the reconcile gate.
141
-
142
- | Level | While dispatching/reconciling you show… | Questions you ask |
143
- | --- | --- | --- |
144
- | **L0** terse | the partition (batches + spine) in one block, then "merged, combined suite green" | none unless a unit fails its done-check or a contract needs freezing |
145
- | **L1** brief | the partition + one line of *why these are independent* | confirm the partition only where independence is borderline |
146
- | **L2** decisions | the partition, the frozen contracts, and each reconcile conflict with its fix | confirm before freezing a contract that constrains multiple units |
147
- | **L3** full | the full independence reasoning per pair, the briefs, the gather, the seam check, narrated | ask to validate the partition before dispatch; teach why the seam is the risk |
148
-
149
- L0 still runs the independence test and the combined-suite gate — silently, but completely. Terse is about words, not about skipping the gate.
150
-
151
- ## When parallel is the wrong tool
152
-
153
- Be honest about this — most task lists are *mostly* serial with a few disjoint pockets, not the other way around.
154
-
155
- - **The pieces share a file or a contract.** Serialize, or freeze the contract first then fan out the rest. Do not parallelize across a live shared edit.
156
- - **One piece needs another's output.** That is a dependency edge, by definition sequential. Order them.
157
- - **There are only two tiny tasks.** Orchestration overhead (writing briefs, gathering, reconciling) can cost more than just doing them in a row. Parallelize when the units are substantial and many, not to look busy.
158
- - **You can't write a self-contained brief for a unit.** If you cannot describe it without referring to a sibling unit, it is not independent yet. Fix the partition or serialize.
159
- - **You only need isolation, not concurrency.** Wanting a clean branch/worktree to work in is `worktrees`, not this. This skill is about doing several things *at once*; isolation is about doing one thing *cleanly*.
123
+ **How loud.** Match the accompaniment level in `02-DOCS/wiki/harness/user-profile.md`: it sets how much of the independence reasoning, the frozen contracts, the briefs and the seam check you narrate, and nothing else. At the tersest level you still run the independence test and the combined-suite gate in full — silently, but completely.
160
124
 
161
125
  ## Anti-patterns → STOP
162
126
 
@@ -169,33 +133,10 @@ Be honest about this — most task lists are *mostly* serial with a few disjoint
169
133
  | "I'll merge the fast unit now and the slow one when it lands." | Partial merges reintroduce the races you partitioned away. Gather all, then reconcile once. |
170
134
  | "It's only two small tasks, but parallel sounds efficient." | Orchestration overhead > the work. Just do them in a row. |
171
135
  | "The brief says 'see the other agent's output' — close enough." | That's a dependency, not independence. Serialize, or freeze the output first. |
172
- | "Combined suite is red, probably the slower unit — I'll tweak it." | Don't guess at the seam. Reproduce and isolate with debug. |
173
- | "I just want an isolated branch, so I'll use parallel." | That's isolation, not concurrency. Use worktrees. |
136
+ | "Combined suite is red, probably the slower unit — I'll tweak it." | Don't guess at the seam. Reproduce and isolate with `debug`. |
137
+ | "I just want an isolated branch, so I'll use parallel." | That's isolation, not concurrency. Use `worktrees`. |
174
138
  | "Routing's on, so I'll run the whole fan-out on one tier." | `parallel` has no fixed tier — give each unit the tier of its own work (scan→light, build→balanced, design→heavy). |
175
139
 
176
- ## Red flags — stop and re-plan the partition
177
-
178
- - A subagent brief can't be written without referencing another unit → not independent; re-partition.
179
- - Two units both need to edit the same file / migration / barrel / type → collapse them into one serial unit.
180
- - Subagents are asking to "sync up" mid-run → the contract wasn't frozen; stop, freeze it, re-dispatch.
181
- - The combined suite is red after merge → the seam leaked; `debug` before continuing, don't checkpoint as done.
182
- - More open subagents than you can actually review → over-fanned; reduce the degree of parallelism.
183
-
184
- ## Checklist (copy per fan-out)
185
-
186
- ```text
187
- - [ ] PARTITION: independence test passed for every pair; batches + serial spine written down
188
- - [ ] Shared contracts/types/schemas FROZEN in the serial spine before dispatch
189
- - [ ] DISPATCH: one self-contained brief per unit (scope, goal, done-check, constraints, report-back)
190
- - [ ] Each brief includes selected skills, compact rules, and fallback behavior from registry
191
- - [ ] Each unit honors the constitution + its stack skill; TDD stays inside the unit
192
- - [ ] GATHER: all units reported; each checked against its done-check BEFORE merge
193
- - [ ] GATHER: each unit returned skill_resolution (used/missing/fallback/compact_rules)
194
- - [ ] RECONCILE: merged, conflicts resolved by hand, decision logs folded into 02-DOCS
195
- - [ ] Combined suite run across the merged result and GREEN (not just green-in-isolation)
196
- - [ ] Result handed back to the calling phase (usually implement → verify)
197
- ```
198
-
199
140
  ## Result envelope
200
141
 
201
142
  End with:
@@ -218,17 +159,10 @@ End with:
218
159
  }
219
160
  ```
220
161
 
221
- ## What this skill is NOT
222
-
223
- - **Not the TDD loop.** Each unit's red → green → refactor stays inside `implement`. This skill runs several of those at once; it does not replace the discipline within one.
224
- - **Not git isolation.** Creating a branch or worktree to work cleanly is `worktrees`. This skill is concurrency across disjoint work, not a clean room for one stream.
225
- - **Not the task breakdown.** Producing the ordered task list with done-checks is `tasks`; `parallel` consumes that list and decides which pieces can run together.
226
- - **Not the debugger.** When the combined suite goes red at the seam, switch to `debug` — don't guess which unit to blame.
227
-
228
162
  ## Where you are in the chain
229
163
 
230
164
  `parallel` is on-demand, callable from any phase but most often from `implement`:
231
165
 
232
166
  `constitution` → `specify` → `clarify` → `plan` → `tasks` → `analyze` → **implement** → `verify` → `review` → `ship`, with `debug` · `worktrees` · **parallel** callable on demand.
233
167
 
234
- **Next:** when the fan-out is reconciled and the combined suite is green, return to the phase that called you — usually `../implement/SKILL.md`, continuing the task list toward `../verify/SKILL.md`. If the seam is red, go to `debug` first. If you discover you actually needed an isolated branch rather than concurrency, that's `worktrees`.
168
+ **Next:** when the fan-out is reconciled and the combined suite is green, return to the phase that called you — usually `../implement/SKILL.md`, continuing the task list toward `../verify/SKILL.md`. If the seam is red, go to `debug` first. If the ordered task list with done-checks does not exist yet, that is `tasks`, not this. If what you actually needed was an isolated branch rather than concurrency, that's `worktrees`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: plan
3
- description: "Use when turning an approved, clarified spec into a technical implementation plan — the SDD phase between clarify and tasks. Covers architecture and component boundaries, the public interfaces/contracts, data model and data flow, the testing strategy, sequencing, and the risk register. Triggers: 'plan this feature', 'how should we build this', 'design the architecture', 'write the implementation plan', 'plan.md', 'what's the data flow', 'how do we test this', 'what are the risks', 'we have the spec, now what'. Reads the spec under 02-DOCS/wiki/sdd/specs/ and the constitution; writes 02-DOCS/wiki/sdd/plans/<slug>.md; defers concrete stack mechanics (framework APIs, ORM, test tooling) to the relevant stack skill. NOT requirements capture (that's specify), NOT ambiguity removal (that's clarify), NOT the task breakdown (that's tasks). Honors the harness accompaniment dial."
3
+ description: "Use when an approved, clarified spec must become a technical blueprint before any code — the SDD phase between clarify and tasks: architecture, contracts, data flow, testing strategy, sequencing and risks, at structure altitude, never framework syntax. NOT the what/why spec (that is `specify`), NOT the ambiguity sweep (that is `clarify`), NOT the task breakdown (that is `tasks`), NOT the code (that is `implement`)."
4
4
  tags: [sdd, plan, design]
5
5
  recommends: [tasks]
6
6
  profiles: [core, full]
@@ -9,213 +9,140 @@ origin: risco
9
9
 
10
10
  # Plan — the technical blueprint between spec and tasks
11
11
 
12
- You have a spec that says **what** and **why**. `plan` decides **how** — the architecture, the
13
- interfaces, the data flow, the way you'll prove it works, and the things most likely to bite you.
14
- It is the engineering counterpart of the spec: a spec a human signed off on becomes a plan an
15
- engineer (or an agent) can execute without re-deciding the shape of the system halfway through.
16
-
17
- `plan` sits fourth in the SDD chain:
12
+ The spec says **what** and **why**. `plan` decides **how**: the components, the contracts between
13
+ them, the data that flows, how each claim gets proven, and what is most likely to bite. It reads the
14
+ clarified spec and the constitution, writes ONE artifact — `02-DOCS/wiki/sdd/plans/<slug>.md` — and
15
+ hands off to `tasks`, which slices it into an ordered, independently-verifiable checklist.
18
16
 
19
17
  ```text
20
18
  constitution → specify → clarify → [ plan ] → tasks → analyze → implement → verify → review → ship
21
19
  ```
22
20
 
23
- It reads the clarified spec and the constitution, produces ONE artifact —
24
- `02-DOCS/wiki/sdd/plans/<slug>.md` — and hands off to `tasks`, which slices that plan into an
25
- ordered, independently-verifiable checklist.
26
-
27
- ## The one rule that defines this phase
21
+ ## Decide structure, not syntax
28
22
 
29
- **Decide structure, not syntax.** A plan names the components, their contracts, the data that
30
- flows between them, and how each piece is proven. It does **not** write the framework's route
31
- decorators, the ORM's session boilerplate, or the test runner's flags. Those are stack mechanics,
32
- and they belong to the stack skill (`../fastapi/SKILL.md`, `../nextjs/SKILL.md`, `../go/SKILL.md`,
33
- `../flutter/SKILL.md`, `../postgresdb/SKILL.md`). The plan says *"the orders service exposes a
34
- `reserve(cartId) → Reservation` operation, transactional, idempotent on cartId"*; the stack skill
35
- later decides whether that's a POST handler with a Pydantic model or a Go method on a struct.
23
+ A plan names components, contracts, shapes and flows. It does not write the framework's route
24
+ decorators, the ORM's session boilerplate or the test runner's flags — those are stack mechanics,
25
+ owned by the stack skill (`../fastapi/SKILL.md`, `../nextjs/SKILL.md`, `../go/SKILL.md`,
26
+ `../flutter/SKILL.md`, `../postgresdb/SKILL.md`) at `implement` time. This altitude is what makes a
27
+ plan reviewable against intent and slice-able by `tasks`; drop it and you get code no one approved.
36
28
 
37
- If you find yourself writing real code in the plan, you have dropped an altitude. Pull back up.
29
+ ```text
30
+ reservation.reserve(cartId: CartId) -> Reservation | OutOfStock | CartNotFound
31
+ - idempotent on cartId (calling twice returns the same Reservation)
32
+ - holds stock for 15 min, then auto-releases
33
+ - never partially reserves: all lines or none
34
+ ```
38
35
 
39
- ## Before you write a line
36
+ That is the altitude. The stack skill later decides whether it becomes a POST handler with a
37
+ Pydantic model or a Go method on a struct — it can, because the contract is unambiguous.
40
38
 
41
- Run this gate. Skipping it produces a plan that drifts from intent on contact.
39
+ ## Entry gate
42
40
 
43
- 1. **Read the accompaniment dial.** Open `02-DOCS/wiki/harness/user-profile.md`. The technical +
44
- accompaniment level (L0..L3) sets how much you explain and how many questions you ask — see
45
- "Adapting to the dial" below. No profile yet → assume non-technical, ask the two gauging
46
- questions first (the harness owns that flow).
47
- 2. **Read the spec.** `02-DOCS/wiki/sdd/specs/<slug>.md`. If it is missing, STOP — there is nothing
48
- to plan from; route to `../specify/SKILL.md`. If it still carries `[NEEDS CLARIFICATION]` markers
49
- or open questions, STOP — route to `../clarify/SKILL.md`. **A plan built on an unclarified spec
50
- is a guess wearing a diagram.**
51
- 3. **Read the constitution.** `02-DOCS/wiki/sdd/constitution.md` holds the project's non-negotiables
41
+ 1. **The spec** — `02-DOCS/wiki/sdd/specs/<slug>.md`. Missing → STOP, route to
42
+ `../specify/SKILL.md`. Still carrying `[NEEDS CLARIFICATION]` markers or open questions → STOP,
43
+ route to `../clarify/SKILL.md`. A plan built on an unclarified spec is a guess wearing a diagram,
44
+ and every phase downstream inherits the guess.
45
+ 2. **The constitution** — `02-DOCS/wiki/sdd/constitution.md` holds the project's non-negotiables
52
46
  (stack canon, quality bars, conventions). Every architectural choice must be consistent with it;
53
- when the plan needs to bend a principle, say so explicitly with a reason — don't bend it silently.
54
- 4. **Read the Knowledge map.** The full index at `02-DOCS/wiki/index.md` (root `CLAUDE.md` keeps only a short pointer to it) points at existing
55
- `02-DOCS/wiki/stack/*` and prior plans/decisions. Reuse what's already established. A plan that
56
- reinvents a pattern the project already settled is scope drift.
57
-
58
- Only when the spec is present and clarified do you plan.
47
+ where the design needs to bend a principle, say so with a reason instead of bending it silently.
48
+ 3. **The Knowledge map** — `02-DOCS/wiki/index.md` points at `02-DOCS/wiki/stack/*` and prior
49
+ plans/decisions. Reusing what the project already settled is the difference between a plan and
50
+ scope drift.
51
+ 4. **The dial** — `02-DOCS/wiki/harness/user-profile.md` (see below).
59
52
 
60
53
  ## What a plan contains
61
54
 
62
- A plan is the answer to seven questions, in this order. Each is a section of the artifact
63
- (template in `references/plan-template.md`). Fill them top-down; later sections lean on earlier ones.
55
+ The sections of the artifact, in order; fill them top-down, later ones lean on earlier ones. The
56
+ fill-in skeleton with per-section guidance is `references/plan-template.md` — use it verbatim.
64
57
 
65
- | # | Section | The question it answers |
58
+ | § | Section | The question it answers |
66
59
  | --- | --- | --- |
67
- | 1 | Context & constraints | What spec/constitution facts pin this design down? |
60
+ | 0 | Global constraints | Which exact values must every task honor? (verbatim, not paraphrased — a context-isolated implementer and its reviewer see nothing else) |
61
+ | 1 | Context & constraints | Which spec/constitution facts pin this design down? Cite (`spec §Acceptance #3`), don't re-paste |
68
62
  | 2 | Architecture | What are the components and how do they fit together? |
69
- | 3 | Interfaces & contracts | What does each component promise to the others? |
63
+ | 3 | Interfaces & contracts | What does each component promise the others? |
70
64
  | 4 | Data model & flow | What data exists, where it lives, how it moves and changes? |
71
65
  | 5 | Testing strategy | How will we *prove* each part does what it claims? |
72
66
  | 6 | Sequencing & dependencies | In what order can this be built and verified? |
73
- | 7 | Risks & open decisions | What is most likely to be wrong, and what's still undecided? |
74
-
75
- Detailed guidance and the fill-in template live in `references/plan-template.md`. The essentials of
76
- each section:
77
-
78
- ### 1. Context & constraints
79
-
80
- Restate, in one or two lines each, the spec facts and constitution rules that actually constrain
81
- the design — the acceptance criteria, the non-functional bars (latency, scale, data residency),
82
- the stack canon. Don't re-paste the spec; cite it (`spec §Acceptance #3`). This section is the
83
- plan's contract with intent: if a reviewer disagrees with the design, this is where they check
84
- whether you misread the constraints.
67
+ | 7 | Risks & open decisions | What is most likely to be wrong, and what is still undecided? |
68
+
69
+ Three of them carry the weight and fail quietly:
70
+
71
+ - **§2 Architecture** — a box-and-arrow diagram, one sentence of single responsibility per
72
+ component, internal vs. external marked (the arrows are the seams you will test and parallelize).
73
+ State the **one** decision that matters most — sync vs. async, split service vs. monolith, read
74
+ model vs. single table — and defend it against a constraint from §1. If two designs are genuinely
75
+ viable, give both, the trade-off, *and* your recommendation; leaving the reader to choose is not a
76
+ plan.
77
+ - **§5 Testing strategy** — per acceptance criterion: the level that proves it (unit / contract /
78
+ integration / e2e), what it asserts, what it fakes to stay fast. Deciding this before code exists
79
+ is what makes `implement`'s TDD possible. You choose the seams; the stack skill owns the tooling.
80
+ - **§7 Risks** — ranked, each with trigger, impact, and the mitigation or spike that retires it. A
81
+ plan claiming zero risk is the riskiest one. Significant decisions taken while planning also get
82
+ appended to `02-DOCS/wiki/sdd/decisions.md`, so later phases can trace the *why*.
85
83
 
86
- ### 2. Architecture
87
-
88
- Name the components and draw the relationship — a small box-and-arrow diagram in a fenced block,
89
- plus a sentence per component stating its single responsibility. Mark each component's boundary:
90
- what's inside the system you're building vs. an external dependency. Show where the seams are,
91
- because the seams are where you'll test, mock, and parallelize later.
92
-
93
- ```text
94
- [ client ] --HTTP--> [ api: orders ] --calls--> [ svc: reservation ]
95
- | |
96
- v v
97
- [ db: orders ] [ external: payments ]
98
- ```
99
-
100
- State the **one** architectural decision that matters most and why you made it (sync vs. async,
101
- monolith vs. split service, read model vs. single table). One real decision, defended, beats five
102
- hedged ones. If two designs are genuinely viable, present both with the trade-off and a
103
- recommendation matched to the constitution — don't leave the reader to guess which you'd ship.
104
-
105
- ### 3. Interfaces & contracts
106
-
107
- For each seam in the architecture, define the contract at the **shape** level, not the
108
- implementation: the operation name, its inputs and outputs, its error modes, and its invariants
109
- (idempotent? transactional? ordered?). This is where most integration bugs are prevented or born.
110
-
111
- ```text
112
- reservation.reserve(cartId: CartId) -> Reservation | OutOfStock | CartNotFound
113
- - idempotent on cartId (calling twice returns the same Reservation)
114
- - holds stock for 15 min, then auto-releases
115
- - never partially reserves: all lines or none
116
- ```
117
-
118
- Keep it language-neutral. The stack skill turns this into a typed signature, a route, or an
119
- interface later — and it will, because you gave it an unambiguous contract.
120
-
121
- ### 4. Data model & flow
122
-
123
- Name the entities, their key fields, and their relationships — again at the model level, not DDL.
124
- Then trace the **flow**: for the primary scenario in the spec, follow one request from entry to
125
- persistence and back, naming what reads and writes each store. Call out the consistency boundaries
126
- (what's transactional together, what's eventually consistent) and the migration impact (new table?
127
- new column? backfill?). Concrete schema, indexes, and migration mechanics → `../postgresdb/SKILL.md`.
128
-
129
- ### 5. Testing strategy
130
-
131
- Decide *how each claim in the spec gets proven* before any code exists — this is what makes
132
- `implement`'s TDD discipline possible. For each acceptance criterion, name the level that proves it
133
- (unit / contract / integration / e2e), what the test asserts, and what it has to fake to stay fast.
134
- You are choosing the *strategy* (which seams to test, what to mock, where the e2e line is); the
135
- stack skill owns the *tooling* (the runner, the fixtures, the assertion library). A plan whose
136
- testing section is "we'll add tests" has no testing strategy — name the levels and the seams.
137
-
138
- ### 6. Sequencing & dependencies
139
-
140
- Order the work so each step is independently verifiable and the dependency graph is explicit. Mark
141
- which steps are independent (candidates for fan-out via the `parallel` phase when it's available)
142
- and which must be serial. This section is the bridge to `tasks`: a clean sequence here becomes a
143
- clean task list there.
144
-
145
- ### 7. Risks & open decisions
84
+ ## The artifact
146
85
 
147
- List what is most likely to be wrong, ranked. For each risk: the trigger, the impact, and the
148
- mitigation or the spike that would retire it. Separately, log any decision still genuinely open
149
- (and what input would close it). Honesty here is the whole point — a plan that claims zero risk is
150
- the riskiest plan. Significant design decisions taken during planning also get appended to
151
- `02-DOCS/wiki/sdd/decisions.md` (the SDD decisions log), so later phases can trace the *why*.
86
+ Write `02-DOCS/wiki/sdd/plans/<slug>.md`, `<slug>` matching the spec's slug exactly — one plan per
87
+ spec, same name, because that is how `tasks`, `analyze` and `implement` find it. Then index it in
88
+ `02-DOCS/wiki/index.md` (the Knowledge map; root `CLAUDE.md` keeps only a pointer). If a plan for
89
+ this slug already exists, update it in place and note what changed — never fork a `-v2`.
152
90
 
153
91
  ## Model tier — `heavy` (opt-in routing)
154
92
 
155
- This phase's default model tier is **`heavy`** — architecture, interfaces, data flow and risks are the heaviest cognitive load in the chain. Routing is **off** unless `models.enabled: true` in `02-DOCS/wiki/sdd/config.yaml`. When on: resolve this phase's tier (`models.overrides` wins over `models.phases`), map it to a model via `models.tiers`, and apply per `../sdd/references/model-routing.md` — announce the switch per the accompaniment dial when it differs from the session model, and dispatch any `Task`/`parallel` subagents on that model. Routing off or no profile → honor the session model silently. Never fake a switch a tool can't make; skip routing on a one-line change.
93
+ Architecture, interfaces, data flow and risk are the heaviest reasoning in the chain, so this
94
+ phase's default tier is **`heavy`**. Routing is off unless `models.enabled: true` in
95
+ `02-DOCS/wiki/sdd/config.yaml`; the resolution order, the announce rule and the model table live in
96
+ `../sdd/references/model-routing.md`. Routing off or no profile → session model, silently.
156
97
 
157
98
  ## Adapting to the dial
158
99
 
159
- Read `02-DOCS/wiki/harness/user-profile.md` and match the artifact and your narration to it:
100
+ The accompaniment level in `02-DOCS/wiki/harness/user-profile.md` (owned by `../init/SKILL.md`)
101
+ changes how much you *say*, never whether a section exists. Even at L0 the plan is complete; it is
102
+ just quiet.
160
103
 
161
104
  | Level | How `plan` behaves |
162
105
  | --- | --- |
163
- | **L0** | Terse plan: the seven sections, minimal prose, diagram + contracts + risks. No narration in chat — write the file, point to it. |
106
+ | **L0** | Terse plan, no narration in chat — write the file, point to it. |
164
107
  | **L1** | Same artifact, one line of *why* on the top architectural decision. |
165
- | **L2** | Justify each significant design choice in the artifact; surface trade-offs you weighed. |
166
- | **L3** | Explain-everything: walk the non-technical user through the architecture in plain language, ask about constraints you can't infer (one focused question at a time), define terms inline. |
167
-
168
- The dial changes how much you *say*, never whether the seven sections exist. Even at L0 the plan is
169
- complete; it's just quiet.
170
-
171
- ## The artifact
172
-
173
- Write to `02-DOCS/wiki/sdd/plans/<slug>.md`, where `<slug>` matches the spec's slug exactly (one
174
- plan per spec, same name — that's how `tasks`, `analyze`, and `implement` find it). Use
175
- `references/plan-template.md` verbatim as the skeleton. Then index it in `02-DOCS/wiki/index.md`
176
- (the Knowledge map; root `CLAUDE.md` keeps only a short pointer) pointing at the new plan, so the harness wiki and
177
- every later phase can find it. If a plan for this slug already exists, update it in place and note
178
- what changed — don't fork a `-v2`.
108
+ | **L2** | Justify each significant design choice in the artifact; surface the trade-offs weighed. |
109
+ | **L3** | Walk a non-technical user through the architecture in plain language, define terms inline, and ask about constraints you cannot infer — one focused question at a time. |
179
110
 
180
- ## Anti-patterns → STOP
111
+ ## Anti-patterns
181
112
 
182
- | Rationalization | Reality / Fix |
113
+ | Anti-pattern | Why it fails / the fix |
183
114
  | --- | --- |
184
- | "I'll just write the actual code in the plan, it's faster" | You dropped an altitude. The plan owns structure; syntax is the stack skill's job at `implement`. Pull back to contracts. |
185
- | "The spec's a bit fuzzy but I get the gist, I'll plan around it" | A plan on an unclarified spec is a guess. STOP, route to `clarify`, then plan. |
186
- | "Testing strategy = 'we'll write tests'" | That's not a strategy. Name the level per acceptance criterion and what each test fakes. |
187
- | "Risks section feels negative, I'll keep it short" | The plan that claims no risk is the riskiest. Rank the real risks and give each a mitigation. |
188
- | "I'll pick the framework and ORM and config here" | Stack canon lives in the constitution; mechanics live in the stack skill. The plan stays stack-neutral above the seam. |
189
- | "Two designs are fine, I'll list both and let them choose" | Decide. Present alternatives only with a trade-off and a recommendation matched to the constitution. |
190
- | "I'll plan the whole sequence as one big step" | Then `tasks` can't slice it and nothing's independently verifiable. Break it into ordered, checkable steps. |
191
- | "There's already a plan for this slug, I'll start a fresh one" | Update in place and note the change. Forked plans rot; later phases read the wrong one. |
192
-
193
- ## When NOT to use
194
-
195
- - Capturing what to build and why, from a fuzzy idea → `../specify/SKILL.md`.
196
- - Removing ambiguity / edge cases from an existing spec → `../clarify/SKILL.md`.
197
- - Slicing an approved plan into an ordered task checklist → `../tasks/SKILL.md`.
198
- - Concrete framework/ORM/test-runner mechanics → the relevant stack skill
199
- (`../fastapi/SKILL.md`, `../nextjs/SKILL.md`, `../go/SKILL.md`, `../flutter/SKILL.md`,
200
- `../postgresdb/SKILL.md`).
201
- - Project-wide non-negotiables (stack canon, quality bars) → `../constitution/SKILL.md`.
115
+ | Writing the real code in the plan "because it's faster" | You dropped an altitude. Syntax is the stack skill's job at `implement`. Pull back to contracts. |
116
+ | Planning around a spec that is "a bit fuzzy but I get the gist" | A plan on an unclarified spec is a guess. STOP, route to `clarify`, then plan. |
117
+ | Testing strategy = "we'll write tests" | Not a strategy. Name the level per acceptance criterion and what each test fakes. |
118
+ | Keeping risks short because they read negative | The plan that claims no risk is the riskiest. Rank the real ones, give each a mitigation. |
119
+ | Picking the framework, ORM and config here | Stack canon lives in the constitution; mechanics live in the stack skill. Stay above the seam. |
120
+ | Listing two designs and letting the reader choose | Decide. Alternatives ship only with a trade-off and a recommendation matched to the constitution. |
121
+ | One big undifferentiated sequencing step | Then `tasks` cannot slice it and nothing is independently verifiable. Order it into checkable steps. |
122
+ | Starting a fresh plan when one exists for the slug | Forked plans rot and later phases read the wrong one. Update in place, note the change. |
202
123
 
203
124
  ## Always propose isolation before the build
204
125
 
205
- Once the plan is written, **always propose isolating the work in a git worktree/branch** before
206
- any code is implemented — every feature, not just the risky ones. One line, calibrated to the dial:
126
+ Once the plan is written, **always propose isolating the work in a git worktree/branch** before any
127
+ code is implemented — every feature, not just the risky ones. One line, calibrated to the dial:
207
128
 
208
129
  > *"Antes de implementar, ¿aíslo este trabajo en un worktree/rama propia (`../worktrees/SKILL.md`)
209
130
  > para no tocar tu rama actual? (recomendado)"*
210
131
 
211
- Propose it here at the plan→build boundary so the decision is made before `implement` writes a line.
212
- If the user accepts, hand to `../worktrees/SKILL.md` first; if they decline, note it and continue.
213
- If you are already on the default branch (`main`/`master`), isolation is **not** optional — say so
214
- and route to `worktrees` regardless. (`implement` re-checks this as a hard gate before its first commit.)
132
+ Accepted → hand to `../worktrees/SKILL.md` first. Declined → note it and continue. Already on the
133
+ default branch (`main`/`master`) → isolation is **not** optional: say so and route to `worktrees`
134
+ regardless. (`implement` re-checks this as a hard gate before its first commit.)
135
+
136
+ ## When NOT to use
137
+
138
+ - Fuzzy idea, no spec yet → `../specify/SKILL.md`; ambiguity in an existing spec →
139
+ `../clarify/SKILL.md`; project-wide non-negotiables → `../constitution/SKILL.md`.
140
+ - Slicing an approved plan into an ordered checklist → `../tasks/SKILL.md`.
141
+ - Concrete framework/ORM/test-runner mechanics → the stack skill (`../fastapi/SKILL.md`,
142
+ `../nextjs/SKILL.md`, `../go/SKILL.md`, `../flutter/SKILL.md`, `../postgresdb/SKILL.md`).
215
143
 
216
144
  ## Next in the chain
217
145
 
218
146
  Plan written, indexed, decisions logged → propose isolation (above), then hand off to
219
- **`../tasks/SKILL.md`**, which turns the sequencing section into an ordered, independently-verifiable
220
- task list with a done-check per task. If planning surfaced an ambiguity the spec never resolved,
221
- loop back to **`../clarify/SKILL.md`** before tasking.
147
+ **`../tasks/SKILL.md`**, which turns §6 into an ordered task list with a done-check per task. If
148
+ planning surfaced an ambiguity the spec never resolved, loop back to **`../clarify/SKILL.md`** first.