@jaimevalasek/aioson 1.22.0 → 1.23.1

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 (88) hide show
  1. package/CHANGELOG.md +932 -919
  2. package/docs/en/5-reference/cli-reference.md +85 -0
  3. package/docs/pt/4-agentes/pm.md +31 -4
  4. package/docs/pt/5-referencia/README.md +3 -0
  5. package/docs/pt/5-referencia/autopilot-handoff.md +131 -0
  6. package/docs/pt/5-referencia/comandos-cli.md +72 -6
  7. package/docs/pt/5-referencia/harness-retro.md +133 -0
  8. package/docs/pt/5-referencia/loop-guardrails.md +225 -0
  9. package/docs/pt/5-referencia/sdd-automation-scripts.md +25 -13
  10. package/package.json +1 -1
  11. package/src/agents.js +1 -1
  12. package/src/cli.js +70 -29
  13. package/src/commands/agent-epilogue.js +186 -0
  14. package/src/commands/context-select.js +33 -0
  15. package/src/commands/harness-preview.js +74 -0
  16. package/src/commands/harness-retro.js +221 -0
  17. package/src/commands/preflight-context.js +13 -9
  18. package/src/commands/review-cycle.js +328 -0
  19. package/src/commands/runtime.js +4 -4
  20. package/src/commands/self-implement-loop.js +12 -2
  21. package/src/commands/state-save.js +2 -0
  22. package/src/commands/workflow-execute.js +138 -28
  23. package/src/commands/workflow-next.js +11 -2
  24. package/src/commands/workflow-status.js +30 -10
  25. package/src/constants.js +15 -13
  26. package/src/context-memory.js +50 -25
  27. package/src/context-selector.js +394 -0
  28. package/src/harness/preview-artifact.js +85 -0
  29. package/src/i18n/messages/en.js +34 -7
  30. package/src/i18n/messages/es.js +34 -7
  31. package/src/i18n/messages/fr.js +34 -7
  32. package/src/i18n/messages/pt-BR.js +34 -7
  33. package/src/lib/retro/retro-aggregate.js +192 -0
  34. package/src/lib/retro/retro-render.js +185 -0
  35. package/src/lib/retro/retro-sources.js +624 -0
  36. package/src/parser.js +1 -1
  37. package/src/squad/preflight-context.js +26 -27
  38. package/template/.aioson/agents/analyst.md +41 -46
  39. package/template/.aioson/agents/architect.md +33 -46
  40. package/template/.aioson/agents/briefing.md +76 -67
  41. package/template/.aioson/agents/dev.md +73 -55
  42. package/template/.aioson/agents/deyvin.md +55 -50
  43. package/template/.aioson/agents/discovery-design-doc.md +35 -22
  44. package/template/.aioson/agents/manifests/architect.manifest.json +11 -1
  45. package/template/.aioson/agents/manifests/dev.manifest.json +15 -0
  46. package/template/.aioson/agents/manifests/pm.manifest.json +20 -0
  47. package/template/.aioson/agents/orchestrator.md +31 -18
  48. package/template/.aioson/agents/pentester.md +12 -4
  49. package/template/.aioson/agents/pm.md +41 -35
  50. package/template/.aioson/agents/product.md +116 -165
  51. package/template/.aioson/agents/qa.md +44 -13
  52. package/template/.aioson/agents/scope-check.md +46 -24
  53. package/template/.aioson/agents/sheldon.md +13 -0
  54. package/template/.aioson/agents/tester.md +28 -5
  55. package/template/.aioson/agents/ux-ui.md +36 -31
  56. package/template/.aioson/agents/validator.md +10 -2
  57. package/template/.aioson/config/autonomy-protocol.json +7 -0
  58. package/template/.aioson/design-docs/code-reuse.md +10 -5
  59. package/template/.aioson/design-docs/componentization.md +10 -5
  60. package/template/.aioson/design-docs/file-size.md +10 -5
  61. package/template/.aioson/design-docs/folder-structure.md +10 -5
  62. package/template/.aioson/design-docs/naming.md +10 -5
  63. package/template/.aioson/docs/autonomy-protocol.md +2 -2
  64. package/template/.aioson/docs/autopilot-handoff.md +82 -34
  65. package/template/.aioson/docs/briefing/briefing-craft.md +9 -3
  66. package/template/.aioson/docs/deyvin/continuity-recovery.md +18 -22
  67. package/template/.aioson/docs/product/conversation-playbook.md +8 -3
  68. package/template/.aioson/docs/product/prd-contract.md +8 -3
  69. package/template/.aioson/docs/product/quality-lens.md +8 -3
  70. package/template/.aioson/docs/product/research-loop.md +8 -3
  71. package/template/.aioson/docs/ux-ui/accessibility-audit.md +7 -2
  72. package/template/.aioson/docs/ux-ui/audit-mode.md +7 -2
  73. package/template/.aioson/docs/ux-ui/component-map.md +7 -2
  74. package/template/.aioson/docs/ux-ui/design-execution.md +7 -2
  75. package/template/.aioson/docs/ux-ui/design-gate.md +7 -2
  76. package/template/.aioson/docs/ux-ui/research-mode.md +7 -2
  77. package/template/.aioson/docs/ux-ui/site-delivery.md +7 -2
  78. package/template/.aioson/docs/ux-ui/token-contract.md +7 -2
  79. package/template/.aioson/rules/aioson-context-boundary.md +11 -9
  80. package/template/.aioson/rules/disk-first-artifacts.md +1 -1
  81. package/template/.aioson/skills/process/aioson-spec-driven/references/approval-gates.md +1 -1
  82. package/template/.aioson/skills/process/aioson-spec-driven/references/architect.md +3 -2
  83. package/template/.aioson/skills/process/aioson-spec-driven/references/artifact-map.md +21 -9
  84. package/template/.aioson/skills/process/aioson-spec-driven/references/dev.md +2 -1
  85. package/template/.aioson/skills/process/aioson-spec-driven/references/pm.md +2 -1
  86. package/template/.aioson/skills/static/web-research-cache.md +29 -8
  87. package/template/AGENTS.md +1 -1
  88. package/template/CLAUDE.md +1 -1
