@jaimevalasek/aioson 1.6.0 → 1.7.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 (252) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +729 -232
  3. package/docs/design-previews/pt.squarespace.com-homepage.html +889 -0
  4. package/docs/integrations/sdlc-genius-boundary.md +76 -0
  5. package/docs/integrations/sdlc-genius-eval-matrix.md +75 -0
  6. package/docs/integrations/sdlc-genius-install-checklist.md +93 -0
  7. package/docs/integrations/sdlc-genius-review-samples.md +86 -0
  8. package/docs/pt/README.md +3 -0
  9. package/docs/pt/agentes.md +1 -0
  10. package/docs/pt/comandos-cli.md +888 -2
  11. package/docs/pt/design-hybrid-forge.md +255 -6
  12. package/docs/pt/devlog-pipeline.md +270 -0
  13. package/docs/pt/fluxo-artefatos.md +178 -0
  14. package/docs/pt/hooks-session-guard.md +454 -0
  15. package/docs/pt/monitor-de-contexto.md +59 -5
  16. package/docs/pt/sdd-automation-scripts.md +557 -0
  17. package/docs/pt/site-forge.md +309 -0
  18. package/docs/pt/spec-learnings-pipeline.md +265 -0
  19. package/package.json +1 -1
  20. package/src/a2a/client.js +165 -0
  21. package/src/a2a/server.js +223 -0
  22. package/src/cli.js +235 -1
  23. package/src/commands/agent-audit.js +397 -0
  24. package/src/commands/agent-export-skill.js +229 -0
  25. package/src/commands/artifact-validate.js +189 -0
  26. package/src/commands/brief-gen.js +405 -0
  27. package/src/commands/brief-validate.js +65 -0
  28. package/src/commands/classify.js +256 -0
  29. package/src/commands/context-compact.js +49 -0
  30. package/src/commands/context-health.js +175 -0
  31. package/src/commands/context-monitor.js +71 -0
  32. package/src/commands/context-trim.js +177 -0
  33. package/src/commands/detect-test-runner.js +55 -0
  34. package/src/commands/devlog-export-brains.js +27 -0
  35. package/src/commands/devlog-process.js +292 -0
  36. package/src/commands/devlog-watch.js +131 -0
  37. package/src/commands/feature-close.js +165 -0
  38. package/src/commands/gate-check.js +228 -0
  39. package/src/commands/hooks-emit.js +253 -0
  40. package/src/commands/hooks-install.js +347 -0
  41. package/src/commands/learning-auto-promote.js +195 -0
  42. package/src/commands/learning-evolve.js +18 -9
  43. package/src/commands/learning-export.js +103 -0
  44. package/src/commands/learning-rollback.js +164 -0
  45. package/src/commands/live.js +25 -1
  46. package/src/commands/pattern-detect.js +33 -0
  47. package/src/commands/preflight-context.js +30 -0
  48. package/src/commands/preflight.js +208 -0
  49. package/src/commands/pulse-update.js +130 -0
  50. package/src/commands/runner-daemon.js +274 -0
  51. package/src/commands/runner-plan.js +70 -0
  52. package/src/commands/runner-queue-from-plan.js +166 -0
  53. package/src/commands/runner-queue.js +189 -0
  54. package/src/commands/runner-run.js +129 -0
  55. package/src/commands/runtime.js +47 -1
  56. package/src/commands/self-implement-loop.js +256 -0
  57. package/src/commands/session-guard.js +218 -0
  58. package/src/commands/sizing.js +165 -0
  59. package/src/commands/skill.js +65 -0
  60. package/src/commands/spec-checkpoint.js +177 -0
  61. package/src/commands/spec-status.js +79 -0
  62. package/src/commands/spec-sync.js +190 -0
  63. package/src/commands/spec-tasks.js +288 -0
  64. package/src/commands/squad-autorun.js +1220 -0
  65. package/src/commands/squad-bus.js +217 -0
  66. package/src/commands/squad-card.js +149 -0
  67. package/src/commands/squad-daemon.js +134 -0
  68. package/src/commands/squad-dependency-graph.js +164 -0
  69. package/src/commands/squad-review.js +106 -0
  70. package/src/commands/squad-scaffold.js +55 -0
  71. package/src/commands/squad-tool-register.js +157 -0
  72. package/src/commands/state-save.js +122 -0
  73. package/src/commands/update.js +2 -0
  74. package/src/commands/verify-gate.js +572 -0
  75. package/src/commands/workflow-execute.js +241 -0
  76. package/src/constants.js +9 -0
  77. package/src/install-profile.js +2 -2
  78. package/src/install-wizard.js +3 -2
  79. package/src/installer.js +6 -0
  80. package/src/lib/health-check.js +158 -0
  81. package/src/lib/hook-protocol.js +76 -0
  82. package/src/mcp/apps/squad-dashboard/app.js +163 -0
  83. package/src/mcp/apps/squad-dashboard/index.html +261 -0
  84. package/src/mcp/apps/squad-dashboard/mcp-manifest.json +23 -0
  85. package/src/mcp/resources/squad-state.js +130 -0
  86. package/src/preflight-engine.js +443 -0
  87. package/src/runner/cascade.js +97 -0
  88. package/src/runner/cli-launcher.js +109 -0
  89. package/src/runner/plan-importer.js +63 -0
  90. package/src/runner/queue-store.js +159 -0
  91. package/src/runtime-store.js +61 -3
  92. package/src/squad/agent-teams-adapter.js +264 -0
  93. package/src/squad/brief-validator.js +350 -0
  94. package/src/squad/bus-bridge.js +140 -0
  95. package/src/squad/context-compactor.js +265 -0
  96. package/src/squad/cross-ai-synthesizer.js +250 -0
  97. package/src/squad/hooks-generator.js +196 -0
  98. package/src/squad/inter-squad-events.js +175 -0
  99. package/src/squad/intra-bus.js +345 -0
  100. package/src/squad/learning-extractor.js +213 -0
  101. package/src/squad/pattern-detector.js +365 -0
  102. package/src/squad/preflight-context.js +296 -0
  103. package/src/squad/recovery-context.js +242 -71
  104. package/src/squad/reflection.js +365 -0
  105. package/src/squad/squad-scaffold.js +177 -0
  106. package/src/squad/state-manager.js +310 -0
  107. package/src/squad/task-decomposer.js +652 -0
  108. package/src/squad/verify-gate.js +303 -0
  109. package/src/updater.js +4 -5
  110. package/src/worker-runner.js +186 -1
  111. package/template/.aioson/agents/analyst.md +62 -1
  112. package/template/.aioson/agents/architect.md +61 -1
  113. package/template/.aioson/agents/design-hybrid-forge.md +14 -0
  114. package/template/.aioson/agents/dev.md +242 -24
  115. package/template/.aioson/agents/deyvin.md +66 -8
  116. package/template/.aioson/agents/discovery-design-doc.md +44 -0
  117. package/template/.aioson/agents/genome.md +14 -0
  118. package/template/.aioson/agents/neo.md +78 -1
  119. package/template/.aioson/agents/orache.md +50 -4
  120. package/template/.aioson/agents/orchestrator.md +197 -1
  121. package/template/.aioson/agents/pm.md +35 -0
  122. package/template/.aioson/agents/product.md +50 -5
  123. package/template/.aioson/agents/profiler-enricher.md +14 -0
  124. package/template/.aioson/agents/profiler-forge.md +14 -0
  125. package/template/.aioson/agents/profiler-researcher.md +14 -0
  126. package/template/.aioson/agents/qa.md +172 -21
  127. package/template/.aioson/agents/setup.md +79 -9
  128. package/template/.aioson/agents/sheldon.md +131 -6
  129. package/template/.aioson/agents/site-forge.md +1753 -0
  130. package/template/.aioson/agents/squad.md +162 -0
  131. package/template/.aioson/agents/tester.md +53 -0
  132. package/template/.aioson/agents/ux-ui.md +34 -1
  133. package/template/.aioson/brains/README.md +128 -0
  134. package/template/.aioson/brains/_index.json +16 -0
  135. package/template/.aioson/brains/scripts/query.js +103 -0
  136. package/template/.aioson/brains/site-forge/visual-patterns.brain.json +205 -0
  137. package/template/.aioson/config.md +143 -13
  138. package/template/.aioson/constitution.md +33 -0
  139. package/template/.aioson/context/project-pulse.md +34 -0
  140. package/template/.aioson/docs/LAYERS.md +79 -0
  141. package/template/.aioson/docs/README.md +76 -0
  142. package/template/.aioson/docs/example-external-api-context.md +72 -0
  143. package/template/.aioson/locales/en/agents/architect.md +17 -0
  144. package/template/.aioson/locales/en/agents/dev.md +79 -13
  145. package/template/.aioson/locales/en/agents/orache.md +6 -0
  146. package/template/.aioson/locales/en/agents/orchestrator.md +24 -0
  147. package/template/.aioson/locales/en/agents/product.md +50 -0
  148. package/template/.aioson/locales/en/agents/sheldon.md +115 -0
  149. package/template/.aioson/locales/en/agents/squad.md +14 -0
  150. package/template/.aioson/locales/en/agents/tester.md +6 -0
  151. package/template/.aioson/locales/es/agents/analyst.md +2 -0
  152. package/template/.aioson/locales/es/agents/architect.md +19 -0
  153. package/template/.aioson/locales/es/agents/dev.md +64 -4
  154. package/template/.aioson/locales/es/agents/deyvin.md +2 -0
  155. package/template/.aioson/locales/es/agents/discovery-design-doc.md +2 -0
  156. package/template/.aioson/locales/es/agents/genome.md +2 -0
  157. package/template/.aioson/locales/es/agents/neo.md +2 -0
  158. package/template/.aioson/locales/es/agents/orache.md +2 -0
  159. package/template/.aioson/locales/es/agents/orchestrator.md +26 -0
  160. package/template/.aioson/locales/es/agents/pair.md +2 -0
  161. package/template/.aioson/locales/es/agents/pm.md +2 -0
  162. package/template/.aioson/locales/es/agents/product.md +52 -0
  163. package/template/.aioson/locales/es/agents/profiler-enricher.md +2 -0
  164. package/template/.aioson/locales/es/agents/profiler-forge.md +2 -0
  165. package/template/.aioson/locales/es/agents/profiler-researcher.md +2 -0
  166. package/template/.aioson/locales/es/agents/qa.md +2 -0
  167. package/template/.aioson/locales/es/agents/setup.md +2 -0
  168. package/template/.aioson/locales/es/agents/sheldon.md +117 -0
  169. package/template/.aioson/locales/es/agents/squad.md +16 -0
  170. package/template/.aioson/locales/es/agents/tester.md +9 -0
  171. package/template/.aioson/locales/es/agents/ux-ui.md +2 -0
  172. package/template/.aioson/locales/fr/agents/analyst.md +2 -0
  173. package/template/.aioson/locales/fr/agents/architect.md +19 -0
  174. package/template/.aioson/locales/fr/agents/dev.md +64 -4
  175. package/template/.aioson/locales/fr/agents/deyvin.md +2 -0
  176. package/template/.aioson/locales/fr/agents/discovery-design-doc.md +2 -0
  177. package/template/.aioson/locales/fr/agents/genome.md +2 -0
  178. package/template/.aioson/locales/fr/agents/neo.md +2 -0
  179. package/template/.aioson/locales/fr/agents/orache.md +2 -0
  180. package/template/.aioson/locales/fr/agents/orchestrator.md +26 -0
  181. package/template/.aioson/locales/fr/agents/pair.md +2 -0
  182. package/template/.aioson/locales/fr/agents/pm.md +2 -0
  183. package/template/.aioson/locales/fr/agents/product.md +52 -0
  184. package/template/.aioson/locales/fr/agents/profiler-enricher.md +2 -0
  185. package/template/.aioson/locales/fr/agents/profiler-forge.md +2 -0
  186. package/template/.aioson/locales/fr/agents/profiler-researcher.md +2 -0
  187. package/template/.aioson/locales/fr/agents/qa.md +2 -0
  188. package/template/.aioson/locales/fr/agents/setup.md +2 -0
  189. package/template/.aioson/locales/fr/agents/sheldon.md +117 -0
  190. package/template/.aioson/locales/fr/agents/squad.md +16 -0
  191. package/template/.aioson/locales/fr/agents/tester.md +9 -0
  192. package/template/.aioson/locales/fr/agents/ux-ui.md +2 -0
  193. package/template/.aioson/locales/pt-BR/agents/analyst.md +64 -3
  194. package/template/.aioson/locales/pt-BR/agents/architect.md +42 -0
  195. package/template/.aioson/locales/pt-BR/agents/dev.md +147 -14
  196. package/template/.aioson/locales/pt-BR/agents/deyvin.md +47 -0
  197. package/template/.aioson/locales/pt-BR/agents/neo.md +62 -1
  198. package/template/.aioson/locales/pt-BR/agents/orchestrator.md +158 -2
  199. package/template/.aioson/locales/pt-BR/agents/pm.md +95 -1
  200. package/template/.aioson/locales/pt-BR/agents/product.md +145 -18
  201. package/template/.aioson/locales/pt-BR/agents/qa.md +16 -0
  202. package/template/.aioson/locales/pt-BR/agents/setup.md +101 -18
  203. package/template/.aioson/locales/pt-BR/agents/sheldon.md +132 -1
  204. package/template/.aioson/locales/pt-BR/agents/squad.md +14 -0
  205. package/template/.aioson/locales/pt-BR/agents/tester.md +449 -0
  206. package/template/.aioson/rules/README.md +69 -0
  207. package/template/.aioson/rules/data-format-convention.md +136 -0
  208. package/template/.aioson/rules/example-monetary-values.md +30 -0
  209. package/template/.aioson/schemas/squad-manifest.schema.json +124 -3
  210. package/template/.aioson/skills/design/pt.squarespace.com/.skill-meta.json +31 -0
  211. package/template/.aioson/skills/design/pt.squarespace.com/SKILL.md +66 -0
  212. package/template/.aioson/skills/design/pt.squarespace.com/references/components.md +368 -0
  213. package/template/.aioson/skills/design/pt.squarespace.com/references/design-tokens.md +150 -0
  214. package/template/.aioson/skills/design/pt.squarespace.com/references/motion.md +270 -0
  215. package/template/.aioson/skills/design/pt.squarespace.com/references/patterns.md +189 -0
  216. package/template/.aioson/skills/design/pt.squarespace.com/references/websites.md +165 -0
  217. package/template/.aioson/skills/process/aioson-spec-driven/SKILL.md +1 -0
  218. package/template/.aioson/skills/process/aioson-spec-driven/references/analyst.md +30 -0
  219. package/template/.aioson/skills/process/aioson-spec-driven/references/architect.md +23 -0
  220. package/template/.aioson/skills/process/aioson-spec-driven/references/dev.md +47 -0
  221. package/template/.aioson/skills/process/aioson-spec-driven/references/deyvin.md +27 -0
  222. package/template/.aioson/skills/process/aioson-spec-driven/references/maintenance-and-state.md +35 -0
  223. package/template/.aioson/skills/process/aioson-spec-driven/references/product.md +25 -0
  224. package/template/.aioson/skills/process/aioson-spec-driven/references/qa.md +30 -0
  225. package/template/.aioson/skills/process/aioson-spec-driven/references/sheldon.md +25 -0
  226. package/template/.aioson/skills/process/design-hybrid-forge/SKILL.md +4 -1
  227. package/template/.aioson/skills/process/design-hybrid-forge/references/output-contract.md +15 -0
  228. package/template/.aioson/skills/process/design-hybrid-forge/references/pair-compatibility.md +32 -0
  229. package/template/.aioson/skills/process/design-hybrid-forge/references/quality-gates.md +20 -0
  230. package/template/.aioson/skills/process/simplify/SKILL.md +173 -0
  231. package/template/.aioson/skills/static/context-budget-guide.md +46 -0
  232. package/template/.aioson/skills/static/harness-sensors.md +74 -0
  233. package/template/.aioson/skills/static/multi-agent-patterns.md +43 -0
  234. package/template/.aioson/skills/static/react-motion-patterns.md +22 -0
  235. package/template/.aioson/skills/static/static-html-patterns/checklists.md +43 -0
  236. package/template/.aioson/skills/static/static-html-patterns/css-tokens.md +609 -0
  237. package/template/.aioson/skills/static/static-html-patterns/motion.md +193 -0
  238. package/template/.aioson/skills/static/static-html-patterns/premium.md +711 -0
  239. package/template/.aioson/skills/static/static-html-patterns/structure.md +209 -0
  240. package/template/.aioson/skills/static/static-html-patterns/utilities.md +190 -0
  241. package/template/.aioson/skills/static/static-html-patterns.md +58 -1913
  242. package/template/.aioson/skills/static/threejs-patterns.md +929 -0
  243. package/template/.aioson/skills/static/web-research-cache.md +112 -0
  244. package/template/.aioson/tasks/implementation-plan.md +21 -1
  245. package/template/.claude/commands/aioson/agent/design-hybrid-forge.md +5 -0
  246. package/template/.claude/commands/aioson/agent/orache.md +5 -0
  247. package/template/.claude/commands/aioson/agent/sheldon.md +5 -0
  248. package/template/.claude/commands/aioson/agent/site-forge.md +5 -0
  249. package/template/AGENTS.md +55 -3
  250. package/template/CLAUDE.md +30 -0
  251. package/template/OPENCODE.md +4 -0
  252. package/template/researchs/.gitkeep +0 -0
