@jaimevalasek/aioson 1.28.1 → 1.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +7 -5
  3. package/docs/en/5-reference/cli-reference.md +40 -10
  4. package/docs/pt/4-agentes/briefing.md +2 -0
  5. package/docs/pt/4-agentes/copywriter.md +2 -0
  6. package/docs/pt/4-agentes/genome.md +1 -0
  7. package/docs/pt/4-agentes/pm.md +1 -1
  8. package/docs/pt/4-agentes/profiler-enricher.md +2 -0
  9. package/docs/pt/4-agentes/profiler-forge.md +2 -0
  10. package/docs/pt/4-agentes/sheldon.md +2 -0
  11. package/docs/pt/4-agentes/squad.md +12 -10
  12. package/docs/pt/5-referencia/autopilot-handoff.md +4 -4
  13. package/docs/pt/5-referencia/comandos-cli.md +7 -3
  14. package/docs/pt/5-referencia/fluxo-artefatos.md +1 -1
  15. package/docs/pt/5-referencia/memoria-e-contexto.md +62 -2
  16. package/docs/pt/_arquivo/monitor-de-contexto.md +2 -2
  17. package/package.json +4 -2
  18. package/src/cli.js +72 -24
  19. package/src/commands/ac-test-audit.js +45 -0
  20. package/src/commands/artifact-validate.js +62 -50
  21. package/src/commands/classify.js +73 -2
  22. package/src/commands/context-brief.js +59 -0
  23. package/src/commands/context-guard.js +88 -0
  24. package/src/commands/context-monitor.js +1 -1
  25. package/src/commands/context-search.js +101 -52
  26. package/src/commands/context-select.js +11 -2
  27. package/src/commands/feature-archive.js +21 -12
  28. package/src/commands/feature-current.js +82 -0
  29. package/src/commands/gate-check.js +32 -15
  30. package/src/commands/harness-check.js +17 -1
  31. package/src/commands/hooks-install.js +169 -26
  32. package/src/commands/hygiene-scan.js +423 -0
  33. package/src/commands/rules-lint.js +124 -0
  34. package/src/commands/sdd-benchmark.js +134 -0
  35. package/src/commands/spec-analyze.js +6 -4
  36. package/src/commands/store-system.js +329 -49
  37. package/src/constants.js +8 -3
  38. package/src/context-brief.js +585 -0
  39. package/src/context-guard.js +209 -0
  40. package/src/context-search.js +796 -96
  41. package/src/context-selector.js +802 -420
  42. package/src/handoff-contract.js +14 -6
  43. package/src/harness/contract-schema.js +1 -1
  44. package/src/i18n/messages/en.js +12 -5
  45. package/src/i18n/messages/es.js +11 -4
  46. package/src/i18n/messages/fr.js +11 -4
  47. package/src/i18n/messages/pt-BR.js +12 -5
  48. package/src/lib/ac-test-audit.js +194 -0
  49. package/src/preflight-engine.js +10 -6
  50. package/src/squad/state-manager.js +1 -1
  51. package/template/.aioson/agents/analyst.md +93 -53
  52. package/template/.aioson/agents/architect.md +41 -32
  53. package/template/.aioson/agents/briefing-refiner.md +15 -2
  54. package/template/.aioson/agents/briefing.md +105 -86
  55. package/template/.aioson/agents/committer.md +1 -1
  56. package/template/.aioson/agents/copywriter.md +53 -10
  57. package/template/.aioson/agents/design-hybrid-forge.md +9 -5
  58. package/template/.aioson/agents/dev.md +22 -25
  59. package/template/.aioson/agents/deyvin.md +126 -124
  60. package/template/.aioson/agents/discover.md +8 -9
  61. package/template/.aioson/agents/discovery-design-doc.md +52 -36
  62. package/template/.aioson/agents/forge-run.md +3 -0
  63. package/template/.aioson/agents/genome.md +12 -6
  64. package/template/.aioson/agents/neo.md +30 -24
  65. package/template/.aioson/agents/orache.md +16 -21
  66. package/template/.aioson/agents/orchestrator.md +40 -31
  67. package/template/.aioson/agents/pentester.md +22 -12
  68. package/template/.aioson/agents/pm.md +11 -2
  69. package/template/.aioson/agents/product.md +162 -183
  70. package/template/.aioson/agents/profiler-enricher.md +29 -6
  71. package/template/.aioson/agents/profiler-forge.md +16 -6
  72. package/template/.aioson/agents/profiler-researcher.md +10 -6
  73. package/template/.aioson/agents/qa.md +29 -19
  74. package/template/.aioson/agents/scope-check.md +14 -2
  75. package/template/.aioson/agents/sheldon.md +51 -21
  76. package/template/.aioson/agents/site-forge.md +4 -6
  77. package/template/.aioson/agents/squad.md +7 -12
  78. package/template/.aioson/agents/tester.md +40 -30
  79. package/template/.aioson/agents/ux-ui.md +56 -41
  80. package/template/.aioson/agents/validator.md +2 -2
  81. package/template/.aioson/config.md +4 -3
  82. package/template/.aioson/design-docs/agent-loading-contract.md +3 -3
  83. package/template/.aioson/docs/LAYERS.md +2 -0
  84. package/template/.aioson/docs/autonomy-protocol.md +7 -5
  85. package/template/.aioson/docs/autopilot-handoff.md +5 -3
  86. package/template/.aioson/docs/dev/execution-discipline.md +3 -0
  87. package/template/.aioson/docs/dev/simple-plan-lane.md +126 -77
  88. package/template/.aioson/docs/dev/stack-conventions.md +4 -1
  89. package/template/.aioson/docs/deyvin/continuity-recovery.md +21 -18
  90. package/template/.aioson/docs/deyvin/debugging-escalation.md +3 -0
  91. package/template/.aioson/docs/deyvin/pair-execution.md +3 -0
  92. package/template/.aioson/docs/deyvin/runtime-handoffs.md +6 -3
  93. package/template/.aioson/docs/dossier/agent-templates.md +3 -0
  94. package/template/.aioson/docs/dossier/schema.md +3 -0
  95. package/template/.aioson/docs/example-external-api-context.md +2 -0
  96. package/template/.aioson/docs/feature-expansion-taxonomy.md +53 -0
  97. package/template/.aioson/docs/handoff-persistence.md +95 -91
  98. package/template/.aioson/docs/pentester/app-playbooks.md +3 -0
  99. package/template/.aioson/docs/pentester/browser-dast-playbook.md +401 -398
  100. package/template/.aioson/docs/pentester/llm-supplychain.md +3 -0
  101. package/template/.aioson/docs/product/conversation-playbook.md +1 -1
  102. package/template/.aioson/docs/quality/code-health-analysis.md +2 -0
  103. package/template/.aioson/docs/sheldon/enrichment-paths.md +47 -1
  104. package/template/.aioson/docs/sheldon/harness-contract.md +26 -21
  105. package/template/.aioson/docs/sheldon/quality-lens.md +3 -0
  106. package/template/.aioson/docs/sheldon/research-loop.md +3 -0
  107. package/template/.aioson/docs/sheldon/web-intelligence.md +3 -0
  108. package/template/.aioson/docs/site-forge-build.md +4 -2
  109. package/template/.aioson/docs/site-forge-extraction.md +2 -0
  110. package/template/.aioson/docs/site-forge-qa.md +2 -0
  111. package/template/.aioson/docs/site-forge-recon.md +7 -5
  112. package/template/.aioson/docs/site-forge-transform.md +2 -0
  113. package/template/.aioson/docs/squad/content-output.md +3 -0
  114. package/template/.aioson/docs/squad/creation-flow.md +22 -1
  115. package/template/.aioson/docs/squad/domain-breadth.md +3 -0
  116. package/template/.aioson/docs/squad/domain-classification.md +3 -0
  117. package/template/.aioson/docs/squad/eval-gate.md +3 -0
  118. package/template/.aioson/docs/squad/genome-bindings.md +14 -0
  119. package/template/.aioson/docs/squad/package-contract.md +5 -0
  120. package/template/.aioson/docs/squad/persona-grounding.md +65 -62
  121. package/template/.aioson/docs/squad/quality-lens.md +3 -0
  122. package/template/.aioson/docs/squad/research-loop.md +3 -0
  123. package/template/.aioson/docs/squad/session-operations.md +3 -0
  124. package/template/.aioson/docs/squad/workflow-quality.md +3 -0
  125. package/template/.aioson/docs/tester/coverage-quality.md +4 -1
  126. package/template/.aioson/docs/ux-ui/design-execution.md +9 -7
  127. package/template/.aioson/rules/README.md +48 -2
  128. package/template/.aioson/rules/agent-language-policy.md +26 -21
  129. package/template/.aioson/rules/agent-structural-contract.md +168 -158
  130. package/template/.aioson/rules/aioson-context-boundary.md +7 -1
  131. package/template/.aioson/rules/canonical-path-contract.md +16 -10
  132. package/template/.aioson/rules/data-format-convention.md +17 -11
  133. package/template/.aioson/rules/disk-first-artifacts.md +12 -8
  134. package/template/.aioson/rules/example-monetary-values.md +4 -0
  135. package/template/.aioson/rules/implementation-structure-and-data-access.md +50 -0
  136. package/template/.aioson/rules/output-brevity.md +2 -0
  137. package/template/.aioson/rules/prd-section-ownership.md +17 -12
  138. package/template/.aioson/rules/security-baseline.md +8 -3
  139. package/template/.aioson/rules/simple-plan-lane.md +22 -5
  140. package/template/.aioson/rules/source-code-language-convention.md +34 -0
  141. package/template/.aioson/rules/spec-level-ownership.md +10 -5
  142. package/template/.aioson/rules/squad-driver-pattern.md +5 -0
  143. package/template/.aioson/skills/process/aioson-spec-driven/references/artifact-map.md +24 -23
  144. package/template/.aioson/skills/process/aioson-spec-driven/references/classification-map.md +4 -0
  145. package/template/.aioson/skills/process/aioson-spec-driven/references/dev.md +2 -2
  146. package/template/.aioson/skills/process/aioson-spec-driven/references/qa.md +1 -1
  147. package/template/.aioson/skills/process/briefing-expansion-scout/SKILL.md +72 -0
  148. package/template/.aioson/skills/process/product-scope-expansion/SKILL.md +74 -0
  149. package/template/.aioson/skills/process/sheldon-expansion-audit/SKILL.md +67 -0
  150. package/template/.aioson/skills/static/context-budget-guide.md +1 -1
  151. package/template/.aioson/skills/static/multi-agent-patterns.md +5 -4
  152. package/template/.aioson/tasks/squad-create.md +11 -0
  153. package/template/.aioson/tasks/squad-design.md +3 -3
  154. package/template/AGENTS.md +36 -19
  155. package/template/CLAUDE.md +9 -5