@@ -4,25 +4,21 @@ description: "Deyvin continuity recovery — session start order, resumption rul
4
4
 
5
5
  # Deyvin Continuity Recovery
6
6
 
7
- Load this module at the start of every `@deyvin` session before touching code.
7
+ Load this module only when the task is continuity recovery, recent-work reconstruction, stale-state diagnosis, or resuming an existing slice.
8
8
 
9
9
  ## Session start order
10
10
 
11
- Build context in this order:
12
-
13
- 1. If `aioson` is available, run `aioson memory:summary . --last=5` as the fast continuity bootstrap
14
- 2. Read `.aioson/context/project.context.md`
15
- 3. Check `.aioson/rules/`; load universal rules and rules targeted at `deyvin`
16
- 4. Check `.aioson/docs/`; load docs referenced by rules or relevant to the task
17
- 5. If the task is specific, run `aioson context:pack . --agent=deyvin --goal="<task>"` and read the generated pack
18
- 6. Read `.aioson/context/memory-index.md` if present
19
- 7. Read `.aioson/context/spec-current.md` and `.aioson/context/spec-history.md` if present
20
- 8. Read `.aioson/context/spec.md` if present
21
- 9. Read `.aioson/context/features.md` if present; if a feature is in progress, also read `prd-{slug}.md`, `requirements-{slug}.md`, and `spec-{slug}.md`
22
- 10. Read `.aioson/context/skeleton-system.md`, `discovery.md`, and `architecture.md` as needed
23
- 11. When the task matches procedural tags, run `aioson brain:query . --tags=<tags> --min-quality=4`
24
- 12. Inspect recent runtime state in `.aioson/runtime/aios.sqlite` when memory summary is insufficient
25
- 13. Use Git only as a fallback after memory + runtime + rules/docs
11
+ Build context in this order:
12
+
13
+ 1. If `aioson` is available, run `aioson memory:summary . --last=5` as the fast continuity bootstrap.
14
+ 2. Read `.aioson/context/project.context.md`
15
+ 3. Run `aioson context:select . --agent=deyvin --mode=planning --task="<task>" --paths="<known paths>"`.
16
+ 4. Load only the selected PLANNING files. Do not load full `.aioson/rules/`, `.aioson/docs/`, `.aioson/design-docs/`, `discovery.md`, or `architecture.md` from this step alone.
17
+ 5. If a feature slug is known, load its dossier/spec only when `context:select`, `dev-state.md`, or `project-pulse.md` points to that slug; use `spec-current.md` for active spec and `spec-history.md` only for history.
18
+ 6. If code inspection/editing is about to start, run `aioson context:select . --agent=deyvin --mode=executing --task="<task>" --paths="<files to touch>"` and load only the selected EXECUTING files.
19
+ 7. When the task matches procedural tags, run `aioson brain:query . --tags=<tags> --min-quality=4`.
20
+ 8. Inspect recent runtime state in `.aioson/runtime/aios.sqlite` when memory summary is insufficient.
21
+ 9. Use Git only as a fallback after memory + runtime + selected rules/docs.
26
22
 
27
23
  If the user asks what happened recently, answer from memory and runtime first. Go to Git only if those sources are insufficient.
28
24
 
@@ -39,12 +35,12 @@ Do not duplicate or rewrite the shared SDD references inside `@deyvin`.
39
35
 