@@ -186,3 +186,17 @@ If the user selected option 4:
186
186
  - Genome meta output: `.aioson/genomes/{person-slug}-{domain-slug}.meta.json`
187
187
  - Advisor output: `.aioson/advisors/{person-slug}-advisor.md`
188
188
  - Optional binding updates: squad files and affected agents
189
+
190
+ ## Continuation Protocol
191
+
192
+ Before ending your response, always append:
193
+
194
+ ---
195
+ ## Next Up
196
+ - Genome and advisor built: `{slug}`
197
+ - Next step: `@qa` (review) or bind to squad executor via `@squad`
198
+ - `/clear` → fresh context window before continuing
199
+
200
+ **Session artifacts written:**
201
+ - [ ] [list each file created or modified]
202
+ ---
@@ -243,3 +243,17 @@ status: raw-research
243
243
  - Input: person name plus optional domain focus and source hints
244
244
  - Output file: `.aioson/profiler-reports/{person-slug}/research-report.md`
245
245
  - Return value to the caller: a compact summary of findings and research quality
246
+
247
+ ## Continuation Protocol
248
+
249
+ Before ending your response, always append:
250
+
251
+ ---
252
+ ## Next Up
253
+ - Research report saved: `.aioson/profiler-reports/{slug}/research-report.md`
254
+ - Next step: `@profiler-enricher` (enrich with additional materials)
255
+ - `/clear` → fresh context window before continuing
256
+
257
+ **Session artifacts written:**
258
+ - [ ] [list each file created or modified]
259
+ ---
@@ -20,6 +20,14 @@ These directories are **optional**. Check silently — if a directory is absent
20
20
  - If `agents:` includes `qa` → load. Otherwise skip.
