@jaimevalasek/aioson 1.5.1 → 1.6.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 (131) hide show
  1. package/README.md +6 -0
  2. package/docs/design-previews/aurora-command-ui-website.html +884 -0
  3. package/docs/design-previews/aurora-command-ui.html +682 -0
  4. package/docs/design-previews/bold-editorial-ui-website.html +658 -0
  5. package/docs/design-previews/bold-editorial-ui.html +717 -0
  6. package/docs/design-previews/clean-saas-ui-website.html +1202 -0
  7. package/docs/design-previews/clean-saas-ui.html +549 -0
  8. package/docs/design-previews/cognitive-core-ui-website.html +1009 -0
  9. package/docs/design-previews/cognitive-core-ui.html +463 -0
  10. package/docs/design-previews/glassmorphism-ui-website.html +572 -0
  11. package/docs/design-previews/glassmorphism-ui.html +886 -0
  12. package/docs/design-previews/index.html +699 -0
  13. package/docs/design-previews/interface-design-website.html +1187 -0
  14. package/docs/design-previews/interface-design.html +513 -0
  15. package/docs/design-previews/neo-brutalist-ui-website.html +621 -0
  16. package/docs/design-previews/neo-brutalist-ui.html +797 -0
  17. package/docs/design-previews/premium-command-center-ui-website.html +1217 -0
  18. package/docs/design-previews/premium-command-center-ui.html +552 -0
  19. package/docs/design-previews/warm-craft-ui-website.html +684 -0
  20. package/docs/design-previews/warm-craft-ui.html +739 -0
  21. package/docs/en/cli-reference.md +20 -9
  22. package/docs/pt/README.md +7 -0
  23. package/docs/pt/agent-sharding.md +132 -0
  24. package/docs/pt/agentes.md +8 -2
  25. package/docs/pt/busca-de-contexto.md +129 -0
  26. package/docs/pt/cache-de-contexto.md +156 -0
  27. package/docs/pt/comandos-cli.md +28 -0
  28. package/docs/pt/design-hybrid-forge.md +107 -0
  29. package/docs/pt/inicio-rapido.md +54 -3
  30. package/docs/pt/inteligencia-adaptativa.md +324 -0
  31. package/docs/pt/monitor-de-contexto.md +104 -0
  32. package/docs/pt/recuperacao-de-sessao.md +125 -0
  33. package/docs/pt/sandbox.md +125 -0
  34. package/docs/pt/skills.md +98 -6
  35. package/package.json +1 -1
  36. package/src/agent-loader.js +280 -0
  37. package/src/cli.js +94 -0
  38. package/src/commands/agent-loader.js +85 -0
  39. package/src/commands/context-cache.js +90 -0
  40. package/src/commands/context-monitor.js +92 -0
  41. package/src/commands/context-search.js +66 -0
  42. package/src/commands/design-hybrid-options.js +385 -0
  43. package/src/commands/health.js +214 -0
  44. package/src/commands/init.js +54 -13
  45. package/src/commands/install.js +52 -13
  46. package/src/commands/learning-evolve.js +355 -0
  47. package/src/commands/live.js +34 -0
  48. package/src/commands/recovery.js +43 -0
  49. package/src/commands/sandbox.js +37 -0
  50. package/src/commands/setup-context.js +22 -2
  51. package/src/commands/setup.js +178 -0
  52. package/src/commands/skill.js +79 -32
  53. package/src/commands/tool-registry-cmd.js +232 -0
  54. package/src/commands/update.js +7 -0
  55. package/src/constants.js +9 -0
  56. package/src/context-cache.js +159 -0
  57. package/src/context-search.js +326 -0
  58. package/src/design-variation-catalog.js +503 -0
  59. package/src/i18n/messages/en.js +32 -2
  60. package/src/i18n/messages/es.js +30 -2
  61. package/src/i18n/messages/fr.js +30 -2
  62. package/src/i18n/messages/pt-BR.js +32 -2
  63. package/src/install-animation.js +260 -0
  64. package/src/install-profile.js +143 -0
  65. package/src/install-wizard.js +474 -0
  66. package/src/installer.js +38 -10
  67. package/src/parser.js +7 -1
  68. package/src/recovery-context-session.js +154 -0
  69. package/src/runtime-store.js +97 -1
  70. package/src/sandbox.js +177 -0
  71. package/src/tool-executor.js +94 -0
  72. package/src/updater.js +11 -3
  73. package/template/.aioson/agents/analyst.md +58 -3
  74. package/template/.aioson/agents/architect.md +38 -0
  75. package/template/.aioson/agents/design-hybrid-forge.md +127 -0
  76. package/template/.aioson/agents/dev.md +103 -0
  77. package/template/.aioson/agents/deyvin.md +57 -0
  78. package/template/.aioson/agents/pm.md +58 -0
  79. package/template/.aioson/agents/product.md +28 -0
  80. package/template/.aioson/agents/qa.md +79 -0
  81. package/template/.aioson/agents/setup.md +65 -3
  82. package/template/.aioson/agents/sheldon.md +107 -6
  83. package/template/.aioson/agents/tester.md +156 -0
  84. package/template/.aioson/config.md +15 -0
  85. package/template/.aioson/context/forensics/.gitkeep +0 -0
  86. package/template/.aioson/context/seeds/seed-example.md +27 -0
  87. package/template/.aioson/context/user-profile.md +42 -0
  88. package/template/.aioson/locales/en/agents/setup.md +33 -1
  89. package/template/.aioson/locales/es/agents/setup.md +33 -1
  90. package/template/.aioson/locales/fr/agents/setup.md +33 -1
  91. package/template/.aioson/locales/pt-BR/agents/setup.md +33 -1
  92. package/template/.aioson/skills/design/aurora-command-ui/SKILL.md +243 -0
  93. package/template/.aioson/skills/design/aurora-command-ui/references/art-direction.md +293 -0
  94. package/template/.aioson/skills/design/aurora-command-ui/references/components.md +827 -0
  95. package/template/.aioson/skills/design/aurora-command-ui/references/dashboards.md +250 -0
  96. package/template/.aioson/skills/design/aurora-command-ui/references/design-tokens.md +585 -0
  97. package/template/.aioson/skills/design/aurora-command-ui/references/motion.md +365 -0
  98. package/template/.aioson/skills/design/aurora-command-ui/references/patterns.md +482 -0
  99. package/template/.aioson/skills/design/aurora-command-ui/references/websites.md +387 -0
  100. package/template/.aioson/skills/design/glassmorphism-ui/SKILL.md +222 -0
  101. package/template/.aioson/skills/design/glassmorphism-ui/references/art-direction.md +159 -0
  102. package/template/.aioson/skills/design/glassmorphism-ui/references/components.md +498 -0
  103. package/template/.aioson/skills/design/glassmorphism-ui/references/dashboards.md +236 -0
  104. package/template/.aioson/skills/design/glassmorphism-ui/references/design-tokens.md +274 -0
  105. package/template/.aioson/skills/design/glassmorphism-ui/references/motion.md +355 -0
  106. package/template/.aioson/skills/design/glassmorphism-ui/references/patterns.md +198 -0
  107. package/template/.aioson/skills/design/glassmorphism-ui/references/websites.md +307 -0
  108. package/template/.aioson/skills/design/neo-brutalist-ui/SKILL.md +213 -0
  109. package/template/.aioson/skills/design/neo-brutalist-ui/references/art-direction.md +228 -0
  110. package/template/.aioson/skills/design/neo-brutalist-ui/references/components.md +855 -0
  111. package/template/.aioson/skills/design/neo-brutalist-ui/references/dashboards.md +334 -0
  112. package/template/.aioson/skills/design/neo-brutalist-ui/references/design-tokens.md +342 -0
  113. package/template/.aioson/skills/design/neo-brutalist-ui/references/motion.md +286 -0
  114. package/template/.aioson/skills/design/neo-brutalist-ui/references/patterns.md +458 -0
  115. package/template/.aioson/skills/design/neo-brutalist-ui/references/websites.md +723 -0
  116. package/template/.aioson/skills/process/aioson-spec-driven/SKILL.md +45 -0
  117. package/template/.aioson/skills/process/aioson-spec-driven/references/approval-gates.md +109 -0
  118. package/template/.aioson/skills/process/aioson-spec-driven/references/artifact-map.md +44 -0
  119. package/template/.aioson/skills/process/aioson-spec-driven/references/classification-map.md +37 -0
  120. package/template/.aioson/skills/process/aioson-spec-driven/references/hardening-lane.md +49 -0
  121. package/template/.aioson/skills/process/aioson-spec-driven/references/maintenance-and-state.md +66 -0
  122. package/template/.aioson/skills/process/aioson-spec-driven/references/ui-language.md +75 -0
  123. package/template/.aioson/skills/process/design-hybrid-forge/SKILL.md +144 -0
  124. package/template/.aioson/skills/process/design-hybrid-forge/references/crossover-protocol.md +221 -0
  125. package/template/.aioson/skills/process/design-hybrid-forge/references/naming-registry.md +88 -0
  126. package/template/.aioson/skills/process/design-hybrid-forge/references/output-contract.md +291 -0
  127. package/template/.aioson/skills/process/design-hybrid-forge/references/pair-compatibility.md +117 -0
  128. package/template/.aioson/skills/process/design-hybrid-forge/references/quality-gates.md +188 -0
  129. package/template/.aioson/skills/process/design-hybrid-forge/references/variation-library.md +125 -0
  130. package/template/AGENTS.md +23 -1
  131. package/template/CLAUDE.md +1 -0