@@ -16,11 +16,14 @@ You do NOT research or analyze. You synthesize, structure, and format.
16
16
  ## Required input
17
17
 
18
18
  - `.aioson/profiler-reports/{slug}/enriched-profile.md` — the consolidated cognitive profile, read in Step 1 (prior-agent output: `@profiler-enricher`)
19
- - `.aioson/profiler-reports/*` (Multi-persona Hybrid mode) — other enriched profiles to fuse (Step 3C)
20
- - `.aioson/squads/*` (apply-to-squad mode) — the target squad whose genome bindings get updated (Step 4)
21
- - `.aioson/context/project.context.md` (if present) — `interaction_language` for user-facing communication
22
-
23
- ## Activation
19
+ - `.aioson/profiler-reports/*` (Multi-persona Hybrid mode) — other enriched profiles to fuse (Step 3C)
20
+ - `.aioson/squads/*` (apply-to-squad mode) — the target squad whose genome bindings get updated (Step 4)
21
+ - `.aioson/context/project.context.md` (if present) — `interaction_language` for user-facing communication
22
+
23
+ ## Context discovery
24
+ Before artifact generation, run `aioson context:search . --query="<profile forge>" --agent=profiler-forge --mode=planning --paths=".aioson/profiler-reports/{slug}/enriched-profile.md,.aioson/squads" --json 2>/dev/null || true`; hits are hints. Load enriched profiles and target squads explicitly; use selected optional rules/docs only when they change output constraints.
25
+
26
+ ## Activation
24
27
  1. Direct: `@profiler-forge [person-slug]`
25
28
  2. Sequential: after `@profiler-enricher`
26
29
 
@@ -96,6 +99,11 @@ Required sections:
96
99
  - `## Heuristicas`
97
100
  - `## Frameworks`
98
101
  - `## Metodologias`
102
+ - `## Operating Procedure`
103
+ - `## Output Structure`
104
+ - `## Style Metrics`
105
+ - `## Prohibitions`
106
+ - `## Delivery Checklist`
99
107
  - `## Mentes`
100
108
  - `## Skills`
101
109
  - `## Perfil Cognitivo`
@@ -111,6 +119,7 @@ Generation rules:
111
119
  - `Estilo de Comunicacao` captures tone, persuasion, structure, and signature expressions
112
120
  - `Vieses e Pontos Cegos` captures bias patterns, error modes, and compensations
113
121
  - `Trait Interactions` translates the MPD patterns from the enriched profile into behavioral implications for the genome user — each pattern becomes an actionable note: "When this agent does X, expect Y because of [trait combination]"
122
+ - `Operating Procedure`, `Output Structure`, `Style Metrics`, `Prohibitions`, and `Delivery Checklist` come from the enriched profile `## Operational Method` — encode the method as numbered executable steps and checkable rules, never as descriptions. A persona genome without an Operating Procedure simulates opinions, not work. When the profile lacks a documented method, mark these sections `inferred` (with rationale) rather than omitting them.
114
123
  - every major section must reference evidence
115
124
  - include a confidence disclaimer because the profile is inferred
116
125
 
@@ -212,7 +221,8 @@ Before ending your response, always append:
212
221
  ## Next Up
213
222
  - Genome and advisor built: `{slug}`
214
223
  - Next step: `@qa` (review) or bind to squad executor via `@squad`
215
- - `/clear` → fresh context window before continuing
224
+ - `/compact` → recommended before continuing the same profile workflow
225
+ - `/clear` → use only for a hard reset, profile switch, polluted context, or security-sensitive reset
216
226
 
217
227
  **Session artifacts written:**
218
228
  - [ ] [list each file created or modified]
@@ -14,11 +14,14 @@ You do NOT analyze, infer psychometrics, or generate a genome. You ONLY research
14
14
 
15
15
  - The target person's full name and context (e.g., Stefan Georgi — direct response copywriter) — the only mandatory input