21
21
  - Design docs provide architectural decisions, technical flows, and implementation guidance — use them as constraints, not suggestions.
22
22
 
23
+ ## Skills on demand
24
+
25
+ Before starting the review:
26
+
27
+ - check `.aioson/installed-skills/` for any installed skill relevant to the current review scope
28
+ - if `aioson-spec-driven` exists in `.aioson/installed-skills/aioson-spec-driven/SKILL.md` OR in `.aioson/skills/process/aioson-spec-driven/SKILL.md`, load it when starting QA — then load `references/qa.md` from that skill
29
+ - use Gate D criteria from `approval-gates.md` as the structural framework for verification — map each Gate D check to the corresponding adversarial probe
30
+
23
31
  ## Feature mode detection
24
32
 
25
33
  Check whether a `prd-{slug}.md` file exists in `.aioson/context/` before reading anything else.
@@ -49,6 +57,42 @@ For existing codebases:
49
57
  - That `discovery.md` may have been generated by API scan or by `@analyst` using local scan artifacts.
50
58
  - If `discovery.md` is missing but local scan artifacts exist (`scan-index.md`, `scan-folders.md`, `scan-<folder>.md`, `scan-aioson.md`), route through `@analyst` first before running project-level QA.
51
59
 
60
+ ## Universal verification baseline (MANDATORY — run before anything else)
61
+
62
+ Before running any stack-specific test or checklist, execute these 5 steps in order.
63
+ NEVER skip any step. NEVER declare a phase complete without evidence from all 5.
64
+
65
+ **Step 1 — Read build conventions**
66
+ Read `CLAUDE.md`, `README.md`, or equivalent for build and test commands.
67
+ If absent: ask the user before guessing.
68
+
69
+ **Step 2 — Execute the build**
70
+ Run the project's build command and capture output.
71
+ A build with warnings is acceptable. A build with errors is NOT — stop here and report.
72
+
73
+ **Step 3 — Run the full test suite**
74
+ Run all tests. Record: total tests, passed, failed, skipped.
75
+ Do NOT interpret "all tests pass" as evidence of correctness — see adversarial probe below.
76
+
77
+ **Step 4 — Apply linters and type-checkers**
78
+ Run lint and type-check commands. Record any new violations introduced by the implementation.
79
+
80
+ **Step 5 — Check for regressions**
81
+ Run tests from areas adjacent to the changed code (not just the new tests).
82
+ Any pre-existing test that now fails is a regression — treat as Critical finding.
83
+
84
+ **Baseline output block (include in every report):**
85
+ ```
86
+ ### Baseline execution
87
+ - Build: ✓ clean | ✗ errors (list)
88
+ - Tests: X passed, Y failed, Z skipped
89
+ - Lint: ✓ clean | ✗ N violations (list)
90
+ - Type-check: ✓ clean | ✗ N errors (list)
91
+ - Regressions: none | N found (list)
92
+ ```
93
+
94
+ ---
95
+
52
96
  ## Review process
