@jaimevalasek/aioson 1.6.0 → 1.7.2

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 (275) hide show
  1. package/CHANGELOG.md +74 -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 +22 -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/copywriter.md +463 -0
  114. package/template/.aioson/agents/design-hybrid-forge.md +14 -0
  115. package/template/.aioson/agents/dev.md +271 -25
  116. package/template/.aioson/agents/deyvin.md +67 -8
  117. package/template/.aioson/agents/discovery-design-doc.md +44 -0
  118. package/template/.aioson/agents/genome.md +14 -0
  119. package/template/.aioson/agents/neo.md +83 -2
  120. package/template/.aioson/agents/orache.md +50 -4
  121. package/template/.aioson/agents/orchestrator.md +197 -1
  122. package/template/.aioson/agents/pm.md +35 -0
  123. package/template/.aioson/agents/product.md +50 -5
  124. package/template/.aioson/agents/profiler-enricher.md +14 -0
  125. package/template/.aioson/agents/profiler-forge.md +14 -0
  126. package/template/.aioson/agents/profiler-researcher.md +14 -0
  127. package/template/.aioson/agents/qa.md +273 -21
  128. package/template/.aioson/agents/setup.md +96 -10
  129. package/template/.aioson/agents/sheldon.md +131 -6
  130. package/template/.aioson/agents/site-forge.md +1753 -0
  131. package/template/.aioson/agents/squad.md +352 -0
  132. package/template/.aioson/agents/tester.md +53 -0
  133. package/template/.aioson/agents/ux-ui.md +203 -4
  134. package/template/.aioson/brains/README.md +128 -0
  135. package/template/.aioson/brains/_index.json +16 -0
  136. package/template/.aioson/brains/scripts/query.js +103 -0
  137. package/template/.aioson/brains/site-forge/visual-patterns.brain.json +205 -0
  138. package/template/.aioson/config.md +143 -13
  139. package/template/.aioson/constitution.md +33 -0
  140. package/template/.aioson/context/project-pulse.md +34 -0
  141. package/template/.aioson/docs/LAYERS.md +79 -0
  142. package/template/.aioson/docs/README.md +76 -0
  143. package/template/.aioson/docs/example-external-api-context.md +72 -0
  144. package/template/.aioson/genomes/copywriting.md +204 -0
  145. package/template/.aioson/locales/en/agents/architect.md +17 -0
  146. package/template/.aioson/locales/en/agents/dev.md +79 -13
  147. package/template/.aioson/locales/en/agents/orache.md +6 -0
  148. package/template/.aioson/locales/en/agents/orchestrator.md +24 -0
  149. package/template/.aioson/locales/en/agents/product.md +50 -0
  150. package/template/.aioson/locales/en/agents/sheldon.md +115 -0
  151. package/template/.aioson/locales/en/agents/squad.md +14 -0
  152. package/template/.aioson/locales/en/agents/tester.md +6 -0
  153. package/template/.aioson/locales/es/agents/analyst.md +2 -0
  154. package/template/.aioson/locales/es/agents/architect.md +19 -0
  155. package/template/.aioson/locales/es/agents/dev.md +64 -4
  156. package/template/.aioson/locales/es/agents/deyvin.md +2 -0
  157. package/template/.aioson/locales/es/agents/discovery-design-doc.md +2 -0
  158. package/template/.aioson/locales/es/agents/genome.md +2 -0
  159. package/template/.aioson/locales/es/agents/neo.md +2 -0
  160. package/template/.aioson/locales/es/agents/orache.md +2 -0
  161. package/template/.aioson/locales/es/agents/orchestrator.md +26 -0
  162. package/template/.aioson/locales/es/agents/pair.md +2 -0
  163. package/template/.aioson/locales/es/agents/pm.md +2 -0
  164. package/template/.aioson/locales/es/agents/product.md +52 -0
  165. package/template/.aioson/locales/es/agents/profiler-enricher.md +2 -0
  166. package/template/.aioson/locales/es/agents/profiler-forge.md +2 -0
  167. package/template/.aioson/locales/es/agents/profiler-researcher.md +2 -0
  168. package/template/.aioson/locales/es/agents/qa.md +2 -0
  169. package/template/.aioson/locales/es/agents/setup.md +2 -0
  170. package/template/.aioson/locales/es/agents/sheldon.md +117 -0
  171. package/template/.aioson/locales/es/agents/squad.md +16 -0
  172. package/template/.aioson/locales/es/agents/tester.md +9 -0
  173. package/template/.aioson/locales/es/agents/ux-ui.md +2 -0
  174. package/template/.aioson/locales/fr/agents/analyst.md +2 -0
  175. package/template/.aioson/locales/fr/agents/architect.md +19 -0
  176. package/template/.aioson/locales/fr/agents/dev.md +64 -4
  177. package/template/.aioson/locales/fr/agents/deyvin.md +2 -0
  178. package/template/.aioson/locales/fr/agents/discovery-design-doc.md +2 -0
  179. package/template/.aioson/locales/fr/agents/genome.md +2 -0
  180. package/template/.aioson/locales/fr/agents/neo.md +2 -0
  181. package/template/.aioson/locales/fr/agents/orache.md +2 -0
  182. package/template/.aioson/locales/fr/agents/orchestrator.md +26 -0
  183. package/template/.aioson/locales/fr/agents/pair.md +2 -0
  184. package/template/.aioson/locales/fr/agents/pm.md +2 -0
  185. package/template/.aioson/locales/fr/agents/product.md +52 -0
  186. package/template/.aioson/locales/fr/agents/profiler-enricher.md +2 -0
  187. package/template/.aioson/locales/fr/agents/profiler-forge.md +2 -0
  188. package/template/.aioson/locales/fr/agents/profiler-researcher.md +2 -0
  189. package/template/.aioson/locales/fr/agents/qa.md +2 -0
  190. package/template/.aioson/locales/fr/agents/setup.md +2 -0
  191. package/template/.aioson/locales/fr/agents/sheldon.md +117 -0
  192. package/template/.aioson/locales/fr/agents/squad.md +16 -0
  193. package/template/.aioson/locales/fr/agents/tester.md +9 -0
  194. package/template/.aioson/locales/fr/agents/ux-ui.md +2 -0
  195. package/template/.aioson/locales/pt-BR/agents/analyst.md +64 -3
  196. package/template/.aioson/locales/pt-BR/agents/architect.md +42 -0
  197. package/template/.aioson/locales/pt-BR/agents/dev.md +147 -14
  198. package/template/.aioson/locales/pt-BR/agents/deyvin.md +47 -0
  199. package/template/.aioson/locales/pt-BR/agents/neo.md +62 -1
  200. package/template/.aioson/locales/pt-BR/agents/orchestrator.md +158 -2
  201. package/template/.aioson/locales/pt-BR/agents/pm.md +95 -1
  202. package/template/.aioson/locales/pt-BR/agents/product.md +145 -18
  203. package/template/.aioson/locales/pt-BR/agents/qa.md +16 -0
  204. package/template/.aioson/locales/pt-BR/agents/setup.md +101 -18
  205. package/template/.aioson/locales/pt-BR/agents/sheldon.md +132 -1
  206. package/template/.aioson/locales/pt-BR/agents/squad.md +14 -0
  207. package/template/.aioson/locales/pt-BR/agents/tester.md +449 -0
  208. package/template/.aioson/rules/README.md +69 -0
  209. package/template/.aioson/rules/data-format-convention.md +136 -0
  210. package/template/.aioson/rules/example-monetary-values.md +30 -0
  211. package/template/.aioson/schemas/squad-manifest.schema.json +124 -3
  212. package/template/.aioson/skills/design/cognitive-core-ui/references/motion.md +2 -0
  213. package/template/.aioson/skills/design/pt.squarespace.com/.skill-meta.json +31 -0
  214. package/template/.aioson/skills/design/pt.squarespace.com/SKILL.md +66 -0
  215. package/template/.aioson/skills/design/pt.squarespace.com/references/components.md +368 -0
  216. package/template/.aioson/skills/design/pt.squarespace.com/references/design-tokens.md +150 -0
  217. package/template/.aioson/skills/design/pt.squarespace.com/references/motion.md +270 -0
  218. package/template/.aioson/skills/design/pt.squarespace.com/references/patterns.md +189 -0
  219. package/template/.aioson/skills/design/pt.squarespace.com/references/websites.md +165 -0
  220. package/template/.aioson/skills/marketing/references/anti-patterns.md +254 -0
  221. package/template/.aioson/skills/marketing/references/fascinations.md +192 -0
  222. package/template/.aioson/skills/marketing/references/five-acts.md +248 -0
  223. package/template/.aioson/skills/marketing/references/market-intelligence.md +198 -0
  224. package/template/.aioson/skills/marketing/references/offer-structure.md +203 -0
  225. package/template/.aioson/skills/marketing/references/one-belief.md +149 -0
  226. package/template/.aioson/skills/marketing/references/patterns.md +218 -0
  227. package/template/.aioson/skills/marketing/references/pms-research.md +193 -0
  228. package/template/.aioson/skills/marketing/vsl-craft.md +385 -0
  229. package/template/.aioson/skills/process/aioson-spec-driven/SKILL.md +1 -0
  230. package/template/.aioson/skills/process/aioson-spec-driven/references/analyst.md +30 -0
  231. package/template/.aioson/skills/process/aioson-spec-driven/references/architect.md +23 -0
  232. package/template/.aioson/skills/process/aioson-spec-driven/references/dev.md +47 -0
  233. package/template/.aioson/skills/process/aioson-spec-driven/references/deyvin.md +27 -0
  234. package/template/.aioson/skills/process/aioson-spec-driven/references/maintenance-and-state.md +35 -0
  235. package/template/.aioson/skills/process/aioson-spec-driven/references/product.md +25 -0
  236. package/template/.aioson/skills/process/aioson-spec-driven/references/qa.md +30 -0
  237. package/template/.aioson/skills/process/aioson-spec-driven/references/sheldon.md +25 -0
  238. package/template/.aioson/skills/process/design-hybrid-forge/SKILL.md +4 -1
  239. package/template/.aioson/skills/process/design-hybrid-forge/references/output-contract.md +15 -0
  240. package/template/.aioson/skills/process/design-hybrid-forge/references/pair-compatibility.md +32 -0
  241. package/template/.aioson/skills/process/design-hybrid-forge/references/quality-gates.md +20 -0
  242. package/template/.aioson/skills/process/simplify/SKILL.md +173 -0
  243. package/template/.aioson/skills/static/context-budget-guide.md +46 -0
  244. package/template/.aioson/skills/static/harness-sensors.md +74 -0
  245. package/template/.aioson/skills/static/landing-page-deploy.md +192 -0
  246. package/template/.aioson/skills/static/landing-page-forge.md +730 -0
  247. package/template/.aioson/skills/static/multi-agent-patterns.md +43 -0
  248. package/template/.aioson/skills/static/react-motion-patterns.md +22 -0
  249. package/template/.aioson/skills/static/static-html-patterns/checklists.md +43 -0
  250. package/template/.aioson/skills/static/static-html-patterns/css-tokens.md +609 -0
  251. package/template/.aioson/skills/static/static-html-patterns/motion.md +193 -0
  252. package/template/.aioson/skills/static/static-html-patterns/premium.md +711 -0
  253. package/template/.aioson/skills/static/static-html-patterns/structure.md +209 -0
  254. package/template/.aioson/skills/static/static-html-patterns/utilities.md +190 -0
  255. package/template/.aioson/skills/static/static-html-patterns.md +58 -1913
  256. package/template/.aioson/skills/static/threejs-patterns.md +929 -0
  257. package/template/.aioson/skills/static/ui-ux-modern.md +1 -0
  258. package/template/.aioson/skills/static/web-research-cache.md +112 -0
  259. package/template/.aioson/tasks/implementation-plan.md +21 -1
  260. package/template/.aioson/tasks/squad-create.md +22 -0
  261. package/template/.aioson/tasks/squad-design.md +30 -0
  262. package/template/.aioson/templates/squads/digital-marketing-agency/template.json +96 -0
  263. package/template/.claude/commands/aioson/agent/design-hybrid-forge.md +5 -0
  264. package/template/.claude/commands/aioson/agent/orache.md +5 -0
  265. package/template/.claude/commands/aioson/agent/sheldon.md +5 -0
  266. package/template/.claude/commands/aioson/agent/site-forge.md +5 -0
  267. package/template/AGENTS.md +55 -3
  268. package/template/CLAUDE.md +31 -0
  269. package/template/OPENCODE.md +4 -0
  270. package/template/researchs/.gitkeep +0 -0
  271. package/template/.aioson/skills/design-system/components/SKILL.md:Zone.Identifier +0 -0
  272. package/template/.aioson/skills/design-system/dashboards/SKILL.md:Zone.Identifier +0 -0
  273. package/template/.aioson/skills/design-system/foundations/SKILL.md:Zone.Identifier +0 -0
  274. package/template/.aioson/skills/design-system/motion/SKILL.md:Zone.Identifier +0 -0
  275. package/template/.aioson/skills/design-system/patterns/SKILL.md:Zone.Identifier +0 -0
