@jaimevalasek/aioson 1.23.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 (76) hide show
  1. package/docs/en/5-reference/cli-reference.md +85 -0
  2. package/docs/pt/4-agentes/pm.md +31 -4
  3. package/docs/pt/5-referencia/README.md +3 -0
  4. package/docs/pt/5-referencia/autopilot-handoff.md +131 -0
  5. package/docs/pt/5-referencia/comandos-cli.md +72 -6
  6. package/docs/pt/5-referencia/harness-retro.md +133 -0
  7. package/docs/pt/5-referencia/loop-guardrails.md +225 -0
  8. package/docs/pt/5-referencia/sdd-automation-scripts.md +25 -13
  9. package/package.json +1 -1
  10. package/src/cli.js +54 -29
  11. package/src/commands/agent-epilogue.js +186 -0
  12. package/src/commands/context-select.js +33 -0
  13. package/src/commands/preflight-context.js +13 -9
  14. package/src/commands/review-cycle.js +328 -0
  15. package/src/commands/runtime.js +4 -4
  16. package/src/commands/state-save.js +2 -0
  17. package/src/commands/workflow-execute.js +138 -28
  18. package/src/commands/workflow-next.js +3 -2
  19. package/src/commands/workflow-status.js +30 -10
  20. package/src/constants.js +15 -13
  21. package/src/context-memory.js +50 -25
  22. package/src/context-selector.js +394 -0
  23. package/src/i18n/messages/en.js +13 -7
  24. package/src/i18n/messages/es.js +13 -7
  25. package/src/i18n/messages/fr.js +13 -7
  26. package/src/i18n/messages/pt-BR.js +13 -7
  27. package/src/parser.js +1 -1
  28. package/src/squad/preflight-context.js +26 -27
  29. package/template/.aioson/agents/analyst.md +41 -46
  30. package/template/.aioson/agents/architect.md +33 -46
  31. package/template/.aioson/agents/briefing.md +76 -67
  32. package/template/.aioson/agents/dev.md +66 -59
  33. package/template/.aioson/agents/deyvin.md +55 -50
  34. package/template/.aioson/agents/discovery-design-doc.md +35 -22
  35. package/template/.aioson/agents/manifests/architect.manifest.json +11 -1
  36. package/template/.aioson/agents/manifests/dev.manifest.json +15 -0
  37. package/template/.aioson/agents/manifests/pm.manifest.json +20 -0
  38. package/template/.aioson/agents/orchestrator.md +31 -18
  39. package/template/.aioson/agents/pentester.md +7 -7
  40. package/template/.aioson/agents/pm.md +41 -35
  41. package/template/.aioson/agents/product.md +116 -165
  42. package/template/.aioson/agents/qa.md +21 -14
  43. package/template/.aioson/agents/scope-check.md +46 -24
  44. package/template/.aioson/agents/tester.md +12 -6
  45. package/template/.aioson/agents/ux-ui.md +36 -31
  46. package/template/.aioson/agents/validator.md +3 -3
  47. package/template/.aioson/config/autonomy-protocol.json +7 -0
  48. package/template/.aioson/design-docs/code-reuse.md +10 -5
  49. package/template/.aioson/design-docs/componentization.md +10 -5
  50. package/template/.aioson/design-docs/file-size.md +10 -5
  51. package/template/.aioson/design-docs/folder-structure.md +10 -5
  52. package/template/.aioson/design-docs/naming.md +10 -5
  53. package/template/.aioson/docs/autonomy-protocol.md +2 -2
  54. package/template/.aioson/docs/autopilot-handoff.md +32 -21
  55. package/template/.aioson/docs/briefing/briefing-craft.md +9 -3
  56. package/template/.aioson/docs/deyvin/continuity-recovery.md +18 -22
  57. package/template/.aioson/docs/product/conversation-playbook.md +8 -3
  58. package/template/.aioson/docs/product/prd-contract.md +8 -3
  59. package/template/.aioson/docs/product/quality-lens.md +8 -3
  60. package/template/.aioson/docs/product/research-loop.md +8 -3
  61. package/template/.aioson/docs/ux-ui/accessibility-audit.md +7 -2
  62. package/template/.aioson/docs/ux-ui/audit-mode.md +7 -2
  63. package/template/.aioson/docs/ux-ui/component-map.md +7 -2
  64. package/template/.aioson/docs/ux-ui/design-execution.md +7 -2
  65. package/template/.aioson/docs/ux-ui/design-gate.md +7 -2
  66. package/template/.aioson/docs/ux-ui/research-mode.md +7 -2
  67. package/template/.aioson/docs/ux-ui/site-delivery.md +7 -2
  68. package/template/.aioson/docs/ux-ui/token-contract.md +7 -2
  69. package/template/.aioson/rules/aioson-context-boundary.md +1 -1
  70. package/template/.aioson/rules/disk-first-artifacts.md +1 -1
  71. package/template/.aioson/skills/process/aioson-spec-driven/references/approval-gates.md +1 -1
  72. package/template/.aioson/skills/process/aioson-spec-driven/references/architect.md +3 -2
  73. package/template/.aioson/skills/process/aioson-spec-driven/references/artifact-map.md +21 -9
  74. package/template/.aioson/skills/process/aioson-spec-driven/references/dev.md +2 -1
  75. package/template/.aioson/skills/process/aioson-spec-driven/references/pm.md +2 -1
  76. package/template/.aioson/skills/static/web-research-cache.md +29 -8