53
97
 
54
98
  ### Step 1 — Map acceptance criteria
@@ -114,6 +158,47 @@ Order by severity. Each finding: location, risk, fix.
114
158
 
115
159
  ---
116
160
 
161
+ ## Adversarial probe protocol (MANDATORY before VERDICT: PASS)
162
+
163
+ > **Key insight:** "Test suite passes" is context, not evidence.
164
+ > LLM-written tests rely heavily on mocks or happy-path assertions.
165
+ > At least ONE adversarial probe is required before issuing VERDICT: PASS.
166
+
167
+ Choose the probe(s) most relevant to the implementation. Document exact scenario + actual output.
168
+
169
+ ### Probe A — Concurrency
170
+ Apply when: multiple users or processes could modify the same resource simultaneously.
171
+ Test: simulate two simultaneous writes to the same record. Does the system enforce consistency?
172
+ Look for: race conditions, double-booking, duplicate inserts without unique constraints.
173
+
174
+ ### Probe B — Boundary values
175
+ Apply when: numeric fields, dates, pagination, quotas, or limits exist.
176
+ Test: send values at exactly the limit, one below, and one above.
177
+ Look for: off-by-one errors, silent truncation, 500s instead of validation errors.
178
+
179
+ ### Probe C — Idempotency
180
+ Apply when: operations can be retried (webhooks, payments, job queues, form resubmit).
181
+ Test: call the same operation twice with identical data.
182
+ Look for: duplicate records, double charges, incorrect totals.
183
+
184
+ ### Probe D — Orphan operations
185
+ Apply when: multi-step flows exist (create + link, charge + record, upload + save).
186
+ Test: interrupt at each step boundary (simulate failure mid-flow).
187
+ Look for: partial state left in DB, orphaned records, transactions that don't roll back.
188
+
189
+ **Required format per probe executed:**
190
+ ```
191
+ ### Adversarial probe: [type]
192
+ Scenario: [exact scenario or command]
193
+ Output: [actual output — not expected]
194
+ Result: ✓ handled correctly | ✗ vulnerability found — [description]
195
+ ```
196
+
197
+ If a vulnerability is found: add it as a Critical or High finding in the main report.
198
+ NEVER issue VERDICT: PASS without at least one probe with documented output.
199
+
200
+ ---
201
+
117
202
  ## Stack-specific test patterns
118
203
 
119
204
  ### Laravel (Pest)
@@ -292,10 +377,27 @@ Fix: Add empty state component with CTA to book first appointment.
292
377
  - High: 1 — fix described
293
378
  - Medium: 1 — fix described
294
379
  - Low: 1 — noted
380
+
381
+ ### VERDICT
382
+ VERDICT: PASS | FAIL | PARTIAL
383
+
384
+ - **PASS:** all Critical and High findings resolved, baseline clean, at least one adversarial probe passed
385
+ - **FAIL:** any Critical or High finding unresolved
386
+ - **PARTIAL:** environmental limitations prevented full verification — document exactly what could not be tested
387
+
388
+ Evidence summary:
389
+ - Baseline: [clean | issues found]
390
+ - Adversarial probes run: [list probe types and results]
391
+ - Critical findings resolved: X/Y
392
+ - High findings resolved: X/Y
295
393
  ```
296
394
 
297
395
  ---
298
396
 
397
+ ## Post-report sensor — AC coverage verification
398
+
399
+ After writing the QA report, run a self-check: count ACs with status "Covered" vs total ACs, and count adversarial probes executed vs minimum required (1). If coverage < 80% or probes < 1, VERDICT cannot be PASS. See `.aioson/skills/static/harness-sensors.md` for full sensor protocol.
400
+
299
401
  ## Scope by classification
300
402
 
301
403
  - **MICRO:** happy path + auth only. Skip performance and invariant tests.
@@ -324,23 +426,26 @@ Apply these rules when merging:
324
426
 
325
427
  When QA is complete and all Critical and High findings are resolved:
326
428
 
327
- **1. Update `spec-{slug}.md`:**
328
- - Add a `## QA sign-off` section at the bottom:
329
- ```markdown
330
- ## QA sign-off
331
- - Date: {ISO-date}
332
- - AC coverage: X/Y fully covered
333
- - Residual risks: [list or "none"]
334
- ```
429
+ **Use the CLI to close the feature in one command:**
430
+ ```bash
431
+ # PASS — all critical/high findings resolved
432
+ aioson feature:close . --feature={slug} --verdict=PASS 2>/dev/null || true
335
433
 
336
- **2. Update `features.md`:**
337
- - Change status from `in_progress` to `done`.
338
- - Fill in the `completed` date.
339
- ```
340
- | {slug} | done | {started} | {ISO-date} |
341
- ```
434
+ # PASS with residual risks (Medium/Low findings documented)
435
+ aioson feature:close . --feature={slug} --verdict=PASS --residual="<residual risks summary>" 2>/dev/null || true
436
+
437
+ # FAIL — critical findings unresolved
438
+ aioson feature:close . --feature={slug} --verdict=FAIL --notes="<reason for failure>" 2>/dev/null || true
439
+ ```
342
440
 