16
16
  - Primary domain of interest — which aspect of the person to capture
17
- - Known sources (optional) — links, books, talks, files, or notes the user already has
18
- - Report language — `en` / `pt-BR` / `es` / `fr`
19
- - `.aioson/context/project.context.md` (if present) — `interaction_language` for user-facing communication
20
-
21
- ## Activation
17
+ - Known sources (optional) — links, books, talks, files, or notes the user already has
18
+ - Report language — `en` / `pt-BR` / `es` / `fr`
19
+ - `.aioson/context/project.context.md` (if present) — `interaction_language` for user-facing communication
20
+
21
+ ## Context discovery
22
+ Before research planning, run `aioson context:search . --query="<person cognitive research>" --agent=profiler-researcher --mode=planning --paths=".aioson/profiler-reports,researchs" --json 2>/dev/null || true`; hits are hints. Reuse relevant local reports/cache before web search, but never invent evidence from a hit summary.
23
+
24
+ ## Activation
22
25
  This agent is activated in two ways:
23
26
  1. Direct: `@profiler-researcher [person name]`
24
27
  2. Via redirect from `@genome` when `type: persona` is detected
@@ -283,7 +286,8 @@ Before ending your response, always append:
283
286
  ## Next Up
284
287
  - Research report saved: `.aioson/profiler-reports/{slug}/research-report.md`
285
288
  - Next step: `@profiler-enricher` (enrich with additional materials)
286
- - `/clear` → fresh context window before continuing
289
+ - `/compact` → recommended before continuing the same profile workflow
290
+ - `/clear` → use only for a hard reset, profile switch, polluted context, or security-sensitive reset
287
291
 
288
292
  **Session artifacts written:**
289
293
  - [ ] [list each file created or modified]
@@ -2,19 +2,24 @@
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
5
+ ## Activation guard
6
+
7
+ If activated without a feature slug or concrete review target: run `aioson context:select . --agent=qa --mode=planning --task="agent activation without concrete task"` when the CLI is available. If reading manually, read only `.aioson/context/project.context.md` + `.aioson/context/project-pulse.md`, report the current stage, ask what to review, and stop. Do not load PRDs, specs, bootstrap, or governance before that answer.
8
+
9
+ `project-pulse.md` is never resolved from the project root or `.aioson/project-pulse.md`; its canonical path is `.aioson/context/project-pulse.md`. If that exact file is missing, report the canonical path as missing instead of probing noncanonical locations.
6
10
 
7
- These directories are optional. Check them silently — if absent or empty, continue without mentioning them.
11
+ ## Context loading modes
8
12
 
9
- 1. `.aioson/rules/`if `.md` files exist, read YAML frontmatter:
10
- - if `agents:` is absent or `[]` → load the rule
11
- - if `agents:` includes `qa` → load the rule
12
- - otherwise skip it
13
- 2. `.aioson/docs/` — load only docs whose `description` is relevant to the current review task, or that are referenced by a loaded rule.
14
- 3. `.aioson/context/design-doc*.md` — load when `scope`, `description`, or `agents:` matches the current feature or review task.
15
- 4. `.aioson/design-docs/*.md` — load only when the implementation under review touches module boundaries, naming, reuse, or componentization. Treat loaded governance docs as review criteria.
13
+ Load context with one call — `context:brief` composes precision selection + broad recall + constraints:
16
14
 
17
- Loaded rules and governance override the default conventions in this file. This fallback applies even when the `aioson` CLI is unavailable.
15
+ ```bash
16
+ aioson context:brief . --agent=qa --mode=planning --task="<review task>" --paths="<feature artifacts>" --json 2>/dev/null || true
17
+ aioson context:brief . --agent=qa --mode=executing --task="<review task>" --paths="<files under review>" --json 2>/dev/null || true
18
+ ```
19
+
20
+ Load `must_load` (precision gate); treat `related` as recall hints (history/archive `select` cannot see); apply `constraints`/`forbidden_patterns`; check `gaps`. **PLANNING** scopes the review; **EXECUTING** loads selected rules/docs/governance before reviewing — treat loaded governance as review criteria.
21
+
22
+ If the CLI is unavailable, read frontmatter first and load only `.aioson/rules/`, `.aioson/docs/`, `.aioson/context/design-doc*.md`, and `.aioson/design-docs/*.md` files whose `agents`, `modes`, `task_types`, `triggers`, `scope`, or `description` match the current review. Never scan folders wholesale. Loaded rules and governance override the default conventions in this file.
18
23
 
19
24
  ## Mission
20
25
  Evaluate production risk and implementation quality with objective, actionable findings.
@@ -53,6 +58,9 @@ Run the full review process scoped to this feature only. After all Critical/High
53
58
  Proceed with the standard required input below.
54
59
 
55
60
  ## Required input
61
+
62
+ Load each item at the step that needs it — never all upfront (see **Activation guard**):
63
+
56
64
  - `.aioson/context/project.context.md`
57
65
  - `.aioson/context/discovery.md`
58
66
  - `.aioson/context/prd.md` (if present — use acceptance criteria as test targets)
@@ -180,7 +188,7 @@ When AIOSON CLI is available and feature mode is MEDIUM, prefer the tracked invo
180
188
  ## Review process
181
189
  1. **Map AC items** from `prd.md` — mark each: covered / partial / missing.
182
190
  2. **Risk-first review** — work through checklist by category.
183
- 3. **Write missing tests** — for Critical/High findings, write the test. Do not just describe it.
191
+ 3. **Write missing tests** — for Critical/High findings, write the test. Do not just describe it. **AC→test floor (all classifications):** every AC marked `missing` or `partial` must get at least one test before the feature can close — write it for Critical/High, otherwise route the uncovered ACs to `@tester`. No AC ships with zero tests. Run `aioson ac:test-audit . --feature={slug}` and treat a failed audit as Gate D blocked evidence, not advisory prose.
184
192
  4. **Deliver report** — ordered by severity, each finding: location + risk + fix.
185
193
 
186
194
  > For deeper improvement analysis — coverage gaps, regression need, execution-chain, performance, componentization/maintainability — load the shared lens `.aioson/docs/quality/code-health-analysis.md` on demand (routes coverage→@tester, structure/perf→@architect).
@@ -344,7 +352,7 @@ Before running the standard review, check for `.aioson/context/security-findings
344
352
  **For direct LLM mode without CLI:**
345
353
  1. Use the checklist-only fallback; do not fabricate runtime events or claim the audit ran.
346
354
  2. Add an explicit note in the QA report that CLI/runtime telemetry was unavailable.
347
- 3. Mirror the same limitation in `project-pulse.md` so the next agent knows Gate D used fallback evidence.
355
+ 3. Mirror the same limitation in `.aioson/context/project-pulse.md` so the next agent knows Gate D used fallback evidence.
348
356
 
349
357
  **If the file exists:**
350
358
  1. Read the `review_contract` — confirm `scope_mode`, `evidence_policy`, and `findings_artifact_path` are present. If `target_mode = app_target`, also verify `target_scope` is explicit for on-demand reviews. If contract data is missing, flag as invalid contract and do not proceed with findings.
@@ -387,7 +395,7 @@ When QA is complete and all Critical and High findings are resolved:
387
395
  - Residual risks: [list or "none"]
388
396
  ```
389
397
 
390
- **2. Update `features.md`:**
398
+ **2. Update `.aioson/context/features.md`:**
391
399
  - Change status from `in_progress` to `done`.
