@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
@@ -5,19 +5,14 @@
5
5
  ## Mission
6
6
  Produce UI/UX that makes the user proud to show the result. Generic output is failure.
7
7
 
8
- ## Project rules, docs & design docs
9
-
10
- These directories are **optional**. Check silently. If a directory is absent or empty, move on without mentioning it.
11
-
12
- 1. **`.aioson/rules/`**If `.md` files exist, read each file's YAML frontmatter:
13
- - If `agents:` is absent load (universal rule).
14
- - If `agents:` includes `ux-ui` → load. Otherwise skip.
15
- - Loaded rules **override** the default conventions in this file.
16
- 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.
17
- 3. **`.aioson/context/design-doc*.md`** — If `design-doc.md` or `design-doc-{slug}.md` files exist, read each file's YAML frontmatter:
18
- - If `agents:` is absent → load when the `scope` or `description` matches the current task.
19
- - If `agents:` includes `ux-ui` → load. Otherwise skip.
20
- - Design docs provide architectural decisions, technical flows, and implementation guidance — use them as constraints, not suggestions.
8
+ ## Context loading modes
9
+
10
+ Use two explicit modes so visual work loads the right evidence without pulling every UX module.
11
+
12
+ - **PLANNING**inspect project context, design skill field, PRD/frontmatter, active feature/dossier, artifact presence, and `context:select` output. Do not load full `.aioson/rules/`, `.aioson/docs/ux-ui/`, `.aioson/design-docs/`, or design skills.
13
+ - **EXECUTING** — after deriving the primary operation, run `context:select --mode=executing` and load only selected rules/design docs plus the required UX modules for that operation.
14
+
15
+ Rules and design docs override this file only when selected by metadata, operation trigger, path match, or explicit artifact reference.
21
16
 
22
17
  ## Step 0 — Design skill gate
23
18
 
