@jaimevalasek/aioson 1.33.1 → 1.37.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 (162) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/docs/en/1-understand/ecosystem-map.md +45 -29
  3. package/docs/en/1-understand/glossary.md +6 -6
  4. package/docs/en/1-understand/what-is-aioson.md +5 -5
  5. package/docs/en/2-start/existing-project.md +7 -7
  6. package/docs/en/2-start/first-project.md +33 -39
  7. package/docs/en/2-start/initial-decisions.md +22 -19
  8. package/docs/en/3-recipes/README.md +2 -2
  9. package/docs/en/3-recipes/continuity-between-sessions.md +2 -2
  10. package/docs/en/3-recipes/from-idea-to-prd-via-briefing.md +13 -3
  11. package/docs/en/3-recipes/full-feature-with-sheldon.md +329 -338
  12. package/docs/en/4-agents/README.md +33 -16
  13. package/docs/en/4-agents/briefing-refiner.md +146 -0
  14. package/docs/en/4-agents/discovery-design-doc.md +20 -8
  15. package/docs/en/4-agents/forge-run.md +3 -2
  16. package/docs/en/5-reference/README.md +1 -0
  17. package/docs/en/5-reference/autopilot-handoff.md +286 -0
  18. package/docs/en/5-reference/cli-reference.md +57 -48
  19. package/docs/en/5-reference/executable-verification.md +10 -7
  20. package/docs/en/5-reference/parallel.md +2 -0
  21. package/docs/en/5-reference/qa-browser.md +2 -2
  22. package/docs/en/README.md +3 -3
  23. package/docs/pt/1-entender/glossario.md +5 -5
  24. package/docs/pt/1-entender/mapa-do-ecossistema.md +33 -22
  25. package/docs/pt/2-comecar/decisoes-iniciais.md +20 -18
  26. package/docs/pt/2-comecar/primeiro-projeto.md +2 -2
  27. package/docs/pt/3-receitas/README.md +1 -1
  28. package/docs/pt/3-receitas/app-saas-do-zero.md +35 -122
  29. package/docs/pt/3-receitas/da-ideia-ao-prd-via-briefing.md +8 -1
  30. package/docs/pt/3-receitas/feature-completa-com-sheldon.md +291 -338
  31. package/docs/pt/4-agentes/README.md +13 -11
  32. package/docs/pt/4-agentes/analyst.md +9 -5
  33. package/docs/pt/4-agentes/architect.md +9 -5
  34. package/docs/pt/4-agentes/briefing-refiner.md +64 -40
  35. package/docs/pt/4-agentes/briefing.md +6 -1
  36. package/docs/pt/4-agentes/dev.md +38 -8
  37. package/docs/pt/4-agentes/deyvin.md +4 -0
  38. package/docs/pt/4-agentes/discover.md +4 -0
  39. package/docs/pt/4-agentes/discovery-design-doc.md +25 -23
  40. package/docs/pt/4-agentes/neo.md +4 -0
  41. package/docs/pt/4-agentes/orache.md +6 -0
  42. package/docs/pt/4-agentes/orchestrator.md +176 -118
  43. package/docs/pt/4-agentes/pentester.md +11 -5
  44. package/docs/pt/4-agentes/pm.md +15 -7
  45. package/docs/pt/4-agentes/product.md +19 -1
  46. package/docs/pt/4-agentes/qa.md +10 -2
  47. package/docs/pt/4-agentes/setup.md +3 -1
  48. package/docs/pt/4-agentes/sheldon.md +178 -99
  49. package/docs/pt/4-agentes/tester.md +6 -0
  50. package/docs/pt/4-agentes/ux-ui.md +9 -5
  51. package/docs/pt/5-referencia/README.md +1 -1
  52. package/docs/pt/5-referencia/agent-chain-continuity.md +14 -5
  53. package/docs/pt/5-referencia/autopilot-handoff.md +191 -74
  54. package/docs/pt/5-referencia/comandos-cli.md +16 -7
  55. package/docs/pt/5-referencia/sdd-automation-scripts.md +6 -6
  56. package/docs/pt/5-referencia/sdd-framework.md +53 -16
  57. package/docs/pt/5-referencia/sdd-planos-e-estrutura.md +27 -15
  58. package/docs/pt/5-referencia/skills.md +2 -0
  59. package/docs/pt/README.md +4 -4
  60. package/docs/pt/agentes.md +50 -50
  61. package/package.json +2 -2
  62. package/src/agents.js +1 -1
  63. package/src/artifact-kinds.js +111 -0
  64. package/src/autopilot-signal.js +71 -0
  65. package/src/cli.js +112 -81
  66. package/src/commands/agent-epilogue.js +251 -186
  67. package/src/commands/agents.js +122 -50
  68. package/src/commands/audit-code.js +344 -0
  69. package/src/commands/briefing.js +337 -1
  70. package/src/commands/classify.js +389 -389
  71. package/src/commands/feature-close.js +122 -4
  72. package/src/commands/harness-check.js +259 -175
  73. package/src/commands/live.js +71 -11
  74. package/src/commands/review-feature.js +189 -0
  75. package/src/commands/runtime.js +81 -66
  76. package/src/commands/sync-agents-copy.js +115 -0
  77. package/src/commands/update.js +5 -1
  78. package/src/commands/verification-plan.js +143 -0
  79. package/src/commands/verify-artifact.js +593 -0
  80. package/src/commands/workflow-execute.js +434 -316
  81. package/src/commands/workflow-next.js +193 -20
  82. package/src/commands/workflow-plan.js +5 -5
  83. package/src/constants.js +2 -0
  84. package/src/doctor.js +4 -2
  85. package/src/gateway-pointer-merge.js +7 -1
  86. package/src/handoff-contract.js +267 -172
  87. package/src/harness/contract-integrity-gate.js +172 -0
  88. package/src/harness/contract-integrity.js +111 -0
  89. package/src/harness/contract-schema.js +377 -332
  90. package/src/harness/detect-runtime-feature.js +90 -0
  91. package/src/harness/static-criteria.js +192 -0
  92. package/src/i18n/messages/en.js +10 -5
  93. package/src/i18n/messages/es.js +10 -5
  94. package/src/i18n/messages/fr.js +10 -5
  95. package/src/i18n/messages/pt-BR.js +10 -5
  96. package/src/install-wizard.js +8 -8
  97. package/src/installer.js +13 -6
  98. package/src/lib/briefing-refiner/apply-feedback.js +18 -4
  99. package/src/lib/briefing-refiner/feedback-schema.js +73 -4
  100. package/src/lib/briefing-refiner/refinement-report.js +11 -0
  101. package/src/lib/briefing-refiner/review-html.js +388 -68
  102. package/src/parser.js +12 -0
  103. package/src/preflight-engine.js +12 -12
  104. package/src/verification/policy-engine.js +95 -95
  105. package/src/verification-policy.js +398 -0
  106. package/src/version.js +52 -1
  107. package/template/.aioson/agents/architect.md +34 -5
  108. package/template/.aioson/agents/briefing-refiner.md +91 -48
  109. package/template/.aioson/agents/briefing.md +4 -0
  110. package/template/.aioson/agents/committer.md +2 -1
  111. package/template/.aioson/agents/copywriter.md +30 -21
  112. package/template/.aioson/agents/design-hybrid-forge.md +10 -1
  113. package/template/.aioson/agents/dev.md +35 -23
  114. package/template/.aioson/agents/deyvin.md +4 -0
  115. package/template/.aioson/agents/discover.md +16 -3
  116. package/template/.aioson/agents/discovery-design-doc.md +7 -2
  117. package/template/.aioson/agents/genome.md +19 -10
  118. package/template/.aioson/agents/neo.md +34 -30
  119. package/template/.aioson/agents/orache.md +24 -11
  120. package/template/.aioson/agents/orchestrator.md +100 -7
  121. package/template/.aioson/agents/pentester.md +4 -0
  122. package/template/.aioson/agents/pm.md +8 -8
  123. package/template/.aioson/agents/product.md +25 -1
  124. package/template/.aioson/agents/profiler-enricher.md +20 -11
  125. package/template/.aioson/agents/profiler-forge.md +20 -11
  126. package/template/.aioson/agents/profiler-researcher.md +20 -11
  127. package/template/.aioson/agents/qa.md +96 -31
  128. package/template/.aioson/agents/setup.md +12 -1
  129. package/template/.aioson/agents/sheldon.md +103 -13
  130. package/template/.aioson/agents/site-forge.md +11 -2
  131. package/template/.aioson/agents/squad.md +20 -5
  132. package/template/.aioson/agents/tester.md +4 -0
  133. package/template/.aioson/agents/ux-ui.md +2 -1
  134. package/template/.aioson/agents/validator.md +33 -1
  135. package/template/.aioson/config/verification.json +61 -0
  136. package/template/.aioson/config.md +13 -9
  137. package/template/.aioson/docs/LAYERS.md +2 -2
  138. package/template/.aioson/docs/agent-help.md +126 -0
  139. package/template/.aioson/docs/autopilot-handoff.md +30 -20
  140. package/template/.aioson/docs/dev/execution-discipline.md +41 -0
  141. package/template/.aioson/docs/dev/phase-loop.md +50 -0
  142. package/template/.aioson/docs/play/llm-data-and-bindings.md +70 -7
  143. package/template/.aioson/docs/presets/workflow.config.full-merged.json +15 -0
  144. package/template/.aioson/docs/presets/workflow.config.lean.json +15 -0
  145. package/template/.aioson/docs/product/prd-contract.md +12 -12
  146. package/template/.aioson/docs/prototype-contract.md +21 -4
  147. package/template/.aioson/docs/reference-identity.md +94 -0
  148. package/template/.aioson/docs/sheldon/harness-contract.md +155 -28
  149. package/template/.aioson/docs/verification-config.md +82 -0
  150. package/template/.aioson/docs/verify-artifact-gates.md +91 -0
  151. package/template/.aioson/docs/workflow-lean-lane.md +129 -0
  152. package/template/.aioson/skills/design/interface-design/SKILL.md +17 -0
  153. package/template/.aioson/skills/design/interface-design/references/intent-and-domain.md +2 -0
  154. package/template/.aioson/skills/process/aioson-spec-driven/SKILL.md +16 -14
  155. package/template/.aioson/skills/process/aioson-spec-driven/references/approval-gates.md +2 -2
  156. package/template/.aioson/skills/process/aioson-spec-driven/references/classification-map.md +4 -4
  157. package/template/.aioson/skills/process/aioson-spec-driven/references/dev.md +15 -15
  158. package/template/.aioson/skills/process/prototype-forge/SKILL.md +6 -0
  159. package/template/.aioson/skills/process/reference-identity-extract/SKILL.md +164 -0
  160. package/template/.aioson/skills/static/multi-agent-patterns.md +5 -5
  161. package/template/AGENTS.md +36 -36
  162. package/template/CLAUDE.md +15 -11