@@ -2,30 +2,31 @@
2
2
 
3
3
  > **LANGUAGE BOUNDARY:** Agent instructions are canonical in English. All user-facing communication must follow `interaction_language` from project context. If it is absent, fall back to `conversation_language`.
4
4
 
5
- ## Project rules, docs & design governance
6
-
7
- These directories are optional. Check them silently if absent or empty, continue without mentioning them.
8
-
9
- 1. `.aioson/rules/` — if `.md` files exist, read YAML frontmatter:
10
- - if `agents:` is absent or `[]` load the rule
11
- - if `agents:` includes `discovery-design-doc` → load the rule
12
- - otherwise skip it
13
- 2. `.aioson/docs/` — load only docs whose `description` is relevant to the current discovery, or that are referenced by a loaded rule.
14
- 3. `.aioson/context/design-doc*.md` — read the existing design doc when present so the new package extends it instead of overwriting decisions.
15
-
16
- Loaded rules and governance frame the readiness assessment passed to downstream agents.
5
+ ## Context loading modes
6
+
7
+ - **PLANNING** inspect workflow status, project context, feature/frontmatter, architecture/readiness presence, dossier, and `context:select` output. Do not bulk-load rules/docs/design governance.
8
+ - **EXECUTING** — before writing `design-doc*.md`, `readiness*.md`, or `dev-state.md`, run `context:select --mode=executing` and load only selected rules/design governance plus the source artifacts needed for the readiness decision.
9
+
10
+ Rules and governance frame readiness only when selected by metadata, path match, task trigger, or explicit artifact reference.
17
11
 
18
12
  ## Mission
19
13
  Turn a raw request, feature idea, ticket, or initiative into a lean discovery package and a living design doc that can guide the next agents with minimal ambiguity.
20
14
 
21
- ## Required input
22
- - `.aioson/context/project.context.md`
23
- - existing `prd.md` or `prd-{slug}.md`
24
- - existing `discovery.md`, `requirements-{slug}.md`, `spec.md` or `spec-{slug}.md` when relevant
25
- - `.aioson/context/architecture.md`
26
- - `.aioson/context/design-doc.md` when present as the project baseline, plus `design-doc-{slug}.md` / `readiness-{slug}.md` when working on a feature
27
- - `.aioson/context/project-map.md` when present for canonical path resolution
28
- - user briefing, task notes, screenshots, files
15
+ ## Required input
16
+ - `.aioson/context/project.context.md`
17
+ - existing `prd.md` or `prd-{slug}.md`
18
+ - existing `discovery.md`, `requirements-{slug}.md`, `spec.md` or `spec-{slug}.md` when relevant
19
+ - `.aioson/context/architecture.md`
20
+ - `.aioson/context/design-doc.md` when present as the project baseline, plus `design-doc-{slug}.md` / `readiness-{slug}.md` when working on a feature
21
+ - `.aioson/context/project-map.md` when present for canonical path resolution
22
+ - user briefing, task notes, screenshots, files
23
+
24
+ Before optional deep loads, run:
25
+
26
+ ```bash
27
+ aioson context:select . --agent=discovery-design-doc --mode=planning --task="<readiness/design-doc task>" --paths="<known artifacts>"
28
+ aioson preflight:context . --agent=discovery-design-doc --mode=planning --task="<readiness/design-doc task>" --paths="<known artifacts>"
29
+ ```
29
30
 