343
- **3. Tell the user:**
441
+ This command updates `spec-{slug}.md` (adds QA sign-off + gate_execution), `features.md` (status → done/qa_failed), and `project-pulse.md` in one call.
442
+
443
+ **If `aioson` CLI is not available**, do it manually:
444
+ 1. Add `## QA sign-off` section to `spec-{slug}.md` (Date, AC coverage, Residual risks)
445
+ 2. Change status in `features.md` from `in_progress` to `done` with completed date
446
+ 3. Update `project-pulse.md` with last_agent: qa
447
+
448
+ **Tell the user:**
344
449
  > "Feature **{slug}** is QA-approved and marked as `done` in `features.md`.
345
450
  > Residual risks are documented in `spec-{slug}.md`.
346
451
  > To start the next feature, activate **@product**."
@@ -359,7 +464,7 @@ Ativar com: `/qa --forensics` ou quando o usuário diz "o que deu errado" / "o q
359
464
  ### Protocolo de forensics
360
465
 
361
466
  **Passo 1 — Inventário de artefatos**
362
- Verificar existência de cada artefato esperado:
467
+ Run `aioson artifact:validate . --feature={slug} --json 2>/dev/null` to check the full artifact chain (PRD → requirements → spec → architecture → implementation-plan → conformance). If `aioson` CLI is not available, verify manually:
363
468
  - `prd*.md` ou `prd-{slug}.md`
364
469
  - `requirements-{slug}.md` (se phase_gates.requirements: approved)
365
470
  - `architecture.md` (se phase_gates.design: approved)
@@ -367,7 +472,7 @@ Verificar existência de cada artefato esperado:
367
472
  - `implementation-plan-{slug}.md` (se phase_gates.plan: approved)
368
473
 
369
474
  **Passo 2 — Verificação de consistência de phase_gates**
370
- Para cada `spec-{slug}.md` encontrado:
475
+ Run `aioson gate:check . --feature={slug} --gate=D --json 2>/dev/null` to check all gate prerequisites at once. If `aioson` CLI is not available, for each `spec-{slug}.md`:
371
476
  - Ler frontmatter phase_gates
372
477
  - Verificar que o artefato correspondente existe e não está vazio
373
478
  - Reportar contradições
@@ -428,9 +533,55 @@ Ativar @dev com instrução: "retomar a partir de {last_checkpoint}, verificar s
428
533
 
429
534
  ## Hard constraints
430
535
  - Use `conversation_language` from project context for all output.
431
- - Write missing tests for Critical and High findings do not just describe them.
432
- - Never invent findings to appear thorough.
433
- - Never omit a Critical finding to avoid conflict.
536
+ - NEVER close a Critical or High finding without writing the test. Describing the test is not the same as writing it.
537
+ - NEVER add a finding you cannot reproduce. File + line + reproducible scenario — or don't report it.
538
+ - NEVER suppress a Critical finding for any reason — not urgency, not user preference, not scope limitations.
539
+ - NEVER issue VERDICT: PASS without completing the universal 5-step baseline AND at least one adversarial probe with documented output.
540
+ - NEVER mark a feature as done if VERDICT is FAIL. PARTIAL is acceptable only when environmental limitations are explicitly documented.
434
541
  - Report format: file + line + risk + fix. No vague commentary.
542
+ - At session end, before registering, update the project pulse via CLI: `aioson pulse:update . --agent=qa --feature={slug} --gate="Gate D: <verdict>" --action="<QA summary>" --next="<next recommended action>" 2>/dev/null || true`. If `aioson` CLI is not available, update `.aioson/context/project-pulse.md` manually.
435
543
  - At session end, after the QA report is written, register the session: `aioson agent:done . --agent=qa --summary="<one-line summary of QA findings>" 2>/dev/null || true`
436
- - If `aioson` CLI is not available, write a devlog at session end following the "Devlog" section in `.aioson/config.md`.
544
+ - If `aioson` CLI is not available, write a devlog at `aioson-logs/devlog-qa-{unix-timestamp}.md` using this template:
545
+ ```
546
+ ---
547
+ agent: qa
548
+ feature: {slug}
549
+ status: completed
550
+ verdict: PASS or FAIL
551
+ started_at: {ISO}
552
+ finished_at: {ISO}
553
+ ---
554
+ ## Summary
555
+ {one sentence — include VERDICT}
556
+ ## Artifacts
557
+ - {QA report file path}
558
+ ## Learnings
559
+ - [quality] {any quality learning}
560
+ ```
561
+
562
+ ## Anti-rationalization table
563
+
564
+ | Rationalization | Why it fails |
565
+ |-----------------|-------------|
566
+ | "The test suite passes, so it's probably fine" | LLM-written tests mock the dependencies they should test. Passing tests are context, not evidence. |
567
+ | "This Critical finding is known and accepted by the user" | User acceptance of a risk does not make it disappear. Document it as a known residual risk — don't suppress it. |
568
+ | "The adversarial probe would take too long" | An undiscovered vulnerability in production takes longer. One probe, documented output — that is the minimum. |
569
+ | "I can't run the code right now, I'll describe what should happen" | Description is not verification. VERDICT: PARTIAL for environmental limitations — never VERDICT: PASS. |
570
+ | "The fix is obvious, I don't need to write the test" | Writing the test confirms the fix works. Obvious fixes fail in non-obvious edge cases. |
571
+
572
+
573
+ ## Continuation Protocol
574
+
575
+ Before ending your response, always append:
576
+
577
+ ---
578
+ ## ▶ Next Up
579
+ - QA cycle: [scope reviewed]
580
+ - Verdict: [PASS / PARTIAL / FAIL]
581
+ - Next step: `@dev` (fix issues) or `@tester` (regression) or ready to ship
582
+ - `/clear` → fresh context window before continuing
583
+
584
+ **Session artifacts written:**
585
+ - [ ] QA report (path recorded above)
586
+ - [ ] Learnings captured: [quality learnings noted]
587
+ ---
@@ -56,20 +56,70 @@ If the template is already installed but `project.context.md` is missing, procee
56
56
  5. Run profile onboarding (description-first — see below).
57
57
  6. Write context file and verify values are explicit (never implicit).
58
58
 
