@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
@@ -1,14 +1,16 @@
1
1
  # Monitor de Contexto
2
2
 
3
- > Visualiza em tempo real o uso de janela de contexto por agente, com alertas automáticos de warning e critical.
3
+ > Visualiza em tempo real o uso de janela de contexto por agente, com alertas automáticos de warning e critical. Também funciona no modo de budget de projeto para sessões diretas.
4
4
 
5
- O `context:monitor` o arquivo `context-monitor.json` de uma squad e exibe barras de progresso ASCII com o percentual de contexto utilizado por cada agente. Útil para acompanhar sessões longas e antecipar quando um agente está próximo de compactar.
5
+ O `context:monitor` tem dois modos de operação:
6
+ - **Modo squad** — lê `context-monitor.json` da squad e exibe barras de progresso por agente
7
+ - **Modo budget** — recebe `--budget` + `--tokens` e calcula a zona de alerta da sessão atual
6
8
 
7
9
  ---
8
10
 
9
- ## Comando
11
+ ## Modo squad
10
12
 
11
- ### `context:monitor`
13
+ ### `context:monitor --squad`
12
14
 
13
15
  ```bash
14
16
  aioson context:monitor [path] [opções]
@@ -18,7 +20,7 @@ aioson context:monitor [path] [opções]
18
20
 
19
21
  | Opção | Descrição |
20
22
  |---|---|
21
- | `--squad=<slug>` | Squad a monitorar (obrigatório) |
23
+ | `--squad=<slug>` | Squad a monitorar (obrigatório neste modo) |
22
24
  | `--agent=<id>` | Filtrar por agente específico (opcional) |
23
25
  | `--json` | Retorna dados estruturados em JSON |
24
26
 
@@ -37,6 +39,58 @@ aioson context:monitor . --squad=meu-squad --json
37
39
 
38
40
  ---
39
41
 
42
+ ## Modo budget de projeto
43
+
44
+ Útil em sessões diretas (sem squad) para checar se você está próximo do limite da janela de contexto.
45
+
46
+ ### `context:monitor --budget`
47
+
48
+ ```bash
49
+ aioson context:monitor [path] --budget=<tokens-totais> --tokens=<tokens-atuais>
50
+ ```
51
+
52
+ **Opções:**
53
+
54
+ | Opção | Descrição |
55
+ |---|---|
56
+ | `--budget=<n>` | Limite total em tokens (ex: `80000` para Claude Sonnet) |
57
+ | `--tokens=<n>` | Tokens consumidos atualmente na sessão |
58
+ | `--json` | Retorna JSON com zona, percentual e budget |
59
+
60
+ **Zonas:**
61
+
62
+ | Zona | Faixa | Ícone | Ação sugerida |
63
+ |---|---|---|---|
64
+ | safe | < 60% | ✓ | Continuar normalmente |
65
+ | warning | 60–80% | ⚠ | Planejar `/clear` antes do próximo agente |
66
+ | critical | ≥ 80% | ! | Rodar `context:health` e reduzir carga |
67
+
68
+ **Exemplos:**
69
+
70
+ ```bash
71
+ # Sessão em safe zone
72
+ aioson context:monitor . --budget=80000 --tokens=28000
73
+ # ✓ Context: 28,000 tokens (35%) — SAFE
74
+
75
+ # Sessão em warning zone
76
+ aioson context:monitor . --budget=80000 --tokens=52000
77
+ # ⚠ Context: 52,000 tokens (65%) — WARNING
78
+ # Suggestion: /clear before next agent activation
79
+
80
+ # Sessão em critical zone
81
+ aioson context:monitor . --budget=80000 --tokens=67000
82
+ # ! Context: 67,000 tokens (84%) — CRITICAL
83
+ # Run: aioson context:health . for reduction options
84
+
85
+ # JSON para automação
86
+ aioson context:monitor . --budget=80000 --tokens=52000 --json
87
+ # { "ok": true, "tokens": 52000, "budget": 80000, "pct": 65, "zone": "warning" }
88
+ ```
89
+
90
+ Quando a zona é `warning` ou `critical`, um evento `context_budget_warning` ou `context_budget_critical` é automaticamente registrado no SQLite (na run ativa mais recente), ficando visível no dashboard.
91
+
92
+ ---
93
+
40
94
  ## Saída
41
95
 
42
96
  ```