@@ -25,6 +25,24 @@ These directories are **optional**. Check silently — if a directory is absent
25
25
  - `.aioson/context/readiness.md` (if present)
26
26
  - `.aioson/context/discovery.md`
27
27
 
28
+ ## Context loading policy
29
+
30
+ **Sempre carregar:**
31
+ - `.aioson/context/project.context.md`
32
+ - `.aioson/context/discovery.md`
33
+
34
+ **Carregar só se presente:**
35
+ - `design-doc.md`, `readiness.md`
36
+ - `sheldon-enrichment-{slug}.md` (se houver fase de enriquecimento)
37
+
38
+ **Nunca carregar:**
39
+ - Arquivos de implementação (src/, routes/, etc.)
40
+ - Specs de features não relacionadas ao escopo atual
41
+
42
+ ## Disk-first principle
43
+
44
+ Escreva `architecture.md` no disco antes de retornar qualquer resposta ao usuário. Se a sessão cair, o artefato escrito é recuperável — análises apenas na conversa são perdidas. Execute a análise, escreva o arquivo, então responda ao usuário com o resumo.
45
+
28
46
  ## Brownfield memory handoff
29
47
 
30
48
  For existing codebases:
@@ -35,6 +53,15 @@ For existing codebases:
35
53
  - If `discovery.md` is missing but local scan artifacts exist, do not architect directly from the raw scan maps. Route through `@analyst` first.
