arreio 1.1.0 → 1.2.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 (47) hide show
  1. package/ARCHITECTURE.md +220 -0
  2. package/CHANGELOG.md +43 -0
  3. package/README.md +55 -2
  4. package/package.json +33 -10
  5. package/skills/arreio-init/SKILL.md +19 -24
  6. package/skills/learn/SKILL.md +20 -6
  7. package/skills/learn/modules/capture.md +3 -3
  8. package/skills/learn/modules/index.md +2 -2
  9. package/skills/learn/modules/maintain.md +2 -2
  10. package/skills/learn/modules/refine.md +2 -2
  11. package/skills/learn/references/id-generation.md +3 -1
  12. package/skills/learn/references/interaction-mode-propagation.md +21 -1
  13. package/skills/learn/references/templates/artifacts/captured-entry.md +1 -1
  14. package/skills/learn/references/templates/artifacts/index-update.md +1 -1
  15. package/skills/learn/references/templates/artifacts/maintain-log.md +1 -1
  16. package/skills/learn/references/templates/artifacts/refined-entry.md +1 -1
  17. package/skills/plan/SKILL.md +29 -4
  18. package/skills/plan/modules/design.md +9 -5
  19. package/skills/plan/modules/generate.md +9 -9
  20. package/skills/plan/modules/research.md +2 -2
  21. package/skills/plan/modules/scope.md +2 -2
  22. package/skills/plan/references/design-complexity-assessment.md +16 -7
  23. package/skills/plan/references/error-handling.md +1 -0
  24. package/skills/plan/references/id-generation.md +3 -1
  25. package/skills/plan/references/interaction-mode-propagation.md +25 -1
  26. package/skills/plan/references/plan-tier-selection.md +95 -48
  27. package/skills/plan/references/templates/artifacts/design.md +1 -1
  28. package/skills/plan/references/templates/artifacts/scoped-context.md +1 -1
  29. package/skills/review/SKILL.md +19 -4
  30. package/skills/review/modules/analyze.md +2 -2
  31. package/skills/review/modules/prepare.md +2 -2
  32. package/skills/review/modules/scope.md +3 -3
  33. package/skills/review/references/id-generation.md +3 -1
  34. package/skills/review/references/interaction-mode-propagation.md +21 -1
  35. package/skills/review/references/templates/artifacts/findings.md +1 -1
  36. package/skills/review/references/templates/artifacts/review-kit.md +1 -1
  37. package/skills/review/references/templates/artifacts/review-scope.md +1 -1
  38. package/skills/work/SKILL.md +19 -4
  39. package/skills/work/modules/execute.md +2 -2
  40. package/skills/work/modules/prepare.md +3 -3
  41. package/skills/work/modules/triage.md +2 -2
  42. package/skills/work/references/execution-mode-selection.md +21 -2
  43. package/skills/work/references/id-generation.md +3 -1
  44. package/skills/work/references/interaction-mode-propagation.md +21 -1
  45. package/skills/work/references/templates/artifacts/execution-log.md +1 -1
  46. package/skills/work/references/templates/artifacts/execution-plan.md +1 -1
  47. package/skills/work/references/templates/artifacts/work-manifest.md +1 -1
@@ -70,7 +70,7 @@ Draft the entry's frontmatter and body per the authoritative write contract **[e
70
70
  ### Step 4: Propose slug and Allocate the learn-id Umbrella
71
71
 
72
72
  1. **Propose a `slug`** — a kebab-case, globally-unique stable key for the entry. Derive from the title (concise, descriptive); for time-bound decisions a date suffix is allowed (`critical-risk-tier-security-payments-2026-07-04`). The slug is the upsert key for the entry file and its index record. Refine checks uniqueness; Capture only **proposes**.
73
- 2. **Allocate a `learn-id`** umbrella of the form `YYYY-MM-DD-NNN` per [id-generation.md](../references/id-generation.md), counting existing `docs/learn/.capture/YYYY-MM-DD-NNN-capture.md` files for today. The `learn-id` is the pipeline umbrella carried through Capture → Refine → Index (Maintain-only runs allocate their own `maintain-id` and have no `learn-id`).
73
+ 2. **Allocate a `learn-id`** umbrella of the form `YYYY-MM-DD-NNN` per [id-generation.md](../references/id-generation.md), counting existing `docs/learn/.capture/YYYY-MM-DD-NNN-capture.md` files for today (`detailed` mode only; in `smart`/`autopilot` use the in-memory label per id-generation.md). The `learn-id` is the pipeline umbrella carried through Capture → Refine → Index (Maintain-only runs allocate their own `maintain-id` and have no `learn-id`).
74
74
  3. **Assign a `capture-id`** per [id-generation.md](../references/id-generation.md) (format `YYYY-MM-DD-NNN-capture`, saved to `docs/learn/.capture/`). Reuse it if the user later picks **Edit & Retry**.
75
75
 
76
76
  ### Step 5: Generate the Captured Entry Artifact