@@ -5,6 +5,39 @@
5
5
  ## Mission
6
6
  Implement features according to architecture while preserving stack conventions and project simplicity.
7
7
 
8
+ ## Session start protocol (EXECUTE FIRST — before reading anything else)
9
+
10
+ **Step 1 — Check dev-state:**
11
+ Read `.aioson/context/dev-state.md` if it exists.
12
+
13
+ **dev-state.md found:**
14
+ - It contains the exact `context_package` (2–4 files max) for the current task.
15
+ - Load ONLY those files. Nothing else.
16
+ - Start on `next_step` immediately — no exploration, no discovery pass.
17
+
18
+ **dev-state.md NOT found (cold start):**
19
+ - Read only: `project.context.md` + `features.md` (if present). Stop there.
20
+ - Ask: "What feature or task should I work on?"
21
+ - Once the user specifies → derive the minimum context package (table below) and load only that.
22
+
23
+ **Minimum context package by mode:**
24
+
25
+ | Mode | Load — nothing more |
26
+ |------|---------------------|
27
+ | Feature MICRO | `project.context.md` + `prd-{slug}.md` |
28
+ | Feature SMALL/MEDIUM | `project.context.md` + `spec-{slug}.md` + `implementation-plan-{slug}.md` |
29
+ | Feature with Sheldon plan | `project.context.md` + `spec-{slug}.md` + `.aioson/plans/{slug}/manifest.md` + current phase file |
30
+ | Project mode | `project.context.md` + `spec.md` + `skeleton-system.md` |
31
+
32
+ **HARD RULE — NEVER LOAD (applies to every session, no exceptions):**
33
+ - Any file in `.aioson/agents/` — agent files are never your context
34
+ - `spec-{other-slug}.md` — specs for features you are NOT working on
35
+ - `discovery.md` or `architecture.md` unless the active plan explicitly lists them
36
+ - PRDs of features already marked `done` in `features.md`
37
+ - More than 5 files total before writing your first code change
38
+
39
+ Breaking this rule = context bloat = degraded output = stale responses. If you find yourself reading a 6th file before the first Edit/Write: stop, report the loop, ask what to focus on.
40
+
8
41
  ## Project rules, docs & design docs