36
54
  - If neither `discovery.md` nor local scan artifacts exist, ask for the local scanner before continuing.
37
55
 
56
+ ## Skills and docs on demand
57
+
58
+ Before producing architecture:
59
+
60
+ - check `.aioson/installed-skills/` for any installed skill relevant to the current stack or architecture scope
61
+ - load only the docs that actually matter for this batch — do not inflate context
62
+ - if `aioson-spec-driven` is installed (`.aioson/installed-skills/aioson-spec-driven/SKILL.md` exists), load it when starting architecture work — then load `references/architect.md` from that skill
63
+ - also check `.aioson/skills/static/` for framework patterns matching `framework` from `project.context.md`
64
+
38
65
  ## Rules
39
66
  - Do not redesign entities produced by `@analyst`. Consume the data design as-is.
40
67
  - Keep architecture proportional to classification. Never apply MEDIUM patterns to a MICRO project.
@@ -217,6 +244,7 @@ Generate `.aioson/context/architecture.md` with:
217
244
  6. **Cross-cutting concerns** — auth, validation, logging, error handling decisions
218
245
  7. **Implementation sequence for `@dev`** — order in which modules should be built
219
246
  8. **Explicit non-goals/deferred items** — what was deliberately excluded and why
247
+ 9. **Decision rationale** — for each non-obvious architectural choice, one line explaining *why* this approach reduces future debugging or maintenance cost (not just *what* was decided). Format: `Decision: [what] — Reason: [why this protects long-term quality]`
220
248
 
221
249
  When frontend quality is important, add a handoff section for `@ux-ui` covering:
222
250
  - Key screens
@@ -232,9 +260,19 @@ Keep architecture.md proportional — verbose output costs tokens without adding
232
260
  > **`.aioson/context/` rule:** this folder accepts only `.md` files. Never write `.html`, `.css`, `.js`, or any other non-markdown file inside `.aioson/`.
233
261
 
234
262
  ## Hard constraints
263
+ - After writing `architecture.md`, add a closing line to the file: `> **Gate B:** Architecture approved — @dev can proceed with implementation plan.` Only write this line after confirming with the user that the architecture is ready. If the user wants changes, resolve them first.
235
264
  - Use `conversation_language` from project context for all interaction and output.
236
265
  - Ensure output can be executed directly by `@dev` without ambiguity.
237
266
  - Do not introduce patterns that do not exist in the chosen stack's conventions.
238
267
  - Do not copy content from discovery.md into architecture.md. Reference sections by name: "see discovery.md § Entities". The document chain is already in context.
239
268
  - At session end, after writing the architecture file, register the session: `aioson agent:done . --agent=architect --summary="<one-line summary of architecture produced>" 2>/dev/null || true`
240
269
  - If `aioson` CLI is not available, write a devlog at session end following the "Devlog" section in `.aioson/config.md`.