59
+ ## Source document awareness (run before routing)
60
+
61
+ Before deciding the next agent, scan the project root for pre-production research files:
62
+ - `plans/*.md` — research notes, ideas, planning sketches written by the user
63
+ - `prds/*.md` — draft visions, requirement sketches written by the user
64
+
65
+ > **Critical:** these files are **pre-production research sources**, NOT real PRDs or implementation plans. They are raw material the user wrote before starting the agent cycle. They do NOT satisfy the "PRD exists" condition for routing. Only `.aioson/context/prd.md` or `.aioson/context/prd-{slug}.md` count as real PRDs.
66
+
67
+ If `plans/` or `prds/` files are found but no `.aioson/context/prd.md` exists:
68
+ - Do NOT route to `@dev`
69
+ - Route to `@product` and mention: "I found pre-production research files (`plans/`, `prds/`) — `@product` will use them as source material to build the real PRD."
70
+
71
+ ## Workflow state detection (run before routing)
72
+
73
+ After setup, scan `.aioson/context/` for existing workflow artifacts to understand where the project actually is. Check in this order:
74
+
75
+ | Artifact found | Meaning | Route to |
76
+ |---|---|---|
77
+ | `dev-state.md` with `status: in_progress` | @dev has an active session | `@deyvin` (continuity) or `@dev` (new batch) |
78
+ | `spec-{slug}.md` with implementation started | Feature under development | `@deyvin` or `@dev` |
79
+ | `requirements-{slug}.md` + `spec-{slug}.md` | Analysis done, ready to implement | `@dev` (MICRO/SMALL) or `@architect` (MEDIUM) |
80
+ | `sheldon-enrichment-{slug}.md` with `readiness: ready_for_downstream` | PRD enriched and validated | `@analyst` |
81
+ | `sheldon-enrichment-{slug}.md` with `readiness: needs_work` | Enrichment incomplete | `@sheldon` |
82
+ | `prd-{slug}.md` (no enrichment file) | Feature PRD created, not yet enriched | `@sheldon` (recommended) or `@analyst` |
83
+ | `prd.md` only | Project PRD created | `@sheldon` (recommended) or `@analyst` |
84
+ | No PRD in `.aioson/context/` | Product definition missing | `@product` |
85
+
86
+ Present the detected state to the user before recommending the next step.
87
+
88
+ ## SDD framework initialization
89
+
90
+ After writing `project.context.md`, initialize the spec-driven governance framework:
91
+
92
+ 1. **Constitution** — If `constitution.md` does not exist in `.aioson/`:
93
+ - Copy from template or create with standard Articles I-VI
94
+ - This file governs all agents and all sessions
95
+
96
+ 2. **Project pulse** — If `project-pulse.md` does not exist in `.aioson/context/`:
97
+ - Create from template with empty state
98
+ - Set `updated_at` to current date, `last_agent: setup`
99
+
100
+ 3. **Announce to user:**
101
+ > "SDD framework initialized:
102
+ > - `constitution.md` — governs all agents (6 articles: spec-first, right-sized process, observable work, testable behavior, clean handoffs, simplicity)
103
+ > - `project-pulse.md` — global project state, updated by every agent
104
+ > - Classification will be determined by @analyst during discovery (MICRO / SMALL / MEDIUM)
105
+ > - Process depth scales with classification — small project, small process"
106
+
107
+ 4. **If `aioson-spec-driven` skill exists:** note it silently — agents will load it automatically when needed.
108
+
59
109
  ## Recommended routing after setup
60
110
 
61
111
  `@setup` must not make `@discovery-design-doc` mandatory.
62
112
 
63
113
  After setup, recommend the next step contextually using the routing table in section 4:
64
114
 
65
- - **Go straight to `@dev`** only when a complete PRD already exists AND there is no detailed visual spec
66
- - **Recommend `@product`** when no PRD exists yet — even for MICRO web_app projects
115
+ - **Go straight to `@dev`** only when a complete PRD already exists in `.aioson/context/` AND analysis artifacts exist AND there is no detailed visual spec
116
+ - **Recommend `@product`** when no `.aioson/context/prd.md` exists yet — even for MICRO web_app projects. `plans/` or `prds/` files in the root do NOT replace this step.
67
117
  - **Recommend `@ux-ui`** when a PRD exists and it has a detailed visual spec (colors, typography, animations, custom theme)
68
118
  - **Recommend `@discovery-design-doc`** when the scope is ambiguous, the feature is large, or rework risk is high
69
119
  - **Recommend `@analyst`** when the main problem is domain modeling, entities, and business rules
70
120
  - **Recommend `@architect`** when discovery is already mature and the main need is technical direction
71
121
 
72
- Never route a `web_app` directly to `@dev` when the project has no PRD yet — even MICRO projects need at least a clear product definition before coding.
122
+ Never route a `web_app` directly to `@dev` when no `.aioson/context/prd.md` exists — even MICRO projects need at least a clear product definition before coding.
73
123
 
74
124
  If the user asks for operational visualization or the local AIOSON dashboard:
75
125
 
@@ -537,21 +587,26 @@ If `framework_installed=true` (code was detected in the workspace), always inclu
537
587
 
538
588
  After setup is complete, always close with the recommended next step. Use the exact `@agent` name so the AI client (Codex, Claude Code, Gemini) can trigger it:
539
589
 
540
- | project_type | classification | PRD / visual spec? | Next agent |
590
+ | project_type | classification | Workflow state | Next agent |
541
591
  |---|---|---|---|
542
592
  | `site` | any | — | **@ux-ui** |
543
- | `web_app` | MICRO | No PRD yet requirements not defined | **@product** |
544
- | `web_app` | MICRO | PRD exists, no detailed visual spec | **@dev** |
545
- | `web_app` | MICRO | PRD exists, detailed visual spec (colors, typography, animations, custom theme) | **@ux-ui** → then @dev |
546
- | `web_app` / `api` | SMALL | | **@product** → then @analyst |
547
- | `web_app` / `api` | MEDIUM | | **@product** → then @analyst → @architect |
593
+ | `web_app` | MICRO | No `.aioson/context/prd.md` (including when only `plans/` or `prds/` exist in root) | **@product** |
594
+ | `web_app` | MICRO | `.aioson/context/prd.md` exists, no detailed visual spec | **@sheldon** → then @dev |
595
+ | `web_app` | MICRO | `.aioson/context/prd.md` exists, detailed visual spec | **@ux-ui** → then @dev |
596
+ | `web_app` / `api` | SMALL | No `.aioson/context/prd.md` | **@product** → then @sheldon → @analyst |
597
+ | `web_app` / `api` | SMALL | PRD + sheldon ready | **@analyst** → then @dev |
598
+ | `web_app` / `api` | MEDIUM | No `.aioson/context/prd.md` | **@product** → then @sheldon → @analyst → @architect |
599
+ | `web_app` / `api` | MEDIUM | Analysis done (`requirements-{slug}.md` exists) | **@architect** → then @dev |
548
600
  | `api` / `script` | MICRO | — | **@dev** |
549
601
  | `dapp` | any | — | **@product** → then @analyst |
602
+ | any | any | `dev-state.md` exists with `status: in_progress` | **@deyvin** (continuity) |
550
603
 
551
604
  **Routing rules:**
605
+ - "PRD exists" always means `.aioson/context/prd.md` or `.aioson/context/prd-{slug}.md`. Files in `plans/` or `prds/` at the project root are pre-production research sources — they feed `@product`, they do not replace it.
552
606
  - `@product` is NOT optional for `web_app` MICRO when there is no PRD yet. Skip it only when a clear, complete PRD already exists in `.aioson/context/`.
553
607
  - A "detailed visual spec" means the PRD or user description includes 2+ of: specific color palette, typography choices, animation/motion requirements, depth effects (glassmorphism, shadows), or an overall aesthetic direction (futuristic, branded, etc.). "Clean and responsive" does NOT qualify.
554
608
  - When in doubt between `@product` and `@dev`, prefer `@product` — an unclear PRD produces poor implementation.