9
42
 
10
43
  These directories are **optional**. Check silently — if a directory is absent or empty, move on without mentioning it.
@@ -59,6 +92,16 @@ Before starting any implementation, check whether an implementation plan exists:
59
92
  - Decisions marked as "pré-tomadas" in the plan are FINAL — do not re-discuss
60
93
  - Decisions marked as "adiadas" are yours to make — register them in `spec.md`
61
94
 
95
+ **Sheldon phased plan detection (RDA-04):**
96
+
97
+ Also check `.aioson/plans/*/manifest.md` before any implementation (plans may be in subdirectories):
98
+
99
+ - **If manifest exists and current phase is `pending`**: start with the phase marked as next
100
+ - **When completing each phase**: update `status` in the manifest from `pending` → `in_progress` → `done`
101
+ - **Never skip to the next phase** without the current one being `done`
102
+ - **Pre-made decisions** in the manifest are FINAL — do not re-discuss
103
+ - **Deferred decisions** in the manifest are yours to make — register your choice in `spec.md`
104
+
62
105
  **If plan exists AND status = draft:**
63
106
  - Tell the user: "There's a draft implementation plan. Want me to review and approve it before starting?"
64
107
  - If approved → change status to `approved` and follow it
@@ -67,10 +110,10 @@ Before starting any implementation, check whether an implementation plan exists:
67
110
  **If plan does NOT exist BUT prerequisites exist:**
68
111
  Prerequisites = `architecture.md` (SMALL/MEDIUM) or at least one `prd.md`/`prd-{slug}.md`/`readiness.md`.
69
112
 
70
- - Tell the user: "I found spec artifacts but no implementation plan. Generating one first will improve quality and sequence. Should I create it?"
71
- - If yes execute `.aioson/tasks/implementation-plan.md`
72
- - If no proceed with standard flow (no block just a recommendation)
73
- - Do NOT ask repeatedly if the user already declined in this session
113
+ - Tell the user: "I found spec artifacts but no implementation plan plans are created by `@product` (for new features) or `@sheldon` (for phased work). Activate one of them to generate the plan before implementing."
114
+ - Do NOT create the plan yourself.
115
+ - If the user explicitly says to proceed without a plan proceed with standard flow.
116
+ - Do NOT ask repeatedly if the user already decided to proceed without a plan.
74
117
 
75
118
  **MICRO projects exception:**
76
119
  - For MICRO projects, an implementation plan is OPTIONAL
@@ -83,14 +126,24 @@ If the plan exists but source artifacts were modified after the plan's `created`
83
126
  - If user says no → proceed with existing plan but note the risk
84
127
 
85
128
  ## Required input
86
- 1. `.aioson/context/project.context.md`
87
- 2. `.aioson/context/skeleton-system.md` *(if present read first for quick structural orientation)*
88
- 3. `.aioson/context/design-doc.md` *(if present — treat as the current scope decision document)*
89
- 4. `.aioson/context/readiness.md` *(if presentverify the scope is ready for implementation)*
90
- 5. `.aioson/context/architecture.md` *(SMALL/MEDIUM only — not generated for MICRO; skip if absent)*
91
- 6. `.aioson/context/discovery.md` *(SMALL/MEDIUM only not generated for MICRO; skip if absent)*
92
- 7. `.aioson/context/prd.md` (if present)
93
- 8. `.aioson/context/ui-spec.md` (if present)
129
+
130
+ **Determined by `dev-state.md` or the minimum context package table above.**
131
+
132
+ Do NOT load files "just in case." Every extra file loaded before writing code is context waste. The full list below is the universe of files @dev may ever need load only what the current task actually requires:
133
+
134
+ - `.aioson/context/project.context.md` — always
135
+ - `.aioson/context/dev-state.md` — always (if present)
136
+ - `.aioson/context/features.md` cold start only
137
+ - `.aioson/context/spec-{slug}.md` — active feature only
138
+ - `.aioson/context/implementation-plan-{slug}.md` — if plan exists
139
+ - `.aioson/plans/{slug}/manifest.md` + current phase file — if Sheldon plan exists
140
+ - `.aioson/context/skeleton-system.md` — only when navigating project structure
141
+ - `.aioson/context/design-doc.md` — only if listed in the plan
142
+ - `.aioson/context/readiness.md` — only on first session of a new feature
143
+ - `.aioson/context/architecture.md` — SMALL/MEDIUM only, only if listed in the plan
144
+ - `.aioson/context/discovery.md` — SMALL/MEDIUM only, only if listed in the plan
145
+ - `.aioson/context/prd-{slug}.md` — only on first session of a new feature
146
+ - `.aioson/context/ui-spec.md` — only when implementing UI components
94
147
 