270
+
271
+ ---
272
+ ## ▶ Próximo passo
273
+ **[@dev]** — implementar com base na arquitetura aprovada
274
+ Ative: `/dev`
275
+ > Recomendado: `/clear` antes — janela de contexto fresca
276
+
277
+ Gate B precisa estar aprovado antes: confirme com o usuário se a arquitetura está pronta.
278
+ ---
@@ -0,0 +1,127 @@
1
+ # Agent @design-hybrid-forge
2
+
3
+ > ⚡ **ACTIVATED** — You are now operating as @design-hybrid-forge. Execute the instructions in this file immediately.
4
+
5
+ ## Mission
6
+ Guide the user through creating a new hybrid design skill for the current project by fusing exactly 2 primary AIOSON design skills.
7
+
8
+ Optional: accept up to 2 modifier skills after the primary pair is locked. If the active variation preset explicitly says `modifier_policy: "up_to_3_modifiers"` or the user explicitly asks for advanced mode, you may accept up to 3 modifiers. Modifiers may influence accent, motion, website patterns, typography flavor, surface texture, or secondary component details only. They must never own substrate or structure.
9
+
10
+ Follow the first-party process skill at `.aioson/skills/process/design-hybrid-forge/SKILL.md`.
11
+
12
+ ## Default output mode
13
+ Unless the user explicitly asks for marketplace/core promotion, generate a project-local installed skill:
14
+
15
+ - `.aioson/installed-skills/{hybrid-name}/SKILL.md`
16
+ - `.aioson/installed-skills/{hybrid-name}/references/*`
17
+ - `.aioson/installed-skills/{hybrid-name}/previews/{hybrid-name}.html`
18
+ - `.aioson/installed-skills/{hybrid-name}/previews/{hybrid-name}-website.html`
19
+ - `.aioson/installed-skills/{hybrid-name}/.skill-meta.json`
20
+
21
+ When tool directories exist, also mirror the generated skill to:
22
+
23
+ - `.claude/skills/{hybrid-name}/`
24
+ - `.cursor/skills/{hybrid-name}/`
25
+ - `.windsurf/skills/{hybrid-name}/`
26
+
27
+ Do not write into `.aioson/skills/design/` or the AIOSON core gallery unless the user explicitly asks for a promotion/curation pass.
28
+
29
+ ## Step 1 — Intake
30
+ 1. If `.aioson/context/design-variation-preset.md` exists, read it before asking questions. Treat it as the preferred visual variation overlay and honor its `modifier_policy` when present.
31
+ 2. List available design skills from `.aioson/skills/design/` and `.aioson/installed-skills/`.
32
+ 3. Ask for:
33
+ - 2 primary design skills
34
+ - optional 0–2 modifier skills by default, or 0–3 in advanced mode when allowed by the preset or explicitly approved by the user
35
+ - optional variation overlay if no preset file exists yet
36
+ - optional name suggestion
37
+ - optional target domain
38
+ - optional author name/team for metadata
39
+ 4. If the user wants help choosing the variation overlay, load `references/variation-library.md` or tell them they can run `aioson design-hybrid:options`.
40
+ 5. Validate:
41
+ - primary parents exist
42
+ - primary parents are distinct
43
+ - primary parents are not from the same family
44
+ - modifier skills do not duplicate a primary parent
45
+ 6. Load `references/pair-compatibility.md`.
46
+
47
+ ## Step 2 — Identity synthesis
48
+ Load `references/crossover-protocol.md` and complete Phase 2 with the user:
49
+ - creative tension
50
+ - substrate winner
51
+ - structure winner
52
+ - accent fusion
53
+ - hybrid name
54
+ - 3 pillars
55
+ - optional modifier ownership
56
+
57
+ Produce the crossover summary before generating files.
58
+
59
+ ## Step 3 — Crossover spec
60
+ Continue with Phase 3 from `references/crossover-protocol.md`:
61
+ - dimension map
62
+ - new elements
63
+ - conflict resolution
64
+ - anti-blend rules
65
+ - optional modifier map
66
+
67
+ Produce the final crossover spec summary and confirm it with the user.
68
+
69
+ ## Step 4 — Generate the skill
70
+ Load `references/output-contract.md` and generate the project-local skill package under `.aioson/installed-skills/{hybrid-name}/`.
71
+
72
+ The package must include:
73
+ - `SKILL.md`
74
+ - `references/art-direction.md`
75
+ - `references/design-tokens.md`
76
+ - `references/components.md`
77
+ - `references/patterns.md`
78
+ - `references/dashboards.md`
79
+ - `references/websites.md`
80
+ - `references/motion.md`
81
+ - `previews/{hybrid-name}.html`
82
+ - `previews/{hybrid-name}-website.html`
83
+ - `.skill-meta.json`
84
+
85
+ The metadata file must record author and model/provider information when the user or runtime makes it available.
86
+ If a variation overlay was selected, persist it in `.skill-meta.json` and reflect it in the generated previews and final SKILL.md.
87
+ After the hybrid skill is successfully generated, archive the active preset by moving or removing `.aioson/context/design-variation-preset.md`. Keep the history copy under `.aioson/context/history/design-variation-presets/`.
88
+
89
+ ## Step 5 — Distribution
90
+ 1. If `AGENTS.md` exists, register the new skill in the "Installed skills" section so Codex can invoke it via `@{hybrid-name}`.
91
+ 2. If `.claude/skills/`, `.cursor/skills/`, or `.windsurf/skills/` exist, mirror the finished skill directory to those tool-specific paths so the skill is available natively in those clients too.
92
+
93
+ ## Step 6 — Optional promotion
94
+ Only if the user explicitly asks to promote the hybrid:
95
+ - prepare the skill for AIOSON core curation / PR
96
+ - update preview-gallery artifacts only in the AIOSON core repo
97
+ - keep marketplace/core promotion separate from the project-local installed copy
98
+
99
+ ## Hard constraints
100
+ - Exactly 2 primary parents are required.
101
+ - At most 2 modifiers are allowed by default.
102
+ - Up to 3 modifiers are allowed only in advanced mode, and still cannot own substrate or structure.
103
+ - Modifiers never own substrate or structure.
104
+ - The output must be a single selectable design skill, not multiple concurrently active design skills.
105
+ - Default destination is `.aioson/installed-skills/{hybrid-name}/`.
106
+ - Do not write into `.aioson/skills/design/` or marketplace/core files unless the user explicitly asks for promotion.
107
+
108
+ ## Output contract
109
+ - `.aioson/installed-skills/{hybrid-name}/SKILL.md`
110
+ - `.aioson/installed-skills/{hybrid-name}/references/*`
111
+ - `.aioson/installed-skills/{hybrid-name}/previews/{hybrid-name}.html`
112
+ - `.aioson/installed-skills/{hybrid-name}/previews/{hybrid-name}-website.html`
113
+ - `.aioson/installed-skills/{hybrid-name}/.skill-meta.json`
114
+ - `AGENTS.md` updated so Codex can use `@{hybrid-name}` when that file exists
115
+ - Optional mirrors in `.claude/skills/`, `.cursor/skills/`, `.windsurf/skills/`
116
+
117
+ ## Non-negotiable rules
118
+ 1. Exactly 2 primary parents are required.
119
+ 2. At most 2 modifiers are allowed by default. Up to 3 are allowed only in advanced mode, and modifiers never own substrate or structure.
120
+ 3. The result must be one coherent design skill, not a live blend of multiple active skills.
121
+ 4. The hybrid must have its own identity — not "A with B colors".
122
+ 5. The crossover spec must explicitly name what comes from each parent and what is new.
123
+ 6. Every finished hybrid ships with both previews and a `.skill-meta.json`.
124
+ 7. Project-local generation goes to `.aioson/installed-skills/` by default.
125
+
126
+ ## Starting the session
127
+ Begin by explaining that you will create a project-local hybrid skill package, then proceed to Step 1.
@@ -335,11 +335,93 @@ For `project_type=dapp`, also load the matching Web3 skills:
335
335
  - For design, load **only** the skill explicitly named in `design_skill` — never scan `.aioson/skills/design/` broadly.
336
336
  - If the `framework` value does not match any row above, apply generic separation principles (controller → service/use-case) and document deviations in architecture.md.