392
400
  - Fill in the `completed` date.
393
401
  ```
@@ -433,7 +441,7 @@ You are encouraged to run `aioson` CLI commands via Bash to complete your stage
433
441
 
434
442
  ### When to run
435
443
  1. **After finishing QA review and writing all tests** — run `aioson workflow:next . --complete=qa`
436
- 2. **If Gate D (execution) is not approved** — ensure `spec-{slug}.md` contains a `## QA Sign-off` section with `**Verdict:** PASS`, then re-run the command
444
+ 2. **If Gate D (execution) is not approved** — ensure `spec-{slug}.md` contains a `## QA Sign-off` section with `**Verdict:** PASS`, run `aioson ac:test-audit . --feature={slug}` until it passes, then re-run the command
437
445
  3. **Before telling the user you are done** — always attempt to complete the stage via CLI first
438
446
 
439
447
  ### Commands you can run
@@ -453,15 +461,17 @@ aioson workflow:next .
453
461
  - **Do not claim the feature is done** if the CLI returns `[Handoff Contract BLOCKED]`
454
462
  - **If all Critical/High findings are resolved**, add the QA sign-off and complete the stage via CLI
455
463
 
456
- ## Path resolution
457
-
458
- - Before creating test files, check `.aioson/context/project-map.md` for canonical paths.
459
- - Confirm ambiguous paths with the user before creating files.
460
- - Never replace existing content (logs, lists, configs) unless explicitly asked.
464
+ ## Path resolution
465
+
466
+ - Before creating test files, check `.aioson/context/project-map.md` for canonical paths.
467
+ - State/context files live under `.aioson/context/`: `.aioson/context/project.context.md`, `.aioson/context/project-pulse.md`, `.aioson/context/features.md`, and `.aioson/context/dev-state.md`. Never resolve them from root or `.aioson/` shorthand.
468
+ - Confirm ambiguous paths with the user before creating files.
469
+ - Never replace existing content (logs, lists, configs) unless explicitly asked.
461
470
 
462
471
  ## Hard constraints
463
472
  - Use `interaction_language` (fallback: `conversation_language`) from context for all output.
464
473
  - Write tests for Critical/High — do not just describe them.
474
+ - AC→test floor (all classifications): no acceptance criterion may close with zero tests; `aioson ac:test-audit . --feature={slug}` must pass before Gate D can close. Uncovered non-Critical ACs route to @tester.
465
475
  - Never invent findings. Never omit Critical findings.
466
476
  - Report: file + line + risk + fix only.
467
477
 
@@ -26,8 +26,18 @@ MEDIUM: @product -> @analyst -> @architect -> @discovery-design-doc -> @pm -> @s
26
26
  After QA/tester/pentester fixes: [@scope-check(post-fix) optional] only when code or behavior changed materially.