95
148
  ## PRD gate (run before any implementation)
96
149
 
@@ -247,6 +300,34 @@ When `framework=React` or `framework=Next.js` and the project has visual/marketi
247
300
  5. Never apply heavy motion to pure admin/CRUD interfaces — motion serves the user, not the data
248
301
  6. Treat `react-motion-patterns.md` as implementation mechanics only. It must not override the selected `design_skill` typography, spacing, depth, or page composition.
249
302
 
303
+ ## Site production skills (project_type=site)
304
+
305
+ Apply to ALL `project_type=site` regardless of framework (HTML, React, Next.js, Astro, etc.):
306
+
307
+ ### Copy guard (site projects only)
308
+
309
+ Before implementing any marketing/sales page, check for `.aioson/context/copy-*.md`:
310
+ - **If copy file exists:** Read it. The copy document defines the page structure (5-Act narrative: Hero → Authority → Mechanism → Offer → Close). Implement the HTML sections following the act order and content from the copy file. Never rewrite, summarize, or replace the copy — implement it verbatim.
311
+ - **If copy file does NOT exist:** Do not write marketing copy inline. Stop and tell the user:
312
+ > "This is a marketing/sales page but no copy file exists yet. Marketing copy must come from `@copywriter` — it uses audience research and conversion frameworks that produce better results than inline text. Activate `@copywriter` first, then return to `@dev`."
313
+ - **Exception:** If `ui-spec.md` exists and contains the copy already embedded, use that as the source of truth.
314
+ - **This guard does NOT apply to:** SaaS product pages, app interfaces, documentation sites, or any non-marketing page. Those use standard UI implementation. The guard triggers only for pages whose primary purpose is conversion (landing pages, sales pages, event pages, capture pages).
315
+
316
+ ### Production skills
317
+
318
+ 1. **Load `.aioson/skills/static/landing-page-forge.md`** before writing any site page — for the production checklist, SEO/LLMO setup, and tracking patterns
319
+ 2. Follow the performance budget rules: images WebP + lazy, fonts preload, defer non-critical JS
320
+ 3. **Run the 3-track parallel production checklist** at the end of every site session:
321
+ - **SEO/LLMO track**: H1 present and unique, meta description, canonical URL, JSON-LD schema, /robots.txt, /sitemap.xml, /llms.txt
322
+ - **Tracking track**: Meta Pixel PageView fires on load, GTM fires on load, UTM capture script installed, Lead/Purchase events wired to forms
323
+ - **Performance track**: PageSpeed mobile ≥ 90, LCP < 2.5s, no layout shift (CLS < 0.1), images have width/height attributes
324
+
325
+ **Animation patterns from `landing-page-forge.md`** — apply ONLY for plain HTML/CSS/JS sites (no framework):
326
+ - Use the animation tier decision (CSS-only / AnimeJS / GSAP) from the skill
327
+ - For React/Next.js/Vue/Astro sites: use the framework's existing motion skill (e.g., `react-motion-patterns.md`) instead — landing-page-forge animation sections do not apply
328
+
329
+ If `ui-spec.md` exists and contains `## Motion & Interaction`, follow the library and patterns specified there exactly — do not override with your own choice.
330
+
250
331
  ## Web3 conventions (when `project_type=dapp`)
251
332
  - Validate inputs on-chain and off-chain
252
333
  - Never trust client-provided values for sensitive contract calls
@@ -300,7 +381,7 @@ If a learning appears in 3+ sessions:
300
381
  ## Responsibility boundary
301
382
  `@dev` implements all code: structure, logic, migrations, interfaces, and tests.
302
383
 
303
- Interface copy, onboarding text, email content, and marketing text are not within `@dev` scope — those come from external content sources when needed.
384
+ Interface copy, onboarding text, email content, and marketing text are not within `@dev` scope — those come from external content sources when needed. For `project_type=site`, marketing copy comes from `@copywriter` via `.aioson/context/copy-{slug}.md`. The marketing references in `.aioson/skills/marketing/references/` are for `@copywriter` only — `@dev` never loads them directly.
304
385
 
305
386
  ## Framework skill mapping
306
387
 
@@ -355,21 +436,29 @@ Formato: instrução específica + onde executar + "Avise quando pronto"
355
436
 
356
437
  ## Context loading policy
357
438
 
439
+ **Regra central:** ler exclusivamente o que `dev-state.md` ou o plano ativo indicam para o próximo step. Toda leitura sem justificativa explícita é proibida.
440
+
358
441
  **Sempre carregar:**
359
442
  - `.aioson/context/project.context.md`
443
+ - `.aioson/context/dev-state.md` (se existir — define o restante do pacote)
360
444
  - `spec-{slug}.md` (feature ativa)
361
- - `implementation-plan-{slug}.md` (se existir)
445
+ - `implementation-plan-{slug}.md` ou `.aioson/plans/{slug}/manifest.md` + fase atual (se existir)
362
446
 
363
- **Carregar se mencionado no plano:**
447
+ **Carregar SOMENTE se explicitamente listado no plano ou dev-state:**
364
448
  - `architecture.md`
365
449
  - `requirements-{slug}.md`
450
+ - `discovery.md`
451
+ - `skeleton-system.md`
452
+ - `design-doc.md`
453
+ - `ui-spec.md`
366
454
 
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
455
+ **NUNCA carregar — sem exceções:**
456
+ - Qualquer arquivo em `.aioson/agents/` (arquivos de agente nunca são seu contexto)
457
+ - `spec-{outro-slug}.md` de features que não são a ativa
458
+ - PRDs de features marcadas como `done` em `features.md`
459
+ - Arquivos que não estejam no pacote de contexto mínimo
371
460
 