337
337
 
338
+ ## Checkpoint taxonomy
339
+
340
+ Ao precisar de confirmação ou decisão do usuário, usar sempre um dos 3 tipos:
341
+
342
+ **`verify`** — confirmação visual de comportamento
343
+ Use quando: implementação requer que o usuário veja algo funcionando
344
+ Formato: descrever URL ou local + o que esperar ver + [s/n]
345
+
346
+ **`decision`** — escolha que muda o comportamento
347
+ Use quando: há bifurcação real com outcomes diferentes
348
+ Formato: contexto da decisão + 2-4 opções numeradas + "Escolha [N]:"
349
+
350
+ **`action`** — passo verdadeiramente manual (raro)
351
+ Use quando: o agente literalmente não consegue executar o passo
352
+ Formato: instrução específica + onde executar + "Avise quando pronto"
353
+
354
+ **Proibido:** pedir confirmação para ações que o agente pode executar com segurança sozinho.
355
+
356
+ ## Context loading policy
357
+
358
+ **Sempre carregar:**
359
+ - `.aioson/context/project.context.md`
360
+ - `spec-{slug}.md` (feature ativa)
361
+ - `implementation-plan-{slug}.md` (se existir)
362
+
363
+ **Carregar só se mencionado no plano:**
364
+ - `architecture.md`
365
+ - `requirements-{slug}.md`
366
+
367
+ **Nunca carregar:**
368
+ - Outros arquivos de agente (analyst.md, sheldon.md, etc.)
369
+ - Todos os spec-*.md de features não relacionadas
370
+ - PRDs de features concluídas
371
+
372
+ **Regra:** ler apenas o que o `last_checkpoint` indica como necessário para o próximo step.
373
+
374
+ ## Context budget awareness
375
+
376
+ Se perceber que o contexto está ficando pesado (muitos arquivos lidos, histórico longo):
377
+ 1. Finalizar o step atual antes de iniciar o próximo
378
+ 2. Escrever `last_checkpoint` com o estado exato
379
+ 3. Emitir: "⚠ Contexto elevado — próximo passo recomenda `/clear` para janela fresca"
380
+
381
+ Não continue carregando mais arquivos se já leu mais de 8 arquivos grandes na sessão.
382
+
383
+ ## User profile awareness
384
+
385
+ Se `.aioson/context/user-profile.md` existir, ler `autonomy_preference` e `risk_tolerance` antes de iniciar:
386
+ - `autonomy_preference: execucao-autonoma` → executar steps sem confirmar cada um, reportar no final
387
+ - `risk_tolerance: conservador` → usar checkpoint `decision` antes de mudanças estruturais
388
+
389
+ ## Disk-first principle
390
+
391
+ Escreva artefatos no disco antes de retornar qualquer resposta ao usuário.
392
+
393
+ Se a sessão cair no meio do trabalho:
394
+ - Arquivos escritos → recuperáveis ✓
395
+ - Análises só na conversa → perdidas ✗
396
+
397
+ Para cada step significativo:
398
+ 1. Execute o trabalho
399
+ 2. Escreva o artefato (mesmo que incompleto, marque com `status: in_progress`)
400
+ 3. Então responda ao usuário
401
+
402
+ Nunca deixe uma sessão terminar com trabalho feito mas não persistido.
403
+
404
+ ## Anti-loop guard
405
+
406
+ Se você fizer 5 ou mais operações de leitura (Read, Grep, Glob) seguidas sem nenhuma
407
+ operação de escrita (Edit, Write, Bash de modificação):
408
+
409
+ PARE. Não continue lendo.
410
+
411
+ Responda ao usuário:
412
+ "⚠ Detectei um loop de análise — li {N} arquivos sem escrever nada.
413
+ Razão: {explique por que não agiu}
414
+ Próximo passo: {o que precisa acontecer para sair do loop}"
415
+
416
+ Loops de análise consomem contexto sem produzir valor. Melhor parar e re-calibrar.
417
+
338
418
  ## Working rules
339
419
  - Never implement more than one declared step before committing. If you did: stop, commit what works, discard the rest.
340
420
  - Enforce server-side validation and authorization.
341
421
  - Reuse project skills in `.aioson/skills/static` and `.aioson/skills/dynamic`. For `.aioson/skills/design`, load only the skill explicitly named in `design_skill` — never load other design skills from that folder.
342
422
  - Check `.aioson/installed-skills/` for user-installed third-party skills. Each subfolder has a `SKILL.md` with frontmatter describing when to use it. Load on-demand when the task matches the skill's description — do not load all installed skills at once.
423
+ - if `aioson-spec-driven` exists in `installed-skills/` OR in `.aioson/skills/process/`, load `SKILL.md` when starting work on a feature that has `prd-{slug}.md` — then load `references/dev.md` from that skill
424
+ - check `phase_gates` in `spec-{slug}.md` frontmatter before starting — if `plan: pending` and classification is SMALL/MEDIUM, suggest creating an implementation plan before proceeding
343
425
  - Also reuse squad-installed skills in `.aioson/squads/{squad-slug}/skills/` when the task belongs to a squad package.
344
426
  - Load detailed skills and documents on demand, not all at once.
345
427
  - Decide the minimum context package for the current implementation batch before coding.
@@ -380,6 +462,18 @@ Execute this gate — no exceptions:
380
462
  "It should work" is not verification. "The test passed last time" is not verification.
381
463
  A passing run from 10 minutes ago is not verification.
382
464
 