@@ -1,338 +1,329 @@
1
- # Recipe: Full feature with `@sheldon` (canonical trail)
2
-
3
- > **Who this is for:** medium-to-high complexity features where wrong early decisions are costly.
4
- > **Time to run:** 2 to 8 hours (varies with scope), spread across 1–4 sessions.
5
- > **What you'll have at the end:** a feature implemented, tested, security-audited, and reviewed end-to-end every decision traceable on disk.
6
- > **Status:** this is the trail the AIOSON creator uses by default for SMALL/MEDIUM projects with significant implementation.
7
-
8
- ---
9
-
10
- ## The trail in one line
11
-
12
- ```
13
- /aioson:agent:product → @sheldon → @analyst → @architect → @ux-ui → @pm → @orchestrator → @scope-check → @dev
14
-
15
- (@qa ↔ @dev) ← autonomous loop
16
-
17
- optional: @tester → (@qa ↔ @dev) ← extra coverage
18
-
19
- optional: @pentester ↔ @dev ← security
20
-
21
- @qa (final general review)
22
- ```
23
-
24
- **Why order matters:** each agent reads the artifacts left by the previous one. Skipping an agent means the next one improvises — and improvisation on big decisions becomes rework.
25
-
26
- ---
27
-
28
- ## Scenario
29
-
30
- You are building a meaningful feature typical examples: **subscription billing with Stripe**, **seller dashboard in a marketplace**, **order cancellation with time-window rules**. Something that mixes backend + UI + business rules + external integration.
31
-
32
- If the feature is trivial (simple CRUD without business logic), skip to the [Landing page recipe](./landing-page.md) or [SaaS app from scratch](./saas-app-from-scratch.md). This trail is a cannon; don't use it to shoot sparrows.
33
-
34
- ## Prerequisites
35
-
36
- - Project with `aioson init/install` already run
37
- - `project.context.md` populated (`@setup` already done)
38
- - Classification **SMALL** or **MEDIUM**
39
- - AI client open in the project
40
-
41
- ---
42
-
43
- ## Step 1 — `@product` defines the PRD
44
-
45
- ```
46
- You > @product
47
-
48
- @product > Let's define a feature. What's the slug?
49
- You > billing-subscription
50
-
51
- @product > In one sentence, the problem?
52
- You > Customer wants to subscribe to monthly/annual plan and manage payment
53
-
54
- @product > [guided questions: ACs, out-of-scope, dependencies, SLA limits]
55
- @product > PRD created at .aioson/context/prd.md (copy at features/billing-subscription/spec.md).
56
- @product > Next: @sheldon to validate and enrich before going technical.
57
- ```
58
-
59
- **What was left on disk:** `prd.md` with clear sections (problem, scope, ACs, out-of-scope).
60
-
61
- > **Variation:** if you already have material in `/plans/` or an approved briefing, `@product` detects it and offers to use it as a base. See [External plans for @product](./external-plans-for-product.md) and [From idea to PRD via @briefing](./from-idea-to-prd-via-briefing.md).
62
-
63
- ---
64
-
65
- ## Step 2 `@sheldon` enriches the PRD (critical step)
66
-
67
- This is the step most people skip — and where AIOSON gains depth.
68
-
69
- ```
70
- You > @sheldon
71
-
72
- @sheldon > Reading prd.md... scanning .aioson/context/architecture.md, dependencies, plans/.
73
- @sheldon > Detected 4 gaps:
74
- 1. PRD does not cover plan downgrade (only upgrade)
75
- 2. No decision on proportional billing (proration)
76
- 3. Stripe webhook has no retry/idempotency policy
77
- 4. No ACs for billing failure after 3 attempts (dunning)
78
-
79
- @sheldon > Do you have external sources? [URL, local file, "no"]
80
- You > docs.stripe.com/billing/subscriptions/upgrade-downgrade
81
-
82
- @sheldon > [searches, reads, cites]
83
- @sheldon > Recommendation:
84
- - Enrich PRD in-place (gaps 1, 2 are product decisions)
85
- - Create phased plan at .aioson/plans/billing-subscription/ for
86
- phased implementation of webhook+dunning (gaps 3, 4)
87
-
88
- @sheldon > Applying enrichment... prd.md updated.
89
- @sheldon > Phased plan: .aioson/plans/billing-subscription/{phase-1.md, phase-2.md, harness-contract.json}
90
- @sheldon > Next: @analyst.
91
- ```
92
-
93
- **Why run `@sheldon`:**
94
- - It reads the **actual project code** and cross-references it with the PRD — it sees what's missing.
95
- - It can fetch **external sources** (Stripe docs, RFCs, technical posts) and **cite them**.
96
- - It decides between **enriching in-place** (editing `prd.md`) or **creating a phased plan** when scope is too large for a single implementation.
97
-
98
- **Can run multiple times:** if the first pass left gaps, invoke `@sheldon` again. It detects existing `sheldon-enrichment.md` and offers a new enrichment round without starting over.
99
-
100
- > **When NOT to run `@sheldon`:** trivial features (basic CRUD) or MICRO. The enrichment effort does not pay off.
101
-
102
- ---
103
-
104
- ## Step 3 — `@analyst` maps the domain
105
-
106
- ```
107
- You > @analyst
108
-
109
- @analyst > Reading enriched prd.md + codebase.
110
- @analyst > Entities: Subscription, Plan, Invoice, PaymentMethod, DunningAttempt.
111
- Already exist in code: Customer, Order. Will extend.
112
- @analyst > Domain map saved to architecture.md (domain section).
113
- @analyst > Next: @architect.
114
- ```
115
-
116
- ## Step 4 — `@architect` decides the technical structure
117
-
118
- ```
119
- You > @architect
120
-
121
- @architect > Decisions:
122
- - Stripe Customer Portal for self-service (reduces custom UI)
123
- - Webhook handler on dedicated route with idempotency key
124
- - Daily dunning cron (3 attempts, 1d/3d/7d intervals)
125
- - Migration: subscriptions table with FK on customers
126
- @architect > Decisions saved to architecture.md (decisions section).
127
- @architect > Next: @ux-ui.
128
- ```
129
-
130
- ## Step 5 — `@ux-ui` designs the UI
131
-
132
- ```
133
- You > @ux-ui
134
-
135
- @ux-ui > Reading architecture and PRD. Stack confirmed: React + current design skill.
136
- @ux-ui > Components:
137
- - PlanSelector (3 cards: Free, Pro, Enterprise)
138
- - BillingPortal (link to Stripe Portal)
139
- - InvoiceList
140
- - DunningBanner (failed billing alert)
141
- @ux-ui > Specs saved to design-doc.md. Next: @pm.
142
- ```
143
-
144
- > In **SMALL** projects without `@ux-ui` in the flow, skip this step.
145
-
146
- ## Step 6 `@pm` breaks down into user stories
147
-
148
- ```
149
- You > @pm
150
-
151
- @pm > 7 user stories identified, grouped into 3 epics.
152
- Each with verifiable ACs (e.g., "POST /subscriptions/upgrade
153
- returns 200 and sets proration_amount > 0").
154
- @pm > tasks.md saved.
155
- @pm > Next: @orchestrator.
156
- ```
157
-
158
- ## Step 7 — `@orchestrator` defines parallel lanes
159
-
160
- ```
161
- You > @orchestrator
162
-
163
- @orchestrator > Identified 3 parallelizable lanes:
164
- - lane-backend.md (routes + webhook + cron)
165
- - lane-ui.md (4 components + integration)
166
- - lane-migration.md (DB schema + test seeds)
167
- @orchestrator > Dependency: lane-ui depends on lane-backend for the API contract.
168
- @orchestrator > parallel/ saved. harness-contract.json created.
169
- @orchestrator > Next: @dev (can work lanes in separate sessions).
170
- ```
171
-
172
- > In **SMALL** projects, skip `@orchestrator` no parallel lanes worth the overhead.
173
-
174
- ## Step 8 `@dev` implements
175
-
176
- ```
177
- You > @dev
178
-
179
- @dev > Reading full plan. Starting with lane-backend (no dependencies).
180
- @dev > [implements] Lane-backend done. dev-state.md updated.
181
- @dev > Next: run @qa for this lane before moving to lane-ui.
182
- ```
183
-
184
- > `@dev` is **resumable**. If the session drops midway, next session `@deyvin` reads `dev-state.md` and continues exactly where it left off. See [Continuity between sessions](./continuity-between-sessions.md).
185
-
186
- ## Step 9 — `@qa ↔ @dev` loop (autonomous, cap 2)
187
-
188
- ```
189
- You > @qa
190
-
191
- @qa > 18 ACs identified. Writing tests...
192
- @qa > Failure on AC-12 (proration calculation).
193
- Iteration 1/2 — passing to @dev autonomously.
194
- @dev > [fixes calculation, renames misleading variable]
195
- @qa > Re-running... 18/18 OK.
196
- @qa > test-plan.md and qa-report.md saved.
197
- ```
198
-
199
- **Cap 2** means: the autonomous loop runs at most 2 iterations. If it still fails, `@qa` stops and calls you for human review — prevents infinite loops.
200
-
201
- ---
202
-
203
- ## Step 10 (optional) — `@tester` for systematic coverage
204
-
205
- When to activate:
206
- - You know the feature will have high load and want **more coverage** than just the PRD ACs.
207
- - You suspect **edge cases** that `@qa` didn't cover (timezones, concurrency, locales).
208
- - The project is legacy and the feature touches untested code.
209
-
210
- ```
211
- You > @tester
212
-
213
- @tester > Reading qa-report. Current coverage: 78%. Quality tier: MEDIUM.
214
- @tester > Identified 3 zones with test smell:
215
- - Tests coupled to brittle fixtures (3 tests)
216
- - 2 tests only verify "no throw" (don't check behavior)
217
- - Missing proration coverage on edge dates (29th–31st of month)
218
- @tester > Additional test plan saved to test-inventory.md.
219
- @tester > Next: run @qa again to implement missing tests.
220
- ```
221
-
222
- After `@tester`, **run `@qa` again** — the `@qa ↔ @dev` loop repeats on the new tests.
223
-
224
- ## Step 11 (optional) — `@pentester ↔ @dev` for security
225
-
226
- When to activate:
227
- - Feature touches sensitive data (payment, PII, auth).
228
- - Going to production.
229
- - There is a regulatory requirement.
230
-
231
- ```
232
- You > @pentester
233
-
234
- @pentester > Mapping attack surfaces (OWASP + supply chain + tooling).
235
- @pentester > Findings:
236
- - HIGH: Stripe webhook without signature validation in dev mode
237
- - MEDIUM: /billing/portal route without rate-limit
238
- - LOW: log includes customer email in plaintext
239
-
240
- @pentester > Iteration 1 passing to @dev to fix.
241
- @dev > [fixes signature validation, adds rate-limit, redacts log]
242
- @pentester > Re-scan: HIGH=0, MEDIUM=0, LOW=1 (accepted as low risk).
243
- @pentester > security-findings-billing-subscription.json saved.
244
- ```
245
-
246
- ## Step 12 — Final `@qa`, general review
247
-
248
- After everything (tester and pentester), run `@qa` one more time:
249
-
250
- ```
251
- You > @qa
252
-
253
- @qa > General review post-pentester and post-tester.
254
- @qa > 18 original ACs + 9 additional tests (from @tester) + 3 security
255
- regression tests (from @pentester). Total: 30 tests. All passing.
256
- @qa > Verdict: feature ready. @validator recommended before closing.
257
- ```
258
-
259
- Optional: run `@validator` to check the success contract, and `@committer` for the final commit.
260
-
261
- ---
262
-
263
- ## What was left on disk (full audit trail)
264
-
265
- ```
266
- .aioson/context/
267
- ├── prd.md ← @product
268
- ├── sheldon-enrichment.md ← @sheldon (multiple rounds)
269
- ├── architecture.md ← @analyst + @architect
270
- ├── design-doc.md ← @ux-ui
271
- ├── tasks.md ← @pm
272
- ├── parallel/
273
- ├── lane-backend.md ← @orchestrator
274
- ├── lane-ui.md
275
- │ └── lane-migration.md
276
- ├── dev-state.md ← @dev (updated each session)
277
- ├── test-plan.md ← @qa
278
- ├── qa-report-billing-subscription.md ← @qa
279
- ├── test-inventory.md ← @tester
280
- ├── security-findings-billing-subscription.json @pentester
281
- └── features/billing-subscription/
282
- ├── spec.md
283
- └── done/ archived by feature:close
284
-
285
- .aioson/plans/billing-subscription/
286
- ├── phase-1.md ← @sheldon (phased plan)
287
- ├── phase-2.md
288
- ├── harness-contract.json ← success contract
289
- └── progress.json ← current status
290
- ```
291
-
292
- Six months from now, anyone (or any AI) reads these files and understands **everything**: what was planned, why, what was implemented, what was discarded.
293
-
294
- ---
295
-
296
- ## Trail variations
297
-
298
- ### MICRO (small scope)
299
- `@product @dev → @qa`. Skip `@sheldon`, `@analyst`, `@architect`, `@ux-ui`, `@pm`, `@orchestrator`. The Constitution Article II (*Right-Sized Process*) protects you from unnecessary ceremony.
300
-
301
- ### SMALL without UI
302
- `@product → @sheldon → @analyst → @scope-check → @architect → @dev → @qa`. Skip `@ux-ui`, `@pm`, `@orchestrator`.
303
-
304
- ### Full MEDIUM
305
- The complete trail above.
306
-
307
- ### When you are only implementing Lane 1 today
308
- Go through `@orchestrator`, then invoke `@dev` only for `lane-backend.md`. Pause before `@qa`. Next session: `@deyvin` picks up on the pending lane.
309
-
310
- ---
311
-
312
- ## Troubleshooting
313
-
314
- | Problem | Solution |
315
- |---|---|
316
- | `@sheldon` complains the PRD is vague | Go back to `@product` and refine. `@sheldon` does not invent what is not clear. |
317
- | `@orchestrator` creates only 1 lane | Your feature is probably SMALL in disguise. Skip parallel lanes. |
318
- | `@qa ↔ @dev` loop hit cap 2 | There is a design defect. Return to `@architect` or `@product` before writing more code. |
319
- | `@pentester` HIGH finding won't clear | Don't force it. Document as accepted risk or defer the feature. |
320
- | Session dropped mid-`@dev` | `@deyvin` picks up. See [Continuity between sessions](./continuity-between-sessions.md). |
321
-
322
- ---
323
-
324
- ## When NOT to use this trail
325
-
326
- - **Isolated bug fix** — go straight to `@dev` (with bug ID reference) and `@qa`.
327
- - **Refactor without behavior change** use [Large refactor](./large-refactor.md).
328
- - **MICRO feature without new business logic** overhead not worth it.
329
-
330
- ---
331
-
332
- ## Next step
333
-
334
- - [SDD: plans and structure](../5-reference/sdd-planos-e-estrutura.md) — deep dive into the structure `@pm` and `@orchestrator` create
335
- - [From idea to PRD via @briefing](./from-idea-to-prd-via-briefing.md) — when the idea is still vague
336
- - [External plans for @product](./external-plans-for-product.md) — when you already planned in another chat
337
- - [Continuity between sessions](./continuity-between-sessions.md) — to resume the trail in another session
338
- - [Ecosystem map](../1-understand/ecosystem-map.md) — view all agents
1
+ # Recipe: Full feature with `@sheldon` (canonical SMALL trail)
2
+
3
+ > **Who this is for:** SMALL features where wrong early decisions are costly.
4
+ > **Time to run:** 1–4 hours, spread across 1–2 sessions.
5
+ > **What you'll have at the end:** a feature implemented, tested, and reviewed — spec + code + tests traceable on disk.
6
+ > **Status:** this is the DEFAULT lean lane for SMALL projects (v1.35.0+).
7
+
8
+ ---
9
+
10
+ ## The trail in one line
11
+
12
+ ```
13
+ @product → @sheldon → @dev → @qa
14
+ ```
15
+
16
+ `@sheldon` is the **single spec authority** for SMALL: in one pass it produces requirements + spec (Gates A/B/C approved) + design-doc + readiness + implementation-plan + harness-contract, then hands directly to `@dev`.
17
+
18
+ > **MEDIUM?** Use the maestro variant: `@product → @orchestrator → @dev → @pentester → @qa` — `@orchestrator` fans out `@analyst`/`@architect`/`@pm` (+ `@ux-ui` for UI-heavy) as sub-agents, consolidates the gated spec package, then hands to `@dev`. See [MEDIUM maestro variant](#medium-maestro-variant).
19
+
20
+ **Why order matters:** each agent reads the artifacts left by the previous one. Skipping the spec authority means `@dev` improvises — improvisation on big decisions becomes rework.
21
+
22
+ > **Step by step or autopilot?** This recipe walks the **manual** path — you invoke each agent yourself. But building the feature the normal way (`@product` → `@sheldon`/`@orchestrator` → `@dev` → `@qa`) can also run **on its own** up to the `feature:close` recommendation: `@product` asks the run mode once at the PRD handoff (or you decide up front with `/product --auto`/`/product --step`), and each agent auto-invokes the next. See [Autopilot handoff](../5-reference/autopilot-handoff.md) for the full chain, the inline tokens, and the stop conditions. The steps below still describe what each agent does under the hood, autopilot on or off.
23
+
24
+ ---
25
+
26
+ ## Scenario
27
+
28
+ You are building a meaningful SMALL feature — typical examples: **subscription billing with Stripe**, **seller dashboard in a marketplace**, **order cancellation with time-window rules**. Something that mixes backend + business rules + optional UI.
29
+
30
+ If the feature is truly trivial (simple CRUD, no business logic), skip this trail go straight to `@product @dev @qa` (MICRO). This trail is a cannon; don't use it to shoot sparrows.
31
+
32
+ ## Prerequisites
33
+
34
+ - Project with `aioson init/install` already run
35
+ - `project.context.md` populated (`@setup` already done)
36
+ - Classification **SMALL**
37
+ - AI client open in the project
38
+
39
+ ---
40
+
41
+ ## Step 1 — `@product` defines the PRD
42
+
43
+ ```
44
+ You > @product
45
+
46
+ @product > Let's define a feature. What's the slug?
47
+ You > billing-subscription
48
+
49
+ @product > In one sentence, the problem?
50
+ You > Customer wants to subscribe to monthly/annual plan and manage payment
51
+
52
+ @product > [guided questions: ACs, out-of-scope, dependencies, SLA limits]
53
+ @product > PRD created at .aioson/context/prd.md (copy at features/billing-subscription/spec.md).
54
+ @product > Next: @sheldon to close the spec and produce the implementation package.
55
+ ```
56
+
57
+ **What was left on disk:** `prd.md` with clear sections (problem, scope, ACs, out-of-scope).
58
+
59
+ > **Variation:** if you already have material in `/plans/` or an approved briefing, `@product` detects it and offers to use it as a base. See [External plans for @product](./external-plans-for-product.md) and [From idea to PRD via @briefing](./from-idea-to-prd-via-briefing.md).
60
+
61
+ ---
62
+
63
+ ## Step 2 — `@sheldon` closes the spec (single spec authority)
64
+
65
+ This is the step that replaces the old multi-hop chain (`@analyst → @scope-check → @architect → ...`). `@sheldon` does it all in one pass.
66
+
67
+ ```
68
+ You > @sheldon
69
+
70
+ @sheldon > Reading prd.md... scanning architecture.md, dependencies, plans/.
71
+ @sheldon > Detected 4 gaps:
72
+ 1. PRD does not cover plan downgrade (only upgrade)
73
+ 2. No decision on proportional billing (proration)
74
+ 3. Stripe webhook has no retry/idempotency policy
75
+ 4. No ACs for billing failure after 3 attempts (dunning)
76
+
77
+ @sheldon > Do you have external sources? [URL, local file, "no"]
78
+ You > docs.stripe.com/billing/subscriptions/upgrade-downgrade
79
+
80
+ @sheldon > [researches, reads, cites]
81
+ @sheldon > Closing spec — producing single-spec-authority package:
82
+ requirements-billing-subscription.md (gaps resolved, ACs hardened)
83
+ design-doc-billing-subscription.md (technical structure + reuse decisions)
84
+ readiness-billing-subscription.md (Gate B: ready_with_warnings cleared)
85
+ ✓ implementation-plan.md (3 phases, file-disjoint waves)
86
+ harness-contract.json (RG-smoke criteria + verification commands)
87
+
88
+ @sheldon > Gates A/B/C: approved.
89
+ @sheldon > Next: @dev — implementation-plan.md is the input.
90
+ ```
91
+
92
+ **What `@sheldon` produces in one pass:**
93
+ - Closes all PRD gaps (with web research when needed)
94
+ - Creates the design-doc + readiness verdict (Gate B)
95
+ - Writes the phased implementation-plan
96
+ - Authors the harness-contract with binary success criteria + `verification` commands
97
+ - Signs off Gates A/B/C before handing to `@dev`
98
+
99
+ **Can run multiple times:** if the first pass left gaps, invoke `@sheldon` again. It detects existing artifacts and offers a new round without starting over.
100
+
101
+ > **When NOT to run `@sheldon`:** trivial features (basic CRUD) or MICRO. The spec effort does not pay off.
102
+
103
+ ---
104
+
105
+ ## Step 3 — `@dev` implements (phase loop)
106
+
107
+ ```
108
+ You > @dev
109
+
110
+ @dev > Reading implementation-plan.md. 3 phases detected. Starting Phase 1.
111
+
112
+ ── Phase 1/3: DB migrations + webhook handler ──
113
+ @dev > [implements]
114
+ @dev > aioson harness:check → OK. Verification sub-agent: pass.
115
+ @dev > Compacting context for Phase 2...
116
+
117
+ ── Phase 2/3: billing routes + dunning cron ──
118
+ @dev > [implements]
119
+ @dev > aioson harness:check → OK. Verification sub-agent: pass.
120
+ @dev > Compacting context for Phase 3...
121
+
122
+ ── Phase 3/3: UI components ──
123
+ @dev > [implements]
124
+ @dev > aioson harness:check OK.
125
+ @dev > dev-state.md updated. All phases complete. Next: @qa.
126
+ ```
127
+
128
+ **The `@dev` phase loop:**
129
+ - Implements phase-by-phase, **auto-continues between phases** (no "continue?" prompts)
130
+ - Runs `aioson harness:check` after each phase (deterministic exit-code check)
131
+ - Runs a light per-phase verification sub-agent; fixes in-phase if needed
132
+ - Compacts context between phases to maintain a clean context window
133
+ - The expensive full **Runtime smoke** runs **once at end-of-feature** (inside `@qa`), never per phase
134
+
135
+ > `@dev` is **resumable**. If the session drops midway, next session `@deyvin` reads `dev-state.md` and continues exactly where it left off. See [Continuity between sessions](./continuity-between-sessions.md).
136
+
137
+ ---
138
+
139
+ ## Step 4 — `@qa` + Runtime smoke gate
140
+
141
+ ```
142
+ You > @qa
143
+
144
+ @qa > 18 ACs identified. Writing tests...
145
+ @qa > Failure on AC-12 (proration calculation).
146
+ Iteration 1/2passing to @dev autonomously.
147
+ @dev > [fixes calculation, renames misleading variable]
148
+ @qa > Re-running... 18/18 OK.
149
+ @qa > Runtime smoke gate: build + migrations (applied to real DB) + boot + Core happy-path...
150
+ @qa > Runtime smoke: PASS.
151
+ @qa > test-plan.md and qa-report.md saved. Feature ready.
152
+ ```
153
+
154
+ **`@qa` owns Gate D:** the feature does NOT close until the Runtime smoke gate passes — build + migrations applied to a real DB + boot + Core happy-path on the REAL stack. Passing unit tests + `tsc` is the floor, not "done."
155
+
156
+ **Cap 2 autonomous loop:** `@qa ↔ @dev` runs at most 2 iterations automatically. If it still fails, `@qa` stops and calls you for human review — prevents infinite loops.
157
+
158
+ ---
159
+
160
+ ## Optional steps — security and coverage
161
+
162
+ ### Optional: `@pentester ↔ @dev` for security-sensitive features
163
+
164
+ When to activate:
165
+ - Feature touches sensitive data (payment, PII, auth)
166
+ - Going to production
167
+ - There is a regulatory requirement
168
+
169
+ ```
170
+ You > @pentester
171
+
172
+ @pentester > Mapping attack surfaces (OWASP + supply chain + tooling).
173
+ @pentester > Findings:
174
+ - HIGH: Stripe webhook without signature validation in dev mode
175
+ - MEDIUM: /billing/portal route without rate-limit
176
+ - LOW: log includes customer email in plaintext
177
+
178
+ @pentester > Iteration 1 — passing to @dev to fix.
179
+ @dev > [fixes signature validation, adds rate-limit, redacts log]
180
+ @pentester > Re-scan: HIGH=0, MEDIUM=0, LOW=1 (accepted as low risk).
181
+ @pentester > security-findings-billing-subscription.json saved.
182
+ ```
183
+
184
+ > **Note:** in MEDIUM, `@pentester` is inline (not optional it runs between `@dev` and `@qa`).
185
+
186
+ ### Optional: `@tester` for systematic coverage
187
+
188
+ When to activate:
189
+ - High-load feature needing coverage beyond PRD ACs
190
+ - Suspected edge cases (timezones, concurrency, locales)
191
+ - Legacy code touched by the feature
192
+
193
+ ```
194
+ You > @tester
195
+
196
+ @tester > Reading qa-report. Current coverage: 78%. Quality tier: MEDIUM.
197
+ @tester > Identified 3 zones with test smell:
198
+ - Tests coupled to brittle fixtures (3 tests)
199
+ - 2 tests only verify "no throw" (don't check behavior)
200
+ - Missing proration coverage on edge dates (29th–31st of month)
201
+ @tester > Additional test plan saved to test-inventory.md.
202
+ @tester > Next: run @qa again to implement missing tests.
203
+ ```
204
+
205
+ After `@tester`, **run `@qa` again** — the `@qa ↔ @dev` loop repeats on the new tests.
206
+
207
+ ### Optional: `@validator` contract verification in fresh context
208
+
209
+ When to activate: a `harness-contract.json` exists and you want a binary verdict before closing.
210
+
211
+ ```
212
+ You > @validator
213
+
214
+ @validator > Running harness:check first... 18/18 criteria pass.
215
+ @validator > LLM-judging non-executable criteria (2 criteria)...
216
+ @validator > Verdict: all criteria met. Feature ready for feature:close.
217
+ ```
218
+
219
+ `@validator` always runs in a **fresh, isolated context** never inline in the implementing session.
220
+
221
+ ---
222
+
223
+ ## Opt-in detours — when to add more spec agents
224
+
225
+ The SMALL lean trail (`@product → @sheldon → @dev → @qa`) is the default. The agents below are **NOT default hops** — none are deleted; invoke them explicitly when the need arises, or use the MEDIUM trail which fans them out automatically.
226
+
227
+ | Agent | When to invoke explicitly |
228
+ |---|---|
229
+ | **`@analyst`** | Deep brownfield domain mapping, complex entity relationships |
230
+ | **`@architect`** | Sensitive technical decision requiring a dedicated review (microservices boundary, library choice) |
231
+ | **`@pm`** | Large feature needing formal user stories + backlog management |
232
+ | **`@ux-ui`** | UI-heavy feature needing a formal design system spec before `@dev` |
233
+ | **`@discovery-design-doc`** | Exploratory mode (vague idea → clarity checkpoint); or an explicit pre-dev design contract |
234
+ | **`@scope-check`** | Explicit drift audit (intent vs plan vs diff) — `spec:analyze` also runs automatically at the `@dev`/`@qa` done gate |
235
+
236
+ ---
237
+
238
+ ## MEDIUM maestro variant
239
+
240
+ **Trail:** `@product @orchestrator @dev @pentester @qa`
241
+
242
+ `@orchestrator` is the **single spec authority** for MEDIUM (horizontal / fan-out): it spawns `@analyst` + `@architect` + `@pm` (+ `@ux-ui` when UI-heavy) as sub-agents, then **consolidates / verifies / redoes** their output into one gated spec package, then hands to `@dev`. Optionally `@sheldon` hardens the PRD as a pre-step.
243
+
244
+ ```
245
+ You > @orchestrator
246
+
247
+ @orchestrator > Starting MEDIUM spec phase. Fanning out sub-agents...
248
+ [spawns @analyst maps domain: Subscription, Plan, Invoice, PaymentMethod]
249
+ [spawns @architect → structures modules: webhook handler, dunning cron, migrations]
250
+ [spawns @pm → implementation plan + user stories]
251
+ @orchestrator > Consolidating output... verifying cross-agent consistency...
252
+ @orchestrator > Gated spec package ready:
253
+ - requirements.md (consolidated + ACs hardened)
254
+ - architecture.md (decisions)
255
+ - tasks.md (user stories + implementation plan)
256
+ - harness-contract.json (RG-smoke criteria + verifications)
257
+ @orchestrator > Gates A/B/C: approved. Next: @dev.
258
+ ```
259
+
260
+ After `@orchestrator`, `@dev` runs the same phase loop as SMALL. `@pentester` then runs inline (not optional in MEDIUM), and `@qa` closes with the Runtime smoke gate.
261
+
262
+ ---
263
+
264
+ ## What was left on disk (SMALL audit trail)
265
+
266
+ ```
267
+ .aioson/context/
268
+ ├── prd.md ← @product
269
+ ├── requirements-billing-subscription.md ← @sheldon (closed gaps, ACs)
270
+ ├── design-doc-billing-subscription.md ← @sheldon (technical structure)
271
+ ├── readiness-billing-subscription.md ← @sheldon (Gate B)
272
+ ├── implementation-plan.md ← @sheldon (phases + waves)
273
+ ├── dev-state.md ← @dev (phase log, updated each session)
274
+ ├── test-plan.md ← @qa
275
+ ├── qa-report-billing-subscription.md ← @qa
276
+ ├── test-inventory.md ← @tester (optional)
277
+ ├── security-findings-billing-subscription.json ← @pentester (optional)
278
+ └── features/billing-subscription/
279
+ ├── spec.md
280
+ └── done/ archived by feature:close
281
+
282
+ .aioson/plans/billing-subscription/
283
+ ├── harness-contract.json @sheldon (success contract)
284
+ └── progress.json ← current status
285
+ ```
286
+
287
+ Six months from now, anyone (or any AI) reads these files and understands **everything**: what was planned, why, what was implemented, what was discarded.
288
+
289
+ ---
290
+
291
+ ## Trail variations
292
+
293
+ ### MICRO (no spec phase)
294
+ `@product → @dev → @qa`. Skip everything else. The Constitution's Article II (*Right-Sized Process*) protects you from unnecessary ceremony.
295
+
296
+ ### SMALL lean (this trail — default)
297
+ `@product → @sheldon → @dev → @qa`. `@sheldon` is the single spec authority. Add opt-in detours (`@analyst`, `@architect`, `@ux-ui`, etc.) when explicitly needed.
298
+
299
+ ### MEDIUM maestro
300
+ `@product → @orchestrator → @dev → @pentester → @qa`. `@orchestrator` fans out `@analyst`/`@architect`/`@pm`/`@ux-ui` as sub-agents automatically. `@pentester` is inline (not opt-in).
301
+
302
+ ---
303
+
304
+ ## Troubleshooting
305
+
306
+ | Problem | Solution |
307
+ |---|---|
308
+ | `@sheldon` complains the PRD is vague | Go back to `@product` and refine. `@sheldon` does not invent what is not clear. |
309
+ | `@dev` phase loop stalls mid-phase | `@deyvin` picks up via `dev-state.md`. See [Continuity between sessions](./continuity-between-sessions.md). |
310
+ | `@qa ↔ @dev` loop hit cap 3 | There is a design defect. Return to `@sheldon` or `@product` before writing more code. |
311
+ | `@pentester` HIGH finding won't clear | Don't force it. Document as accepted risk or defer the feature. |
312
+ | `@orchestrator` creates only 1 lane | Your feature is probably SMALL in disguise. Use the `@sheldon` trail instead. |
313
+ | Session dropped mid-`@dev` | `@deyvin` picks up. See [Continuity between sessions](./continuity-between-sessions.md). |
314
+
315
+ ---
316
+
317
+ ## When NOT to use this trail
318
+
319
+ - **Isolated bug fix** go straight to `@dev` (with bug ID reference) and `@qa`.
320
+ - **Refactor without behavior change** use [Large refactor](./large-refactor.md).
321
+ - **MICRO feature without new business logic** — overhead not worth it.
322
+
323
+ ---
324
+
325
+ ## Next step
326
+
327
+ - [From idea to PRD via @briefing](./from-idea-to-prd-via-briefing.md) — when the idea is still vague
328
+ - [Continuity between sessions](./continuity-between-sessions.md) to resume the trail in another session
329
+ - [Ecosystem map](../1-understand/ecosystem-map.md) — view all agents