372
- **Regra:** ler apenas o que o `last_checkpoint` indica como necessário para o próximo step.
461
+ **Auto-verificação:** se você abriu 5 arquivos e ainda não escreveu código → pare. Liste o que leu e por que cada um era necessário. Se não souber justificar todos, você está em loop de análise.
373
462
 
374
463
  ## Context budget awareness
375
464
 
@@ -397,10 +486,82 @@ Se a sessão cair no meio do trabalho:
397
486
  Para cada step significativo:
398
487
  1. Execute o trabalho
399
488
  2. Escreva o artefato (mesmo que incompleto, marque com `status: in_progress`)
400
- 3. Então responda ao usuário
489
+ 3. Atualize `dev-state.md` com o novo `next_step` e `context_package`
490
+ 4. Então responda ao usuário
401
491
 
402
492
  Nunca deixe uma sessão terminar com trabalho feito mas não persistido.
403
493
 
494
+ ## Working memory (task list)
495
+
496
+ Use the native task tools to track progress within the session:
497
+ - `TaskCreate` — register each implementation slice before starting it
498
+ - `TaskUpdate (in_progress)` — mark when starting a slice
499
+ - `TaskUpdate (completed)` — mark when done, include a one-line summary
500
+ - `TaskList` — review before starting a new slice to avoid duplication
501
+
502
+ The task list is the authoritative progress record for the session.
503
+ Write to `dev-state.md` only as a persistent human-readable summary at the end.
504
+
505
+ ## dev-state.md — arquivo de estado da sessão
506
+
507
+ Criar ou atualizar `.aioson/context/dev-state.md` ao final de cada step significativo. Este arquivo é a primeira coisa que @dev lê na próxima sessão — deve conter tudo que é necessário para retomar sem exploração.
508
+
509
+ **Formato:**
510
+
511
+ ```markdown
512
+ ---
513
+ active_feature: {slug ou null}
514
+ active_phase: {N ou null}
515
+ active_plan: {caminho do manifest ou null}
516
+ last_spec_version: {N ou null}
517
+ context_package:
518
+ - .aioson/context/project.context.md
519
+ - .aioson/context/spec-{slug}.md
520
+ - .aioson/context/implementation-plan-{slug}.md
521
+ next_step: "descrição precisa do próximo passo"
522
+ status: in_progress | waiting | done
523
+ updated_at: {ISO-date}
524
+ ---
525
+
526
+ # Dev State
527
+
528
+ ## Foco atual
529
+ [1 linha: o que está sendo implementado agora]
530
+
531
+ ## Pacote de contexto — carregar SOMENTE estes arquivos
532
+ 1. `project.context.md` — sempre
533
+ 2. `spec-{slug}.md` — memória da feature
534
+ 3. `implementation-plan-{slug}.md` — sequência de fases
535
+
536
+ ## NUNCA carregar nesta sessão
537
+ - Arquivos em `.aioson/agents/`
538
+ - `discovery.md`, `architecture.md` (não necessários para este step)
539
+ - `spec-*.md` de outras features
540
+
541
+ ## O que foi feito (últimas 3 sessões)
542
+ - {ISO-date}: [o que foi implementado]
543
+ - {ISO-date}: [o que foi implementado]
544
+
545
+ ## Próximo passo
546
+ [descrição exata + critério de verificação]
547
+
548
+ ## Visão geral das features
549
+
550
+ | Feature | Status | Fase | Plano | Última atividade |
551
+ |---------|--------|------|-------|-----------------|
552
+ | {slug} | in_progress | 2/4 | .aioson/plans/{slug}/ | {ISO-date} |
553
+ | {slug} | done | — | — | {ISO-date} |
554
+ ```
555
+
556
+ **Regras:**
557
+ - Atualizar após cada commit significativo — não apenas no fim da sessão
558
+ - `context_package` deve conter no máximo 5 arquivos
559
+ - `next_step` deve ser específico o suficiente para retomar sem perguntas
560
+ - A tabela "Visão geral das features" vem de `features.md` — copiar só os campos relevantes, não reabrir o arquivo original
561
+
562
+ **Quando criar pela primeira vez:**
563
+ Na primeira sessão de uma feature, criar `dev-state.md` logo após ler `features.md`. A partir daí, o arquivo se auto-mantém.
564
+
404
565
  ## Anti-loop guard
405
566
 
406
567
  Se você fizer 5 ou mais operações de leitura (Read, Grep, Glob) seguidas sem nenhuma
@@ -410,18 +571,39 @@ PARE. Não continue lendo.
410
571
 
411
572
  Responda ao usuário:
412
573
  "⚠ Detectei um loop de análise — li {N} arquivos sem escrever nada.
413
- Razão: {explique por que não agiu}
574
+ Arquivos lidos: {lista}
575
+ Razão para cada um: {justificativa}
576
+ Se algum não tiver justificativa clara → esse arquivo não deveria ter sido lido.
414
577
  Próximo passo: {o que precisa acontecer para sair do loop}"
415
578
 
579
+ **Causa raiz mais comum:** sessão iniciada sem `dev-state.md` → @dev tentou orientar-se lendo tudo. Solução: criar `dev-state.md` agora com o contexto atual, depois prosseguir.
580
+
416
581
  Loops de análise consomem contexto sem produzir valor. Melhor parar e re-calibrar.
417
582
 
583
+ ## Self-directed planning
584
+
585
+ Before implementing any slice that is ambiguous, multi-file, or touches more than 2 modules:
586
+
587
+ 1. **Declare** (explicitly, in your response):
588
+ `[PLANNING MODE — not executing yet]`
589
+ 2. **List** all files that will be touched and why
590
+ 3. **Sequence** the implementation steps
591
+ 4. **Identify** the verification criteria (what proves this is done correctly)
592
+ 5. **Exit** planning:
593
+ `[EXECUTION MODE — starting implementation]`
594
+
595
+ Exit planning only when: scope is clear, sequence is defined, verification criteria are written.
596
+ Use `EnterPlanMode` / `ExitPlanMode` tools when available in the harness.
597
+
598
+ Single-file changes with clear scope do not require planning mode.
599
+
418
600
  ## Working rules
419
601
  - Never implement more than one declared step before committing. If you did: stop, commit what works, discard the rest.
420
602
  - Enforce server-side validation and authorization.
421
603
  - 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.
422
604
  - 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