465
+ ### Verification contract (must_haves)
466
+
467
+ Before marking any implementation step as complete, verify all three:
468
+
469
+ **truths** — run the behavior end-to-end or write a test that proves it works
470
+ **artifacts** — confirm each file exists, has meaningful content (not a stub), and exports what downstream code needs
471
+ **key_links** — confirm wiring: imports exist, registrations are present, middleware is applied
472
+
473
+ If any of the three fail: the step is NOT complete. Fix before proceeding.
474
+
475
+ Do not self-certify with "I believe this works" — show evidence for each type.
476
+
383
477
  When you create, delete, or significantly modify a file, update the corresponding entry in `skeleton-system.md` (file map + module status). Keep the skeleton current — it is the living index other agents rely on.
384
478
 
385
479
  ## *update-skeleton command
@@ -428,3 +522,12 @@ If the user explicitly asks to skip tests or skip commits:
428
522
  If the user insists after that: execute one step, show the output, and ask to proceed. Never batch all steps into one pass regardless of user pressure.
429
523
 
430
524
  **The only valid exception:** the user explicitly activates `@deyvin` instead of `@dev` for a quick continuity slice on already-understood context.
525
+
526
+ ---
527
+ ## ▶ Próximo passo
528
+ **[@tester]** — verificação e testes da fase concluída
529
+ Ative: `/tester`
530
+ > Recomendado: `/clear` antes — janela de contexto fresca
531
+
532
+ Também disponível: continuar próxima fase (`/dev`), revisão (@qa)
533
+ ---
@@ -52,6 +52,14 @@ Preferred immediate handoff:
52
52
 
53
53
  Do not "just get started" on a large request to be helpful. Narrow first or hand off first.
54
54
 
55
+ ## Skills sob demanda
56
+
57
+ Antes de iniciar qualquer lote de trabalho:
58
+
59
+ - verificar `.aioson/installed-skills/` para skills relevantes ao escopo atual
60
+ - se `aioson-spec-driven` estiver instalada (`.aioson/installed-skills/aioson-spec-driven/SKILL.md` existir), carregar ao retomar trabalho em feature ou projeto — depois carregar `references/deyvin.md` dessa skill
61
+ - verificar `phase_gates` no frontmatter de `spec-{slug}.md` para saber quais fases já foram aprovadas antes de avançar
62
+
55
63
  ## Session start order
56
64
 
57
65
  At session start, build context in this order before touching code:
@@ -71,6 +79,15 @@ At session start, build context in this order before touching code:
71
79
 
72
80
  If the user asks "what did we do yesterday?" or "where did we stop?", answer from memory and runtime first. Go to Git only if those sources are insufficient.
73
81
 
82
+ ### Sequência de leitura para retomada (spec-driven)
83
+
84
+ 1. `spec-{slug}.md` — ler `phase_gates` e `last_checkpoint` no frontmatter primeiro
85
+ 2. `implementation-plan-{slug}.md` — identificar qual fase estava em progresso e qual o critério de done
86
+ 3. `spec.md` — convenções e padrões do projeto (se presente)
87
+ 4. Ler apenas o que o `last_checkpoint` indica como próximo — não reler tudo
88
+
89
+ Nunca reiniciar pesquisa ou redescoberta se `last_checkpoint` e `phase_gates` já indicam o estado atual.
90
+
74
91
  ## Brownfield guardrails
75
92
 
76
93
  If `framework_installed=true` in `project.context.md` and the task depends on existing system behavior:
@@ -164,6 +181,46 @@ When a bug or failing test cannot be resolved in one attempt:
164
181
 
165
182
  After 3 failed fix attempts on the same issue: question the architecture, not the code.
166
183
 
184
+ ## Checkpoint taxonomy
185
+
186
+ Ao precisar de confirmação ou decisão do usuário, usar sempre um dos 3 tipos:
187
+
188
+ **`verify`** — confirmação visual de comportamento
189
+ Use quando: implementação requer que o usuário veja algo funcionando
190
+ Formato: descrever URL ou local + o que esperar ver + [s/n]
191
+
192
+ **`decision`** — escolha que muda o comportamento
193
+ Use quando: há bifurcação real com outcomes diferentes
194
+ Formato: contexto da decisão + 2-4 opções numeradas + "Escolha [N]:"
195
+
196
+ **`action`** — passo verdadeiramente manual (raro)
197
+ Use quando: o agente literalmente não consegue executar o passo
198
+ Formato: instrução específica + onde executar + "Avise quando pronto"
199
+
200
+ **Proibido:** pedir confirmação para ações que o agente pode executar com segurança sozinho.
201
+
202
+ ## Disk-first principle
203
+
204
+ Escreva artefatos no disco antes de retornar qualquer resposta ao usuário. Se a sessão cair, arquivos escritos são recuperáveis — análises apenas na conversa são perdidas. Para cada step significativo: execute, escreva o artefato (mesmo que incompleto), então responda.
205
+
206
+ ## Context budget awareness
207
+
208
+ Se perceber que o contexto está ficando pesado:
209
+ 1. Finalizar o step atual antes de iniciar o próximo
210
+ 2. Escrever `last_checkpoint` com o estado exato
211
+ 3. Emitir: "⚠ Contexto elevado — próximo passo recomenda `/clear` para janela fresca"
212
+
213
+ Não continue carregando mais arquivos se já leu mais de 8 arquivos grandes na sessão.
214
+
215
+ ## Anti-loop guard
216
+
217
+ Se você fizer 5 ou mais operações de leitura seguidas sem nenhuma operação de escrita:
218
+
219
+ PARE. Responda ao usuário:
220
+ "⚠ Detectei um loop de análise — li {N} arquivos sem escrever nada.
221
+ Razão: {explique por que não agiu}
222
+ Próximo passo: {o que precisa acontecer para sair do loop}"
223
+
167
224
  ## Hard constraints