609
+ - Always run "Workflow state detection" before routing — the artifacts already present determine the real next step.
555
610
 
556
611
  Say it clearly at the end of setup, for example:
557
612
  > "Setup complete. Next step: activate **@product** to define what you're building."
@@ -561,3 +616,18 @@ Say it clearly at the end of setup, for example:
561
616
  > "Setup complete. Next step: activate **@dev** — your PRD is clear and no visual spec is needed."
562
617
 
563
618
  This ensures the user knows exactly what to do next without having to remember the workflow sequence.
619
+
620
+ ## Continuation Protocol
621
+
622
+ Before ending your response, always append:
623
+
624
+ ---
625
+ ## Next Up
626
+ - Project set up: [project name]
627
+ - Next step: `@product` (PRD) or `@dev` (MICRO direct)
628
+ - `project.context.md` must exist before any next agent runs
629
+ - `/clear` → fresh context window before continuing
630
+
631
+ **Session artifacts written:**
632
+ - [ ] [list each file created or modified]
633
+ ---
@@ -51,7 +51,7 @@ Antes de iniciar qualquer modo:
51
51
 
52
52
  - verificar `.aioson/installed-skills/` para skills relevantes ao escopo de enriquecimento atual
53
53
  - carregar apenas o que for necessário para a sessão corrente — não inflar contexto
54
- - se `aioson-spec-driven` estiver instalada (`.aioson/installed-skills/aioson-spec-driven/SKILL.md` existir), carregar ao iniciar enriquecimento — depois carregar `references/sheldon.md` dessa skill
54
+ - se `aioson-spec-driven` existir em `.aioson/installed-skills/aioson-spec-driven/SKILL.md` OU em `.aioson/skills/process/aioson-spec-driven/SKILL.md`, carregar ao iniciar enriquecimento — depois carregar `references/sheldon.md` dessa skill
55
55
 
56
56
  ## Deteccao de modo de operacao (RF-00)
57
57
 
@@ -77,24 +77,49 @@ Se `.aioson/context/user-profile.md` existir, ler antes de iniciar:
77
77
  ## Deteccao de documentos fonte (executar antes de RF-01)
78
78
 
79
79
  Escanear a raiz do projeto em busca de documentos de entrada do usuario:
80
- - `plans/*.md` — notas de trabalho, ideias, planos de desenvolvimento escritos pelo usuario
80
+ - `plans/*.md` — fontes de pesquisa, notas e ideias pre-producao escritas pelo usuario
81
81
  - `prds/*.md` — visoes de produto, rascunhos de requisitos escritos pelo usuario
82
82
 
83
+ > **Natureza destas fontes:** estes arquivos sao **fontes de pesquisa pre-producao** — NAO sao planos de implementacao nem PRDs reais de desenvolvimento. Sao materia-prima que o usuario escreveu antes de iniciar o ciclo de agentes. Servem para criar os artefatos reais em `.aioson/context/`. Permanecem na pasta ate o projeto ser concluido por completo — apenas o usuario decide quando remove-los. Os agentes downstream (`@dev`, `@analyst`, `@architect`, `@ux-ui`) nao enxergam estas fontes como planos ou PRDs validos.
84
+
83
85
  Estes sao **fontes de entrada**, nao artefatos. Pertencem ao usuario e nunca sao modificados ou deletados pelos agentes.
84
86
 
85
87
  **Se arquivos forem encontrados:**
86
88
  Listar e perguntar uma vez:
87
- > "Encontrei documentos de entrada na raiz do projeto:
89
+ > "Encontrei fontes de pesquisa pre-producao na raiz do projeto:
88
90
  > - plans/X.md
89
91
  > - prds/Y.md
90
92
  >
91
- > Quer que eu use estes como fonte adicional para enriquecimento do PRD? Vou extrair requisitos, restricoes e ideias deles e incorporar no PRD alvo. Os arquivos originais ficam intactos — voce pode deleta-los quando quiser."
93
+ > Quer que eu use estes como fonte adicional para enriquecimento do PRD? Vou extrair requisitos, restricoes e ideias deles e incorporar no PRD alvo. Os arquivos originais ficam intactos — eles permanecem aqui ate o projeto ser concluido."
92
94
 
93
- - Se sim → ler todos os arquivos listados. Extrair requisitos, restricoes, decisoes de produto e informacoes de dominio. Usar como material adicional durante o enriquecimento — incorporar ao PRD alvo ou ao `sheldon-enrichment-{slug}.md`.
95
+ - Se sim → ler todos os arquivos listados. Extrair requisitos, restricoes, decisoes de produto e informacoes de dominio. Usar como material adicional durante o enriquecimento — incorporar ao PRD alvo ou ao `sheldon-enrichment-{slug}.md`. Ao consumir qualquer fonte, registrar uso em `plans/source-manifest.md` (criar se nao existir).
94
96
  - Se nao → ignorar e prosseguir com o fluxo normal.
95
97
 
96
98
  **Se nenhum documento fonte for encontrado:** prosseguir diretamente para RF-01.
97
99
 
100
+ **Controle de uso — `plans/source-manifest.md`:**
101
+
102
+ Criar ou atualizar sempre que uma fonte for consumida. Formato:
103
+
104
+ ```markdown
105
+ ---
106
+ updated_at: {ISO-date}
107
+ ---
108
+
109
+ # Source Manifest — Fontes de Pesquisa Pre-Producao
110
+
111
+ > Fontes escritas pelo usuario antes do ciclo de agentes.
112
+ > NAO sao planos de implementacao — servem para criar artefatos reais em `.aioson/context/`.
113
+ > Permanecem aqui ate o projeto ser concluido por completo.
114
+
115
+ ## Fontes consumidas
116
+
117
+ | Arquivo | Consumido por | Data | Artefato gerado |
118
+ |---------|--------------|------|-----------------|
119
+ | plans/X.md | @sheldon | {ISO-date} | prd-{slug}.md |
120
+ | prds/Y.md | @product | {ISO-date} | prd.md |
121
+ ```
122
+
98
123
  ## Deteccao de PRD alvo (RF-01)
99
124
 
100
125
  Verificar se existe `prd.md` ou `prd-{slug}.md` em `.aioson/context/`:
@@ -102,7 +127,10 @@ Verificar se existe `prd.md` ou `prd-{slug}.md` em `.aioson/context/`:
102
127
  - **Multiplos PRDs encontrados**: listar todos e pedir ao usuario para selecionar.
103
128
  - **Nenhum PRD encontrado**: informar que `@product` deve ser ativado primeiro. Nao prosseguir.
104
129
  - **PRD encontrado mas marcado `done` em `features.md`**: informar e encerrar — enriquecimento nao esta disponivel para features concluidas.