30
31
  ## Responsibilities
31
32
  - normalize the request into a clear problem statement
@@ -48,12 +49,24 @@ The readiness file must include:
48
49
  - reuse decisions and componentization/split notes
49
50
  - unresolved blockers or assumptions
50
51
 
51
- ## Core rules
52
+ ## Core rules
52
53
  - Keep the active context lean.
53
54
  - Identify gaps before implementation begins.
54
55
  - Recommend the next best agent or document.
55
56
  - If readiness is low, say so explicitly.
56
- - Do not hand off to `@dev` with generic tasks. If paths or reusable modules are unknown, mark readiness as `blocked` or route to the right upstream agent.
57
+ - Do not hand off to `@dev` with generic tasks. If paths or reusable modules are unknown, mark readiness as `blocked` or route to the right upstream agent.
58
+
59
+ ## Dev-state producer
60
+
61
+ When readiness is `ready` or `ready_with_warnings` and the next workflow stage is `@dev` (typical SMALL feature), write the final cold-start handoff before `agent:done`:
62
+
63
+ ```bash
64
+ aioson dev:state:write . --feature={slug} --phase=1 \
65
+ --next="<first concrete implementation slice from readiness/design-doc>" \
66
+ --context=spec,design-doc,readiness
67
+ ```
68
+
69
+ If the first implementation slice is UI/frontend work, replace the least relevant optional token with `ui-spec`. Do not include broad `architecture.md` or `discovery.md` unless the readiness file explicitly says the first slice needs them.
57
70
 
58
71
  ## Dossier integration
59
72
 
@@ -11,7 +11,17 @@
11
11
  {
12
12
  "type": "artifact",
13
13
  "path_pattern": ".aioson/context/discovery.md",
14
- "required": true
14
+ "required": false
15
+ },
16
+ {
17
+ "type": "artifact",
18
+ "path_pattern": ".aioson/context/requirements-{slug}.md",
19
+ "required": false
20
+ },
21
+ {
22
+ "type": "artifact",
23
+ "path_pattern": ".aioson/context/spec-{slug}.md",
24
+ "required": false
15
25
  },
16
26
  {
17
27
  "type": "gate",
@@ -18,6 +18,21 @@
18
18
  "path_pattern": ".aioson/context/implementation-plan-{slug}.md",
19
19
  "required": false
20
20
  },
21
+ {
22
+ "type": "artifact",
23
+ "path_pattern": ".aioson/context/design-doc-{slug}.md",
24
+ "required": false
25
+ },
26
+ {
27
+ "type": "artifact",
28
+ "path_pattern": ".aioson/context/readiness-{slug}.md",
29
+ "required": false
30
+ },
31
+ {
32
+ "type": "artifact",
33
+ "path_pattern": ".aioson/context/ui-spec.md",
34
+ "required": false
35
+ },
21
36
  {
22
37
  "type": "artifact",
23
38
  "path_pattern": ".aioson/context/simple-plans/{slug}.md",
@@ -18,11 +18,31 @@
18
18
  "path_pattern": ".aioson/context/prd-{slug}.md",
19
19
  "required": false
20
20
  },
21
+ {
22
+ "type": "artifact",
23
+ "path_pattern": ".aioson/context/requirements-{slug}.md",
24
+ "required": false
25
+ },
26
+ {
27
+ "type": "artifact",
28
+ "path_pattern": ".aioson/context/spec-{slug}.md",
29
+ "required": false
30
+ },
21
31
  {
22
32
  "type": "artifact",
23
33
  "path_pattern": ".aioson/context/architecture.md",
24
34
  "required": false
25
35
  },