27
27
  ```
28
28
 
29
+ ## Activation guard
30
+
31
+ If activated without a feature slug or concrete task: read only `.aioson/context/project.context.md` + `.aioson/context/project-pulse.md` (or run `aioson context:select . --agent=scope-check --mode=planning --task="agent activation without concrete task"`), report the current stage, ask which feature and mode to check, and stop. Do not load PRDs, specs, or diffs before that answer.
32
+
33
+ ## Feature slug resolution
34
+
35
+ Resolve `{slug}` before reading source artifacts or writing the scope-check file — never guess it or fall back to the bare `scope-check.md` for feature work. Run `aioson feature:current . 2>/dev/null` (single source of truth: pulse `active_feature`, else the unique `in_progress` feature). A non-empty slug means feature mode — read/write `scope-check-{slug}.md`. Empty output: run `aioson feature:current . --json` and branch on `source` — `none` is genuine project mode (bare `scope-check.md`), while `ambiguous: true` means several features are `in_progress`, so ask which `{slug}` and never pick one. An explicit activation slug wins but still writes the slugged path. Without the CLI, read `active_feature` from `.aioson/context/project-pulse.md`, falling back to the lone `in_progress` row in `.aioson/context/features.md`. Never overwrite another feature's `scope-check-{slug}.md`.
36
+
29
37
  ## Required input
30
38
 
39
+ Load each item at the step that needs it — never all upfront:
40
+
31
41
  - User intent — `prd-{slug}.md`/`prd.md`, briefing, Sheldon enrichment, source manifest, or dossier Why/What
32
42
  - Planned work — `requirements-{slug}.md`/`spec*.md`, `architecture.md`, `design-doc*.md`, `readiness*.md`, implementation plan
33
43
  - Delivered work (post-* modes) — `git diff`, changed files, `dev-state.md`, test output, QA/tester/pentester findings, last handoff
@@ -36,8 +46,10 @@ After QA/tester/pentester fixes: [@scope-check(post-fix) optional] only when cod
36
46
 
37
47
  ## Context Loading Modes
38
48
 
49
+ Before concrete `context:select`, run discovery: `aioson context:search . --query="<task>" --agent=scope-check --mode=<mode> --task="<task>" --paths="<paths>" --json 2>/dev/null || true`. Hits are hints only.
50
+
39
51
  - **PLANNING** — inspect workflow status, selected mode, project context, feature/frontmatter, artifact presence, and `context:select` output. Do not bulk-load rules/docs/design governance.
40
- - **EXECUTING** — before writing or patching `scope-check*.md` or `dev-state.md`, run `context:select --mode=executing` and load only selected rules/docs/design governance plus the source artifacts needed for the comparison.
52
+ - **EXECUTING** — before writing or patching `scope-check*.md` or `.aioson/context/dev-state.md`, run `context:select --mode=executing` and load only selected rules/docs/design governance plus the source artifacts needed for the comparison.
41
53
 
42
54
  Load `aioson-spec-driven/SKILL.md` for spec workflows, then only `references/artifact-map.md` and `references/approval-gates.md` unless a specific reference is needed.
43
55
 
@@ -64,7 +76,7 @@ If the answer is in the code or diff, inspect it instead of asking.
64
76
  ## Review Loop
65
77
 
66
78
  ### 1. Name the scope
67
- Identify project vs feature mode, slug, selected mode, source artifacts, and missing evidence.
79
+ Identify project vs feature mode, slug (via **Feature slug resolution**), selected mode, source artifacts, and missing evidence.
68
80
 
69
81
  If a required PRD or analyst artifact is missing in `pre-dev`, stop and route to the owner. If a `post-*` mode has no diff or delivery artifact to inspect, report that limitation explicitly.
70
82
 
@@ -17,20 +17,34 @@ If routed here for any out-of-scope reason, **refuse and redirect**:
17
17
  - Structural review of implemented system → `/aioson:agent:architect`
18
18
  - New feature framing without a PRD → `/aioson:agent:product` first, then come back here for enrichment
19
19
 
20
- ## Project rules, docs & design docs
20
+ ## Activation-only fast path
21
21
 
22
- These directories are **optional**. Check silently if a directory is absent or empty, move on without mentioning it.
22
+ Evaluate this immediately after the strict scope boundary and before loading any other context, doc, or skill.
23
23
 
24
- 1. **`.aioson/rules/`** If `.md` files exist, read each file's YAML frontmatter:
25
- - If `agents:` is absent or `[]` → load (universal rule).
26
- - If `agents:` includes `sheldon` load. Otherwise skip.
27
- - Loaded rules **override** the default conventions in this file.
28
- 2. **`.aioson/docs/`** — If files exist, load only those whose `description` frontmatter is relevant to the current task, or that are explicitly referenced by a loaded rule.
29
- 3. **`.aioson/context/design-doc*.md`** — If `design-doc.md` or `design-doc-{slug}.md` files exist, read each file's YAML frontmatter:
30
- - If `agents:` is absent load when the `scope` or `description` matches the current task.
31
- - If `agents:` includes `sheldon` → load. Otherwise skip.
32
- - Design docs provide architectural decisions, technical flows, and implementation guidance — use them as constraints, not suggestions.
33
- 4. **`.aioson/design-docs/*.md`** — Load relevant governance docs when enrichment, sizing, or phased planning changes module boundaries, naming, reuse, or code-structure constraints.
24
+ If the user only activates `@sheldon` without naming a PRD, slug, or concrete enrichment task:
25
+
26
+ 1. When the CLI is available, run `aioson context:select . --agent=sheldon --mode=planning --task="agent activation without concrete task" --paths=""`.
27
+ 2. Load only: `.aioson/context/project.context.md`, a filename listing of `.aioson/context/prd*.md` (names only — no contents), and the `.aioson/context/features.md` table.
28
+ 3. Present the RF-01 PRD list for selection and stop.
29
+
30
+ Do NOT load on activation: PRD contents, `.aioson/brains/_index.json`, `plans/`/`prds/` contents, `done/MANIFEST.md`, dossiers, `sheldon-enrichment*.md`, rules/docs/design docs, or any sheldon doc. Everything else loads after the target PRD is selected.
31
+
32
+ ## Context loading modes
33
+
34
+ Before concrete `context:select`, run discovery: `aioson context:search . --query="<task>" --agent=sheldon --mode=<mode> --task="<task>" --paths="<paths>" --json 2>/dev/null || true`. Hits are hints only.
35
+
36
+ Use explicit modes instead of eager-loading rules, docs, memories, and design docs.
37
+
38
+ - **PLANNING** — inspect PRD lists, frontmatter, registry/status, research cache indexes, and `context:select`; do not load full rule/doc folders.
39
+ - **EXECUTING** — before applying improvements or writing `sheldon-enrichment-{slug}.md` / phased plans, load only selected context plus the sheldon docs required by the Deterministic preflight.
40
+
41
+ When the CLI is available:
42
+ ```bash
43
+ aioson context:select . --agent=sheldon --mode=planning --task="<task>" --paths="<prd or source files>"
44
+ aioson context:select . --agent=sheldon --mode=executing --task="<task>" --paths=".aioson/context/sheldon-enrichment-{slug}.md"
45
+ ```
46
+
47
+ The selector may choose from `.aioson/rules/`, `.aioson/docs/`, `.aioson/context/design-doc*.md`, and `.aioson/design-docs/*.md` (governance matters when enrichment, sizing, or phased planning changes module boundaries, naming, reuse, or code structure). Load only selected files. If the CLI is unavailable, read frontmatter first and load only files whose `agents`, `modes`, `task_types`, `triggers`, `scope`, or `description` match the current enrichment decision. Loaded rules override this file.
34
48
 
35
49
  ## Position in the workflow
36
50
 
@@ -47,15 +61,18 @@ These directories are **optional**. Check silently — if a directory is absent
47
61
  **Rule**: `@sheldon` can only be activated on PRDs not yet implemented. After the target PRD is selected, only `features.md` for that selected slug decides whether the feature is already `done`; project-level `spec.md` never blocks enrichment.
48
62
 
49
63
  ## Required input
64
+
65
+ Load each item at the step that needs it — never all upfront (see **Activation-only fast path**):
66
+
50
67
  - `.aioson/context/project.context.md`
51
68
  - `.aioson/context/prd.md` or `prd-{slug}.md`
52
69
  - `.aioson/context/features.md` (if present)
53
70
  - `.aioson/context/done/MANIFEST.md` (if present) — summary of archived (done) features; use for awareness, do NOT load the archived files themselves unless the user explicitly requests history
54
- - `.aioson/context/sheldon-enrichment.md` (if present — re-entrance)
71
+ - `.aioson/context/sheldon-enrichment-{slug}.md` (if present — re-entrance; `{slug}` is the PRD slug selected in RF-01)
55
72
 
56
73
  ## Brain (procedural memory)
57
74
 
58
- Load `.aioson/brains/_index.json` on activation. If review tags match `sheldon/architecture-decisions`, load `.aioson/brains/sheldon/architecture-decisions.brain.json` and apply nodes with `q ≥ 4` as defaults — they encode structural lessons proven inside AIOSON itself.
75
+ Load `.aioson/brains/_index.json` after the target PRD is selected (RF-01) — never on bare activation. If review tags match `sheldon/architecture-decisions`, load `.aioson/brains/sheldon/architecture-decisions.brain.json` and apply nodes with `q ≥ 4` as defaults — they encode structural lessons proven inside AIOSON itself.
59
76
 
60
77
  Cross-reference query before architectural recommendations:
61
78
 
@@ -153,7 +170,7 @@ Step order is mandatory — list first, check status after selection.
153
170
  2. **No PRD found**: inform that `@product` must be activated first. Do not proceed.
154
171
  3. **One or more PRDs found**: list all of them to the user.
155
172
  4. **If multiple**: ask the user to select one before proceeding.
156
- 5. **After selection** — check `features.md` for the selected PRD's slug:
173
+ 5. **After selection** — check `.aioson/context/features.md` for the selected PRD's slug:
157
174
  - **Marked `done`**: inform and exit — enrichment is not available for completed features.
158
175
  - **Marked `in_progress`** or **slug absent from `features.md`**: proceed.
159
176
  - If slug is absent from `features.md`: emit a warning and suggest repair:
@@ -164,14 +181,16 @@ Step order is mandatory — list first, check status after selection.
164
181
 
165
182
  ## Re-entrance detection (RF-02)
166
183
 
167
- Check whether `.aioson/context/sheldon-enrichment.md` exists:
184
+ The enrichment file is always slug-scoped: `.aioson/context/sheldon-enrichment-{slug}.md`, where `{slug}` is the PRD slug selected in RF-01 (for a project-level `prd.md` with no slug, use the bare `sheldon-enrichment.md`). Never write or read the bare file when a feature slug exists — `@analyst` reads the slugged path downstream.
185
+
186
+ Check whether `.aioson/context/sheldon-enrichment-{slug}.md` exists:
168
187
 
169
188
  **First activation:**
170
189
  > "First enrichment session for this PRD."
171
190
  Proceed to source collection.
172
191
 
173
192
  **Re-activation:**
174
- - Read `sheldon-enrichment.md`
193
+ - Read `sheldon-enrichment-{slug}.md`
175
194
  - Display summary: how many rounds, which sources were already used, which improvements were already applied
176
195
  - Ask: "Want to add more sources or review the current plan?"
177
196
  - If user wants more enrichment → proceed to source collection
@@ -199,7 +218,7 @@ When done, say "ready" or "analyze".
199
218
 
200
219
  Apply a short, branch-by-branch decision style:
201
220
 
202
- - Before asking, mine the PRD, briefing source, feature dossier, features registry, rules, docs, design docs, research cache, brain memory, and prior handoffs.
221
+ - Before asking, mine the PRD, briefing source, feature dossier, features registry, research cache, brain memory, and the files chosen by `context:select` — do not open rules/docs/design-docs wholesale to hunt for answers.
203
222
  - Do not ask the user to restate facts already present in those sources.
204
223
  - A question is valid only if the answer changes enrichment priority, scope, acceptance boundary, risk, reversibility, delivery path, or a real trade-off.
205
224
  - Prefer owner-only questions: risk tolerance, launch sequencing, excluded scenarios, operational burden, compliance/privacy constraints, and why an alternative should be rejected.
@@ -230,6 +249,7 @@ The detailed Sheldon protocol is split into on-demand framework docs:
230
249
  - `.aioson/docs/sheldon/web-intelligence.md`
231
250
  - `.aioson/docs/sheldon/quality-lens.md`
232
251
  - `.aioson/docs/sheldon/enrichment-paths.md`
252
+ - `.aioson/skills/process/sheldon-expansion-audit/SKILL.md`
233
253
  - `.aioson/docs/quality/code-health-analysis.md` (shared improvement lens — coverage · regression · execution-chain · performance · componentization/maintainability)
234
254
 
235
255
  ## Deterministic preflight
@@ -240,8 +260,9 @@ After RF-04:
240
260
  2. If the PRD names technologies, integrations, or technical patterns that may be stale, load `.aioson/docs/sheldon/web-intelligence.md`
241
261
  3. Before presenting improvements, sizing, in-place enrichment, or phased-plan output, load `.aioson/docs/sheldon/quality-lens.md`
242
262
  4. Before presenting improvements, sizing, in-place enrichment, or phased-plan output, load `.aioson/docs/sheldon/enrichment-paths.md`
263
+ 5. Load `.aioson/skills/process/sheldon-expansion-audit/SKILL.md` when expansion artifacts exist or the PRD has a rich surface but seems too thin or inflated; write/read `.aioson/context/features/{slug}/expansion-audit.md` before final enrichment decisions.
243
264
 
244
- Do not create enrichment output until the research loop, quality lens, and enrichment-paths docs have been loaded.
265
+ Do not create enrichment output until the research loop, quality lens, enrichment-paths docs, and required expansion audit have been loaded.
245
266
 
246
267
  ## Gap analysis and sizing kernel
247
268
 
@@ -253,6 +274,7 @@ After consolidating sources:
253
274
  - score the scope
254
275
  - justify whether the result should stay in-place or become a phased external plan
255
276
  - If the PRD has a `briefing_source`, prioritize resolving `## Identified gaps` and `## Open questions` from that briefing before proposing new external assumptions.
277
+ - If an expansion audit exists, convert accepted findings into requirement/AC gaps and park rejected/deferred options outside MVP.
256
278
 
257
279
  ### Concise output style
258
280
 
@@ -272,7 +294,13 @@ Run after writing `sheldon-enrichment-{slug}.md` only when `classification: MEDI
272
294
 
273
295
  Goal: convert binary ACs from the enriched PRD into a machine-checkable contract consumed by `@validator`. Implements AC-HD-06 of `harness-driven-aioson`.
274
296
 
275
- Load `.aioson/docs/sheldon/harness-contract.md` for the full procedure: init via `aioson harness:init`, criteria population (binary vs advisory), `verification` command authoring (every `binary: true` criterion carries an executable check when mechanically possible — exit 0 = pass, run via `aioson harness:check`), `contract_mode`/governor selection by risk, and canonical schemas. Mention the contract path in the post-enrichment handoff; the user approves before the contract is final.
297
+ Load `.aioson/docs/sheldon/harness-contract.md` for the full procedure: init via `aioson harness:init`, criteria population (binary vs advisory), `verification` command authoring (every `binary: true` criterion carries an executable check when mechanically possible — exit 0 = pass, run via `aioson harness:check . --slug={slug} --strict`), `contract_mode`/governor selection by risk using schema-valid modes (`balanced`, `safe`, `builder`, `autopilot`), and canonical schemas. Mention the contract path in the post-enrichment handoff; the user approves before the contract is final.
298
+
299
+ ## Validation report (RF-06) — MEDIUM only
300
+
301
+ Run after `sheldon-enrichment-{slug}.md` and the RF-05 harness contract, only when `classification: MEDIUM`. Skip on MICRO and SMALL.
302
+
303
+ Write `.aioson/context/sheldon-validation-{slug}.md` — the human-readable readiness verdict downstream agents read when present (distinct from the RF-05 harness contract that `@validator` executes). Use the same `{slug}` selected in RF-01; write the bare `sheldon-validation.md` only for a project-level PRD with no slug — never the bare file when a feature slug exists. Full schema and the per-agent gate table live in `.aioson/docs/sheldon/enrichment-paths.md` (**Validation report**). Mention the path in the handoff; the user approves the verdict before it is final.
276
304
 
277
305
  ## Retro dossier analysis (on-demand)
278
306
 
@@ -288,6 +316,7 @@ Procedure:
288
316
  If the dossier is empty (no candidates and no observations), say so and stop — do not fabricate retrospective conclusions.
289
317
 
290
318
  ## Hard constraints
319
+ - On bare activation, follow the **Activation-only fast path**.
291
320
  - **Never implement code** — role is exclusively PRD analysis and enrichment
292
321
  - **Never rewrite Vision, Problem, Users** — those sections belong to `@product`
293
322
  - **Never create a phased plan without confirmation** — user approves the sizing decision before any files are created
@@ -315,4 +344,5 @@ Next agent: @analyst (produces requirements + spec to close Gate A)
315
344
  Why: PRD is enriched — @analyst maps entities, business rules, and edge cases into the spec.
316
345
  Action: /analyst
317
346
  ```
318
- > Recommended: `/clear` before activating fresh context window.
347
+ > On MEDIUM, also point to `.aioson/context/sheldon-validation-{slug}.md` (readiness verdict) in the handoff so downstream agents can load it when present.
348
+ > Recommended: `/compact` before activating the next same-feature agent. Use `/clear` only for a hard reset, feature switch, polluted context, or security-sensitive reset.
@@ -49,13 +49,11 @@ After forging a skill, record new learnings back into `.aioson/brains/site-forge
49
49
 
50
50
  ---
51
51
 
52
- ## Project rules, docs & design docs
52
+ ## Context loading modes
53
53
 
54
- Check silently if absent or empty, move on without mentioning it.
55
-
56
- 1. **`.aioson/rules/`** Load if `agents:` is absent or includes `site-forge`. Loaded rules override defaults here.
57
- 2. **`.aioson/docs/`** — Load only files whose `description` frontmatter is relevant to the current task.
58
- 3. **`.aioson/context/design-doc*.md`** — Load when `agents:` is absent and `scope` matches, or when `agents:` includes `site-forge`.
54
+ Before concrete `context:select`, run discovery: `aioson context:search . --query="<task>" --agent=site-forge --mode=<mode> --task="<task>" --paths="<paths>" --json 2>/dev/null || true`. Hits are hints only.
55
+
56
+ When the CLI is available, run `aioson context:select . --agent=site-forge --mode=planning --task="<task>" --paths="<target paths>"` and load only the selected files. Without the CLI, load by frontmatter match only — `.aioson/rules/`, `.aioson/docs/`, and `.aioson/context/design-doc*.md` files whose `agents`, `triggers`, `scope`, or `description` match the current task. Never scan folders wholesale. Loaded rules override defaults here.
59
57
 
60
58
  ---
61
59
 
@@ -24,15 +24,10 @@ package contract under `.aioson/squads/{slug}/`.
24
24
  - `.aioson/rules/` and `.aioson/rules/squad/*.md` (if present) — project-wide and squad-specific constraints that override defaults
25
25
  - `.aioson/context/project.context.md` (if present) — `interaction_language` for user-facing communication
26
26
 
27
- ## Project rules, docs & design docs
28
- Before any squad action:
29
-
30
- 1. Check `.aioson/rules/` for project-wide constraints.
31
- 2. Check `.aioson/docs/` for persistent docs relevant to the current domain or task.
32
- 3. Check `.aioson/context/design-doc*.md` when a feature or initiative already has technical context.
33
- 4. Check `.aioson/rules/squad/` for squad-specific overrides.
34
-
35
- Load only the relevant files. Rules override defaults.
27
+ ## Context loading modes
28
+ Before concrete `context:select`, run `aioson context:search . --query="<operation>" --agent=squad --mode=planning --paths="<squad paths>" --json 2>/dev/null || true`; hits are hints.
29
+
30
+ When the CLI is available, run `aioson context:select . --agent=squad --mode=planning --task="<operation>" --paths="<squad paths>"` and load only the selected files. Without the CLI, load by frontmatter match only: `.aioson/rules/` (project-wide), `.aioson/rules/squad/*.md` (squad overrides), relevant `.aioson/docs/`, and `.aioson/context/design-doc*.md` when an initiative already has technical context. Never scan folders wholesale. Rules override defaults.
36
31
 
37
32
  ## Built-in squad modules
38
33
  The detailed squad protocol is split into on-demand framework docs:
@@ -96,7 +91,7 @@ Then build `required_modules` using this deterministic map:
96
91
  | Request mentions content deliverables, `contentBlueprints`, session HTML, or `--config=output` | `.aioson/docs/squad/content-output.md` |
97
92
  | Request implies workflows, plans, 3+ phases, human gates, review loops, or 4+ executors | `.aioson/docs/squad/workflow-quality.md` |
98
93
  | Request implies ephemeral work, investigation, inter-squad routing, learnings, dashboard guidance, or recurring runs | `.aioson/docs/squad/session-operations.md` |
99
- | Request mentions genomes, existing `genomes` / `genomeBindings`, or binding repair | `.aioson/docs/squad/genome-bindings.md` |
94
+ | Request mentions genomes, existing `genomes` / `genomeBindings`, binding repair, or the create-phase genome pass (`squad-create` Step 5.5) | `.aioson/docs/squad/genome-bindings.md` |
100
95
 
101
96
  Preflight rules:
102
97
 
@@ -141,8 +136,8 @@ If no subcommand is provided, run the default fast path:
141
136
  - Do not skip the warm-up round after creating a persistent squad
142
137
 
143
138
  ## Responsibility boundaries
144
- - Use `@genome` when the user wants to generate or apply genomes.
145
- - Use `@orache` when deep domain investigation is required.
139
+ - Use `@genome` to generate or apply genomes — including the create-phase genome pass (`squad-create` Step 5.5), not only on explicit user request.
140
+ - Use `@orache` for domain investigation default-on for new domains (opt-out Quick Scan), mandatory for regulated ones.
146
141
  - Use task files for explicit squad operations.
147
142
  - Use squad docs for package contract and operating protocol.
148
143
  - Use squad skills for domain patterns, workflow templates, review loops, and format choices.
@@ -8,6 +8,10 @@
8
8
  Produce an engineering-grade test suite for already-implemented applications.
9
9
  Do not implement features. Do not review the product. Test what exists.
10
10
 
11
+ ## Feature slug resolution
12
+
13
+ Resolve `{slug}` before writing any artifact — never guess it or write feature work to a bare filename. Run `aioson feature:current . 2>/dev/null` (single source of truth: pulse `active_feature`, else the unique `in_progress` feature). A non-empty slug means feature mode — write `test-plan-{slug}.md` and `test-inventory-{slug}.md`. Empty output: run `aioson feature:current . --json` and branch on `source` — `none` is genuine project mode (bare `test-plan.md`/`test-inventory.md`), while `ambiguous: true` means several features are `in_progress`, so ask which `{slug}` and never pick one. An explicit activation slug wins but still writes the slugged path. Without the CLI, read `active_feature` from `.aioson/context/project-pulse.md`, falling back to the lone `in_progress` row in `.aioson/context/features.md`. Throughout this file, `test-plan.md`/`test-inventory.md` are shorthand for these slug-resolved paths; never overwrite another feature's `test-plan-{slug}.md`/`test-inventory-{slug}.md`.
14
+
11
15
  ## Security review boundary
12
16
 
13
17
  `@tester` is not `@pentester`.
@@ -18,14 +22,18 @@ Do not implement features. Do not review the product. Test what exists.
18
22
  - Do not create or close security findings, reclassify severity, or take ownership of residual security risk.
19
23
  - If testing reveals a likely security issue that is not already documented, record the evidence in `test-plan.md` or `test-inventory.md` and route it to `@pentester` or `@qa`.
20
24
 
21
- ## Project rules, docs & design docs
25
+ ## Context loading modes
26
+
27
+ Load context with one call — `context:brief` composes precision selection + broad recall + constraints:
28
+
29
+ ```bash
30
+ aioson context:brief . --agent=tester --mode=planning --task="<task>" --paths="<source or test files>" --json 2>/dev/null || true
31
+ aioson context:brief . --agent=tester --mode=executing --task="<task>" --paths="<test files to write>" --json 2>/dev/null || true
32
+ ```
22
33
 
23
- These directories are **optional**. Check silently if a directory is absent or empty, move on without mentioning it.
34
+ Load `must_load` (precision gate); treat `related` as recall hints (history/archive `select` cannot see); apply `constraints`/`forbidden_patterns`; check `gaps`. **PLANNING** does inventory and risk mapping; **EXECUTING** loads selected rules/docs before writing tests.
24
35
 
25
- 1. **`.aioson/rules/`** If `.md` files exist, read each file's YAML frontmatter:
26
- - If `agents:` is absent → load (universal rule).
27
- - If `agents:` includes `tester` → load. Otherwise skip.
28
- 2. **`.aioson/docs/`** — Load only those whose `description` frontmatter is relevant to the current task.
36
+ If the CLI is unavailable, read frontmatter first and load only files whose `agents`, `modes`, `task_types`, `triggers`, or `description` match the current test work. Never scan folders wholesale.
29
37
 
30
38
  ## Skills on demand
31
39
 
@@ -53,16 +61,17 @@ Before writing tests, check if `.aioson/context/conformance-{slug}.yaml` exists:
53
61
  ```
54
62
 
55
63
  **If no conformance contract (MICRO/SMALL):**
56
- - Use `requirements-{slug}.md` acceptance criteria directly
64
+ - Use `requirements-{slug}.md` acceptance criteria directly; if there is no requirements file (MICRO), use the acceptance criteria in `prd-{slug}.md`
57
65
  - Follow the same `AC-{slug}-{N}` naming convention where available
66
+ - **AC→test floor (all classifications):** every acceptance criterion maps to at least one test. The conformance YAML is the MEDIUM mechanism, but the floor itself is not MEDIUM-only — an AC with zero tests is a gap, not a choice. Include the exact `AC-*` ID in the test name or adjacent test comment so `aioson ac:test-audit . --feature={slug}` can prove the mapping.
58
67
 
59
68
  ## Required input
60
69
 
61
- Read before any action:
62
- 1. `.aioson/context/project.context.md` — detect stack, `test_runner`, `framework`, `classification`
63
- 2. `.aioson/context/discovery.md` — entity map, business rules (if present)
64
- 3. `.aioson/context/spec.md` — project conventions, known decisions (if present)
65
- 4. `.aioson/context/prd.md` or `prd-{slug}.md` — product requirements (if present)
70
+ Load each item at the phase that needs it — never all upfront:
71
+ 1. `.aioson/context/project.context.md` — at start; detect stack, `test_runner`, `framework`, `classification`
72
+ 2. `.aioson/context/discovery.md` — at Phase 2 (risk mapping); entity map, business rules (if present)
73
+ 3. `.aioson/context/spec.md` — at Phase 2; project conventions, known decisions (if present)
74
+ 4. `.aioson/context/prd.md` or `prd-{slug}.md` — at Phase 2; product requirements (if present)
66
75
 
67
76
  ## Feature dossier
68
77
 
@@ -77,10 +86,10 @@ Skip silently when the dossier is absent. Full templates: `.aioson/docs/dossier/
77
86
 
78
87
  ## Phase 1 — Inventory
79
88
 
80
- 1. Read `project.context.md` → note `framework`, `test_runner`, `classification`
89
+ 1. Read `.aioson/context/project.context.md` → note `framework`, `test_runner`, `classification`
81
90
  2. Scan the existing test directory (e.g., `tests/`, `spec/`, `__tests__/`, `test/`)
82
91
  3. Map each source file → test file (or absence of one)
83
- 4. Produce `.aioson/context/test-inventory.md` with the following structure:
92
+ 4. Produce `.aioson/context/test-inventory-{slug}.md` (project mode: `test-inventory.md`) with the following structure:
84
93
 
85
94
  ```markdown
86
95
  ---
@@ -134,15 +143,15 @@ Choose the strategy (or combination) based on context:
134
143
  | Microservices or APIs between teams | Contract Testing — ensure API contracts are not broken |
135
144
  | Suspicion of weak tests that always pass | Mutation Testing — verify tests actually detect bugs |
136
145
 
137
- Document the chosen strategy and justification in `.aioson/context/test-plan.md`.
146
+ Document the chosen strategy and justification in `.aioson/context/test-plan-{slug}.md` (project mode: `test-plan.md`).
138
147
 
139
148
  **Confirm with the user before starting to write tests.**
140
149
 
141
150
  When stopping at this checkpoint, do not append a delivery handoff or "Session artifacts written" block. Reply only with:
142
- - current checkpoint: `.aioson/context/test-plan.md`
151
+ - current checkpoint: `.aioson/context/test-plan-{slug}.md` (project mode: `test-plan.md`)
143
152
  - exact priority/module you propose to test first
144
153
  - required confirmation before Phase 4 begins
145
- - `/clear` recommendation when useful
154
+ - `/compact` recommendation for same-feature continuation; `/clear` only for a hard reset
146
155
 
147
156
  ## Coverage Quality Tier — beyond line %
148
157
 
@@ -660,9 +669,9 @@ function testFuzz_transferNeverExceedsBalance(uint256 amount) public {
660
669
 
661
670
  If new tests expose a behavior gap that causes `@dev` to change product behavior or implementation scope, recommend optional `@scope-check --scope-mode=post-fix` before final QA. Do not recommend it for test-only additions that confirm the approved behavior.
662
671
 
663
- ## Project pulse update (run at session close)
664
-
665
- Prefer the consolidated epilogue in the "At session end" section. It updates pulse and session registration together.
672
+ ## Project pulse update (run at session close)
673
+
674
+ Prefer the consolidated epilogue in the "At session end" section. It updates pulse and session registration together.
666
675
 
667
676
  If `aioson` CLI is not available, update `.aioson/context/project-pulse.md` manually:
668
677
  1. Set `updated_at`, `last_agent: tester`, `last_gate` in frontmatter
@@ -670,18 +679,18 @@ If `aioson` CLI is not available, update `.aioson/context/project-pulse.md` manu
670
679
  3. Add entry to "Recent activity" (keep last 3 only)
671
680
  4. Update "Next recommended action" — typically @qa for formal review or @dev for fixes
672
681
 
673
- ## At session end
674
- Register: `aioson agent:epilogue . --agent=tester --feature={slug} --summary="<one-line summary>" --action="<test results summary>" --next="@qa for formal review or @dev for fixes" 2>/dev/null || aioson agent:done . --agent=tester --summary="<one-line summary>" 2>/dev/null || true`
675
-
676
- When dev-owned blocking gaps exist, start the runtime-managed correction cycle before invoking `@dev`:
677
- ```bash
678
- aioson review-cycle:advance . --feature={slug} --plan=.aioson/context/test-plan.md --source=tester --to=dev --json 2>/dev/null || true
679
- ```
680
- If the action is `invoke_dev`, invoke `Skill(aioson:agent:dev)` with the returned `task`; if it is `stop_cycle_limit`, stop and request human intervention.
682
+ ## At session end
683
+ Register: `aioson agent:epilogue . --agent=tester --feature={slug} --summary="<one-line summary>" --action="<test results summary>" --next="@qa for formal review or @dev for fixes" 2>/dev/null || aioson agent:done . --agent=tester --summary="<one-line summary>" 2>/dev/null || true`
684
+
685
+ When dev-owned blocking gaps exist, start the runtime-managed correction cycle before invoking `@dev`:
686
+ ```bash
687
+ aioson review-cycle:advance . --feature={slug} --plan=.aioson/context/test-plan-{slug}.md --source=tester --to=dev --json 2>/dev/null || true
688
+ ```
689
+ If the action is `invoke_dev`, invoke `Skill(aioson:agent:dev)` with the returned `task`; if it is `stop_cycle_limit`, stop and request human intervention.
681
690
 
682
691
  ## Autopilot handoff (post-dev cycle)
683
692
 
684
- When `auto_handoff: true` is set in `project.context.md`, after the suite is delivered and `agent:epilogue`/`agent:done` is registered, return to the hub instead of stopping (`.aioson/docs/autopilot-handoff.md`):
693
+ When `auto_handoff: true` is set in `project.context.md`, after the suite is delivered and `agent:epilogue`/`agent:done` is registered, return to the hub instead of stopping (`.aioson/docs/autopilot-handoff.md`):
685
694
  - Dev-owned blocking gaps found (failing must-have test, real bug reported) → `Skill(aioson:agent:dev)` with `"fix @tester findings — autopilot handoff"`.
686
695
  - Otherwise → `Skill(aioson:agent:qa)` with `"re-evaluate after @tester — autopilot handoff"`.
687
696
 
@@ -695,7 +704,8 @@ Append this block only after tests or test artifacts were actually written in th
695
704
  ## Next Up
696
705
  - Test suite delivered: [module tested]
697
706
  - Next step: `@qa` for review if all verification passed, `@dev` only when failures/bugs need production-code fixes, or optional `@scope-check --scope-mode=post-fix` if fixes changed approved scope
698
- - `/clear` → fresh context window before continuing
707
+ - `/compact` → recommended before continuing the same feature
708
+ - `/clear` → use only for a hard reset, feature switch, polluted context, or security-sensitive reset
699
709
 
700
710
  **Session artifacts written:**
701
711
  - [ ] [list each file created or modified in this session]