@@ -0,0 +1,557 @@
1
+ # SDD Automation Scripts — Regra dos 80%
2
+
3
+ > Referência completa dos 12 comandos determinísticos do AIOSON que movem trabalho de arquivo/estado/validação para fora do contexto LLM.
4
+
5
+ ## Por que esses scripts existem
6
+
7
+ Antes desses scripts, verificações como "o gate A está aprovado?" ou "qual o classificação desse projeto?" eram resolvidas dentro da janela de contexto do agente — custando entre 7.200 e 18.500 tokens por feature. Os scripts SDD cobrem exatamente esses 80% de trabalho determinístico, deixando o agente focar nos 20% que exigem raciocínio.
8
+
9
+ ---
10
+
11
+ ## preflight
12
+
13
+ ```
14
+ aioson preflight [path] [--agent=<agent>] [--feature=<slug>] [--json]
15
+ ```
16
+
17
+ Coleta todos os dados de pré-voo em uma chamada só: modo do projeto, classificação, framework detectado, test runner, artefatos disponíveis, estado dos phase gates, dev-state, contexto compacto e prontidão para o agente pedido.
18
+
19
+ **Flags:**
20
+
21
+ | Flag | Descrição |
22
+ |---|---|
23
+ | `--agent=<name>` | Filtra prontidão para o agente específico (dev, qa, analyst…) |
24
+ | `--feature=<slug>` | Slug da feature para procurar artefatos e gates |
25
+ | `--json` | Saída estruturada JSON |
26
+
27
+ **Saída JSON (campos principais):**
28
+
29
+ ```json
30
+ {
31
+ "ok": true,
32
+ "mode": "feature",
33
+ "classification": "SMALL",
34
+ "framework": "Laravel",
35
+ "test_runner": "phpunit",
36
+ "artifacts": { "prd": true, "spec": true, "implementation_plan": false },
37
+ "phase_gates": { "A": "approved", "B": "approved", "C": null, "D": null },
38
+ "readiness": { "status": "READY", "blockers": [] },
39
+ "rules": ["process-atomic-commits.md"]
40
+ }
41
+ ```
42
+
43
+ **Quando usar:** no início de qualquer sessão de agente para eliminar a necessidade de ler vários arquivos manualmente.
44
+
45
+ ---
46
+
47
+ ## classify
48
+
49
+ ```
50
+ aioson classify [path] [--feature=<slug>] [--interactive] [--json]
51
+ ```
52
+
53
+ Detecta a classificação da feature (MICRO / SMALL / MEDIUM) automaticamente a partir do PRD e dos requirements, ou interativamente via prompts.
54
+
55
+ **Algoritmo de pontuação:**
56
+
57
+ | Dimensão | 0 pts | 1 pt | 2 pts |
58
+ |---|---|---|---|
59
+ | Tipos de usuário | 1 | 2 | 3+ |
60
+ | Integrações externas | nenhuma | 1 | 2+ |
61
+ | Regras de negócio | simples | moderadas | complexas |
62
+
63
+ - **0–1:** MICRO — só `@dev`, sem fases
64
+ - **2–3:** SMALL — `@product → @analyst → @dev → @qa`
65
+ - **4–6:** MEDIUM — adiciona `@architect`, paralelismo, conformance
66
+
67
+ **Flags:**
68
+
69
+ | Flag | Descrição |
70
+ |---|---|
71
+ | `--feature=<slug>` | Lê `prd-<slug>.md` e `requirements-<slug>.md` automaticamente |
72
+ | `--interactive` | Prompts no terminal para entrada manual |
73
+ | `--json` | Saída estruturada |
74
+
75
+ ---
76
+
77
+ ## sizing
78
+
79
+ ```
80
+ aioson sizing [path] [--feature=<slug>] [--prd=<path>] [--json]
81
+ ```
82
+
83
+ Lê o PRD e determina o modelo de sizing: `inplace`, `phased_inplace` ou `phased_external`.
84
+
85
+ **Critérios:**
86
+
87
+ | Decisão | Quando |
88
+ |---|---|
89
+ | `inplace` | ≤ 3 entidades, ≤ 2 fases, sem integração externa |
90
+ | `phased_inplace` | 4–7 entidades, 3–5 fases, 1 integração |
91
+ | `phased_external` | 8+ entidades ou 6+ fases ou 2+ integrações |
92
+
93
+ **Saída:**
94
+
95
+ ```json
96
+ {
97
+ "ok": true,
98
+ "sizing": "phased_inplace",
99
+ "entities": 5,
100
+ "phases": 4,
101
+ "integrations": 1,
102
+ "score": 10
103
+ }
104
+ ```
105
+
106
+ ---
107
+
108
+ ## detect:test-runner
109
+
110
+ ```
111
+ aioson detect:test-runner [path] [--json]
112
+ ```
113
+
114
+ Detecta o test runner do projeto verificando arquivos de configuração e `package.json`.
115
+
116
+ **Frameworks detectados:**
117
+
118
+ | Framework | Arquivo de configuração |
119
+ |---|---|
120
+ | PHPUnit | `phpunit.xml`, `phpunit.xml.dist` |
121
+ | Pest | `phpunit.xml` com `pestphp` |
122
+ | Jest | `jest.config.js`, `jest.config.ts`, `jest.config.mjs` |
123
+ | Vitest | `vitest.config.js`, `vitest.config.ts` |
124
+ | Pytest | `pytest.ini`, `pyproject.toml`, `setup.cfg` |
125
+ | RSpec | `.rspec`, `spec/spec_helper.rb` |
126
+ | Forge | `phpunit.xml` com `orchestra/testbench` |
127
+ | node:test | `package.json` com script `test` usando `node --test` |
128
+
129
+ **Saída:**
130
+
131
+ ```json
132
+ {
133
+ "ok": true,
134
+ "name": "jest",
135
+ "command": "npx jest",
136
+ "configFile": "jest.config.ts"
137
+ }
138
+ ```
139
+
140
+ ---
141
+
142
+ ## pulse:update
143
+
144
+ ```
145
+ aioson pulse:update [path] --agent=<agent> [--feature=<slug>] [--gate=<text>] [--action=<text>] [--next=<text>] [--json]
146
+ ```
147
+
148
+ Cria ou atualiza `.aioson/context/project-pulse.md` com o estado atual da sessão.
149
+
150
+ **O que atualiza:**
151
+ - `active_agent`, `active_feature`, `active_work`
152
+ - `last_gate` e `last_agent`
153
+ - Seção `## Recent Activity` (mantém as últimas 3 entradas)
154
+
155
+ **Flags:**
156
+
157
+ | Flag | Descrição |
158
+ |---|---|
159
+ | `--agent=<name>` | Agente ativo (obrigatório) |
160
+ | `--feature=<slug>` | Feature em andamento |
161
+ | `--gate=<text>` | Último gate avançado |
162
+ | `--action=<text>` | O que está sendo feito agora |
163
+ | `--next=<text>` | Próximo passo previsto |
164
+
165
+ **Exemplo:**
166
+
167
+ ```bash
168
+ aioson pulse:update . \
169
+ --agent=dev \
170
+ --feature=checkout \
171
+ --gate="Gate C: approved" \
172
+ --action="Implementing Phase 2: AddToCart" \
173
+ --next="Phase 3: Payment webhook"
174
+ ```
175
+
176
+ ---
177
+
178
+ ## state:save
179
+
180
+ ```
181
+ aioson state:save [path] --feature=<slug> [--phase=<n>] [--next=<text>] [--spec-version=<n>] [--status=<status>] [--json]
182
+ ```
183
+
184
+ Cria ou atualiza `.aioson/context/dev-state.md` com o ponto de continuação atual.
185
+
186
+ **Status válidos:** `in_progress`, `blocked`, `complete`, `paused`
187
+
188
+ **O que grava:**
189
+ - Frontmatter: `feature`, `phase`, `status`, `spec_version`, `updated_at`
190
+ - Seção `## History` com entrada timestampada para auditoria
191
+
192
+ **Exemplo:**
193
+
194
+ ```bash
195
+ aioson state:save . \
196
+ --feature=checkout \
197
+ --phase=3 \
198
+ --next="Implement webhook idempotency" \
199
+ --spec-version=4 \
200
+ --status=in_progress
201
+ ```
202
+
203
+ ---
204
+
205
+ ## feature:close
206
+
207
+ ```
208
+ aioson feature:close [path] --feature=<slug> --verdict=<PASS|FAIL> [--residual=<text>] [--notes=<text>] [--json]
209
+ ```
210
+
211
+ Fecha uma feature após QA sign-off. Atualiza três arquivos:
212
+
213
+ 1. **`spec-<slug>.md`** — adiciona bloco `## QA Sign-off` e atualiza `gate_execution` no frontmatter
214
+ 2. **`features.md`** — muda status para `done` ou `qa_failed`
215
+ 3. **`project-pulse.md`** — zera `active_feature`, atualiza `last_gate`
216
+
217
+ **Exemplo (PASS):**
218
+
219
+ ```bash
220
+ aioson feature:close . --feature=checkout --verdict=PASS
221
+ # Com residual (item não testado mas aceito):
222
+ aioson feature:close . \
223
+ --feature=checkout \
224
+ --verdict=PASS \
225
+ --residual="Email delivery not tested E2E"
226
+ ```
227
+
228
+ **Exemplo (FAIL):**
229
+
230
+ ```bash
231
+ aioson feature:close . \
232
+ --feature=checkout \
233
+ --verdict=FAIL \
234
+ --notes="Auth edge case missing — re-open after fix"
235
+ ```
236
+
237
+ **Saída JSON:**
238
+
239
+ ```json
240
+ {
241
+ "ok": true,
242
+ "feature": "checkout",
243
+ "verdict": "PASS",
244
+ "date": "2026-04-04",
245
+ "residual": null,
246
+ "updates": [
247
+ "spec-checkout.md: added QA sign-off (2026-04-04, PASS)",
248
+ "features.md: checkout → done (2026-04-04)",
249
+ "project-pulse.md: updated active work"
250
+ ]
251
+ }
252
+ ```
253
+
254
+ ---
255
+
256
+ ## gate:check
257
+
258
+ ```
259
+ aioson gate:check [path] --feature=<slug> --gate=<gate> [--json]
260
+ ```
261
+
262
+ Verifica se um phase gate pode ser aprovado. Retorna `PASS` ou `BLOCKED` com lista de evidências.
263
+
264
+ **Gates aceitos:** `A` / `requirements`, `B` / `design`, `C` / `plan`, `D` / `execution`
265
+
266
+ **Pré-requisitos por gate:**
267
+
268
+ | Gate | Requer | Artefato obrigatório |
269
+ |---|---|---|
270
+ | A | — | `requirements-<slug>.md` ou `prd-<slug>.md` |
271
+ | B | Gate A | `spec-<slug>.md` |
272
+ | C | Gates A + B | `implementation-plan-<slug>.md` |
273
+ | D | Gates A + B + C | QA sign-off em `spec-<slug>.md` |
274
+
275
+ **Exemplo:**
276
+
277
+ ```bash
278
+ aioson gate:check . --feature=checkout --gate=C --json
279
+ ```
280
+
281
+ ```json
282
+ {
283
+ "ok": true,
284
+ "gate": "C",
285
+ "gate_name": "plan",
286
+ "verdict": "PASS",
287
+ "evidence": [
288
+ "Gate A: approved",
289
+ "Gate B: approved",
290
+ "implementation-plan-checkout.md: found"
291
+ ]
292
+ }
293
+ ```
294
+
295
+ **Quando BLOCKED:**
296
+
297
+ ```json
298
+ {
299
+ "ok": false,
300
+ "gate": "C",
301
+ "verdict": "BLOCKED",
302
+ "blockers": ["Gate B not approved — spec-checkout.md missing or gate_design not set"],
303
+ "evidence": ["Gate A: approved"]
304
+ }
305
+ ```
306
+
307
+ ---
308
+
309
+ ## artifact:validate
310
+
311
+ ```
312
+ aioson artifact:validate [path] --feature=<slug> [--json]
313
+ ```
314
+
315
+ Valida a cadeia completa de artefatos de uma feature. Verifica a existência de cada arquivo esperado e reporta o que está presente, ausente ou opcional.
316
+
317
+ **Cadeia verificada:**
318
+
319
+ ```
320
+ project.context.md
321
+ → prd-<slug>.md
322
+ → sheldon-<slug>.md (opcional para MICRO)
323
+ → requirements-<slug>.md
324
+ → spec-<slug>.md
325
+ → architecture.md
326
+ → implementation-plan-<slug>.md
327
+ → conformance-<slug>.yaml (somente MEDIUM)
328
+ ```
329
+
330
+ **Saída:**
331
+
332
+ ```json
333
+ {
334
+ "ok": true,
335
+ "feature": "checkout",
336
+ "classification": "SMALL",
337
+ "present": ["project.context.md", "prd-checkout.md", "spec-checkout.md"],
338
+ "missing": ["implementation-plan-checkout.md"],
339
+ "optional_missing": ["sheldon-checkout.md"],
340
+ "chain_complete": false,
341
+ "next_missing": "implementation-plan-checkout.md"
342
+ }
343
+ ```
344
+
345
+ ---
346
+
347
+ ## workflow:execute
348
+
349
+ ```
350
+ aioson workflow:execute [path] --feature=<slug> [--tool=<tool>] [--classification=<tier>] [--dry-run] [--start-from=<agent>] [--json]
351
+ ```
352
+
353
+ Monta e executa o plano de agentes para uma feature com base na classificação.
354
+
355
+ **Planos por tier:**
356
+
357
+ | Tier | Passos |
358
+ |---|---|
359
+ | MICRO | `@dev` |
360
+ | SMALL | `@product → @analyst → @dev → @qa` |
361
+ | MEDIUM | `@product → @analyst → @architect → gate:check C → @dev (por fase) → @qa` |
362
+
363
+ **Flags:**
364
+
365
+ | Flag | Descrição |
366
+ |---|---|
367
+ | `--tool=<tool>` | Ferramenta a usar (`claude`, `codex`, `gemini`) |
368
+ | `--classification=<tier>` | Override manual da classificação |
369
+ | `--dry-run` | Mostra o plano sem executar |
370
+ | `--start-from=<agent>` | Pula agentes anteriores ao agente dado |
371
+
372
+ **Exemplo dry-run:**
373
+
374
+ ```bash
375
+ aioson workflow:execute . \
376
+ --feature=checkout \
377
+ --classification=SMALL \
378
+ --dry-run \
379
+ --json
380
+ ```
381
+
382
+ ```json
383
+ {
384
+ "ok": true,
385
+ "dry_run": true,
386
+ "feature": "checkout",
387
+ "classification": "SMALL",
388
+ "steps": [
389
+ { "agent": "product", "skip": false, "reason": "prd not found" },
390
+ { "agent": "analyst", "skip": false },
391
+ { "agent": "dev", "skip": false },
392
+ { "agent": "qa", "skip": false }
393
+ ]
394
+ }
395
+ ```
396
+
397
+ **Exemplo com retomada:**
398
+
399
+ ```bash
400
+ # Feature travada em dev — pular product e analyst
401
+ aioson workflow:execute . \
402
+ --feature=checkout \
403
+ --tool=claude \
404
+ --start-from=dev
405
+ ```
406
+
407
+ ---
408
+
409
+ ## runner:queue:from-plan
410
+
411
+ ```
412
+ aioson runner:queue:from-plan [path] --feature=<slug> [--plan=<path>] [--agent=<agent>] [--dry-run] [--json]
413
+ ```
414
+
415
+ Extrai as fases de um plano de implementação e as enfileira no runner do AIOSON com prioridades correspondentes ao número da fase.
416
+
417
+ **Formato reconhecido:**
418
+
419
+ O arquivo deve conter headers `## Phase N: Título da fase` (onde N é um inteiro). Qualquer nível de heading funciona.
420
+
421
+ **Requer:** banco de runtime inicializado (`aioson runtime:init .` ou uso prévio do runner).
422
+
423
+ **Flags:**
424
+
425
+ | Flag | Descrição |
426
+ |---|---|
427
+ | `--feature=<slug>` | Lê `.aioson/context/implementation-plan-<slug>.md` |
428
+ | `--plan=<path>` | Caminho arbitrário para o arquivo de plano |
429
+ | `--agent=<name>` | Agente padrão para as tarefas enfileiradas |
430
+ | `--dry-run` | Lista as fases sem enfileirar |
431
+
432
+ **Exemplo:**
433
+
434
+ ```bash
435
+ # Dry-run para ver as fases antes de enfileirar
436
+ aioson runner:queue:from-plan . --feature=checkout --dry-run
437
+
438
+ # Enfileirar todas as fases para o agente dev
439
+ aioson runner:queue:from-plan . --feature=checkout --agent=dev
440
+ ```
441
+
442
+ **Saída (modo enfileirado):**
443
+
444
+ ```json
445
+ {
446
+ "ok": true,
447
+ "feature": "checkout",
448
+ "queued": [
449
+ { "phase": 1, "title": "Create database migrations", "priority": 1 },
450
+ { "phase": 2, "title": "Implement AddToCart action", "priority": 2 },
451
+ { "phase": 3, "title": "Payment webhook handler", "priority": 3 }
452
+ ]
453
+ }
454
+ ```
455
+
456
+ ---
457
+
458
+ ## learning:auto-promote
459
+
460
+ ```
461
+ aioson learning:auto-promote [path] [--threshold=<n>] [--dry-run] [--json]
462
+ ```
463
+
464
+ Lê `project_learnings` do SQLite de runtime e promove automaticamente aprendizados de processo e qualidade de alta frequência para arquivos de regra em `.aioson/rules/`.
465
+
466
+ **Tipos promovidos:** `process`, `quality`
467
+ **Tipos não promovidos:** `domain` (anotados em `noted_items`, não viram regras)
468
+
469
+ **Threshold padrão:** 3 ocorrências
470
+
471
+ **Arquivo gerado:** `.aioson/rules/<type>-<slug>.md`
472
+
473
+ **Exemplo:**
474
+
475
+ ```bash
476
+ # Ver o que seria promovido sem escrever nada
477
+ aioson learning:auto-promote . --threshold=3 --dry-run
478
+
479
+ # Promover com threshold mais alto
480
+ aioson learning:auto-promote . --threshold=5
481
+ ```
482
+
483
+ **Saída:**
484
+
485
+ ```json
486
+ {
487
+ "ok": true,
488
+ "dry_run": false,
489
+ "threshold": 3,
490
+ "eligible": 2,
491
+ "promoted": 2,
492
+ "skipped": 0,
493
+ "noted": 1,
494
+ "promoted_items": [
495
+ { "title": "Commit after each atomic step", "type": "process", "file": ".aioson/rules/process-commit-after-each-atomic-step.md" },
496
+ { "title": "Run tests before commit", "type": "process", "file": ".aioson/rules/process-run-tests-before-commit.md" }
497
+ ],
498
+ "noted_items": [
499
+ { "title": "Cart uniqueness constraint", "type": "domain" }
500
+ ]
501
+ }
502
+ ```
503
+
504
+ ---
505
+
506
+ ## Fluxo completo de uma feature SMALL
507
+
508
+ ```bash
509
+ # 1. Pré-voo: ver o estado antes de começar
510
+ aioson preflight . --agent=dev --feature=checkout
511
+
512
+ # 2. Classificar automaticamente
513
+ aioson classify . --feature=checkout
514
+
515
+ # 3. Verificar cadeia de artefatos
516
+ aioson artifact:validate . --feature=checkout
517
+
518
+ # 4. Checar gate C antes de começar dev
519
+ aioson gate:check . --feature=checkout --gate=C
520
+
521
+ # 5. Executar workflow (ou dry-run primeiro)
522
+ aioson workflow:execute . --feature=checkout --tool=claude --dry-run
523
+ aioson workflow:execute . --feature=checkout --tool=claude
524
+
525
+ # 6. Durante dev: salvar estado ao final de cada fase
526
+ aioson state:save . --feature=checkout --phase=2 --status=in_progress \
527
+ --next="Phase 3: webhook" --spec-version=3
528
+ aioson pulse:update . --agent=dev --feature=checkout \
529
+ --action="Phase 2 done" --next="Phase 3"
530
+
531
+ # 7. QA sign-off
532
+ aioson feature:close . --feature=checkout --verdict=PASS
533
+
534
+ # 8. Promover aprendizados para regras
535
+ aioson learning:auto-promote . --threshold=3
536
+ ```
537
+
538
+ ---
539
+
540
+ ## Integração com a Regra dos 80%
541
+
542
+ Esses scripts foram criados conforme o **Plan 79 — SDD Automation Scripts**. A ideia central é:
543
+
544
+ - **80% do trabalho** de verificação, estado e validação é determinístico — scripts fazem melhor que LLMs
545
+ - **20% restantes** exigem raciocínio — reserve o contexto do agente para isso
546
+
547
+ **Economia estimada por feature:**
548
+
549
+ | Comando | Tokens economizados |
550
+ |---|---|
551
+ | `preflight` | 1.800–3.200 tokens (leitura de vários arquivos) |
552
+ | `classify` | 800–1.500 tokens (análise de scoring) |
553
+ | `gate:check` | 600–1.200 tokens (verificação de pré-requisitos) |
554
+ | `artifact:validate` | 500–900 tokens (varredura de cadeia) |
555
+ | `state:save` + `pulse:update` | 300–600 tokens (escrita de estado) |
556
+ | `feature:close` | 800–1.400 tokens (atualização de três arquivos) |
557
+ | **Total** | **4.800–8.800 por feature** |