40
36
  ## Brownfield guardrails
41
37
 
42
- If `framework_installed=true` in `project.context.md` and the task depends on existing system behavior:
43
-
44
- - prefer `discovery.md` + `spec.md` as the primary memory pair
45
- - use `skeleton-system.md` or `memory-index.md` first for faster orientation
46
- - if `discovery.md` is missing but scan artifacts exist, stop and hand off to `@analyst`
47
- - if broad architecture decisions are required, hand off to `@architect`
38
+ If `framework_installed=true` in `project.context.md` and the task depends on existing system behavior:
39
+
40
+ - prefer selected module memory, `memory-index.md`, dossier, or spec before opening broad `discovery.md` / `architecture.md`
41
+ - use `skeleton-system.md` or `memory-index.md` first for faster orientation
42
+ - if `discovery.md` is missing but scan artifacts exist, stop and hand off to `@analyst`
43
+ - if broad architecture decisions are required, hand off to `@architect`
48
44
 
49
45
  ## Git fallback
50
46
 
@@ -1,6 +1,11 @@
1
- ---
2
- description: "Product conversation playbook — opening messages, batching rules, proactive triggers, conversation phases, and finalize/surprise handling."
3
- ---
1
+ ---
2
+ description: "Product conversation playbook — opening messages, batching rules, proactive triggers, conversation phases, and finalize/surprise handling."
3
+ agents: [product]
4
+ modes: [planning]
5
+ task_types: [product-conversation, product-intake, feature-definition, prd-scoping]
6
+ load_tier: trigger
7
+ triggers: [asking product questions, structured intake, broad product discovery, visual preferences, finalize conversation]
8
+ ---
4
9
 
5
10
  # Product Conversation Playbook
6
11
 
@@ -1,6 +1,11 @@
1
- ---
2
- description: "Product PRD contract — exact PRD structure, visual identity block, output paths, and next-step routing."
3
- ---
1
+ ---
2
+ description: "Product PRD contract — exact PRD structure, visual identity block, output paths, and next-step routing."
3
+ agents: [product]
4
+ modes: [executing]
5
+ task_types: [prd-writing, prd-finalization, output-contract, artifact-writing]
6
+ load_tier: trigger
7
+ triggers: [writing PRD, updating PRD, PRD contract, output path, next-step routing, visual identity]
8
+ ---
4
9
 
5
10
  # Product PRD Contract
6
11
 
@@ -1,6 +1,11 @@
1
- ---
2
- description: "Product quality lens — strong patterns, anti-pattern replacements, and a compact scorecard for higher-quality PRDs."
3
- ---
1
+ ---
2
+ description: "Product quality lens — strong patterns, anti-pattern replacements, and a compact scorecard for higher-quality PRDs."
3
+ agents: [product]
4
+ modes: [executing]
5
+ task_types: [prd-writing, prd-finalization, prd-review, quality-review]
6
+ load_tier: trigger
7
+ triggers: [writing PRD, updating PRD, finalize PRD, PRD quality, review scorecard]
8
+ ---
4
9
 
5
10
  # Product Quality Lens
6
11
 
@@ -1,6 +1,11 @@
1
- ---
2
- description: "Product research loop — extract short keyword phrases, consult research cache, search fresh sources, and fold the findings back into the PRD conversation."
3
- ---
1
+ ---
2
+ description: "Product research loop — extract short keyword phrases, consult research cache, search fresh sources, and fold the findings back into the PRD conversation."
3
+ agents: [product]
4
+ modes: [planning, executing]
5
+ task_types: [product-research, external-validation, market-scouting, competitor-research, product-patterns]
6
+ load_tier: trigger
7
+ triggers: [web search, research cache, market assumptions, competitor, pricing, compliance, time-sensitive UX, external evidence]
8
+ ---
4
9
 
5
10
  # Product Research Loop
6
11
 
@@ -1,6 +1,11 @@
1
1
  ---
2
- description: "UI/UX accessibility audit mode — WCAG-focused scan, remediation format, and QA handoff guidance for UI accessibility issues."
3
- ---
2
+ description: "UI/UX accessibility audit mode — WCAG-focused scan, remediation format, and QA handoff guidance for UI accessibility issues."
3
+ agents: [ux-ui]
4
+ modes: [planning, executing]
5
+ task_types: [accessibility, a11y, wcag, ui-audit]
6
+ load_tier: trigger
7
+ triggers: [a11y, accessibility, WCAG, screen reader, keyboard navigation, contrast]
8
+ ---
4
9
 
5
10
  # UX/UI Accessibility Audit
6
11
 
@@ -1,6 +1,11 @@
1
1
  ---