@@ -42,13 +37,20 @@ Apply when `project_type=site` and the operation is `default-create` or `refine-
42
37
  3. **If present:** read the copy file before any layout decision. The page structure (sections, headings, CTAs) must mirror the structure declared in the copy document. Treat the copy as the source of truth for textual content — never paraphrase, never insert placeholders, never reorder sections without the user's explicit instruction.
43
38
  4. The `audit`, `research`, `tokens`, `component-map`, and `a11y` submodes do not trigger this gate. They may run on existing UI without copy.
44
39
 
45
- ## Required input
46
- - `.aioson/context/project.context.md`
47
- - `.aioson/context/prd.md` or `prd-{slug}.md` when present
48
- - `.aioson/context/discovery.md` when present
49
- - `.aioson/context/architecture.md` when present
50
- - `.aioson/context/spec-{slug}.md` (feature mode, if present)
51
- - `.aioson/context/spec.md` (project mode, if present)
40
+ ## Required input
41
+ - `.aioson/context/project.context.md`
42
+ - `.aioson/context/prd.md` or `prd-{slug}.md` when present
43
+ - `.aioson/context/discovery.md` when selected because current flows/entities affect UI
44
+ - `.aioson/context/architecture.md` when selected because component boundaries, routes, or frontend architecture affect UI
45
+ - `.aioson/context/spec-{slug}.md` (feature mode, if present)
46
+ - `.aioson/context/spec.md` (project mode, if present)
47
+
48
+ Before loading optional inputs, run:
49
+
50
+ ```bash
51
+ aioson context:select . --agent=ux-ui --mode=planning --task="<ux task>" --paths="<known UI paths>"
52
+ aioson preflight:context . --agent=ux-ui --mode=planning --task="<ux task>" --paths="<known UI paths>"
53
+ ```
52
54
 
53
55
  ## Sheldon plan detection (RDA-03)
54
56
 
@@ -128,7 +130,7 @@ Before acting, derive one primary `operation`:
128
130
  - `component-map`
129
131
  - `a11y`
130
132
 
131
- Then build `required_modules` using this map:
133
+ Then build `required_modules` using this map:
132
134
 
133
135
  | Condition | Required modules |
134
136
  |---|---|
@@ -140,14 +142,15 @@ Then build `required_modules` using this map:
140
142
  | `component-map` | `.aioson/docs/ux-ui/component-map.md` |
141
143
  | `a11y` | `.aioson/docs/ux-ui/accessibility-audit.md` |
142
144
 
143
- Preflight rules:
144
-
145
- 1. If the operation creates or revises visual direction, load `design-gate.md` before layout or token decisions.
146
- 2. If the operation is `default-create` or `refine-spec`, run the entry check from `design-execution.md` before producing output.
145
+ Preflight rules:
146
+
147
+ 1. If the operation creates or revises visual direction, load `design-gate.md` before layout or token decisions.
148
+ 2. If the operation is `default-create` or `refine-spec`, run the entry check from `design-execution.md` before producing output.
147
149
  3. If existing UI artifacts are found and the user chooses **Audit**, switch the operation to `audit`.
148
150
  4. If the user chooses **Rebuild**, confirm overwrite before continuing.
149
- 5. Do not proceed until every required module has been loaded.
150
- 6. Do not preload ux-ui modules that are not required.
151
+ 5. Do not proceed until every required module has been loaded.
152
+ 6. Do not preload ux-ui modules that are not required.
153
+ 7. Before writing `ui-spec.md`, run `context:select --mode=executing` with the UI paths/components being specified and load only the selected rules/design governance.
151
154
 
152
155
  ## Output contract
153
156
 
@@ -156,9 +159,11 @@ Preflight rules:
156
159
  - `.aioson/context/ui-spec.md`
157
160
  - `.aioson/context/project.context.md` only if the `design_skill` selection was confirmed in this session
158
161
 
159
- **Creation mode — `project_type≠site`:**
160
- - `.aioson/context/ui-spec.md`
161
- - `.aioson/context/project.context.md` only if the `design_skill` selection was confirmed in this session
162
+ **Creation mode — `project_type≠site`:**
163
+ - `.aioson/context/ui-spec.md`
164
+ - `.aioson/context/project.context.md` only if the `design_skill` selection was confirmed in this session
165
+
166
+ `ui-spec.md` is the canonical downstream UI artifact. `@dev` reads it only when implementing UI components, frontend routes, interaction states, copy placement, or visual QA fixes.
162
167
 
163
168
  **Submode outputs:**
164
169
  - `research` → `.aioson/context/ui-research.md`
@@ -192,4 +197,4 @@ Do not overwrite sections owned by `@product` or `@analyst`.
192
197
  - If `aioson` CLI is not available, write a devlog at session end following `.aioson/config.md`.
193
198
 
194
199
  ## Observability
195
- At session end, register: `aioson agent:done . --agent=ux-ui --summary="UI spec <slug>: <N> components, design=<skill>" 2>/dev/null || true`
200
+ At session end, prefer: `aioson agent:epilogue . --agent=ux-ui --feature=<slug> --summary="UI spec <slug>: <N> components, design=<skill>" 2>/dev/null || aioson agent:done . --agent=ux-ui --summary="UI spec <slug>: <N> components, design=<skill>" 2>/dev/null || true`
@@ -100,12 +100,12 @@ aioson dossier:add-finding . --slug={slug} --agent=validator --section="Agent Tr
100
100
 
101
101
  Skip silently when the dossier is absent — `progress.json` remains the canonical machine output.
102
102
 
103
- ## Observability
104
- At session end, register: `aioson agent:done . --agent=validator --summary="Validated <slug> phase <N>: score=<0|1>, ready_for_done=<bool>" 2>/dev/null || true`
103
+ ## Observability
104
+ At session end, register: `aioson agent:epilogue . --agent=validator --feature=<slug> --summary="Validated <slug> phase <N>: score=<0|1>, ready_for_done=<bool>" --no-dossier 2>/dev/null || aioson agent:done . --agent=validator --summary="Validated <slug> phase <N>: score=<0|1>, ready_for_done=<bool>" 2>/dev/null || true`
105
105
 
106
106
  ## Autopilot handoff (post-dev cycle)
107
107
 
108
- When `auto_handoff: true` is set in `project.context.md`, after the verdict and `agent:done` (`.aioson/docs/autopilot-handoff.md`):
108
+ When `auto_handoff: true` is set in `project.context.md`, after the verdict and `agent:epilogue`/`agent:done` (`.aioson/docs/autopilot-handoff.md`):
109
109
  - Score 0 / FAIL → `Skill(aioson:agent:dev)` with `"fix @validator findings — autopilot handoff"`.
110
110
  - Score 1 / PASS → **STOP**. The feature is verification-clean; recommend the human run `aioson feature:close . --feature={slug}`. **Never auto-run `feature:close`** — the close is the human gate.
111
111
 
@@ -32,6 +32,7 @@
32
32
  "workflow:status",
33
33
  "runtime:emit",
34
34
  "agent:done",
35
+ "review-cycle:status",
35
36
  "brain:query",
36
37
  "doctor"
37
38
  ]
@@ -48,6 +49,10 @@
48
49
  "memory:trim",
49
50
  "workflow:next",
50
51
  "workflow:heal",
52
+ "agent:epilogue",
53
+ "review-cycle:advance",
54
+ "review-cycle:resolve",
55
+ "review-cycle:reset",
51
56
  "live:handoff",
52
57
  "live:close",
53
58
  "dossier:add-codemap",
@@ -56,8 +61,10 @@
56
61
  "notify"
57
62
  ],
58
63
  "write_paths": [
64
+ ".aioson/context/**",
59
65
  ".aioson/context/bootstrap/**",
60
66
  ".aioson/context/features/**",
67
+ ".aioson/plans/**",
61
68
  ".aioson/runtime/**"
62
69
  ]
63
70
  },
@@ -1,12 +1,17 @@
1
1
  ---
2
- description: "DRY principles, reuse hierarchy, and composition patterns"
3
- scope: "governance"
4
- agents: []
5
- ---
2
+ description: "DRY principles, reuse hierarchy, and composition patterns"
3
+ scope: "governance"
4
+ agents: [dev, deyvin, architect]
5
+ modes: [planning, executing]
6
+ task_types: [implementation-architecture, file-creation, refactor, reuse]
7
+ load_tier: trigger
8
+ triggers: [creating files, adding shared utility, reusing code, avoiding duplication, extending existing module]
9
+ paths: [src/**, app/**, lib/**, template/**]
10
+ ---
6
11
 
7
12
  # Code Reuse — Governance Rules
8
13
 
9
- > Loaded automatically by @dev and @deyvin. Override per-project via `.aioson/rules/`.
14
+ > Loaded by the context selector when creating files, reusing code, extending modules, or avoiding duplication is in scope. Override per-project via `.aioson/rules/`.
10
15
 
11
16
  ## Before creating any new file
12
17
 
@@ -1,12 +1,17 @@
1
1
  ---
2
- description: "When and how to extract components, modules, and abstractions"
3
- scope: "governance"
4
- agents: []
5
- ---
2
+ description: "When and how to extract components, modules, and abstractions"
3
+ scope: "governance"
4
+ agents: [dev, deyvin, architect]
5
+ modes: [planning, executing]
6
+ task_types: [implementation-architecture, module-boundary, refactor, extraction]
7
+ load_tier: trigger
8
+ triggers: [extract component, extract module, split module, abstraction, componentization, refactor duplicated logic]
9
+ paths: [src/**, app/**, lib/**, template/**]
10
+ ---
6
11
 
7
12
  # Componentization — Governance Rules
8
13
 
9
- > Loaded automatically by @dev and @deyvin. Override per-project via `.aioson/rules/`.
14
+ > Loaded by the context selector when extraction, module boundaries, duplication, or abstraction decisions are in scope. Override per-project via `.aioson/rules/`.
10
15
 
11
16
  ## When to extract
12
17
 
@@ -1,12 +1,17 @@
1
1
  ---
2
- description: "File size guidelines, alert thresholds, and split strategies"
3
- scope: "governance"
4
- agents: []
5
- ---
2
+ description: "File size guidelines, alert thresholds, and split strategies"
3
+ scope: "governance"
4
+ agents: [dev, deyvin, architect]
5
+ modes: [planning, executing]
6
+ task_types: [implementation, refactor, extraction, file-size]
7
+ load_tier: trigger
8
+ triggers: [large file, over 500 lines, split file, extract module, file size, growing file]
9
+ paths: [src/**, app/**, lib/**, template/**, tests/**]
10
+ ---
6
11
 
7
12
  # File Size — Governance Rules
8
13
 
9
- > Loaded automatically by @dev and @deyvin. Override per-project via `.aioson/rules/`.
14
+ > Loaded by the context selector when file size, split, extraction, or large-file risk is in scope. Override per-project via `.aioson/rules/`.
10
15
 
11
16
  ## Thresholds
12
17
 
@@ -1,12 +1,17 @@
1
1
  ---
2
- description: "Universal folder organization rules — hierarchy, depth, naming, grouping"
3
- scope: "governance"
4
- agents: []
5
- ---
2
+ description: "Universal folder organization rules — hierarchy, depth, naming, grouping"
3
+ scope: "governance"
4
+ agents: [dev, deyvin, architect]
5
+ modes: [planning, executing]
6
+ task_types: [implementation-architecture, file-creation, module-boundary, refactor]
7
+ load_tier: trigger
8
+ triggers: [creating files, moving files, splitting modules, designing implementation structure, folder structure]
9
+ paths: [src/**, app/**, lib/**, template/**, tests/**]
10
+ ---
6
11
 
7
12
  # Folder Structure — Governance Rules
8
13
 
9
- > Loaded automatically by @dev and @deyvin. Override per-project via `.aioson/rules/`.
14
+ > Loaded by the context selector when implementation structure, file creation, moves, or module boundaries are in scope. Override per-project via `.aioson/rules/`.
10
15
 
11
16
  ## Depth
12
17
 
@@ -1,12 +1,17 @@
1
1
  ---
2
- description: "Naming conventions for files, variables, functions, and classes"
3
- scope: "governance"
4
- agents: []
5
- ---
2
+ description: "Naming conventions for files, variables, functions, and classes"
3
+ scope: "governance"
4
+ agents: [dev, deyvin, architect]
5
+ modes: [planning, executing]
6
+ task_types: [implementation-architecture, file-creation, naming, refactor]
7
+ load_tier: trigger
8
+ triggers: [naming files, naming APIs, creating files, adding functions, adding classes, choosing names]
9
+ paths: [src/**, app/**, lib/**, template/**, tests/**]
10
+ ---
6
11
 
7
12
  # Naming — Governance Rules
8
13
 
9
- > Loaded automatically by @dev and @deyvin. Override per-project via `.aioson/rules/`.
14
+ > Loaded by the context selector when naming files, APIs, functions, classes, or implementation paths is in scope. Override per-project via `.aioson/rules/`.
10
15
 
11
16
  ## Files
12
17
 
@@ -14,8 +14,8 @@ Visual notifier: `aioson notify --level=info|warn|block`.
14
14
 
15
15
  | Tier | Intent | UX | Examples |
16
16
  |---|---|---|---|
17
- | `tier1_silent` | Read-only and telemetry. Auto-execute, no notification. | none | `git status`, `aioson preflight`, `aioson context:health`, `agent:done` |
18
- | `tier2_notified` | Mutates AIOSON memory (`bootstrap/`, `features/`, `runtime/`). Auto-execute with **inline notify** (ℹ). | `ℹ [topic] msg` | `memory:reflect-prepare`, `memory:reflect-commit`, `workflow:next`, `dossier:*` |
17
+ | `tier1_silent` | Read-only and telemetry. Auto-execute, no notification. | none | `git status`, `aioson preflight`, `aioson context:health`, `agent:done`, `review-cycle:status` |
18
+ | `tier2_notified` | Mutates AIOSON memory (`bootstrap/`, `features/`, `runtime/`). Auto-execute with **inline notify** (ℹ). | `ℹ [topic] msg` | `memory:reflect-prepare`, `memory:reflect-commit`, `workflow:next`, `dossier:*`, `agent:epilogue`, `review-cycle:advance|resolve|reset` |
19
19
  | `tier3_blocking` | Irreversible or external (publish, push, npm registry). **Never** auto-executed; the CLI returns exit 2 and waits for a human. | `⛔ [topic] msg` | `git push *`, `npm publish *`, `cloud:publish:*`, `genome:publish` |
20
20
 
21
21
  A tool opts into tiers via `derived_from_tiers`:
@@ -9,13 +9,21 @@ Opt-in protocol that removes manual handoff confirmations in the deterministic s
9
9
  1. **Pre-dev chain (`@analyst` → `@dev`):** `@analyst`, `@scope-check`, `@architect`, `@discovery-design-doc`, and `@pm` (MEDIUM only). Upstream agents (`@briefing`, `@product`, `@sheldon`) always stay manual — they end on genuine human decisions.
10
10
  2. **Post-dev review cycle (`@dev` → `@qa` → `@tester`/`@pentester` → `@validator`):** once a human starts `@dev`, the implementation and review agents chain automatically until the feature is ready to close. `@qa` is the hub: it owns the routing to the specialized agents and the corrections loop.
11
11
 
12
- ## Activation
13
-
14
- Autopilot is active only when ALL are true:
15
-
16
- 1. `project.context.md` frontmatter has `auto_handoff: true` (absent or `false` = manual handoffs, current behavior).
17
- 2. A feature workflow is active (feature slug known, classification SMALL or MEDIUM).
18
- 3. The current agent's own gate/verdict passed (see stop conditions).
12
+ ## Activation
13
+
14
+ Autopilot is active only when ALL are true:
15
+
16
+ 1. `project.context.md` frontmatter has `auto_handoff: true` (absent or `false` = manual handoffs, current behavior).
17
+ 2. A feature workflow is active (feature slug known, classification SMALL or MEDIUM).
18
+ 3. The current agent's own gate/verdict passed (see stop conditions).
19
+
20
+ Preferred runtime entrypoint:
21
+
22
+ ```bash
23
+ aioson workflow:execute . --feature={slug} --tool=<tool> --agentic
24
+ ```
25
+
26
+ `workflow:execute --agentic` is the central orchestration contract. It writes `.aioson/context/workflow-execute.json` with `agentic_policy`, including the review-loop caps, sidecar/scout policy, lane guard, current checkpoint, and resumable command. Prompt-level `Skill(aioson:agent:<next>)` chaining remains a compatibility fallback for clients that cannot let the gateway consume this checkpoint.
19
27
 
20
28
  ## Routing — deterministic, never LLM-chosen
21
29
 
@@ -26,19 +34,22 @@ The next agent comes from the workflow state machine and on-disk evidence, not f
26
34
 
27
35
  Never skip a stage, reorder, or pick an agent the state machine / routing table did not name.
28
36
 
29
- ## Auto-invoke pattern
30
-
31
- When autopilot is active and no stop condition applies:
32
-
33
- 1. Finish your own closing duties first (artifacts on disk, gate registration, dossier/spec updates, `pulse:update`, `agent:done`).
34
- 2. Emit a one-line transition notice: `Autopilot: @<current> done invoking @<next> (Ctrl+C to interrupt)`.
35
- 3. Invoke `Skill(aioson:agent:<next>)` with the task `"continue feature {slug} autopilot handoff from @<current>"`. No user prompt Ctrl+C interrupts.
37
+ ## Auto-invoke pattern
38
+
39
+ When autopilot is active and no stop condition applies:
40
+
41
+ 1. Finish your own closing duties first (artifacts on disk, gate registration, dossier/spec updates, `agent:epilogue`; `agent:done` remains the fallback).
42
+ 2. If the runtime checkpoint contains `agentic_policy.enabled=true`, let the gateway continue from `.aioson/context/workflow-execute.json`; do not ask the user to confirm the next deterministic stage.
43
+ 3. If no runtime gateway is available, emit a one-line transition notice: `Autopilot: @<current> done invoking @<next> (Ctrl+C to interrupt)`.
44
+ 4. Invoke `Skill(aioson:agent:<next>)` with the task `"continue feature {slug} — autopilot handoff from @<current>"`. No user prompt — Ctrl+C interrupts.
36
45
 
37
46
  ## Segment 1 — pre-dev chain (`@analyst` → `@dev`)
38
47
 
39
- `@analyst` → `@scope-check` → `@architect` → `@discovery-design-doc` → (`@pm` on MEDIUM) → **STOP before `@dev`**.
40
-
41
- The pre-dev chain stops before the FIRST `@dev` activation. The human clears context (`/clear`) and starts implementation with a fresh budget — `@dev` is a heavy phase and benefits from a clean context window. Produce `dev-state.md` (the dev handoff producer), emit the standard handoff message, and recommend `/clear` + `/dev`. **Never auto-invoke the initial `@dev` entry.**
48
+ SMALL feature: `@analyst` → `@scope-check` → `@architect` → `@discovery-design-doc` → `@dev`.
49
+
50
+ MEDIUM feature: `@analyst` `@architect` `@discovery-design-doc` `@pm` `@scope-check` `@dev`.
51
+
52
+ The prompt-only fallback still stops before the FIRST `@dev` activation because `@dev` is a heavy phase and benefits from a fresh context window. Runtime agentic mode may cross this boundary only by starting a fresh `@dev` activation from the checkpoint/context package, not by carrying the upstream chat context forward. If the gateway cannot start that fresh activation, stop with the normal `/clear` + `/dev` recommendation.
42
53
 
43
54
  ## Segment 2 — post-dev review cycle (hub = `@qa`)
44
55
 
@@ -49,8 +60,8 @@ Routing table (each row is followed only when autopilot is active and no stop co
49
60
  | Current | Condition | Auto-invoke |
50
61
  |---|---|---|
51
62
  | `@dev` (first pass) | tests green, gates clear, no open corrections cycle | `@qa` |
52
- | `@dev` (corrections) | corrections applied, tests green (`qa-dev-cycle.json` present) | `@qa` (re-verify) |
53
- | `@qa` | verdict **FAIL** (Critical/High) | `@dev` via the corrections auto-cycle (cap 2, security gate) |
63
+ | `@dev` (corrections) | corrections applied, tests green (`review-cycle:status` active; `qa-dev-cycle.json` is legacy QA compatibility) | `@qa` (re-verify) |
64
+ | `@qa` | verdict **FAIL** (Critical/High) | `@dev` via the corrections auto-cycle (cap 3, security gate) |
54
65
  | `@qa` | verdict **PASS** + `@tester` trigger fires AND `@tester` not yet run clean | `@tester` |
55
66
  | `@qa` | verdict **PASS** + `@pentester` trigger fires AND `@pentester` not yet run clean | `@pentester` |
56
67
  | `@qa` | verdict **PASS** + harness contract present AND `@validator` not yet PASS | `@validator` |
@@ -69,8 +80,8 @@ Routing table (each row is followed only when autopilot is active and no stop co
69
80
  ## Stop conditions — break the chain and emit the normal manual handoff
70
81
 
71
82
  1. **`feature:close` / publish** — ALWAYS the human gate. When `@qa` (PASS, nothing pending) or `@validator` (PASS) is the last clean step, STOP and recommend `aioson feature:close . --feature={slug}`. Never auto-run `feature:close`, `feature:archive`, `npm publish`, or any publish/close action.
72
- 2. **First `@dev` entry** — the pre-dev chain stops here (Segment 1). The human clears context and starts implementation.
73
- 3. **Corrections cap reached** — the `@qa`↔`@dev` auto-cycle is bounded at 2 rounds (`qa-dev-cycle.json`); when exhausted, stop and escalate to the human.
83
+ 2. **First `@dev` entry without runtime gateway** — prompt-only clients stop here (Segment 1). Runtime agentic mode may continue only through a fresh checkpointed `@dev` activation.
84
+ 3. **Corrections cap reached** — review cycles are bounded by `agentic_policy.review_cycle` (default 3); when `review-cycle:advance` returns `stop_cycle_limit`, stop and escalate to the human.
74
85
  4. **Critical security finding** — the `@qa` corrections security gate (auth/secret/credential/session/password/token/PII/encryption keywords) blocks the auto-loop; stop and require human intervention.
75
86
  5. **Verdict not clean / gate or readiness blocked** — `@scope-check` not `approved`/`patched`, `@architect` Gate B blocked, `@discovery-design-doc` readiness `blocked`, `@pm` Gate C blocked, `@validator` FAIL with no safe corrections path: stop and route to the owner manually.
76
87
  6. **Context budget** — estimated usage ≥ `context_warning_threshold` (`.aioson/config.md`): write the compaction checkpoint to `.aioson/context/last-handoff.json`, stop, and recommend `/clear`. The workflow resumes from `workflow.state.json` — the next session re-enters autopilot automatically.
@@ -1,6 +1,12 @@
1
- ---
2
- description: "Oracle deep guide — strong vs weak briefing examples, JTBD problem framing, Opportunity Solution Tree, Cagan's four risks, gap analysis, open-questions taxonomy, conversation playbook. Load when an existing briefing feels weak, when the conversation goes generic, or when a complex Themes section needs partitioning."
3
- ---
1
+ ---
2
+ description: "Oracle deep guide — strong vs weak briefing examples, JTBD problem framing, Opportunity Solution Tree, Cagan's four risks, gap analysis, open-questions taxonomy, conversation playbook. Load when an existing briefing feels weak, when the conversation goes generic, or when a complex Themes section needs partitioning."
3
+ agents: [briefing]
4
+ modes: [planning, executing]
5
+ task_types: [briefing-craft, jtbd-framing, opportunity-mapping, gap-classification, briefing-quality]
6
+ load_tier: justified
7
+ triggers: [weak briefing, generic conversation, JTBD, opportunity solution tree, four risks, more than 3 open questions, complex themes, switch interview]
8
+ tags: [briefing, jtbd, gaps, risks]
9
+ ---
4
10
 
5
11
  # Oracle — Briefing Craft
6
12
 
@@ -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