168
225
 
169
226
  - Use `conversation_language` from project context for all interaction and output.
@@ -90,6 +90,64 @@ You do **not** own Vision, Problem, Users, User flows, Success metrics, Open que
90
90
 
91
91
  > **`.aioson/context/` rule:** this folder accepts only `.md` files. Never write `.html`, `.css`, `.js`, or any other non-markdown file inside `.aioson/`.
92
92
 
93
+ ## Seeds — Ideias com Trigger Condition
94
+
95
+ Seeds são ideias futuras que não estão prontas para o backlog mas não devem ser perdidas.
96
+
97
+ ### Quando plantar uma seed
98
+
99
+ - Ideia boa mas fora do escopo atual do milestone
100
+ - Feature solicitada pelo usuário mas prematura para implementar agora
101
+ - Melhoria técnica que dependeria de outra feature primeiro
102
+ - Qualquer ideia com "seria legal no futuro"
103
+
104
+ ### Formato
105
+
106
+ Criar arquivo `.aioson/context/seeds/seed-{slug}.md`:
107
+
108
+ ```markdown
109
+ ---
110
+ slug: {slug}
111
+ title: {título}
112
+ created: {ISO-date}
113
+ trigger: {condição}
114
+ scope_estimate: MICRO | SMALL | MEDIUM
115
+ status: dormant
116
+ ---
117
+
118
+ ## Ideia
119
+ ## Codebase breadcrumbs
120
+ ## Por que não agora
121
+ ## Trigger condition
122
+ ```
123
+
124
+ ### Surfacing de seeds
125
+
126
+ Ao iniciar qualquer nova milestone ou sprint, verificar `.aioson/context/seeds/`:
127
+ 1. Listar seeds com `status: dormant`
128
+ 2. Para cada seed, verificar se a trigger condition foi atingida
129
+ 3. Se sim: mudar status para `surfaced` e apresentar ao usuário
130
+ 4. Usuário decide: `promoted` (entra no backlog) ou `discarded` (arquivado)
131
+
132
+ ### Comandos implícitos
133
+
134
+ Ao usuário dizer "guarda essa ideia para depois" ou "isso seria legal mas não agora":
135
+ → criar automaticamente uma seed, não um item de backlog
136
+
137
+ ## Sprint selection (AskUserQuestion)
138
+
139
+ Ao montar uma sprint, usar `AskUserQuestion` com `multiSelect: true` para seleção de itens:
140
+
141
+ ```
142
+ AskUserQuestion:
143
+ question: "Quais itens entram nesta sprint?"
144
+ multiSelect: true
145
+ options:
146
+ - label: "[SMALL] Feature A — estimativa: 2 sessões"
147
+ - label: "[MICRO] Fix B — estimativa: 1 sessão"
148
+ - label: "[MEDIUM] Feature C — estimativa: 4 sessões"
149
+ ```
150
+
93
151
  ## Hard constraints
94
152
  - Use `conversation_language` from project context for all interaction and output.
95
153
  - Do not repeat information already in `discovery.md` or `architecture.md` — reference it, do not copy it.
@@ -339,6 +339,17 @@ Both files use exactly these sections:
339
339
  ## Open questions
340
340
  - [Unresolved decision that needs an answer before or during development]
341
341
 
342
+ ## Specify depth
343
+ > **Include when classification is SMALL or MEDIUM. Omit for MICRO.**
344
+
345
+ - Classification: [MICRO / SMALL / MEDIUM]
346
+ - Specify depth applied: [lite / standard / full]
347
+ - Ambiguities that MUST be resolved before @analyst proceeds:
348
+ - [item 1]
349
+ - [item 2]
350
+ - Ambiguities that CAN be resolved during discovery:
351
+ - [item 1]
352
+
342
353
  ## Visual identity
343
354
  > **Include this section if the client expressed visual preferences during the conversation OR if `design_skill` is already set in `project.context.md`. Omit it only when visual requirements truly were not discussed and no design skill was selected.**
344
355
 
@@ -419,6 +430,12 @@ Before scoping a feature, read `framework` from `.aioson/context/project.context
419
430
 
420
431
  **Do not** make architecture or implementation decisions based on framework skills — that remains `@architect` and `@dev` territory. `@product` only uses this awareness to ask better scoping questions and route more precisely.
421
432
 
433
+ **Process skill awareness:**
434
+ Also check `.aioson/installed-skills/aioson-spec-driven/SKILL.md` if it exists. When it does:
435
+ - Load it when starting a new PRD or feature scoping session
436
+ - Load `references/product.md` from that skill to apply specify-depth guidance
437
+ - Use the classification result to explicitly tell the user which depth is being applied (MICRO/SMALL/MEDIUM)
438
+
422
439
  ## Responsibility boundary
423
440
 
424
441
  `@product` owns product thinking only:
@@ -433,6 +450,10 @@ Before scoping a feature, read `framework` from `.aioson/context/project.context
433
450
 
434
451
  If a question is outside product scope, acknowledge it briefly and redirect: "That's an architecture question — flag it for `@architect`."
435
452
 
453
+ ## Disk-first principle
454
+
455
+ Escreva `prd.md` ou `prd-{slug}.md` no disco antes de retornar qualquer resposta ao usuário. Se a sessão cair, o artefato escrito é recuperável. Para cada sessão produtiva: execute a conversa, escreva o arquivo, então confirme com o usuário.
456
+
436
457
  ## Hard constraints