2
- description: "UI/UX audit mode — inventory scan, design quality checks, severity-based reporting, and fix recommendation format for existing UI."
3
- ---
2
+ description: "UI/UX audit mode — inventory scan, design quality checks, severity-based reporting, and fix recommendation format for existing UI."
3
+ agents: [ux-ui]
4
+ modes: [planning, executing]
5
+ task_types: [ui-audit, design-review, visual-qa]
6
+ load_tier: trigger
7
+ triggers: [audit, existing UI, design quality, visual QA, review UI]
8
+ ---
4
9
 
5
10
  # UX/UI Audit Mode
6
11
 
@@ -1,6 +1,11 @@
1
1
  ---
2
- description: "UI/UX component map mode — component inventory, atomic classification, variants, states, and gap analysis between spec and implementation."
3
- ---
2
+ description: "UI/UX component map mode — component inventory, atomic classification, variants, states, and gap analysis between spec and implementation."
3
+ agents: [ux-ui]
4
+ modes: [planning, executing]
5
+ task_types: [component-map, component-inventory, ui-components]
6
+ load_tier: trigger
7
+ triggers: [component-map, component inventory, variants, states, duplicate components]
8
+ ---
4
9
 
5
10
  # UX/UI Component Map
6
11
 
@@ -1,6 +1,11 @@
1
1
  ---
2
- description: "UI/UX design execution — entry check, refine-vs-rebuild routing, design intent, domain exploration, direction selection, and delivery quality rules."
3
- ---
2
+ description: "UI/UX design execution — entry check, refine-vs-rebuild routing, design intent, domain exploration, direction selection, and delivery quality rules."
3
+ agents: [ux-ui]
4
+ modes: [executing]
5
+ task_types: [ui-design, ui-spec-writing, refine-spec, visual-direction]
6
+ load_tier: trigger
7
+ triggers: [default-create, refine-spec, writing ui-spec, rebuild UI, existing UI]
8
+ ---
4
9
 
5
10
  # UX/UI Design Execution
6
11
 
@@ -1,6 +1,11 @@
1
1
  ---
2
- description: "UI/UX design gate — context repair, design skill selection, isolation rules, and style ambiguity handling before visual direction is chosen."
3
- ---
2
+ description: "UI/UX design gate — context repair, design skill selection, isolation rules, and style ambiguity handling before visual direction is chosen."
3
+ agents: [ux-ui]
4
+ modes: [planning, executing]
5
+ task_types: [ui-design, design-skill-selection, visual-direction]
6
+ load_tier: trigger
7
+ triggers: [design skill, visual direction, style ambiguity, project_type site, project_type web_app]
8
+ ---
4
9
 
5
10
  # UX/UI Design Gate
6
11
 
@@ -1,6 +1,11 @@
1
1
  ---
2
- description: "UI/UX research mode — visual benchmarking, domain patterns, anti-patterns, and directional hypotheses before design work begins."
3
- ---
2
+ description: "UI/UX research mode — visual benchmarking, domain patterns, anti-patterns, and directional hypotheses before design work begins."
3
+ agents: [ux-ui]
4
+ modes: [planning]
5
+ task_types: [ui-research, visual-benchmarking, domain-patterns]
6
+ load_tier: trigger
7
+ triggers: [research, benchmark, visual references, competitor UI, domain patterns]
8
+ ---
4
9
 
5
10
  # UX/UI Research Mode
6
11
 
@@ -1,6 +1,11 @@
1
1
  ---
2
- description: "UI/UX site delivery — landing-page composition rules, hero law, motion standards, copy expectations, CSS techniques, and final HTML structure."
3
- ---
2
+ description: "UI/UX site delivery — landing-page composition rules, hero law, motion standards, copy expectations, CSS techniques, and final HTML structure."
3
+ agents: [ux-ui]
4
+ modes: [executing]
5
+ task_types: [site-delivery, landing-page, static-html]
6
+ load_tier: trigger
7
+ triggers: [project_type site, landing page, marketing page, index.html, static site, full-page HTML]
8
+ ---
4
9
 
5
10
  # UX/UI Site Delivery
6
11
 
@@ -1,6 +1,11 @@
1
1
  ---
2
- description: "UI/UX token contract mode — extraction and normalization of design tokens for colors, spacing, typography, and semantic ownership."
3
- ---
2
+ description: "UI/UX token contract mode — extraction and normalization of design tokens for colors, spacing, typography, and semantic ownership."
3
+ agents: [ux-ui]
4
+ modes: [executing]
5
+ task_types: [design-tokens, token-contract, visual-system]
6
+ load_tier: trigger
7
+ triggers: [tokens, design tokens, colors, spacing, typography, visual system]
8
+ ---
4
9
 
5
10
  # UX/UI Token Contract
6
11
 