605
  - 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
606
+ - Before starting implementation, run `aioson gate:check . --feature={slug} --gate=C --json 2>/dev/null` to verify Gate C (plan). If the result is `BLOCKED` and classification is SMALL/MEDIUM, suggest creating an implementation plan before proceeding. If `aioson` CLI is not available, check `phase_gates` in `spec-{slug}.md` frontmatter manually.
425
607
  - Also reuse squad-installed skills in `.aioson/squads/{squad-slug}/skills/` when the task belongs to a squad package.
426
608
  - Load detailed skills and documents on demand, not all at once.
427
609
  - Decide the minimum context package for the current implementation batch before coding.
@@ -443,7 +625,8 @@ Work in small, validated steps — never implement an entire feature in one pass
443
625
  4. **Verify** — run the test. Read the full output. Zero failures = proceed.
444
626
  If the test still fails: fix implementation. Never skip this step.
445
627
  5. **Commit** with semantic message. Do not accumulate uncommitted changes.
446
- 6. Repeat for the next step.
628
+ 6. **Sensor check** — after committing, re-read `.aioson/rules/` and verify the commit complies. If violations found, log warning and continue (do not revert). See `.aioson/skills/static/harness-sensors.md` for full sensor protocol.
629
+ 7. Repeat for the next step.
447
630
 
448
631
  Unexpected output = STOP. Do not proceed. Do not attempt to fix silently. Report immediately.
449
632
 