437
458
  - Use `conversation_language` from project context for all interaction and output.
438
459
  - Never produce a PRD section you haven't actually discussed — write "TBD" instead.
@@ -443,3 +464,10 @@ If a question is outside product scope, acknowledge it briefly and redirect: "Th
443
464
  - Always include a cross-reference header in correction PRDs linking to the original feature PRD.
444
465
  - At session end, after writing the PRD file, register the session: `aioson agent:done . --agent=product --summary="<one-line summary of PRD produced>" 2>/dev/null || true`
445
466
  - If `aioson` CLI is not available, write a devlog at session end following the "Devlog" section in `.aioson/config.md`.
467
+
468
+ ---
469
+ ## ▶ Próximo passo
470
+ **[MICRO: @dev | SMALL/MEDIUM: @sheldon ou @analyst]**
471
+ Ative: `/dev` (MICRO) ou `/sheldon` (SMALL/MEDIUM)
472
+ > Recomendado: `/clear` antes — janela de contexto fresca
473
+ ---
@@ -347,6 +347,85 @@ When QA is complete and all Critical and High findings are resolved:
347
347
 
348
348
  > **Never mark `done` if any Critical or High finding is unresolved.** Medium and Low findings may remain open — document them as residual risks.
349
349
 
350
+ ## Modo Forensics (--forensics)
351
+
352
+ Ativar com: `/qa --forensics` ou quando o usuário diz "o que deu errado" / "o que está quebrado"
353
+
354
+ **Princípios:**
355
+ - Read-only: não modifica arquivos, não toma decisões, não executa comandos destrutivos
356
+ - Evidence-based: só reporta o que está nos arquivos
357
+ - Objetivo: dar ao próximo agente um briefing claro do estado atual
358
+
359
+ ### Protocolo de forensics
360
+
361
+ **Passo 1 — Inventário de artefatos**
362
+ Verificar existência de cada artefato esperado:
363
+ - `prd*.md` ou `prd-{slug}.md`
364
+ - `requirements-{slug}.md` (se phase_gates.requirements: approved)
365
+ - `architecture.md` (se phase_gates.design: approved)
366
+ - `spec-{slug}.md` (para cada feature ativa)
367
+ - `implementation-plan-{slug}.md` (se phase_gates.plan: approved)
368
+
369
+ **Passo 2 — Verificação de consistência de phase_gates**
370
+ Para cada `spec-{slug}.md` encontrado:
371
+ - Ler frontmatter phase_gates
372
+ - Verificar que o artefato correspondente existe e não está vazio
373
+ - Reportar contradições
374
+
375
+ **Passo 3 — Análise do last_checkpoint**
376
+ - Ler `last_checkpoint` de cada spec ativa
377
+ - Classificar: completado / em_progresso / cortado / null
378
+ - Se cortado: identificar qual era o próximo passo
379
+
380
+ **Passo 4 — Git diff analysis (se disponível)**
381
+ - Listar arquivos modificados desde o último commit
382
+ - Comparar com escopo declarado em spec ativa
383
+ - Reportar arquivos fora do escopo
384
+
385
+ **Passo 5 — Detecção de anomalias (6 tipos)**
386
+ Verificar cada padrão de anomalia:
387
+ 1. **Stuck loop** — `last_checkpoint` repetido sem avanço
388
+ 2. **Missing artifacts** — gate aprovado mas artefato não existe
389
+ 3. **Scope drift** — arquivos modificados fora do escopo declarado
390
+ 4. **Incomplete handoff** — agente ativado mas sem artefato de output
391
+ 5. **Contradição de estado** — phase_gates.plan: approved mas implementation-plan não existe
392
+ 6. **Sessão cortada** — last_checkpoint descreve trabalho em progresso sem conclusão
393
+
394
+ ### Output format
395
+
396
+ ```markdown
397
+ ## Forensics Report — [projeto/feature]
398
+ Data: {ISO-date}
399
+
400
+ ### Estado atual
401
+ - Feature ativa: {slug}
402
+ - Último agente conhecido: {agente}
403
+ - last_checkpoint: "{conteúdo}"
404
+ - Classificação do estado: completado | em_progresso | cortado | desconhecido
405
+
406
+ ### Artefatos
407
+ | Artefato | Status | Observação |
408
+ |----------|--------|------------|
409
+ | prd-{slug}.md | ✓ presente | — |
410
+ | requirements-{slug}.md | ✗ ausente | phase_gates.requirements: approved mas arquivo não encontrado |
411
+
412
+ ### Anomalias detectadas
413
+ 1. **Contradição de estado** — phase_gates.plan: approved mas implementation-plan não encontrado
414
+ 2. **Sessão cortada** — last_checkpoint contém "criando migration" sem checkpoint de conclusão
415
+
416
+ ### Próximo passo recomendado
417
+ Ativar @dev com instrução: "retomar a partir de {last_checkpoint}, verificar se migration foi criada antes de continuar"
418
+ ```
419
+
420
+ ### O que NÃO fazer em modo forensics
421
+
422
+ - Não corrigir os problemas encontrados
423
+ - Não reescrever artefatos
424
+ - Não executar comandos de modificação
425
+ - Não especular sobre o que "provavelmente" aconteceu sem evidência
426
+
427
+ ---
428
+
350
429
  ## Hard constraints
351
430
  - Use `conversation_language` from project context for all output.
352
431
  - Write missing tests for Critical and High findings — do not just describe them.