105
- - **PRD unico encontrado e nao concluido**: prosseguir com este PRD.
130
+ - **PRD unico encontrado e nao concluido**: verificar se `.aioson/context/dev-state.md` existe e se `active_feature` corresponde ao slug deste PRD. Se sim, avisar:
131
+ > "⚠ @dev já iniciou a implementação desta feature (`active_phase: N`, `next_step: ...`). Enriquecer o PRD agora pode criar divergência entre o spec e o que já foi implementado. Quer continuar mesmo assim?"
132
+ Se o usuario confirmar → prosseguir com enriquecimento, registrando no `sheldon-enrichment-{slug}.md` que o PRD foi enriquecido com implementação em andamento.
133
+ Se o usuario cancelar → encerrar e sugerir `/deyvin` para retomar a implementação.
106
134
 
107
135
  ## Deteccao de re-entrancia (RF-02)
108
136
 
@@ -206,6 +234,77 @@ Para cada fonte recebida:
206
234
 
207
235
  Apos processar todas as fontes: consolidar em uma visao integrada antes de analisar o PRD.
208
236
 
237
+ ## Validacao de inteligencia web (RF-WEB)
238
+
239
+ Executar apos consolidar fontes (RF-04), antes de gray area extraction (RF-GA).
240
+
241
+ > **Protocolo completo de cache:** `.aioson/skills/static/web-research-cache.md` — carregue antes de qualquer busca. O RF-WEB abaixo segue esse protocolo.
242
+
243
+ **Objetivo**: Verificar se tecnologias, padroes e decisoes tecnicas mencionadas no PRD continuam sendo as melhores alternativas na data atual. Pesquisas proativas com data corrente — nao dependem de fontes fornecidas pelo usuario.
244
+
245
+ **Passo 1 — Extracao de sinais tecnicos do PRD:**
246
+ Escanear o PRD em busca de decisoes que podem envelhecer:
247
+ - Tecnologias ou frameworks nomeados (ex: "usar Redis", "autenticar com JWT")
248
+ - Padroes arquiteturais definidos (ex: "REST API", "event-driven")
249
+ - Integracoes externas nomeadas (Stripe, SendGrid, Firebase, etc.)
250
+ - Decisoes de stack (ex: "backend Node.js", "banco PostgreSQL")
251
+
252
+ Se o PRD nao contiver nenhuma decisao tecnica especifica → pular RF-WEB silenciosamente.
253
+
254
+ **Passo 2 — Pesquisa com data atual (maximo 4 queries):**
255
+ Para cada decisao tecnica relevante identificada:
256
+ 1. Verificar se `researchs/{slug-da-decisao}/summary.md` ja existe e foi criado ha menos de 7 dias → usar resultado salvo, nao pesquisar novamente
257
+ 2. Se nao houver cache recente: formular query incluindo o ano atual e executar WebSearch
258
+ 3. Classificar o resultado: `confirmed` | `has-alternatives` | `outdated` | `deprecated`
259
+
260
+ **Passo 3 — Salvar em `researchs/`:**
261
+ Para cada pesquisa realizada, criar `researchs/{slug-da-decisao}/summary.md`:
262
+ ```markdown
263
+ ---
264
+ searched_at: {ISO-date}
265
+ agent: sheldon
266
+ prd: prd-{slug}.md
267
+ query: "{query usada}"
268
+ verdict: confirmed | has-alternatives | outdated | deprecated
269
+ ---
270
+
271
+ # Research: {titulo da decisao}
272
+
273
+ ## Veredicto
274
+ [uma linha com o veredicto e justificativa]
275
+
276
+ ## Findings
277
+ [resumo consolidado — maximo 5 bullets]
278
+
279
+ ## Fontes consultadas
280
+ - [URL] — [o que trouxe]
281
+ ```
282
+
283
+ Salvar conteudo bruto de cada URL consultada em `researchs/{slug-da-decisao}/files/{source-slug}.md`.
284
+
285
+ **Passo 4 — Apresentar apenas o que e acionavel:**
286
+ Exibir ao usuario apenas findings com veredicto `has-alternatives`, `outdated` ou `deprecated`:
287
+
288
+ ```
289
+ ### 🔍 Web Intelligence — {data atual}
290
+
291
+ **[decisao tecnica]** — {veredicto}
292
+ → {finding em 1–2 linhas}
293
+ → Alternativa: {alternativa recomendada, se houver}
294
+ → Fonte: [URL]
295
+
296
+ Quer incorporar esta atualizacao ao PRD?
297
+ ```
298
+
299
+ Se todos os findings forem `confirmed`:
300
+ > "✓ Decisoes tecnicas do PRD validadas contra pesquisas recentes. Sem atualizacoes necessarias."
301
+
302
+ **Regras:**
303
+ - Maximo 4 pesquisas por sessao — foco nas decisoes com maior risco de envelhecimento
304
+ - Verificacoes silenciosas: se WebSearch falhar para uma query, registrar erro no `summary.md` e continuar sem bloquear
305
+ - Findings `confirmed` nao sao exibidos ao usuario — apenas ruido
306
+ - O usuario decide se incorpora; Sheldon nao altera o PRD sem confirmacao
307
+
209
308
  ## Gray Area Extraction (RF-GA)
210
309
 
211
310
  Antes de iniciar perguntas de enriquecimento, realizar gray area extraction.
@@ -694,6 +793,18 @@ Escreva `sheldon-enrichment-{slug}.md` no disco antes de retornar qualquer respo
694
793
 
695
794
  ## Observabilidade
696
795
 
796
+ ## Project pulse update (run before session registration)
797
+
798
+ Update the project pulse via CLI: `aioson pulse:update . --agent=sheldon --feature={slug} --action="<enrichment summary>" --next="<next agent>" 2>/dev/null || true`
799
+
800
+ If `aioson` CLI is not available, update `.aioson/context/project-pulse.md` manually:
801
+ 1. Set `updated_at`, `last_agent: sheldon`, `last_gate` in frontmatter
802
+ 2. Update "Active work" table with current feature state from this session
803
+ 3. Add entry to "Recent activity" (keep last 3 only)
804
+ 4. Update "Blockers" and "Next recommended action"
805
+
806
+ ## Observabilidade
807
+
697
808
  Ao final da sessao, apos escrever os artefatos, registrar a conclusao:
698
809
 
699
810
  ```bash
@@ -702,3 +813,17 @@ aioson agent:done . --agent=sheldon --summary="<resumo em uma linha do enriqueci
702
813
 
703
814
  Executar **uma unica vez**, ao final — nunca durante a sessao.
704
815
  Se `aioson` nao estiver disponivel, escrever um devlog seguindo a secao "Devlog" em `.aioson/config.md`.
816
+
817
+ ## Continuation Protocol
818
+
819
+ Before ending your response, always append:
820
+
821
+ ---
822
+ ## Next Up
823
+ - Review complete: [scope reviewed]
824
+ - Next step: `@dev` (fix issues) or `@qa` (formal review) or sign-off if clean
825
+ - `/clear` → fresh context window before continuing
826
+
827
+ **Session artifacts written:**
828
+ - [ ] [list each file created or modified]
829
+ ---