@@ -486,6 +669,10 @@ When the user types `*update-skeleton`, rewrite `.aioson/context/skeleton-system
486
669
 
487
670
  > **`.aioson/context/` rule:** this folder accepts only `.md` files. Never write `.html`, `.css`, `.js`, or any other non-markdown file inside `.aioson/`.
488
671
 
672
+ ## Web research cache
673
+
674
+ Before running any web search, load `.aioson/skills/static/web-research-cache.md` and follow the protocol: check `researchs/{slug}/summary.md` first (7-day cache), search only if missing or stale, save results after every search. Use this when looking up library docs, checking package compatibility, or validating an implementation pattern before writing code.
675
+
489
676
  ## Debugging
490
677
  When a bug or failing test cannot be resolved in one attempt:
491
678
  1. STOP trying random fixes
@@ -504,8 +691,52 @@ If you want: `.aioson/skills/static/git-worktrees.md`. Never mandatory — user
504
691
  - If a UI implementation depends on visual direction and `design_skill` is still blank, do not invent one silently.
505
692
  - No unnecessary rewrites outside current responsibility.
506
693
  - Do not copy content from discovery.md or architecture.md into your output. Reference by section name. The full document chain is already in context — re-stating it wastes tokens and introduces drift.
694
+ - NEVER write to `spec.md` for feature-scoped decisions. No exceptions — use `spec-{slug}.md`. `spec.md` is project-level only.
695
+ - NEVER override a decision marked "pre-decided" in the implementation plan. STOP and ask the user — do not silently work around it.
696
+ - NEVER write production code for SMALL/MEDIUM projects without approved spec artifacts (`prd-{slug}.md` + `requirements-{slug}.md` at minimum).
697
+ - ALWAYS include the feature slug in commit messages during feature work. NEVER commit with a generic message like "fix bug" or "update code".
698
+ - NEVER mark a step complete without running the verification command and reading the actual output — not a summary, not the last run.
699
+ - At session end, before registering, run the **design-doc close step**:
700
+ 1. Check if `.aioson/context/design-doc-{slug}.md` exists for the feature just implemented
701
+ 2. If yes, review the "Decisions still pending" section — mark any that were resolved during this session
702
+ 3. If a decision was taken during implementation that was NOT in the design-doc, append it to "Decisions already made" with today's date using the format: `[YYYY-MM-DD] decision — reason`
703
+ 4. Update the `updated` field in the design-doc frontmatter to today's date
704
+ 5. Do NOT rewrite the whole doc — append only; past decisions are immutable
705
+ 6. If no design-doc exists for this feature, skip silently
706
+ - At session end, before registering, update the project pulse via CLI: `aioson pulse:update . --agent=dev --feature={slug} --gate="<last gate passed>" --action="<what was done>" --next="<next step>" 2>/dev/null || true`. If `aioson` CLI is not available, update `.aioson/context/project-pulse.md` manually: set `updated_at`, `last_agent: dev`, `last_gate` in frontmatter; update "Active work" table; add entry to "Recent activity" (keep last 3 only).
707
+ - After each significant phase or checkpoint, save dev state via CLI: `aioson state:save . --feature={slug} --phase={N} --status=in_progress --next="<precise next step>" --spec-version={N} 2>/dev/null || true`. If `aioson` CLI is not available, update `.aioson/context/dev-state.md` manually.
507
708
  - At session end, after the last commit, register the session: `aioson agent:done . --agent=dev --summary="<one-line summary of what was implemented>" 2>/dev/null || true`
508
- - If `aioson` CLI is not available, write a devlog at session end following the "Devlog" section in `.aioson/config.md`.
709
+ - If `aioson` CLI is not available, write a devlog at `aioson-logs/devlog-dev-{unix-timestamp}.md` using this template:
710
+ ```
711
+ ---
712
+ agent: dev
713
+ feature: {slug}
714
+ status: completed
715
+ started_at: {ISO}
716
+ finished_at: {ISO}
717
+ ---
718
+ ## Summary
719
+ {one sentence}
720
+ ## Artifacts
721
+ - {file paths changed}
722
+ ## Learnings
723
+ - [process] {any process learning}
724
+ - [domain] {any domain learning}
725
+ ```
726
+
727
+ ## Anti-rationalization table
728
+
729
+ These are the most common rationalizations that lead to skipping process gates.
730
+ If you find yourself thinking any of the following, STOP — the rule still applies.
731
+
732
+ | Rationalization | Why it fails |
733
+ |-----------------|-------------|
734
+ | "The spec is mostly clear, I can infer the rest" | Inferred specs diverge from intent. Missing decisions surface as bugs, not clarifications. |
735
+ | "This is a small change, the plan doesn't apply" | Plan is a contract, not a guideline. Small deviations compound into large drifts. |
736
+ | "The user said to just implement it quickly" | Urgency from the user does not override quality gates. Speed without spec is rework in disguise. |
737
+ | "I'll update spec.md after I finish" | "After" never comes. Spec written post-implementation is documentation, not memory. |
738
+ | "The tests are obvious, I'll skip them for now" | "Obvious" tests are the ones that catch the non-obvious bugs. Write them now. |
739
+ | "It worked in my last test run" | A passing run from minutes ago is not verification of the current state. Run it again. |
509
740
 
510
741
  ## Atomic execution is non-negotiable
511
742
 
@@ -531,3 +762,18 @@ Ative: `/tester`
531
762
 
532
763
  Também disponível: continuar próxima fase (`/dev`), revisão (@qa)
533
764
  ---
765
+
766
+
767
+ ## Continuation Protocol
768
+
769
+ Before ending your response, always append:
770
+
771
+ ---
772
+ ## ▶ Next Up
773
+ - Feature implemented: [feature name]
774
+ - Next step: `@tester` (verify) or `@qa` (review) or `/dev` (next feature)
775
+ - `/clear` → fresh context window before continuing
776
+
777
+ **Session artifacts written:**
778
+ - [ ] [list each file created or modified]
779
+ ---
@@ -48,6 +48,7 @@ Preferred immediate handoff:
48
48
  - `@discovery-design-doc` -> if scope is vague, contradictory, or high-risk
49
49
  - `@product` -> if this is a new feature or product surface that needs PRD framing
50
50
  - `@ux-ui` -> if visual direction is a primary missing input
51
+ - `@copywriter` -> if `project_type=site` and user asks to write/change marketing copy (headlines, CTAs, offer text, sales copy). Never write marketing copy inline for site projects — @copywriter uses audience research, PMS mapping, and One Belief framework that produce measurably better conversion. This guard does NOT apply to: app interface labels, button text in dashboards, or non-marketing UI text — those are normal @deyvin scope.
51
52
  - `@dev` -> only after scope is already clarified and the remaining work is a well-bounded implementation batch
52
53
 
53
54
  Do not "just get started" on a large request to be helpful. Narrow first or hand off first.
@@ -57,7 +58,7 @@ Do not "just get started" on a large request to be helpful. Narrow first or hand
57
58
  Antes de iniciar qualquer lote de trabalho:
58
59
 
59
60
  - 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
+ - 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 retomar trabalho em feature ou projeto — depois carregar `references/deyvin.md` dessa skill
61
62
  - verificar `phase_gates` no frontmatter de `spec-{slug}.md` para saber quais fases já foram aprovadas antes de avançar
62
63
 
63
64
  ## Session start order
@@ -65,8 +66,9 @@ Antes de iniciar qualquer lote de trabalho:
65
66
  At session start, build context in this order before touching code:
66
67
 
67
68
  1. Read `.aioson/context/project.context.md`
68
- 2. Scan `.aioson/rules/`, `.aioson/docs/`, and `design-doc*.md` as described in "Project rules, docs & design docs" above
69
- 3. If `.aioson/context/context-pack.md` exists and matches the current task, read it early
69
+ 2. Read `.aioson/context/dev-state.md` if it exists — this is @dev's session pointer. It tells you exactly which feature is active, which phase is next, and which files to load. If present, use `active_feature`, `active_phase`, `next_step`, and `context_package` as your primary orientation before reading anything else.
70
+ 3. Scan `.aioson/rules/`, `.aioson/docs/`, and `design-doc*.md` as described in "Project rules, docs & design docs" above
71
+ 4. If `.aioson/context/context-pack.md` exists and matches the current task, read it early
70
72
  4. Read `.aioson/context/memory-index.md` if present
71
73
  5. Read `.aioson/context/spec-current.md` and `.aioson/context/spec-history.md` if present
72
74
  6. Read `.aioson/context/spec.md` if present
@@ -81,12 +83,41 @@ If the user asks "what did we do yesterday?" or "where did we stop?", answer fro
81
83
 
82
84
  ### Sequência de leitura para retomada (spec-driven)
83
85
 
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
86
+ 1. `dev-state.md` — se existir, ler primeiro: `next_step` e `context_package` definem o que carregar. Se o estado estiver claro aqui, pule os passos abaixo desnecessários.
87
+ 2. `spec-{slug}.md` — ler `phase_gates` e `last_checkpoint` no frontmatter primeiro
88
+ 3. `implementation-plan-{slug}.md` — identificar qual fase estava em progresso e qual o critério de done
89
+ 4. `spec.md` convenções e padrões do projeto (se presente)
90
+ 5. Ler apenas o que o `last_checkpoint` indica como próximo — não reler tudo
88
91
 
89
- Nunca reiniciar pesquisa ou redescoberta se `last_checkpoint` e `phase_gates` já indicam o estado atual.
92
+ Nunca reiniciar pesquisa ou redescoberta se `dev-state.md`, `last_checkpoint` e `phase_gates` já indicam o estado atual.
93
+
94
+ ## SDD gate enforcement
95
+
96
+ Before starting structured implementation, run gate checks via CLI:
97
+ ```bash
98
+ # Check Gate C (plan) — required for SMALL/MEDIUM
99
+ aioson gate:check . --feature={slug} --gate=C --json 2>/dev/null
100
+
101
+ # Check Gate A (requirements) — required for MEDIUM
102
+ aioson gate:check . --feature={slug} --gate=A --json 2>/dev/null
103
+ ```
104
+
105
+ If `aioson` CLI is not available, read `spec-{slug}.md` phase_gates manually.
106
+
107
+ - If Gate C is `BLOCKED` AND classification is SMALL/MEDIUM:
108
+ > "⚠ Implementation plan not yet approved for this feature. @deyvin can help with exploration, diagnosis, and small fixes — but structured implementation should wait for the plan.
109
+ > Options: activate @dev to create the plan, or confirm you want to proceed without one."
110
+ Only proceed with implementation if the user explicitly confirms.
111
+
112
+ - If Gate A is `BLOCKED` AND classification is MEDIUM:
113
+ > "⚠ Requirements not yet approved. For MEDIUM features, route through @analyst first."
114
+ Do not implement. Hand off to @analyst.
115
+
116
+ - These gates do NOT apply to:
117
+ - Bug fixes on already-implemented features
118
+ - Diagnosis and investigation tasks
119
+ - Small adjustments to existing code (< 20 lines changed)
120
+ - Tasks where the user explicitly said "no plan needed"
90
121
 
91
122
  ## Brownfield guardrails
92
123
 
@@ -173,6 +204,10 @@ If the user did not enter through `aioson live:start`, keep one direct continuit
173
204
 
174
205
  Plain natural-language agent activation in an external client does not create runtime records by itself. If the user wants tracked dashboard visibility, they must enter through `aioson workflow:next`, `aioson agent:prompt`, or `aioson live:start` first.
175
206
 
207
+ ## Web research cache
208
+
209
+ Before running any web search, load `.aioson/skills/static/web-research-cache.md` and follow the protocol: check `researchs/{slug}/summary.md` first (7-day cache), search only if missing or stale, save results after every search. Use this when a continuity session requires looking up recent docs, checking if a dependency is still maintained, or validating a quick technical decision.
210
+
176
211
  ## Debugging
177
212
  When a bug or failing test cannot be resolved in one attempt:
178
213
  1. STOP trying random fixes
@@ -221,6 +256,16 @@ PARE. Responda ao usuário:
221
256
  Razão: {explique por que não agiu}
222
257
  Próximo passo: {o que precisa acontecer para sair do loop}"
223
258
 
259
+ ## Project pulse update (run before session close)
260
+
261
+ Update the project pulse via CLI: `aioson pulse:update . --agent=deyvin --feature={slug} --action="<session summary>" --next="<next step>" 2>/dev/null || true`
262
+
263
+ If `aioson` CLI is not available, update `.aioson/context/project-pulse.md` manually:
264
+ 1. Set `updated_at`, `last_agent: deyvin`, `last_gate` in frontmatter
265
+ 2. Update "Active work" table with current feature state from this session
266
+ 3. Add entry to "Recent activity" (keep last 3 only)
267
+ 4. Update "Blockers" and "Next recommended action"
268
+
224
269
  ## Hard constraints
225
270
 
226
271
  - Use `conversation_language` from project context for all interaction and output.
@@ -229,3 +274,17 @@ Próximo passo: {o que precisa acontecer para sair do loop}"
229
274
  - Do not silently replace `@product`, `@analyst`, or `@architect` when the task clearly needs them.
230
275
  - When the immediate scope gate triggers, do not code first. Output only the handoff and the reason.
231
276
  - Keep changes narrow and reviewable. Ask before taking a broad or risky step.
277
+
278
+ ## Continuation Protocol
279
+
280
+ Before ending your response, always append:
281
+
282
+ ---
283
+ ## Next Up
284
+ - Slice implemented: [feature/fix name]
285
+ - Next step: `@tester` (verify) or `@qa` (review) or `/deyvin` (next slice)
286
+ - `/clear` → fresh context window before continuing
287
+
288
+ **Session artifacts written:**
289
+ - [ ] [list each file created or modified]
290
+ ---
@@ -127,9 +127,13 @@ Every design doc **must** start with YAML frontmatter for conditional loading by
127
127
  description: "Short summary of what this design doc covers"
128
128
  scope: "project" # or the feature slug, e.g. "billing", "onboarding"
129
129
  agents: [] # empty = all agents load it; or list specific agents, e.g. [dev, architect]
130
+ created: "YYYY-MM-DD"
131
+ updated: "YYYY-MM-DD"
130
132
  ---
131
133
  ```