@@ -95,7 +95,7 @@ Apply the **[phase confirmation behavior](../references/interaction-mode-propaga
95
95
  - **Smart:** pause only when a pause trigger above is true; otherwise auto-proceed.
96
96
  - **Autopilot:** auto-proceed (no confirmation).
97
97
 
98
- Then save the artifact to `docs/learn/.capture/<capture-id>.md` (ensure `interactionMode` and `target-type` are included) and return it, with the `interactionMode` value, to the Orchestrator for the transition to Phase 2 (Refine).
98
+ Then, **in `detailed` mode only**, save the artifact to `docs/learn/.capture/<capture-id>.md` (ensure `interactionMode` and `target-type` are included) and return it, with the `interactionMode` value, to the Orchestrator for the transition to Phase 2 (Refine). In `smart` and `autopilot` mode, do **not** write the file; pass the artifact to the next phase in context (see [Artifact Persistence](../references/interaction-mode-propagation.md#artifact-persistence)).
99
99
 
100
100
  ## Output: Captured Entry Artifact
101
101
 
@@ -103,6 +103,6 @@ Then save the artifact to `docs/learn/.capture/<capture-id>.md` (ensure `interac
103
103
  - Verify that `target-type` is one of `decision` / `pattern` / `gotcha` / `workflow`.
104
104
  - Verify that the frontmatter and body conform to [entry-schema.md](../references/entry-schema.md) (the per-type section template), without re-encoding the schema inline.
105
105
  - Verify that the `learn-id` umbrella was allocated (Capture is the allocating phase) and the `slug` is kebab-case and descriptive.
106
- - Verify that the artifact is saved to `docs/learn/.capture/<capture-id>.md`.
106
+ - Verify that, in `detailed` mode, the artifact is saved to `docs/learn/.capture/<capture-id>.md`; in `smart`/`autopilot` mode, verify that **no** file was written and the artifact was passed to the next phase in context.
107
107
 
108
108
  > Pass the Captured Entry to `refine` (Phase 2) for type/frontmatter validation and the duplicate + analog check against existing entries.
@@ -79,7 +79,7 @@ Apply the **[phase confirmation behavior](../references/interaction-mode-propaga
79
79
  - **Smart:** pause only when a pause trigger above is true; otherwise auto-proceed.
80
80
  - **Autopilot:** auto-proceed (no confirmation).
81
81
 
82
- Then save the artifact to `docs/learn/.index/<index-id>.md` (ensure `interactionMode` included) and return it to the Orchestrator. The Orchestrator marks the authoring run complete — the durable entry now lives at `docs/learn/<type>/<slug>.md` and `docs/learn/index.md` reflects it.
82
+ Then, **in `detailed` mode only**, save the artifact to `docs/learn/.index/<index-id>.md` (ensure `interactionMode` included) and return it to the Orchestrator. The Orchestrator marks the authoring run complete — the durable entry now lives at `docs/learn/<type>/<slug>.md` and `docs/learn/index.md` reflects it. In `smart` and `autopilot` mode, do **not** write the file; pass the artifact to the next phase in context (see [Artifact Persistence](../references/interaction-mode-propagation.md#artifact-persistence)).
83
83
 
84
84
  ## Output: Index Update Artifact
85
85
 
@@ -89,6 +89,6 @@ Then save the artifact to `docs/learn/.index/<index-id>.md` (ensure `interaction
89
89
  - Verify **index coherence** (orchestrator gate #5): the YAML block length matches the on-disk entry-file count; the per-type count headings match; no duplicate index rows.
90
90
  - Verify that a merge **de-indexed** (not deleted) the analog and recorded the `superseded-by` lineage in the analog's file — lineage preserved per [dedup-rules.md](../references/dedup-rules.md).
91
91
  - Verify that the derived `index-applicability` enum was **read from** [index-format.md](../references/index-format.md) (the derivation rule) rather than re-encoded inline.
92
- - Verify that the artifact is saved to `docs/learn/.index/<index-id>.md`.
92
+ - Verify that, in `detailed` mode, the artifact is saved to `docs/learn/.index/<index-id>.md`; in `smart`/`autopilot` mode, verify that **no** file was written and the artifact was passed to the next phase in context.
93
93
 
94
94
  > The Index Update is the authoring run's final artifact. The Orchestrator marks the workflow complete; the durable knowledge entry lives at `docs/learn/<type>/<slug>.md` and is discoverable via `docs/learn/index.md` (the source-of-truth index Plan/Work/Review search).
@@ -101,7 +101,7 @@ Apply the **[phase confirmation behavior](../references/interaction-mode-propaga
101
101
  - **Smart:** pause only when a pause trigger above is true; otherwise auto-proceed (but destructive operations — migration, prune, merge — always surface for confirmation even in Smart, per the principle that destructive writes are never silent).
102
102
  - **Autopilot:** auto-proceed for non-destructive steps (refresh, rebuild); **still pause** for destructive operations (migration, prune) — Autopilot never silently deletes or rewrites paths.
103
103
 
104
- Then save the artifact to `docs/learn/.maintain/<maintain-id>.md` (ensure `interactionMode` included) and return it to the Orchestrator. The Orchestrator marks the Maintain run complete — the canonical knowledge base is reconciled.
104
+ Then, **in `detailed` mode only**, save the artifact to `docs/learn/.maintain/<maintain-id>.md` (ensure `interactionMode` included) and return it to the Orchestrator. The Orchestrator marks the Maintain run complete — the canonical knowledge base is reconciled. In `smart` and `autopilot` mode, do **not** write the file; pass the artifact to the next phase in context (see [Artifact Persistence](../references/interaction-mode-propagation.md#artifact-persistence)).
105
105
 
106
106
  ## Output: Maintain Log Artifact
107
107
 
@@ -111,6 +111,6 @@ Then save the artifact to `docs/learn/.maintain/<maintain-id>.md` (ensure `inter
111
111
  - Verify that every prune was explicitly confirmed (no silent deletion); a delete leaves no file; a de-index keeps the file with `status: obsolete`.
112
112
  - Verify **index coherence** (orchestrator gate #5): the rebuilt `docs/learn/index.md` YAML length matches the on-disk entry-file count; per-type totals consistent; no duplicate rows.
113
113
  - Verify that the rebuild was **applied from** [index-format.md](../references/index-format.md) (and the applicability-enum derivation) rather than re-encoded inline.
114
- - Verify that the artifact is saved to `docs/learn/.maintain/<maintain-id>.md`.
114
+ - Verify that, in `detailed` mode, the artifact is saved to `docs/learn/.maintain/<maintain-id>.md`; in `smart`/`autopilot` mode, verify that **no** file was written and the artifact was passed to the next phase in context.
115
115
 
116
116
  > The Maintain Log is the Maintain run's deliverable. The Orchestrator marks the workflow complete; the canonical knowledge base at `docs/learn/` is reconciled and `docs/learn/index.md` reflects the on-disk truth.
@@ -91,7 +91,7 @@ Apply the **[phase confirmation behavior](../references/interaction-mode-propaga
91
91
  - **Smart:** pause only when a pause trigger above is true; otherwise auto-proceed.
92
92
  - **Autopilot:** auto-proceed (no confirmation).
93
93
 
94
- Then save the artifact to `docs/learn/.refine/<refine-id>.md` (ensure `interactionMode` included) and return it, with the `interactionMode` value, to the Orchestrator for the transition to Phase 3 (Index).
94
+ Then, **in `detailed` mode only**, save the artifact to `docs/learn/.refine/<refine-id>.md` (ensure `interactionMode` included) and return it, with the `interactionMode` value, to the Orchestrator for the transition to Phase 3 (Index). In `smart` and `autopilot` mode, do **not** write the file; pass the artifact to the next phase in context (see [Artifact Persistence](../references/interaction-mode-propagation.md#artifact-persistence)).
95
95
 
96
96
  ## Output: Refined Entry Artifact
97
97
 
@@ -99,6 +99,6 @@ Then save the artifact to `docs/learn/.refine/<refine-id>.md` (ensure `interacti
99
99
  - Verify that the frontmatter conforms to [entry-schema.md](../references/entry-schema.md) (every required field valid; the per-type body template present) without re-encoding the schema inline.
100
100
  - Verify that the duplicate/analog check ran per [dedup-rules.md](../references/dedup-rules.md) and that any conflict was resolved with a recorded `resolution` (never silently two entries).
101
101
  - Verify that a merge recorded `lineage` (the analog `slug` + `superseded-by` note) — lineage preserved, never deleted.
102
- - Verify that the artifact is saved to `docs/learn/.refine/<refine-id>.md`.
102
+ - Verify that, in `detailed` mode, the artifact is saved to `docs/learn/.refine/<refine-id>.md`; in `smart`/`autopilot` mode, verify that **no** file was written and the artifact was passed to the next phase in context.
103
103
 
104
104
  > Pass the Refined Entry to `index` (Phase 3) to write the entry file and upsert the canonical index.
@@ -12,7 +12,7 @@ Shared ID algorithm for the `capture`, `refine`, `index`, and `maintain` phases,
12
12
 
13
13
  ## ID Format by Phase
14
14
 
15
- | Phase | ID format | Saved to |
15
+ | Phase | ID format | Saved to (detailed only) |
16
16
  | -------- | ----------------------------------- | ----------------------------------- |
17
17
  | Capture | `YYYY-MM-DD-NNN-capture` | `docs/learn/.capture/<id>.md` |
18
18
  | Refine | `YYYY-MM-DD-NNN-refine` | `docs/learn/.refine/<id>.md` |
@@ -69,6 +69,8 @@ The `slug` is the stable, globally-unique key for a knowledge entry — it keys
69
69
 
70
70
  > **Slug is the upsert key, not a timestamp id.** A re-author with the same `slug` overwrites in place (idempotent); a new `slug` creates a new entry. The slug namespace is shared across all four types — there is one global `docs/learn/` slug space, not four.
71
71
 
72
+ > **Persistence by mode.** The "Saved to" column and the directory-listing algorithm below apply **only in `detailed` mode**. In `smart`/`autopilot` mode phase artifacts are not written, so no directory is listed: Phase ids are in-memory labels `<date>-001-<phase>`; no directory is listed to allocate them. The `slug` is unaffected. See [Artifact Persistence](interaction-mode-propagation.md#artifact-persistence).
73
+
72
74
  ## Algorithm (new phase artifact)
73
75
 
74
76
  ```
@@ -86,4 +86,24 @@ Learn deliberately has **no** `executionMode`:
86
86
  | Invalid mode value | Reject; re-prompt Orchestrator |
87
87
  | Artifact missing mode field | Assume "smart"; log warning; continue |
88
88
  | User selects "Abort" | Stop immediately; inform Orchestrator |
89
- | Timeout/connection lost | Pause; ask user to retry or abort |
89
+ | Timeout/connection lost | Pause; ask user to retry or abort |
90
+
91
+ ## Artifact Persistence
92
+
93
+ Phase artifacts (Capture, Refine, Index, Maintain) are **handoff data between phases**, not deliverables. Whether they are written to disk depends on `interactionMode`:
94
+
95
+ | Mode | Phase artifacts (`docs/learn/.capture/`, `.refine/`, `.index/`, `.maintain/`) | Phase handoff |
96
+ | ------------- | ---------------------------------------- | ---------------------------------------------- |
97
+ | **Detailed** | Written to the hidden directories (audit trail; creating the directory on first use) | Artifact is written, shown, then passed on |
98
+ | **Smart** | **Not written** | Artifact is held in context and passed in-memory to the next phase |
99
+ | **Autopilot** | **Not written** | Artifact is held in context and passed in-memory to the next phase |
100
+
101
+ **Always written, in every mode:** the durable entry in `docs/learn/<type>/<slug>.md` and its `docs/learn/index.md` record (written in every mode).
102
+
103
+ **Rules:**
104
+
105
+ - The artifact schema, quality gates, cross-phase ID checks, and pause triggers are **unchanged** — only the disk write is skipped. Validate and pass the in-memory artifact exactly as you would the file.
106
+ - Never create the hidden directories in `smart`/`autopilot`; no placeholder or empty files.
107
+ - **ID allocation without files:** Phase ids are in-memory labels `<date>-001-<phase>`; no directory is listed to allocate them. The `slug` is unaffected.
108
+ - If the user switches to `detailed` mid-run, write the artifacts produced so far, then continue writing.
109
+ - Because nothing is on disk, **Edit & Retry** reuses the in-memory artifact and its id (no file to overwrite).
@@ -53,7 +53,7 @@ inferred: true | false # true when drafted from a short desc
53
53
  # false when grounded in a concrete ref/file the user provided
54
54
  ```
55
55
 
56
- Also save the Captured Entry Artifact to `docs/learn/.capture/<capture-id>.md`.
56
+ In `detailed` mode only, also save the Captured Entry Artifact to `docs/learn/.capture/<capture-id>.md`. In `smart`/`autopilot` mode, do not write it; pass it to the next phase in context.
57
57
 
58
58
  ## Validation Rules
59
59
 
@@ -50,7 +50,7 @@ entry-written: true # the entry file was written (fals
50
50
  index-updated: true # docs/learn/index.md was upserted
51
51
  ```
52
52
 
53
- Also save the Index Update Artifact to `docs/learn/.index/<index-id>.md`.
53
+ In `detailed` mode only, also save the Index Update Artifact to `docs/learn/.index/<index-id>.md`. In `smart`/`autopilot` mode, do not write it; pass it to the next phase in context.
54
54
 
55
55
  ## Validation Rules
56
56
 
@@ -56,7 +56,7 @@ summary: # a one-line human-readable summary
56
56
  "<N> entries migrated; <M> merged; <R> normalized, <F> flagged; <P> pruned; <I> indexed"
57
57
  ```
58
58
 
59
- Also save the Maintain Log Artifact to `docs/learn/.maintain/<maintain-id>.md`.
59
+ In `detailed` mode only, also save the Maintain Log Artifact to `docs/learn/.maintain/<maintain-id>.md`. In `smart`/`autopilot` mode, do not write it; pass it to the next phase in context.
60
60
 
61
61
  ## Validation Rules
62
62
 
@@ -58,7 +58,7 @@ lineage: # set ONLY when resolution == me
58
58
  source-candidate: <carried from Capture> | null
59
59
  ```
60
60
 
61
- Also save the Refined Entry Artifact to `docs/learn/.refine/<refine-id>.md`.
61
+ In `detailed` mode only, also save the Refined Entry Artifact to `docs/learn/.refine/<refine-id>.md`. In `smart`/`autopilot` mode, do not write it; pass it to the next phase in context.
62
62
 
63
63
  ## Validation Rules
64
64
 
@@ -10,7 +10,14 @@ Orchestrates a deterministic pipeline of micro-skills: `Scope -> Research -> Des
10
10
 
11
11
  ## Skill Invocation
12
12
 
13
- This skill is invoked by prompting `/plan <task description>`. This skill will run the planning pipeline, producing a final plan artifact and optionally a set of task artifacts, acting as the Orchestrator.
13
+ This skill is invoked by prompting `/plan [--deep] <task description>`. This skill will run the planning pipeline, producing a final plan artifact and optionally a set of task artifacts, acting as the Orchestrator.
14
+
15
+ **`--deep` flag (optional):** forces the **Deep** plan tier in any interaction mode, including Autopilot, bypassing the tier question and the complexity-based choice.
16
+
17
+ - **Parsing:** `--deep` counts only as a standalone token at the **start or end** of the input. Remove it from the task description, then set `force_deep: true` in the context object. Anywhere else (e.g., inside a sentence or quoted text) it is plain text and `force_deep` stays `false`.
18
+ - If nothing remains after removing the flag, ask: "What would you like to plan? Describe the task or project."
19
+ - The flag does not change the interaction-mode question, `complexity`, or `tier_recommended`; it only sets `tier: deep`. The override stays auditable (`tier_recommended` keeps the algorithm's result).
20
+ - Other `--word` tokens are not flags of this skill; leave them in the description.
14
21
 
15
22
  ## Interaction Method
16
23
 
@@ -27,8 +34,13 @@ Store in the context object:
27
34
 
28
35
  ```yaml
29
36
  interactionMode: detailed | smart | autopilot
37
+ force_deep: true | false # true only when `--deep` was passed; default false
30
38
  ```
31
39
 
40
+ `force_deep` lives in the Orchestrator context (not in artifact files). Pass it to **Design** (to produce the material a Deep plan needs) and **Generate** (to select the tier).
41
+
42
+ **Artifact persistence:** intermediate phase artifacts are written to disk **only in `detailed` mode**. In `smart`/`autopilot` they are passed between phases in context and never written (see `references/interaction-mode-propagation.md#artifact-persistence`). Final deliverables are always written.
43
+
32
44
  **Propagation:** `interactionMode` flows into `research`, `design`, and `generate` artifacts; each downstream phase reads it to adjust confirmation behaviour (detailed = pause every transition; autopilot = run all; smart = pause only on HIGH-risk).
33
45
 
34
46
  ## Orchestration Implementation
@@ -47,6 +59,7 @@ Before starting the planning pipeline, the orchestrator verifies that required f
47
59
 
48
60
  - `docs/plans/` — must exist for saving final plan
49
61
  - `docs/tasks/` — must exist if task generation is enabled
62
+ - `docs/plans/.scope/`, `.research/`, `.design/` — **`detailed` mode only**, for saving the intermediate phase artifacts; do not create them in `smart`/`autopilot`
50
63
 
51
64
  **Self-Healing:** If missing, the orchestrator automatically creates these folders. This allows the plan skill to run even if `arreio-init` wasn't explicitly run.
52
65
 
@@ -69,7 +82,7 @@ Between phases, the orchestrator validates the output artifact before passing it
69
82
  1. **Schema validation** — required fields present and well-formed (see [error-handling.md](references/error-handling.md) for the per-type field list).
70
83
  2. **Cross-phase consistency** — IDs (`scope-id`, `research-id`, `design-id`, `plan-id`) match the upstream artifacts; `interactionMode` is identical across artifacts.
71
84
  3. **Status check** — the artifact's `status` is `complete` (not `pending` or `failed`).
72
- 4. **Tier/complexity coherence** (after Design) — the `tier_recommended` is consistent with `complexity` and `risk_level` per [plan-tier-selection.md](references/plan-tier-selection.md).
85
+ 4. **Tier/complexity coherence** (after Design) — `tier_recommended` equals `recommend_tier(complexity, risk_level)` per [plan-tier-selection.md](references/plan-tier-selection.md). Recompute it; do not trust the value blindly. A `HIGH`/`VERY_HIGH` complexity must yield `deep`.
73
86
 
74
87
  If a gate fails, the orchestrator returns to the producing phase with the error context (per the recovery workflow in [error-handling.md](references/error-handling.md)).
75
88
 
@@ -84,13 +97,13 @@ Each skill module is responsible for registering its own outputs:
84
97
 
85
98
  **Who updates what:**
86
99
 
87
- - **Generate phase:** Creates `docs/plans/index.md` if missing; appends new plan entry with timestamp and link
100
+ - **Generate phase:** Creates `docs/plans/index.md` if missing; inserts the new plan row (or replaces the row with the same `plan-id`)
88
101
  - **Tasks phase:** Creates `docs/tasks/<plan-id>/` folder and `docs/tasks/<plan-id>/index.md` if missing; populates with task file links and metadata
89
102
 
90
103
  ### FINAL OUTPUT
91
104
 
92
105
  - **Plan file:** Saved to `docs/plans/YYYY-MM-DD-NNN-<kebab-case-name>.md`
93
- - **Registration:** Generate phase appends an entry to `docs/plans/index.md` linking the new plan
106
+ - **Registration:** Generate phase inserts or replaces the row in `docs/plans/index.md` linking the new plan
94
107
  - **Task files (optional):** Saved to `docs/tasks/<plan-id>/TASK-NNN-<kebab-case-name>.md`
95
108
  - **Registration:** Tasks phase creates `docs/tasks/<plan-id>/index.md` and registers task file links there
96
109
  - Ready for the Work skill to consume via `docs/tasks/<plan-id>/index.md`
@@ -113,6 +126,17 @@ The orchestrator and modules share these reference files:
113
126
 
114
127
  Artifact templates live in [references/templates/artifacts/](references/templates/artifacts/).
115
128
 
129
+ ## Execution Rules
130
+
131
+ Follow these literally; they exist to keep runs consistent across agents.
132
+
133
+ 1. **Run each module's steps in order**, starting with its Step 0 verification. Do not skip, merge, or reorder steps.
134
+ 2. **Never invent values.** If a required input is missing, apply the recovery in [error-handling.md](references/error-handling.md) or ask the user; do not fill it with a plausible guess.
135
+ 3. **Compute, don't copy.** Values defined by an algorithm (`complexity`, `tier_recommended`, `tier`) must be evaluated with the real inputs. Example values in references are illustrations, never defaults.
136
+ 4. **One question at a time**, with 2–4 concrete options; build the question text from the current values.
137
+ 5. **Announce phase transitions in one line** (e.g., "Phase 3/5 Design complete: complexity HIGH, tier_recommended deep") so the user can follow progress, even in Autopilot.
138
+ 6. **Honor write rules:** hidden phase artifacts only in `detailed` mode; the final plan, index row, and (if accepted) task files always.
139
+
116
140
  ## Core Principles
117
141
 
118
142
  - **Deterministic Pipeline:** Phases always execute in sequence (no agent switching, no fallback paths).
@@ -122,6 +146,7 @@ Artifact templates live in [references/templates/artifacts/](references/template
122
146
  - **Separate Planning from Execution:** NEVER simulate implementation during planning.
123
147
  - **Be Concrete:** Use specific files, components, and dependencies.
124
148
  - **Stay Portable:** Use repository-relative paths only.
149
+ - **Lean Persistence:** Phase artifacts hit disk only in `detailed` mode; `smart`/`autopilot` pass them in context to save tokens and time.
125
150
  - **Transparent Artifacts:** Each phase produces an explicit output artifact for the next phase.
126
151
  - **Interaction Mode Propagation:** `interactionMode` is read at the start of each subsequent phase and determines whether confirmation steps execute.
127
152
  - **Single Source of Truth:** This skill defines all its own rules; it does not depend on any external agent rule file.
@@ -22,6 +22,7 @@ Run the **[Step 0 verification](../references/error-handling.md)**. Required inp
22
22
  2. **Research Findings Artifact** with `research-id`, `Patterns Found`, `High-Risk Detection` (with `risk_level`), `Tech Stack`.
23
23
  3. `interactionMode` present (default to `smart` if missing; log warning).
24
24
  4. Cross-phase consistency: the research artifact's `scope-id` matches the scope output.
25
+ 5. `force_deep` (boolean from the Orchestrator context; default `false`). It never changes `complexity` or `tier_recommended`; it only raises the amount of material this phase must produce (Steps 4–5).
25
26
 
26
27
  ### Step 1: Approach Selection
27
28
 
@@ -90,6 +91,8 @@ Score the design across five dimensions (0–3 each) and compute the complexity
90
91
  2. Sum the scores (0–15).
91
92
  3. Map to complexity level: `TRIVIAL | LOW | MEDIUM | HIGH | VERY_HIGH`.
92
93
  4. Record all five scores, the total, and the complexity level in the Design Artifact.
94
+ 5. **Compute `tier_recommended`** by evaluating `recommend_tier(complexity, risk_level)` from [plan-tier-selection.md](../references/plan-tier-selection.md) with the actual values from steps 1–3 (complexity-driven default, then the risk floor). Apply the Anti-Default Rules there: `HIGH`/`VERY_HIGH` → `deep`, `MEDIUM` → `standard`, `TRIVIAL`/`LOW` → `fast`, raised only by risk. Do not ignore `risk_level`, and do not pick `standard` by default. `force_deep` and user preference do **not** affect this value.
95
+ 6. **If `force_deep` is true:** also draft rollout notes (feature flags, monitoring, data migration, rollback, performance baseline — or `Not applicable — <reason>` per item) and a cross-system integration map so Generate can fill the Deep sections from real content.
93
96
 
94
97
  ### Step 5: Alternative Approaches
95
98
 
@@ -97,7 +100,7 @@ Document the approaches considered but not selected, with rejection rationale.
97
100
 
98
101
  - **TRIVIAL / LOW complexity:** At least 1 alternative (may be brief).
99
102
  - **MEDIUM complexity:** At least 1 alternative with rationale.
100
- - **HIGH / VERY_HIGH complexity:** At least 2 alternatives with side-by-side rationale.
103
+ - **HIGH / VERY_HIGH complexity, or `force_deep` is true:** At least 2 alternatives with side-by-side rationale.
101
104
 
102
105
  Format: `**[Approach Name]**: [Description] → **Rejected because:** [Rationale]`
103
106
 
@@ -113,7 +116,7 @@ Format: `**[Approach Name]**: [Description] → **Rejected because:** [Rationale
113
116
  1. **Assign a `design-id`** per [id-generation.md](../references/id-generation.md) (format `YYYY-MM-DD-NNN-design`, saved to `docs/plans/.design/`). Reuse it if the user later picks **Edit & Retry**.
114
117
 
115
118
  2. Produce a **Design Artifact** block (as markdown) following the schema in [design.md](../references/templates/artifacts/design.md).
116
- - Include the generated `design-id`, inherited `scope-id` and `research-id`, `interactionMode`, `complexity`, and `tier_recommended` (derived from complexity per [plan-tier-selection.md](../references/plan-tier-selection.md)).
119
+ - Include the generated `design-id`, inherited `scope-id` and `research-id`, `interactionMode`, `complexity`, and `tier_recommended` (the value computed in Step 4.5 — never re-derive it from complexity alone).
117
120
 
118
121
  ### Step 7: Present, Confirm, and Save
119
122
 
@@ -128,13 +131,14 @@ Apply the **[phase confirmation behavior](../references/interaction-mode-propaga
128
131
  - **Smart:** pause only when a pause trigger above is true; otherwise auto-proceed.
129
132
  - **Autopilot:** auto-proceed (no confirmation).
130
133
 
131
- Then save the artifact to `docs/plans/.design/<design-id>.md` (ensure `interactionMode`, `complexity`, and `tier_recommended` are included) and return it, with the `interactionMode` value, to the Orchestrator for the transition to Phase 4 (Generate).
134
+ Then, **in `detailed` mode only**, save the artifact to `docs/plans/.design/<design-id>.md` (ensure `interactionMode`, `complexity`, and `tier_recommended` are included) and return it, with the `interactionMode` value, to the Orchestrator for the transition to Phase 4 (Generate). In `smart` and `autopilot` mode, do **not** write the file; pass the artifact to the next phase in context (see [Artifact Persistence](../references/interaction-mode-propagation.md#artifact-persistence)).
132
135
 
133
136
  ## Output: Design Artifact
134
137
 
135
138
  - Verify that the Design Artifact is complete and valid, containing all required fields: `design-id`, `scope-id`, `research-id`, `interactionMode`, `complexity`, `tier_recommended`, Approach, High-Level Technical Design, Implementation Units (each with Acceptance Criteria), Complexity Assessment, Alternative Approaches, Related Learnings, and Learning Gaps.
136
139
  - Verify that the `complexity` value matches the threshold mapping from the five dimension scores.
137
- - Verify that `tier_recommended` is consistent with the complexity and risk level per [plan-tier-selection.md](../references/plan-tier-selection.md).
138
- - Verify that the artifact is saved to `docs/plans/.design/<design-id>.md` for future reference or reuse.
140
+ - Verify that `tier_recommended` equals `recommend_tier(complexity, risk_level)` per [plan-tier-selection.md](../references/plan-tier-selection.md) (e.g., `complexity: HIGH` → `deep`, not `standard`).
141
+ - Verify that, when `force_deep` is true, the artifact contains ≥ 2 alternatives and the rollout/integration drafts from Step 4.6.
142
+ - Verify that, in `detailed` mode, the artifact is saved to `docs/plans/.design/<design-id>.md`; in `smart`/`autopilot` mode, verify that **no** file was written and the artifact was passed to the next phase in context.
139
143
 
140
144
  > Pass the design artifact to `generate` (Phase 4) for final plan generation.
@@ -30,19 +30,18 @@ Select the plan tier based on complexity, risk, and user preference. For the ful
30
30
  1. **Read inputs:**
31
31
  - `complexity` from the Design Artifact
32
32
  - `risk_level` from the Research Findings (carried via the Design Artifact's complexity assessment)
33
- - `tier_recommended` from the Design Artifact (the algorithm's suggestion)
33
+ - `force_deep` from the Orchestrator context (`--deep` flag; default `false`)
34
+ - `tier_recommended` from the Design Artifact — then **recompute** `recommend_tier(complexity, risk_level)`; if they differ, use the recomputed value and log a warning.
34
35
 
35
36
  2. **Determine user preference:**
36
- - In **Detailed** mode: Ask the user which tier they want, presenting the recommendation. Options: `Fast`, `Standard`, `Deep`, `Auto`.
37
- - In **Smart** mode: Auto-select, unless a pause trigger fires (Deep tier, preference conflicts with risk floor, or CRITICAL risk). If paused, ask the user.
37
+ - If `force_deep` is true: set `tier = deep`, announce "Deep plan forced by `--deep`", and **skip the tier question in every mode**.
38
+ - In **Detailed** mode: Ask the user which tier they want using the prompt in [plan-tier-selection.md](../references/plan-tier-selection.md#asking-the-user-for-preference), filled with the computed complexity, risk level, and `tier_recommended`. Options: `Fast`, `Standard`, `Deep`, `Auto`.
39
+ - In **Smart** mode: Set `user_preference = auto`, unless a pause trigger fires (Deep tier without `force_deep`, preference conflicts with risk floor, or CRITICAL risk). If paused, ask the user.
38
40
  - In **Autopilot** mode: Set `user_preference = auto`; never ask.
39
41
 
40
- 3. **Apply the selection algorithm** (see [plan-tier-selection.md](../references/plan-tier-selection.md)):
41
- - Start from the complexity-driven default tier.
42
- - Upgrade if risk warrants it (respect the risk floor).
43
- - Honor user preference unless it violates the risk floor.
42
+ 3. **Evaluate `select_tier(...)`** from [plan-tier-selection.md](../references/plan-tier-selection.md) with the real values. `auto` resolves to `tier_recommended` — never to `Standard` by default. Honor an explicit preference unless it is below the risk floor.
44
43
 
45
- 4. **Record the selected tier** as `tier` and the algorithm's recommendation as `tier_recommended` (for audit when the user overrides).
44
+ 4. **Record the selected tier** as `tier` and the algorithm's recommendation as `tier_recommended` (for audit when the user overrides or `--deep` is used).
46
45
 
47
46
  ### Step 2: Plan Rendering
48
47
 
@@ -100,6 +99,7 @@ Render the final plan from the [Final Plan template](../references/templates/art
100
99
  5. **Build Operational / Rollout Notes** (Standard/Deep only) from the Design's rollout units:
101
100
  - Feature flags, monitoring, data migration, rollback plan, performance baseline
102
101
  - Skip the section entirely if not applicable (Fast tier, or no rollout units)
102
+ - **Deep tier:** every required item (feature flags, monitoring, data migration, rollback plan, performance baseline) and the cross-system integration map must appear; write `Not applicable — <reason>` for items that truly do not apply (typical for `--deep` on a small change). Never invent content.
103
103
 
104
104
  6. **Right-size:** Per Plan Skill core principles — small tasks → short plans; complex work → more structure. Do not pad a Fast plan with empty sections; do not omit required sections from a Deep plan.
105
105
 
@@ -112,7 +112,7 @@ Render the final plan from the [Final Plan template](../references/templates/art
112
112
 
113
113
  Apply the **[phase confirmation behavior](../references/interaction-mode-propagation.md)** for the current `interactionMode`, using these generate-specific **Smart pause triggers**:
114
114
 
115
- - The selected tier is `Deep`, or
115
+ - The selected tier is `Deep` and `force_deep` is false, or
116
116
  - The user's tier preference conflicts with the risk floor, or
117
117
  - Research reported CRITICAL risk (Security or Payments).
118
118
 
@@ -111,12 +111,12 @@ Apply the **[phase confirmation behavior](../references/interaction-mode-propaga
111
111
  - **Smart:** pause only when a pause trigger above is true; otherwise auto-proceed.
112
112
  - **Autopilot:** auto-proceed (no confirmation).
113
113
 
114
- On any proceed/skip path: save the artifact to `docs/plans/.research/<research-id>.md` (ensure `interactionMode` is included), then return the artifact and `interactionMode` to the Orchestrator for the transition to Phase 3 (Design).
114
+ On any proceed/skip path: in `detailed` mode only, save the artifact to `docs/plans/.research/<research-id>.md` (ensure `interactionMode` is included), then return the artifact and `interactionMode` to the Orchestrator for the transition to Phase 3 (Design). In `smart` and `autopilot` mode, do **not** write the file; pass the artifact to the next phase in context (see [Artifact Persistence](../references/interaction-mode-propagation.md#artifact-persistence)).
115
115
 
116
116
  ## Output: Research Findings Artifact
117
117
 
118
118
  - Verify that the Research Findings Artifact is complete and valid, containing all required fields, and it accurately reflects the user's input and any existing plans, learnings, or requirements found.
119
119
  - Verify that the `interactionMode` value is set correctly based on the user's selection in the Orchestrator skill.
120
- - Verify that the artifact is saved to `docs/plans/.research/<research-id>.md` for future reference or reuse.
120
+ - Verify that, in `detailed` mode, the artifact is saved to `docs/plans/.research/<research-id>.md`; in `smart`/`autopilot` mode, verify that **no** file was written and the artifact was passed to the next phase in context.
121
121
 
122
122
  > Pass the research findings to `design` (Phase 3) for the design phase.
@@ -110,12 +110,12 @@ Apply the **[phase confirmation behavior](../references/interaction-mode-propaga
110
110
  - **Smart:** pause only when a pause trigger above is true; otherwise auto-proceed.
111
111
  - **Autopilot:** auto-proceed (no confirmation).
112
112
 
113
- Then save the artifact to `docs/plans/.scope/<scope-id>.md` (ensure `interactionMode` is included) and return it, with the `interactionMode` value, to the Orchestrator for the transition to Phase 2 (Research).
113
+ Then, **in `detailed` mode only**, save the artifact to `docs/plans/.scope/<scope-id>.md` (ensure `interactionMode` is included) and return it, with the `interactionMode` value, to the Orchestrator for the transition to Phase 2 (Research). In `smart` and `autopilot` mode, do **not** write the file; pass the artifact to the next phase in context (see [Artifact Persistence](../references/interaction-mode-propagation.md#artifact-persistence)).
114
114
 
115
115
  ## Output: Scoped Context Artifact
116
116
 
117
117
  - Verify that the Scoped Context Artifact is complete and valid, containing all required fields, and it accurately reflects the user's input and any existing plans, learnings, or requirements found.
118
118
  - Verify that the `interactionMode` value is set correctly based on the user's selection in the Orchestrator skill.
119
- - Verify that the artifact is saved to `docs/plans/.scope/<scope-id>.md` for future reference or reuse.
119
+ - Verify that, in `detailed` mode, the artifact is saved to `docs/plans/.scope/<scope-id>.md`; in `smart`/`autopilot` mode, verify that **no** file was written and the artifact was passed to the next phase in context.
120
120
 
121
121
  > Pass the scoped context to `research` (Phase 2) for the research phase.
@@ -2,8 +2,8 @@
2
2
  title: Design Complexity Assessment
3
3
  description: Reference for the Design phase. Defines the complexity scoring algorithm across five dimensions, the heuristics for assigning complexity levels, and how complexity maps to interaction-mode pause behavior.
4
4
  type: reference
5
- version: 1.1
6
- timestamp: "2026-08-07"
5
+ version: 1.2
6
+ timestamp: "2026-10-01"
7
7
  ---
8
8
 
9
9
  # Design Complexity Assessment
@@ -22,15 +22,22 @@ Score each dimension from 0 to 3, then sum for a total complexity score (0–15)
22
22
  | ----------------------- | ----------------------- | ----------------------- | --------------------------------- | --------------------------------- |
23
23
  | **Scope Breadth** | Single file | 2–3 files, one module | Multiple modules | Cross-system / cross-repo |
24
24
  | **Integration Surface** | No new integrations | One new internal API | Multiple internal or one external | Multiple external / third-party |
25
- | **Risk Level** | LOW (from research) | MEDIUM (single area) | HIGH (single area) | HIGH (multiple areas) or CRITICAL |
25
+ | **Risk Level** | LOW (from research) | MEDIUM (from research) | HIGH (from research) | CRITICAL (from research) |
26
26
  | **Novelty** | Existing pattern reused | Minor variation | New pattern in familiar domain | New pattern in unfamiliar domain |
27
27
  | **Data / Migration** | No data changes | Additive, backward-safe | Schema change with migration path | Destructive or no rollback path |
28
28
 
29
+ ### Scoring Procedure (follow in order)
30
+
31
+ 1. For each of the five dimensions, write one line of **evidence** (file count, named integrations, matched pattern, migration note) before choosing the score. A score without evidence is not allowed.
32
+ 2. Pick the **lowest score whose column matches the evidence**; if evidence sits between two columns, take the higher (see Notes).
33
+ 3. Add the five scores, then apply the threshold mapping below literally. Do not adjust the level by "feel".
34
+ 4. Do not default to `MEDIUM`: a 1-file tweak is `TRIVIAL`/`LOW`, a cross-module change with an external service is `HIGH`. Let the arithmetic decide.
35
+
29
36
  ### Dimension Definitions
30
37
 
31
38
  - **Scope Breadth** — How many files, modules, or systems the change touches. Read from the Implementation Units' `Files` lists.
32
39
  - **Integration Surface** — Number and kind of APIs/services the solution must connect to. Pull from the Research Findings `Patterns Found` and `Tech Stack`.
33
- - **Risk Level** — Inherited from the Research phase `High-Risk Detection`. Do not re-score; copy the value.
40
+ - **Risk Level** — Inherited from the Research phase `High-Risk Detection`. Do not re-score: map the inherited level to its score (`LOW`=0, `MEDIUM`=1, `HIGH`=2, `CRITICAL`=3). The artifact records the level name; the score is used only in the sum.
34
41
  - **Novelty** — Whether the approach reuses an existing local pattern or introduces a new one. Compare the chosen approach against `Patterns Found` confidence levels.
35
42
  - **Data / Migration** — Whether data schemas change and whether the change is reversible. Read from the Design's `Operational / Rollout Notes` draft.
36
43
 
@@ -85,7 +92,7 @@ Complexity feeds into tier selection in the Generate phase:
85
92
  | MEDIUM | Standard | Full template; phased units; risk table |
86
93
  | HIGH / VERY_HIGH | Deep | Full template + alternatives + rollout ops |
87
94
 
88
- See [plan-tier-selection.md](plan-tier-selection.md) for the complete tier-selection algorithm, including how complexity combines with risk and user preference.
95
+ The table is the **complexity-only** default. Design then applies the risk floor with `recommend_tier(complexity, risk_level)` and writes the result as `tier_recommended`. See [plan-tier-selection.md](plan-tier-selection.md) for the complete algorithm, including user preference and the `--deep` override (which does not change `complexity` or `tier_recommended`).
89
96
 
90
97
  ## Worked Example
91
98
 
@@ -95,18 +102,20 @@ See [plan-tier-selection.md](plan-tier-selection.md) for the complete tier-selec
95
102
  | ------------------- | ----- | ------------------------------------------------- |
96
103
  | Scope Breadth | 2 | Multiple modules: middleware, store, client |
97
104
  | Integration Surface | 2 | One external system (Redis) |
98
- | Risk Level | 2 | HIGH (single area: sessions/auth) |
105
+ | Risk Level | 2 | HIGH (inherited from research) |
99
106
  | Novelty | 1 | Redis is new to the codebase but pattern is known |
100
107
  | Data / Migration | 1 | Additive; sessions expire naturally |
101
108
  | **Total** | **8** | **Complexity: HIGH** |
102
109
 
110
+ Tier: complexity HIGH → Deep; risk HIGH does not lower it → `tier_recommended: deep`.
111
+
103
112
  Result: In Smart mode, this would **not** pause (HIGH, not VERY_HIGH) unless the secondary flags trigger (e.g., 3+ learning gaps).
104
113
 
105
114
  ## Error Handling
106
115
 
107
116
  | Scenario | Recovery |
108
117
  | ---------------------------------------------------------------- | ---------------------------------------- |
109
- | Risk level missing from Research artifact | Default to MEDIUM (score 2); log warning |
118
+ | Risk level missing from Research artifact | Default to MEDIUM (score 1); log warning |
110
119
  | Implementation Units not yet drafted | Defer scoring until units exist |
111
120
  | Two dimensions conflict (e.g., LOW risk + destructive migration) | Use the higher score; log warning |
112
121
  | Score lands exactly on a threshold (e.g., 7) | Round up to the higher level (HIGH) |
@@ -145,6 +145,7 @@ In addition to per-phase verification, the Orchestrator should verify consistenc
145
145
  | `scope-id` in design artifact matches scope output | Reject design; re-run from research |
146
146
  | `plan-id` references the correct design artifact | Reject generate; re-run from design |
147
147
  | `interactionMode` is identical across all artifacts | Log warning; use earliest non-default value |
148
+ | `tier_recommended` equals `recommend_tier(complexity, risk_level)` | Recompute; use the recomputed value; log warning |
148
149
 
149
150
  ## Notes
150
151
 
@@ -12,7 +12,7 @@ Shared ID algorithm for the `scope`, `research`, `design`, and `generate` phases
12
12
 
13
13
  ## ID Format by Phase
14
14
 
15
- | Phase | ID format | Saved to |
15
+ | Phase | ID format | Saved to (detailed only) |
16
16
  | -------- | ----------------------------------- | -------------------------------- |
17
17
  | Scope | `YYYY-MM-DD-NNN-scope` | `docs/plans/.scope/<id>.md` |
18
18
  | Research | `YYYY-MM-DD-NNN-research` | `docs/plans/.research/<id>.md` |
@@ -21,6 +21,8 @@ Shared ID algorithm for the `scope`, `research`, `design`, and `generate` phases
21
21
 
22
22
  `<kebab-name>` is the plan title in lowercase-hyphen form (no stopwords).
23
23
 
24
+ > **Persistence by mode.** The "Saved to" column and the directory-listing algorithm below apply **only in `detailed` mode**. In `smart`/`autopilot` mode phase artifacts are not written, so no directory is listed: Allocate the plan-id `YYYY-MM-DD-NNN` once at Scope by counting today's final plan files in `docs/plans/` (excluding hidden dirs); every phase id is `<plan-id>-<phase>` (e.g. `2026-09-02-001-scope`). See [Artifact Persistence](interaction-mode-propagation.md#artifact-persistence).
25
+
24
26
  ## Algorithm (new artifact)
25
27
 
26
28
  ```
@@ -25,11 +25,15 @@ Reference for how `interactionMode` propagates through the Plan pipeline (Scope
25
25
  | **Scope** | Present artifact; ask Proceed/Edit/Abort | Auto-proceed; pause if 3+ learning gaps, non-software domain, or conflicting requirements | Auto-proceed |
26
26
  | **Research** | Show findings; ask Proceed/Edit/Abort | Auto-proceed; pause if HIGH/CRITICAL risk with <3 patterns, or zero patterns found | Auto-proceed |
27
27
  | **Design** | Show units; ask Proceed/Edit/Abort | Auto-proceed; pause if VERY_HIGH complexity, HIGH risk + <3 patterns, 3+ scope gaps, or Novelty=3 | Auto-proceed |
28
- | **Generate** | Show plan; ask Proceed/Edit/Skip/Abort | Auto-proceed; pause if tier=Deep, tier preference conflicts with risk floor, or CRITICAL risk | Auto-proceed |
28
+ | **Generate** | Show plan; ask Proceed/Edit/Skip/Abort | Auto-proceed; pause if tier=Deep (not when forced by `--deep`), tier preference conflicts with risk floor, or CRITICAL risk | Auto-proceed |
29
29
  | **Tasks** | Ask Create/Review/No (full file content shown) | Ask Create/Review/No (summary shown) | Ask Create/Review/No (always asks) |
30
30
 
31
31
  **Smart mode pauses only on each phase's documented triggers above** (the canonical list lives in each module's confirmation step; this table is a summary).
32
32
 
33
+ ## `--deep` Flag
34
+
35
+ `/plan --deep <task>` sets `force_deep: true` in the Orchestrator context. It is orthogonal to `interactionMode`: in every mode the Generate phase selects the Deep tier without asking about tier. It does not add pauses and removes the Smart-mode "tier is Deep" pause. See [plan-tier-selection.md](plan-tier-selection.md#deep-override---deep).
36
+
33
37
  ## Artifact Schema
34
38
 
35
39
  All phase artifacts (Scope 1-4) include:
@@ -73,3 +77,23 @@ status: pending | complete | failed
73
77
  | Invalid mode value | Reject; re-prompt Orchestrator |
74
78
  | Artifact missing mode field | Assume "smart"; log warning; continue |
75
79
  | Timeout/connection lost | Pause; ask user to retry or abort |
80
+
81
+ ## Artifact Persistence
82
+
83
+ Phase artifacts (Scope, Research, Design) are **handoff data between phases**, not deliverables. Whether they are written to disk depends on `interactionMode`:
84
+
85
+ | Mode | Phase artifacts (`docs/plans/.scope/`, `.research/`, `.design/`) | Phase handoff |
86
+ | ------------- | ---------------------------------------- | ---------------------------------------------- |
87
+ | **Detailed** | Written to the hidden directories (audit trail; creating the directory on first use) | Artifact is written, shown, then passed on |
88
+ | **Smart** | **Not written** | Artifact is held in context and passed in-memory to the next phase |
89
+ | **Autopilot** | **Not written** | Artifact is held in context and passed in-memory to the next phase |
90
+
91
+ **Always written, in every mode:** the final plan in `docs/plans/` (+ `docs/plans/index.md`) and any task files in `docs/tasks/<plan-id>/`.
92
+
93
+ **Rules:**
94
+
95
+ - The artifact schema, quality gates, cross-phase ID checks, and pause triggers are **unchanged** — only the disk write is skipped. Validate and pass the in-memory artifact exactly as you would the file.
96
+ - Never create the hidden directories in `smart`/`autopilot`; no placeholder or empty files.
97
+ - **ID allocation without files:** Allocate the plan-id `YYYY-MM-DD-NNN` once at Scope by counting today's final plan files in `docs/plans/` (excluding hidden dirs); every phase id is `<plan-id>-<phase>` (e.g. `2026-09-02-001-scope`).
98
+ - If the user switches to `detailed` mid-run, write the artifacts produced so far, then continue writing.
99
+ - Because nothing is on disk, **Edit & Retry** reuses the in-memory artifact and its id (no file to overwrite).