@@ -28,10 +28,11 @@ Allowed machine-readable exceptions:
28
28
  | Project configuration | `.aioson/config.md` |
29
29
  | Conformance schema | `.aioson/context/conformance-{slug}.yaml` ← machine-readable exception |
30
30
  | Security findings | `.aioson/context/security-findings-{slug}.json` ← machine-readable exception |
31
- | Workflow handoff/runtime state | `.aioson/context/workflow.state.json`, `.aioson/context/handoff-protocol.json`, `.aioson/context/last-handoff.json` |
32
- | Parallel coordination machine files | `.aioson/context/parallel/*.json` |
33
- | Simple implementation plans | `.aioson/context/simple-plans/{slug}.md` |
34
- | Squad definitions | `.aioson/squads/{slug}/` |
31
+ | Workflow handoff/runtime state | `.aioson/context/workflow.state.json`, `.aioson/context/handoff-protocol.json`, `.aioson/context/last-handoff.json` |
32
+ | Parallel coordination machine files | `.aioson/context/parallel/*.json` |
33
+ | Simple implementation plans | `.aioson/context/simple-plans/{slug}.md` |
34
+ | Retrospective dossier | `.aioson/context/retro/{slug}.md` (or `window-last-{N}.md`) ← harness:retro |
35
+ | Squad definitions | `.aioson/squads/{slug}/` |
35
36
  | Skill manifests | `.aioson/skills/{category}/{slug}/SKILL.md` |
36
37
  | Feature artifacts | `.aioson/context/{artifact}-{slug}.md` |
37
38
  | Project artifacts | `.aioson/context/{artifact}.md` |
@@ -43,13 +44,14 @@ project.context.md ← setup
43
44
  discovery.md ← analyst
44
45
  requirements-{slug}.md ← analyst
45
46
  architecture.md ← architect
46
- ui-spec-{slug}.md ← ux-ui
47
+ ui-spec.md / ui-spec-{slug}.md ← ux-ui (`ui-spec.md` is the current canonical runtime artifact)
47
48
  prd.md / prd-{slug}.md ← product
48
49
  spec-{slug}.md ← dev
49
- implementation-plan-{slug}.md ← pm
50
- simple-plans/{slug}.md ← dev / deyvin
51
- features.md product / pm
52
- project-pulse.md all agents (update at session end)
50
+ implementation-plan-{slug}.md ← pm
51
+ simple-plans/{slug}.md ← dev / deyvin
52
+ retro/{slug}.md harness:retro (retrospective dossier; window-last-{N}.md for windows)
53
+ features.md product / pm
54
+ project-pulse.md ← all agents (update at session end)
53
55
  conformance-{slug}.yaml ← conformance machine-readable exception
54
56
  security-findings-{slug}.json ← pentester/qa security findings exception
55
57
  workflow.state.json ← workflow runtime exception
@@ -18,7 +18,7 @@ Every artifact produced by an AIOSON agent MUST be written to disk before sessio
18
18
  | `@analyst` | Discovery | `.aioson/context/discovery.md` |
19
19
  | `@analyst` | Requirements | `.aioson/context/requirements-{slug}.md` |
20
20
  | `@architect` | Architecture | `.aioson/context/architecture.md` |
21
- | `@ux-ui` | UI Spec | `.aioson/context/ui-spec-{slug}.md` |
21
+ | `@ux-ui` | UI Spec | `.aioson/context/ui-spec.md` (current canonical; `ui-spec-{slug}.md` is accepted only when explicitly feature-scoped) |
22
22
  | `@sheldon` | Manifest | `.aioson/plans/{slug}/manifest.md` |
23
23
  | `@pm` | Implementation Plan | `.aioson/context/implementation-plan-{slug}.md` |
24
24
  | `@dev` | Feature spec | `.aioson/context/spec-{slug}.md` |
@@ -54,7 +54,7 @@ Required for the gate to pass:
54
54
  Required for the gate to pass:
55
55
  - [ ] Execution sequence is defined
56
56
  - [ ] Checkpoints are listed with criteria of done
57
- - [ ] Context package is listed (which files to read before each phase)
57
+ - [ ] Context package is listed as a short primary activation package plus phase-triggered loads (which files to read before each phase, and why)
58
58
  - [ ] Review / QA requirements are noted
59
59
  - [ ] Decisions marked "pre-taken" are FINAL — @dev does not re-discuss
60
60
 
@@ -19,5 +19,6 @@
19
19
 
20
20
  - Classification depth from `classification-map.md` controls whether `architecture.md` is required, selective, or skippable
21
21
  - Gate B is the handoff signal — @dev must not start implementation without Gate B passing (MEDIUM) or being explicitly waived (SMALL)