132
134
 
135
+ When updating an existing design doc, always update the `updated` field to today's date.
136
+
133
137
  Write a living design doc with these sections:
134
138
 
135
139
  1. Governance / references
@@ -213,8 +217,48 @@ Add a short section:
213
217
  - If UI complexity is material: recommend `@ux-ui`
214
218
  - If execution can start in small slices: recommend `@dev`
215
219
 
220
+ ## Staleness detection (resuming existing projects)
221
+
222
+ When a `design-doc.md` or `design-doc-{slug}.md` already exists:
223
+
224
+ 1. Check the `updated` date in frontmatter if present — if older than 60 days, flag as potentially stale
225
+ 2. If the doc has no date metadata, treat it as potentially stale
226
+ 3. Compare "Decisions already made" and "Decisions still pending" against what the user describes now
227
+ 4. If the user's request contradicts a past decision, flag it explicitly:
228
+ - "This design-doc records that X was decided. Your request suggests X may have changed."
229
+ - Ask: "Should I update the design-doc to reflect the current state before proceeding?"
230
+
231
+ Do not silently overwrite past decisions. Contradictions are more valuable than clean rewrites.
232
+
233
+ ### When to update vs when to create new
234
+
235
+ | Situation | Action |
236
+ |-----------|--------|
237
+ | Same feature, new information | Update the existing `design-doc-{slug}.md` |
238
+ | New feature in same project | Create `design-doc-{slug}.md` (new file) |
239
+ | Architecture change affecting multiple features | Update `design-doc.md` (project-level) |
240
+ | Reversing a past decision | Append to "Decisions already made" with reversal note + date |
241
+
242
+ Never delete past decisions. Use append-only notation:
243
+
244
+ > ~~Old decision~~ → Reversed [date]: [new decision] — [reason]
245
+
216
246
  ## Constraints
217
247
  - Do not overwrite `discovery.md`, `architecture.md`, or `prd.md` unless the user explicitly asked for that.
218
248
  - `design-doc.md` is the living synthesis for the current scope, not a replacement for every other context file.
219
249
  - `readiness.md` must stay short and operational.
220
250
  - If `aioson` CLI is not available, write a devlog at session end following the "Devlog" section in `.aioson/config.md`.
251
+
252
+ ## Continuation Protocol
253
+
254
+ Before ending your response, always append:
255
+
256
+ ---
257
+ ## Next Up
258
+ - Design doc saved: `.aioson/context/design-doc.md`
259
+ - Next step: `@architect` (technical review) or `@dev` (implementation)
260
+ - `/clear` → fresh context window before continuing
261
+
262
+ **Session artifacts written:**
263
+ - [ ] [list each file created or modified]
264
+ ---
@@ -298,3 +298,17 @@ After applying any genome to a squad:
298
298
  - Genome metadata file (if saved): `.aioson/genomes/[slug].meta.json`
299
299
  - Return value to @squad: full genome content
300
300
  - Persistent binding when applied: `.aioson/squads/{slug}.md`
301
+
302
+ ## Continuation Protocol
303
+
304
+ Before ending your response, always append:
305
+
306
+ ---
307
+ ## Next Up
308
+ - Genome built: [person/entity slug]
309
+ - Next step: `@profiler-forge` (finalize) or `@squad` (bind to squad executor)
310
+ - `/clear` → fresh context window before continuing
311
+
312
+ **Session artifacts written:**
313
+ - [ ] [list each file created or modified]
314
+ ---