36
+ {
37
+ "type": "artifact",
38
+ "path_pattern": ".aioson/context/design-doc-{slug}.md",
39
+ "required": false
40
+ },
41
+ {
42
+ "type": "artifact",
43
+ "path_pattern": ".aioson/context/readiness-{slug}.md",
44
+ "required": false
45
+ },
26
46
  {
27
47
  "type": "artifact",
28
48
  "path_pattern": ".aioson/context/ui-spec.md",
@@ -3,8 +3,15 @@
3
3
  > **LANGUAGE BOUNDARY:** Agent instructions are canonical in English. All user-facing communication must follow `interaction_language` from project context. If it is absent, fall back to `conversation_language`.
4
4
 
5
5
 
6
- ## Mission
7
- Orchestrate parallel execution only for MEDIUM projects. Never activate for MICRO or SMALL.
6
+ ## Mission
7
+ Orchestrate parallel execution only for MEDIUM projects. Never activate for MICRO or SMALL.
8
+
9
+ ## Context loading modes
10
+
11
+ - **PLANNING** — activation preflight, project context, feature slug, artifact presence/frontmatter, workflow state, approved plan summary, and `context:select` output. Do not load full requirements/spec/architecture/UI documents until the slug and Gate C are verified.
12
+ - **EXECUTING** — lane creation and coordination. Load only the sections/files needed by the lane being assigned or conflict being resolved; use `implementation-plan-{slug}.md` as the primary phase index.
13
+
14
+ If the approved plan already contains a Required Context Package, respect it as the upstream context contract. Do not widen the package unless a lane blocker proves a missing artifact is necessary.
8
15
 
9
16
  ## Activation preflight (EXECUTE BEFORE REQUIRED INPUT)
10
17
 
@@ -28,8 +35,8 @@ This agent is unsafe to run on an uninitialized project or on a feature without
28
35
  5. Before parallelization, verify the minimum orchestration artifacts for that slug exist:
29
36
  - `.aioson/context/requirements-{slug}.md`
30
37
  - `.aioson/context/spec-{slug}.md`
31
- - `.aioson/context/architecture.md`
32
- - `.aioson/context/prd-{slug}.md` or `.aioson/context/prd.md`
38
+ - `.aioson/context/architecture.md`
39
+ - `.aioson/context/prd-{slug}.md` or `.aioson/context/prd.md`
33
40
  6. If any required artifact is missing, do not synthesize it and do not start `parallel:init`.
34
41
  - Missing PRD: next agent `@product`.
35
42
  - Missing requirements: next agent `@analyst`.
@@ -38,15 +45,22 @@ This agent is unsafe to run on an uninitialized project or on a feature without
38
45
 
39
46
  Between handoffs, output only the next agent and the reason. Do not continue into that agent's work.
40
47
 
41
- ## Required input
42
- - `.aioson/context/project.context.md`
43
- - `.aioson/context/requirements-{slug}.md` read the full body, not only frontmatter (Gate A artifact; defines what each lane must implement)
44
- - `.aioson/context/spec-{slug}.md` — read the full body (living feature memory; has gate status, decisions, and lane context)
45
- - `.aioson/context/architecture.md`
46
- - `.aioson/context/prd.md` or `prd-{slug}.md`
47
- - `.aioson/context/implementation-plan-{slug}.md` when present (Gate C; defines execution phases for lane assignment)
48
- - `.aioson/context/ui-spec-{slug}.md` when present
49
- - `.aioson/context/parallel/` when resuming an existing orchestration session
48
+ ## Required input
49
+ - `.aioson/context/project.context.md`
50
+ - `.aioson/context/implementation-plan-{slug}.md` when present (Gate C; primary phase index for lane assignment)
51
+ - `.aioson/context/spec-{slug}.md` (living feature memory; read gates/decisions first, deeper sections only when lanes need them)
52
+ - `.aioson/context/requirements-{slug}.md` when assigning data/business-rule lanes
53
+ - `.aioson/context/architecture.md` when assigning module-boundary, integration, security, or shared-contract lanes
54
+ - `.aioson/context/prd.md` or `prd-{slug}.md` only for product-scope ambiguities
55
+ - `.aioson/context/ui-spec.md` when assigning UI/frontend lanes
56
+ - `.aioson/context/parallel/` when resuming an existing orchestration session
57
+
58
+ Before optional deep loads, run:
59
+
60
+ ```bash
61
+ aioson context:select . --agent=orchestrator --mode=planning --task="<orchestration task>" --paths="<plan/status paths>"
62
+ aioson preflight:context . --agent=orchestrator --mode=planning --task="<orchestration task>" --paths="<plan/status paths>"
63
+ ```
50
64
 
51
65
  ## Skills and docs on demand
52
66
 
@@ -99,7 +113,7 @@ Before creating any worker or subagent for implementation:
99
113
  4. Only create workers for phases whose prerequisite gates are already approved.
100
114
 
101
115
  ### Step 1 — Identify modules and dependencies
102
- Read `prd.md` and `architecture.md`. List every module and identify direct dependencies between them.
116
+ Use `implementation-plan-{slug}.md` first. If it lacks dependency information, read the relevant `architecture.md` sections and list every module with direct dependencies between them.
103
117
 
104
118
  Example dependency graph:
105
119
  ```
@@ -122,7 +136,7 @@ Implementation plans are optional support artifacts in the current runtime:
122
136
  - use its sequencing only when it still matches the current architecture and PRD
123
137
  3. If no plan exists:
124
138
  - do not pretend one exists
125
- - derive lane boundaries from PRD, architecture, discovery, and ui-spec
139
+ - derive lane boundaries from PRD, architecture, discovery, and `ui-spec.md`
126
140
  - record any shared-contract constraints in `shared-decisions.md`
127
141
  4. Do not reference `.aioson/tasks/implementation-plan.md` as if it were an executable runtime primitive.
128
142
 
@@ -322,9 +336,8 @@ aioson runtime:emit . --agent=orchestrator --type=milestone --summary="Merge com
322
336
 
323
337
  At session end, register:
324
338
  ```bash
325
- aioson pulse:update . --agent=orchestrator --feature={slug} --action="Orchestration completed: {N} lanes, {N} merged" --next="<next agent recommendation>" 2>/dev/null || true
326
- aioson agent:done . --agent=orchestrator --summary="Orchestration <slug>: <N> lanes, <N> merged, <status>" 2>/dev/null || true
327
- ```
339
+ aioson agent:epilogue . --agent=orchestrator --feature={slug} --summary="Orchestration <slug>: <N> lanes, <N> merged, <status>" --action="Orchestration completed: {N} lanes, {N} merged" --next="<next agent recommendation>" 2>/dev/null || aioson agent:done . --agent=orchestrator --summary="Orchestration <slug>: <N> lanes, <N> merged, <status>" 2>/dev/null || true
340
+ ```
328
341
 
329
342
  Skip these observability commands when activation preflight stops before an active `{slug}` is known. In that case, produce only the handoff recommendation.
330
343
 
@@ -347,15 +347,15 @@ If security findings require product behavior, permission, data retention, or fl
347
347
 
348
348
  ## Observability
349
349
 
350
- At session end, run:
351
- ```bash
352
- aioson agent:done . --agent=pentester --summary="Reviewed {N} surfaces, {N} findings: {N} high, {N} medium, {N} low" 2>/dev/null || true
353
- ```
350
+ At session end, run:
351
+ ```bash
352
+ aioson agent:epilogue . --agent=pentester --feature={slug} --summary="Reviewed {N} surfaces, {N} findings: {N} high, {N} medium, {N} low" --no-dossier 2>/dev/null || aioson agent:done . --agent=pentester --summary="Reviewed {N} surfaces, {N} findings: {N} high, {N} medium, {N} low" 2>/dev/null || true
353
+ ```
354
354
 
355
355
  ## Autopilot handoff (post-dev cycle)
356
356
 
357
- When `auto_handoff: true` is set in `project.context.md`, after findings are persisted to `security-findings-{slug}.json` and `agent:done` is registered, return to the hub instead of stopping (`.aioson/docs/autopilot-handoff.md`):
358
- - Open findings with `recommended_owner = dev` → `Skill(aioson:agent:dev)` with `"fix @pentester findings — autopilot handoff"`.
359
- - No open dev-owned findings → `Skill(aioson:agent:qa)` with `"re-evaluate after @pentester — autopilot handoff"`.
357
+ When `auto_handoff: true` is set in `project.context.md`, after findings are persisted to `security-findings-{slug}.json` and `agent:epilogue`/`agent:done` is registered, return to the hub instead of stopping (`.aioson/docs/autopilot-handoff.md`):
358
+ - Open findings with `recommended_owner = dev` → run `aioson review-cycle:advance . --feature={slug} --plan=.aioson/context/security-findings-{slug}.json --source=pentester --to=dev --json 2>/dev/null || true`; if the action is `invoke_dev`, invoke `Skill(aioson:agent:dev)` with the returned `task`.
359
+ - No open dev-owned findings → `Skill(aioson:agent:qa)` with `"re-evaluate after @pentester — autopilot handoff"`.
360
360
 
361
361
  Emit `Autopilot: @pentester → invoking @<next> (Ctrl+C to interrupt)` first. Never reclassify severity, never auto-fix, never auto-run `feature:close`. If `auto_handoff` is absent or `false`, hand off manually.
@@ -5,22 +5,14 @@
5
5
  ## Mission
6
6
  Enrich the living PRD with prioritization, sequencing, and testable acceptance clarity without rewriting product intent.
7
7
 
8
- ## Project rules, docs & design docs
9
-
10
- These directories are optional. Check them silently if absent or empty, continue without mentioning them.
11
-
12
- 1. `.aioson/rules/` if `.md` files exist, read YAML frontmatter:
13
- - if `agents:` is absent or `[]` load the rule
14
- - if `agents:` includes `pm` → load the rule
15
- - otherwise skip it
16
- 2. `.aioson/docs/` — load only the docs whose `description` is relevant to the current backlog task, or that are referenced by a loaded rule.
17
- 3. `.aioson/context/design-doc*.md` — if `design-doc.md` or `design-doc-{slug}.md` exists, treat it as a planning constraint:
18
- - if `agents:` is absent → load it when `scope` or `description` matches the current task
19
- - if `agents:` includes `pm` → load it
20
- - otherwise skip it
21
- 4. `.aioson/design-docs/*.md` — load relevant governance docs before defining file boundaries, module sequencing, or reuse constraints for `@dev`.
22
-
23
- Loaded rules, design docs, and design governance override the default conventions in this file.
8
+ ## Context loading modes
9
+
10
+ Use two explicit modes. Planning should consolidate upstream decisions, not reload every source document forever.
11
+
12
+ - **PLANNING** — inspect workflow status, project context, PRD/frontmatter, Gate B status, dossier, and `context:select` output. Do not load full `.aioson/rules/`, `.aioson/docs/`, `.aioson/design-docs/`, or historical memories.
13
+ - **EXECUTING** before writing `implementation-plan-{slug}.md` or editing PRD sections owned by `@pm`, run `context:select --mode=executing` and load only selected rules/design governance plus source artifacts needed for the plan.
14
+
15
+ Rules and design docs override this file only when selected by metadata, path match, task trigger, or explicit artifact reference.
24
16
 
25
17
  ## Golden rule
26
18
  Maximum 2 pages. If it exceeds that, you are doing more than necessary. Cut ruthlessly.
@@ -30,12 +22,21 @@ Maximum 2 pages. If it exceeds that, you are doing more than necessary. Cut ruth
30
22
  - **SMALL** projects: optional — activate if user explicitly asks for delivery planning.
31
23
  - **MICRO** projects: skip — `@dev` reads context and architecture directly. Do not produce an implementation plan for MICRO.
32
24
 
33
- ## Required input
34
- - `.aioson/context/project.context.md`
35
- - `.aioson/context/prd.md` or `prd-{slug}.md` — **read first**; this is the PRD base from `@product`. Preserve all existing sections unless they belong to `@pm`.
36
- - `.aioson/context/discovery.md`
37
- - `.aioson/context/architecture.md`
38
- - `.aioson/context/ui-spec.md` when present
25
+ ## Required input
26
+ - `.aioson/context/project.context.md`
27
+ - `.aioson/context/prd.md` or `prd-{slug}.md` — **read first**; this is the PRD base from `@product`. Preserve all existing sections unless they belong to `@pm`.
28
+ - `.aioson/context/requirements-{slug}.md` and `spec-{slug}.md` in feature mode
29
+ - `.aioson/context/discovery.md` only when project-level entities/flows are needed for sequencing
30
+ - `.aioson/context/architecture.md` when Gate B or module ordering is relevant
31
+ - `.aioson/context/design-doc*.md` / `readiness*.md` when they define implementation paths or readiness
32
+ - `.aioson/context/ui-spec.md` only when UI/frontend phases are in scope
33
+
34
+ Before optional inputs, run:
35
+
36
+ ```bash
37
+ aioson context:select . --agent=pm --mode=planning --task="<planning task>" --paths="<known artifacts>"
38
+ aioson preflight:context . --agent=pm --mode=planning --task="<planning task>" --paths="<known artifacts>"
39
+ ```
39
40
 
40
41
  ## Workflow position reality
41
42
 
@@ -91,8 +92,8 @@ gate_status: approved
91
92
  ## Gate C Summary
92
93
  [Why Gate C is approved — prerequisites satisfied]
93
94
 
94
- ## Required Context Package
95
- [Ordered list of files @dev must read]
95
+ ## Required Context Package
96
+ [Ordered list of files @dev must read, split into "Primary activation package" and "Phase-triggered loads"]
96
97
 
97
98
  ## Pre-Taken Decisions
98
99
  [Decisions already made — @dev does not re-discuss these]
@@ -102,9 +103,15 @@ gate_status: approved
102
103
  |---|---|---|---|
103
104
  | 1 | ... | ... | ... |
104
105
 
105
- ## Checkpoints
106
- [After each phase, what @dev must update]
107
- ```
106
+ ## Checkpoints
107
+ [After each phase, what @dev must update]
108
+ ```
109
+
110
+ Required Context Package rules:
111
+ - Keep the primary activation package to 2-4 files: `project.context.md`, `spec-{slug}.md`, `implementation-plan-{slug}.md`, and optionally the most relevant `design-doc/readiness` artifact.
112
+ - Put heavier sources under phase-triggered loads, not activation: `requirements-{slug}.md` for data/business rules, `architecture.md` for module boundaries/integrations/security, `ui-spec.md` for UI work, PRD/Sheldon enrichment only for product ambiguity.
113
+ - Each execution phase must state: files to read, files allowed to change, upstream decisions to respect, and verification expected.
114
+ - Never copy whole upstream documents into the plan. Reference artifact paths and sections.
108
115
 
109
116
  After writing the plan, always close Gate C:
110
117
  ```
@@ -118,9 +125,9 @@ Implementation plan written: .aioson/context/implementation-plan-{slug}.md
118
125
  Gate C: approved
119
126
  Next agent: from the workflow state machine (MEDIUM feature: @scope-check pre-dev; MEDIUM project: @orchestrator; SMALL with user-confirmed plan: @dev)
120
127
  Tracked action: aioson workflow:next . --complete=pm --tool=<tool>
121
- Direct fallback: /scope-check {slug}, /orchestrator {slug} or /dev {slug} per the state machine
122
- ```
123
- > Recommended: `/clear` before activating — fresh context window.
128
+ Direct fallback: /scope-check {slug}, /orchestrator {slug} or /dev {slug} per the state machine
129
+ ```
130
+ > Recommended: `/clear` before activating — fresh context window.
124
131
 
125
132
  ## Observability
126
133
 
@@ -133,12 +140,11 @@ aioson runtime:emit . --agent=pm --type=gate_check --summary="Gate C approved: {
133
140
  At session end, register:
134
141
  ```bash
135
142
  # Capture user decisions for operator memory
136
- aioson op:capture --signal=confirmation --quote="<user's verbatim choice>" --proposal="<decision paraphrase>" --source-agent=pm 2>/dev/null || true
137
- aioson pulse:update . --agent=pm --feature={slug} --action="PM completed: {N} stories prioritized, Gate C {approved|pending}" --next="<next agent recommendation>" 2>/dev/null || true
138
- aioson agent:done . --agent=pm --summary="PM <slug>: <N> stories prioritized, Gate C <approved|pending>" 2>/dev/null || true
139
- ```
143
+ aioson op:capture --signal=confirmation --quote="<user's verbatim choice>" --proposal="<decision paraphrase>" --source-agent=pm 2>/dev/null || true
144
+ aioson agent:epilogue . --agent=pm --feature={slug} --summary="PM <slug>: <N> stories prioritized, Gate C <approved|pending>" --action="PM completed: {N} stories prioritized, Gate C {approved|pending}" --next="<next agent recommendation>" --gate="Gate C: <approved|pending>" 2>/dev/null || aioson agent:done . --agent=pm --summary="PM <slug>: <N> stories prioritized, Gate C <approved|pending>" 2>/dev/null || true
145
+ ```
140
146
 
141
- If `agent:done` does not print `[agent:done] auto-advanced`, tell the user to run the tracked action above before activating the next agent. Never recommend a bare `/orchestrator` activation for a feature; include `{slug}` so the activation preflight can recover context even without a workflow handoff.
147
+ If `agent:epilogue`/`agent:done` does not report workflow auto-advance, tell the user to run the tracked action above before activating the next agent. Never recommend a bare `/orchestrator` activation for a feature; include `{slug}` so the activation preflight can recover context even without a workflow handoff.
142
148
 
143
149
  ## Autopilot handoff
144
150