22
- - Decision rationale is mandatory for non-obvious choices — `approval-gates.md` Gate B checklist item applies
23
- - `design-doc*.md` is @architect's scope-specific decision document — see `artifact-map.md`
22
+ - Decision rationale is mandatory for non-obvious choices — `approval-gates.md` Gate B checklist item applies
23
+ - `design-doc*.md` is @architect's scope-specific decision document — see `artifact-map.md`
24
+ - `architecture.md` should include dev context triggers so @dev knows when to load architecture sections instead of reading the full file at activation
@@ -8,11 +8,12 @@
8
8
  prd*.md
9
9
  → sheldon-enrichment-{slug}.md (optional enrichment layer)
10
10
  → requirements-{slug}.md (entities, rules, ACs — @analyst)
11
- → spec-{slug}.md (feature memory — @analyst seeds, @dev fills)
12
- → architecture.md (tech decisions — @architect)
13
- design-doc*.md (scope-specific decisions — @architect)
14
- implementation-plan-{slug}.md (execution sequence — @pm for MEDIUM, AC-SDLC-15)
15
- spec-{slug}.md (updated) (living state during execution @dev)
11
+ → spec-{slug}.md (feature memory — @analyst seeds, @dev fills)
12
+ → architecture.md (tech decisions — @architect)
13
+ ui-spec.md (UI/UX contract — @ux-ui when UI is in scope)
14
+ design-doc*.md (scope-specific decisions — @architect)
15
+ implementation-plan-{slug}.md (execution sequence @pm for MEDIUM, AC-SDLC-15)
16
+ → spec-{slug}.md (updated) (living state during execution — @dev)
16
17
  ```
17
18
 
18
19
  ## Artifact ownership
@@ -26,13 +27,24 @@ prd*.md
26
27
  | `requirements-{slug}.md` | @analyst | — | @architect, @dev, @qa |
27
28
  | `spec-{slug}.md` | @analyst (skeleton) | @dev (execution state) | @dev, @deyvin, @qa |
28
29
  | `spec.md` | @dev | @dev | @dev, @deyvin |
29
- | `architecture.md` | @architect | — | @dev, @ux-ui |
30
- | `design-doc*.md` | @architect | — | @dev, @ux-ui |
31
- | `implementation-plan-{slug}.md` | @pm (MEDIUM, AC-SDLC-15) | — | @dev, @deyvin, @orchestrator |
30
+ | `architecture.md` | @architect | — | @dev, @ux-ui |
31
+ | `design-doc*.md` | @architect | — | @dev, @ux-ui |
32
+ | `ui-spec.md` | @ux-ui | — | @dev only for UI/frontend implementation, @pm/@orchestrator when UI phases exist |
33
+ | `implementation-plan-{slug}.md` | @pm (MEDIUM, AC-SDLC-15) | — | @dev, @deyvin, @orchestrator |
34
+
35
+ ## Dev context contract
36
+
37
+ `@dev` should not activate with the entire artifact chain loaded. The final pre-dev agent writes `dev-state.md` with a short primary package, and `implementation-plan-{slug}.md` carries phase-triggered loads:
38
+
39
+ - `requirements-{slug}.md` — data, rules, ACs, migrations, edge cases
40
+ - `architecture.md` — module boundaries, integrations, security, cross-cutting concerns
41
+ - `design-doc*.md` / `readiness*.md` — implementation paths, reuse decisions, readiness blockers
42
+ - `ui-spec.md` — UI components, frontend routes, interaction states, visual QA
43
+ - PRD / Sheldon enrichment — only for product ambiguity
32
44
 
33
45
  ## Naming conventions
34
46
 
35
- - Project-level artifacts: `prd.md`, `discovery.md`, `spec.md`, `architecture.md`
47
+ - Project-level artifacts: `prd.md`, `discovery.md`, `spec.md`, `architecture.md`, `ui-spec.md`
36
48
  - Feature-level artifacts: always use `{slug}` suffix — `prd-{slug}.md`, `requirements-{slug}.md`, `spec-{slug}.md`
37
49
  - Enrichment: `sheldon-enrichment.md` (project) or `sheldon-enrichment-{slug}.md` (feature)
38
50
  - Plans: `.aioson/plans/{slug}/manifest.md` + `plan-{slug-fase}.md` files
@@ -8,7 +8,7 @@
8
8
 
9
9
  - `maintenance-and-state.md` — use to write and update `spec-{slug}.md` correctly: `phase_gates`, `last_checkpoint`, `pending_review`, and `Key decisions` format
10
10
  - `approval-gates.md` — Gate C (plan approval) must be checked before executing a significant batch; Gate D (execution verification) defines done criteria for each phase
11
- - For SMALL/MEDIUM work, confirm `.aioson/context/design-doc.md` and `.aioson/context/readiness.md` were produced by `@discovery-design-doc` before implementation starts
11
+ - For SMALL/MEDIUM work, confirm `.aioson/context/design-doc*.md` and `.aioson/context/readiness*.md` were produced by `@discovery-design-doc` before implementation starts. Load them only when `dev-state.md`, readiness, the plan, or touched paths require their details.
12
12
 
13
13
  ### Load when starting a new feature with classification context
14
14
 
@@ -44,6 +44,7 @@ Additionally, at session start for SMALL/MEDIUM:
44
44
 
45
45
  - `spec-{slug}.md` must be updated at the end of every implementation session — see `maintenance-and-state.md` for format
46
46
  - Gate C from `approval-gates.md` means the implementation plan is locked — do not re-discuss pre-taken decisions
47
+ - Treat `dev-state.md` as the primary activation package and `implementation-plan-{slug}.md` as the source for phase-triggered context loads
47
48
  - Gate D verification must happen before marking a phase complete — not just "I think it works"
48
49
  - If `phase_gates.plan` is `pending` and classification is SMALL/MEDIUM, suggest generating an implementation plan before proceeding
49
50
  - If `design-doc.md` or `readiness.md` is missing for SMALL/MEDIUM, route to `@discovery-design-doc` instead of coding first
@@ -22,7 +22,8 @@
22
22
  ## Behavioral notes for @pm under SDD
23
23
 
24
24
  - @pm is the **Gate C owner** — the plan is not complete until `spec-{slug}.md` has `phase_gates.plan: approved` and `implementation-plan-{slug}.md` (if MEDIUM) has `status: approved`
25
- - Gate C is **blocking in MEDIUM** — @dev and @orchestrator must not execute without Gate C passing
25
+ - Gate C is **blocking in MEDIUM** — @dev and @orchestrator must not execute without Gate C passing
26
+ - The implementation plan's context package must stay short at activation and list phase-triggered loads separately; @dev should not need to re-read the whole artifact chain to start
26
27
  - Gate C is **informational in SMALL** — flag if the plan looks thin, but do not block
27
28
  - Gate C is **skipped in MICRO** — @dev reads prd.md directly; @pm does not run for MICRO
28
29
  - ACs produced by @pm must match or extend the ACs in `conformance-{slug}.yaml` when it exists — never contradict the analyst's behavioral contracts
@@ -26,11 +26,31 @@ Before running any WebSearch:
26
26
  4. If `searched_at` is within the last **7 days** → use the cached result, do not search again
27
27
  5. If older than 7 days or missing → proceed to search
28
28
 
29
- ## Step 2 — Run the search
30
-
31
- - Formulate the query including the **current year** so results are fresh
32
- - Maximum **4 queries per session** focus on the decisions with highest risk of being outdated
33
- - If WebSearch fails for a query: record the error in `summary.md` and continue do not block
29
+ ## Step 2 — Run the search
30
+
31
+ - Formulate the query including the **current year** when recency matters
32
+ - Prefer specific keyword phrases over broad prompts: user segment, domain noun, workflow, technology, pricing/compliance/risk term
33
+ - For technical/library decisions, prefer primary sources first: official docs, changelog/release notes, GitHub repo, standards, or vendor API reference
34
+ - For product/domain decisions, prefer sources that expose real patterns: official product docs, pricing pages, support docs, market reports, competitor docs, or credible case studies
35
+ - Open/extract the source pages before using them. Search result snippets are routing signals, not evidence.
36
+ - Run at most one query expansion pass if the first query returns weak results: add domain/source constraints, synonyms, or the concrete decision being evaluated
37
+ - Maximum **4 queries per session** — focus on decisions with highest risk of being outdated or materially wrong
38
+ - If WebSearch fails for a query: record the error in `summary.md` and continue — do not block
39
+
40
+ ## Search quality model
41
+
42
+ Good research is a pipeline, not a single search call:
43
+
44
+ 1. **Plan** — name the decision and what would change if the answer is different.
45
+ 2. **Search** — retrieve candidate sources.
46
+ 3. **Read/extract** — inspect the pages that actually support the finding.
47
+ 4. **Compress** — keep only source-grounded deltas that change options, risks, defaults, or open questions.
48
+
49
+ Optional provider guidance for future integrations:
50
+
51
+ - Agent/RAG search APIs such as Tavily, Exa, Firecrawl, or Brave can improve retrieval and extraction, especially when they return page content, highlights, or grounded answers.
52
+ - Open-source extraction tools such as Crawl4AI are useful when AIOSON needs self-hosted crawling/scraping.
53
+ - Do not make any provider mandatory in the core prompt. Use adapters behind the same cache contract so agents keep working with built-in web tools.
34
54
 
35
55
  ## Step 3 — Save results
36
56
 
@@ -106,9 +126,10 @@ If all findings are `confirmed`:
106
126
 
107
127
  ## Rules
108
128
 
109
- - **Never search without saving** — unsaved results are lost after the session
110
- - **Never block on search failure** — record the error and continue
111
- - **Never show `confirmed` findings** — they add noise without value
129
+ - **Never search without saving** — unsaved results are lost after the session
130
+ - **Never block on search failure** — record the error and continue
131
+ - **Never use snippets as final evidence** — inspect source pages or use cached summaries
132
+ - **Never show `confirmed` findings** — they add noise without value
112
133
  - **Never modify the PRD/plan without user confirmation** — surface findings, let the user decide
113
134
  - **Cache is shared across all agents** — if another agent already searched the same topic this week, use their result
114
135
  - `@product`, `@sheldon`, and `@squad` should derive short keyword phrases from the active task and scout the cache before finalizing substantial output
@@ -102,7 +102,7 @@ When running Codex directly (without `aioson workflow:next`), these rules apply:
102
102
  - For implementation requests (code changes, feature build, refactor, bugfix), default to workflow routing and execute via the next workflow stage agent (typically `@dev` after required upstream stages).
103
103
  - Exception: if the user explicitly activates `@deyvin` (or the compatibility alias `@pair`), it may work directly only as a continuity / pair-programming agent for existing known context and a small validated slice. If the request is a new project, greenfield build, new feature, broad redesign, vague or contradictory, or mixes product + UX + implementation scope, `@deyvin` must hand off immediately and must not code first.
104
104
  - Official workflow agents (`@setup`, `@product`, `@analyst`, `@scope-check`, `@architect`, `@ux-ui`, `@pm`, `@orchestrator`, `@dev`, `@qa`) must stay inside the workflow. Do not answer requests outside the current agent's scope.
105
- - Between agent handoffs, your ONLY valid output is: which agent is next and why. Do not continue into that agent's work. Single exception: when `auto_handoff: true` is set in `project.context.md`, the agents covered by `.aioson/docs/autopilot-handoff.md` auto-invoke the next agent's skill instead of stopping never past the `@dev` handoff.
105
+ - Between agent handoffs, your ONLY valid output is: which agent is next and why. Do not continue into that agent's work. Single exception: when `auto_handoff: true` is set in `project.context.md`, the agents covered by `.aioson/docs/autopilot-handoff.md` auto-invoke the next agent's skill instead of stopping. That chain stops before the first `@dev` activation (the human clears context and starts implementation) and resumes through the post-dev review cycle (`@dev` → `@qa` → `@tester`/`@pentester` when their `@qa` triggers fire → `@validator`); it never auto-runs `feature:close`/publish — those require explicit human approval.
106
106
  - If `project.context.md` is inconsistent, stale, or partially invalid, repair it inside the workflow when the correct value is objectively inferable from the active context and artifacts.
107
107
  - If a context field is still uncertain, route back to `@setup` inside the workflow instead of offering direct execution as a workaround.
108
108
  - Never silently bypass workflow after `@setup` or after collecting requirements.
@@ -103,7 +103,7 @@ When running Claude Code directly (without `aioson workflow:next`), these rules
103
103
  **Hard constraints — no exceptions:**
104
104
  - You MUST NEVER implement code, produce UI specs, write PRDs, or answer technical tasks outside an activated agent.
105
105
  - If the user explicitly activates `/deyvin` or `/pair`, it may act directly only for continuity on existing known context and a small validated slice. If the request is a new project, greenfield build, new feature, broad redesign, vague or contradictory, or mixes product + UX + implementation scope, `/deyvin` must hand off immediately and must not code first.
106
- - Between agent handoffs, your ONLY valid output is: which agent is next and why. Do not continue into that agent's work. Single exception: when `auto_handoff: true` is set in `project.context.md`, the agents covered by `.aioson/docs/autopilot-handoff.md` auto-invoke the next agent's skill instead of stopping never past the `@dev` handoff.
106
+ - Between agent handoffs, your ONLY valid output is: which agent is next and why. Do not continue into that agent's work. Single exception: when `auto_handoff: true` is set in `project.context.md`, the agents covered by `.aioson/docs/autopilot-handoff.md` auto-invoke the next agent's skill instead of stopping. That chain stops before the first `@dev` activation (the human clears context and starts implementation) and resumes through the post-dev review cycle (`@dev` → `@qa` → `@tester`/`@pentester` when their `@qa` triggers fire → `@validator`); it never auto-runs `feature:close`/publish — those require explicit human approval.
107
107
  - If the user sends an implementation request before setup is complete: do not implement. Tell them to activate `/setup` first.
108
108
  - If the user insists on bypassing an agent stage: refuse and redirect. Urgency or complexity do not override this rule.
109
109