arreio 1.0.5 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +55 -2
  2. package/package.json +1 -1
  3. package/skills/arreio-init/SKILL.md +33 -46
  4. package/skills/learn/SKILL.md +21 -7
  5. package/skills/learn/modules/capture.md +6 -6
  6. package/skills/learn/modules/index.md +3 -3
  7. package/skills/learn/modules/maintain.md +3 -3
  8. package/skills/learn/modules/refine.md +3 -3
  9. package/skills/learn/references/id-generation.md +14 -12
  10. package/skills/learn/references/interaction-mode-propagation.md +21 -1
  11. package/skills/learn/references/templates/artifacts/captured-entry.md +1 -1
  12. package/skills/learn/references/templates/artifacts/index-update.md +1 -1
  13. package/skills/learn/references/templates/artifacts/learn-input.md +1 -1
  14. package/skills/learn/references/templates/artifacts/maintain-log.md +1 -1
  15. package/skills/learn/references/templates/artifacts/refined-entry.md +1 -1
  16. package/skills/plan/SKILL.md +29 -4
  17. package/skills/plan/modules/design.md +9 -5
  18. package/skills/plan/modules/generate.md +9 -9
  19. package/skills/plan/modules/research.md +2 -2
  20. package/skills/plan/modules/scope.md +2 -2
  21. package/skills/plan/references/design-complexity-assessment.md +16 -7
  22. package/skills/plan/references/error-handling.md +1 -0
  23. package/skills/plan/references/id-generation.md +3 -1
  24. package/skills/plan/references/interaction-mode-propagation.md +25 -1
  25. package/skills/plan/references/plan-tier-selection.md +95 -48
  26. package/skills/plan/references/templates/artifacts/design.md +1 -1
  27. package/skills/plan/references/templates/artifacts/scoped-context.md +1 -1
  28. package/skills/review/SKILL.md +24 -9
  29. package/skills/review/modules/analyze.md +3 -3
  30. package/skills/review/modules/prepare.md +3 -3
  31. package/skills/review/modules/report.md +9 -9
  32. package/skills/review/modules/scope.md +4 -4
  33. package/skills/review/references/error-handling.md +1 -1
  34. package/skills/review/references/id-generation.md +18 -16
  35. package/skills/review/references/interaction-mode-propagation.md +21 -1
  36. package/skills/review/references/templates/artifacts/findings.md +1 -1
  37. package/skills/review/references/templates/artifacts/review-input.md +1 -1
  38. package/skills/review/references/templates/artifacts/review-kit.md +1 -1
  39. package/skills/review/references/templates/artifacts/review-report.md +6 -6
  40. package/skills/review/references/templates/artifacts/review-scope.md +1 -1
  41. package/skills/work/SKILL.md +19 -4
  42. package/skills/work/modules/execute.md +2 -2
  43. package/skills/work/modules/prepare.md +3 -3
  44. package/skills/work/modules/triage.md +2 -2
  45. package/skills/work/references/execution-mode-selection.md +21 -2
  46. package/skills/work/references/id-generation.md +3 -1
  47. package/skills/work/references/interaction-mode-propagation.md +21 -1
  48. package/skills/work/references/templates/artifacts/execution-log.md +1 -1
  49. package/skills/work/references/templates/artifacts/execution-plan.md +1 -1
  50. package/skills/work/references/templates/artifacts/work-manifest.md +1 -1
package/README.md CHANGED
@@ -34,13 +34,25 @@ Run this command in your AI coding agent to:
34
34
  2. Create the project structure (`docs/plans/`, `docs/learn/`, etc.)
35
35
  3. Set up architectural documentation and index files
36
36
 
37
- This makes all five core skills available in your AI development environment:
37
+ This makes all six skills available in your AI development environment:
38
38
 
39
39
  - **arreio-init** - Initialize projects to follow the Arreio workflow
40
40
  - **plan** - Structure and decompose work into executable tasks
41
41
  - **work** - Execute tasks with guardrailed implementation
42
42
  - **review** - Conduct comprehensive code reviews
43
43
  - **learn** - Capture and refine knowledge from completed work
44
+ - **end-session** - Commit the session with a traceable session artifact
45
+
46
+ ## Quick Start
47
+
48
+ ```text
49
+ /plan [--deep] Add Redis-backed session storage # produce a plan (+ optional task files)
50
+ /work <plan-id> # execute the plan's tasks, test-first
51
+ /review <work-id | git range | description> # review the changes, get a verdict
52
+ /learn <candidate-ref | decision "text"> # keep what the team learned
53
+ ```
54
+
55
+ Each skill is invoked by prompt (`/plan`, `/work`, `/review`, `/learn`) and first asks you to choose an interaction mode.
44
56
 
45
57
  ## Skill Based Workflow
46
58
 
@@ -48,8 +60,22 @@ This makes all five core skills available in your AI development environment:
48
60
 
49
61
  Use /arreio-init to initialize a new project, to enable the project to follow the four phases of the Arreio workflows.
50
62
 
63
+ ### Interaction Modes
64
+
65
+ Every pipeline asks for an interaction mode before it starts:
66
+
67
+ | Mode | Behavior |
68
+ | ------------- | -------------------------------------------------------------------------------- |
69
+ | **Detailed** | Confirm at each phase transition; inspect every artifact. Maximum control. |
70
+ | **Smart** | Phases run automatically; pause only on risky, destructive, or ambiguous events. |
71
+ | **Autopilot** | Phases run automatically; only the final outcome is reported. |
72
+
73
+ Intermediate phase artifacts (scope, research, triage, analyze, etc.) are written to hidden folders **only in Detailed mode**; in Smart/Autopilot they are passed in context. Final deliverables (plans, tasks, reports, learn entries) are always written.
74
+
51
75
  ### Plan
52
76
 
77
+ Invoke with `/plan [--deep] <task description>`.
78
+
53
79
  | Phase | Module Name | Purpose |
54
80
  | ----- | ------------ | ----------------------------------------- |
55
81
  | 1 | **scope** | Gather context, validate domain |
@@ -58,8 +84,16 @@ Use /arreio-init to initialize a new project, to enable the project to follow th
58
84
  | 4 | **generate** | Select tier, render plan, save to docs |
59
85
  | 5 | **tasks** | Slice plan into executable tasks |
60
86
 
87
+ **Plan tiers.** The Generate phase right-sizes the plan: **Fast** (trivial/low complexity), **Standard** (medium), or **Deep** (high/very high complexity, with alternatives and rollout notes). The tier comes from a complexity score (five dimensions, 0–15) combined with the detected risk level; high risk raises the minimum tier. Choosing `Auto` uses the computed recommendation, which is recorded as `tier_recommended`.
88
+
89
+ **`--deep`.** Put `--deep` at the start or end of the input to force a Deep plan in any interaction mode (including Autopilot), without the tier question. The algorithm's own recommendation is still recorded in `tier_recommended`, so the override is auditable.
90
+
91
+ Plan outputs: `docs/plans/YYYY-MM-DD-NNN-<name>.md` (indexed in `docs/plans/index.md`) and, optionally, one task file per acceptance criterion in `docs/tasks/<plan-id>/`.
92
+
61
93
  ### Work
62
94
 
95
+ Invoke with `/work <plan-id>`, `/work <task file or task-id>`, or `/work <task description>` (ad-hoc). Work runs on its own `work/<short-description>` git branch, executes each task Red → Green → Refactor, and chooses an **execution mode** (inline, serial, or parallel waves) from task priority, risk, and dependencies; HIGH-risk tasks always run inline.
96
+
63
97
  | Phase | Module Name | Purpose |
64
98
  | ----- | ----------- | ----------------------------------------- |
65
99
  | 1 | **triage** | Classify input and extract context |
@@ -69,12 +103,14 @@ Use /arreio-init to initialize a new project, to enable the project to follow th
69
103
 
70
104
  ### Review
71
105
 
106
+ Invoke with `/review <git range | HEAD | branch | paths>`, `/review <work-id>`, or `/review <target description>`. Findings are graded `blocker` / `major` / `minor` / `nit` across quality, security, tests, documentation, integration, and scope creep, and the approval status (`approved` / `changes-requested` / `rejected`) is derived from the findings. Review is local and read-only: reports are written to `docs/review/`, never posted to GitHub.
107
+
72
108
  | Phase | Module Name | Purpose |
73
109
  | ----- | ----------- | -------------------------------- |
74
110
  | 1 | **scope** | Classify input and scope review |
75
111
  | 2 | **prepare** | Set up review environment |
76
112
  | 3 | **analyze** | Execute code review, find issues |
77
- | 4 | **report** | Report verdict |
113
+ | 4 | **report** | Derive approval, write report |
78
114
 
79
115
  ### Learn
80
116
 
@@ -85,6 +121,23 @@ Use /arreio-init to initialize a new project, to enable the project to follow th
85
121
  | 3 | **index** | Catalog and index the entry |
86
122
  | 4 | **maintain** | Dedup, refresh, and prune entries |
87
123
 
124
+ Invoke with `/learn <decision|pattern|gotcha|workflow> <text>`, `/learn <candidate-ref>` (a Work or Review `learnings-to-capture` item), or `/learn maintain`. Entries live in `docs/learn/<type>/`, are indexed in `docs/learn/index.md`, and are searched by Plan, Work, and Review.
125
+
126
+ ### Project Structure
127
+
128
+ After `/arreio-init`, generated artifacts live under `docs/`:
129
+
130
+ ```text
131
+ docs/
132
+ plans/ final plans + index.md (hidden .scope/.research/.design/ in Detailed mode)
133
+ tasks/ <plan-id>/ task files + index.md
134
+ learn/ decision/ pattern/ gotcha/ workflow/ + index.md
135
+ review/ index.md + .report/ (other hidden phase folders in Detailed mode)
136
+ archives/
137
+ ```
138
+
139
+ Whether to commit `docs/` is your choice; this repository ignores it.
140
+
88
141
  ### Supporting Skills
89
142
 
90
143
  We have designed a set of supporting skills to help you to manage your repository and work.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arreio",
3
- "version": "1.0.5",
3
+ "version": "1.2.0",
4
4
  "description": "Arreio transforms agentic coding workflows into a predictable, safe, and high-quality software delivery pipeline. Master the four core phases—Plan, Work, Review, Learn—to orchestrate a highly reliable development cycle.",
5
5
  "license": "MIT",
6
6
  "author": "Wicttor",
@@ -54,7 +54,7 @@ Creates the organizational spine for Arreio artifacts:
54
54
 
55
55
  - `docs/plans/` — Stores generated plans and design artifacts
56
56
  - `docs/learn/` — Stores extracted learnings and insights
57
- - `docs/reports/` — Stores review reports and analysis
57
+ - `docs/review/` — Stores review reports and analysis
58
58
  - `docs/tasks/` — Stores task lists and execution records
59
59
  - `docs/archives/` — Stores historical artifacts
60
60
 
@@ -92,15 +92,7 @@ Creates the organizational spine for Arreio artifacts:
92
92
 
93
93
  **Action:** If `docs/learn/index.md` doesn't exist, create it using the [Learn Index Template](references/learn-index-template.md).
94
94
 
95
- ### Step 7: Create Reports Folder
96
-
97
- **Folder:** `docs/reports/`
98
-
99
- **Rationale:** Stores review reports and analysis artifacts. The `review/SKILL.md` module generates reports here.
100
-
101
- **Action:** Create the `docs/reports/` folder if it doesn't exist.
102
-
103
- ### Step 8: Create Plan Skill Hidden Artifact Directories
95
+ ### Step 7: Plan Skill Hidden Artifact Directories (not created at init)
104
96
 
105
97
  **Folders:**
106
98
 
@@ -108,11 +100,11 @@ Creates the organizational spine for Arreio artifacts:
108
100
  - `docs/plans/.research/` — Stores Research phase artifacts
109
101
  - `docs/plans/.design/` — Stores Design phase artifacts
110
102
 
111
- **Rationale:** The `plan/SKILL.md` orchestrator saves intermediate phase artifacts in these hidden directories to preserve the planning trail and enable recovery/resumption.
103
+ **Rationale:** The `plan/SKILL.md` orchestrator writes intermediate phase artifacts to these hidden directories **only when the user picks `detailed` interaction mode**. In `smart`/`autopilot` they are passed in context.
112
104
 
113
- **Action:** Create all three directories if they don't exist.
105
+ **Action:** Do **not** create them. The plan skill creates them lazily on first `detailed` run.
114
106
 
115
- ### Step 9: Create Work Skill Hidden Artifact Directories
107
+ ### Step 8: Work Skill Artifact Directories
116
108
 
117
109
  **Folders:**
118
110
 
@@ -121,26 +113,26 @@ Creates the organizational spine for Arreio artifacts:
121
113
  - `docs/plans/.work/.execute/` — Stores Execute phase artifacts
122
114
  - `docs/plans/.work/.review/` — Stores Review phase artifacts
123
115
 
124
- **Rationale:** The `work/SKILL.md` orchestrator saves phase artifacts here during task execution to track work progress and decisions.
116
+ **Rationale:** `.triage/`, `.prepare/`, `.execute/` hold intermediate artifacts written **only in `detailed` mode**. `.review/` holds the Work Report, which is always written (read by `/review` and `/learn`).
125
117
 
126
- **Action:** Create all four directories if they don't exist.
118
+ **Action:** Create only `docs/plans/.work/.review/`. The work skill creates the other three lazily on first `detailed` run.
127
119
 
128
- ### Step 10: Create Review Skill Hidden Artifact Directories and Registry
120
+ ### Step 9: Review Skill Artifact Directories and Registry
129
121
 
130
122
  **Folders:**
131
123
 
132
- - `docs/plans/.review/.scope/` — Stores Review Scope phase artifacts
133
- - `docs/plans/.review/.prepare/` — Stores Review Prepare phase artifacts
134
- - `docs/plans/.review/.analyze/` — Stores Review Analyze phase artifacts
135
- - `docs/plans/.review/.report/` — Stores Review Report phase artifacts
124
+ - `docs/review/.scope/` — Stores Review Scope phase artifacts
125
+ - `docs/review/.prepare/` — Stores Review Prepare phase artifacts
126
+ - `docs/review/.analyze/` — Stores Review Analyze phase artifacts
127
+ - `docs/review/.report/` — Stores Review Report phase artifacts
136
128
 
137
129
  **File:**
138
130
 
139
- - `docs/plans/.review/index.md` — Central registry of all review reports
131
+ - `docs/review/index.md` — Central registry of all review reports
140
132
 
141
- **Rationale:** The `review/SKILL.md` orchestrator saves phase artifacts in these hidden directories and maintains a central index of all review reports.
133
+ **Rationale:** `.scope/`, `.prepare/`, `.analyze/` hold intermediate artifacts written **only in `detailed` mode**. `.report/` holds the Review Report (always written). The orchestrator also maintains a central index of all review reports.
142
134
 
143
- **Action:** Create all four directories if they don't exist. If `docs/plans/.review/index.md` doesn't exist, create it with a header:
135
+ **Action:** Create only `docs/review/.report/`; the review skill creates the other three lazily on first `detailed` run. If `docs/review/index.md` doesn't exist, create it with a header:
144
136
 
145
137
  ```markdown
146
138
  ---
@@ -161,20 +153,20 @@ This is the index of all review reports for the project. Reports are organized b
161
153
  _No review reports yet._
162
154
  ```
163
155
 
164
- ### Step 11: Create Learn Skill Hidden Artifact Directories
156
+ ### Step 10: Learn Skill Hidden Artifact Directories (not created at init)
165
157
 
166
158
  **Folders:**
167
159
 
168
- - `docs/plans/.learn/.capture/` — Stores Capture phase artifacts
169
- - `docs/plans/.learn/.refine/` — Stores Refine phase artifacts
170
- - `docs/plans/.learn/.index/` — Stores Index phase artifacts
171
- - `docs/plans/.learn/.maintain/` — Stores Maintain phase artifacts
160
+ - `docs/learn/.capture/` — Stores Capture phase artifacts
161
+ - `docs/learn/.refine/` — Stores Refine phase artifacts
162
+ - `docs/learn/.index/` — Stores Index phase artifacts
163
+ - `docs/learn/.maintain/` — Stores Maintain phase artifacts
172
164
 
173
- **Rationale:** The `learn/SKILL.md` orchestrator saves phase artifacts in these hidden directories to preserve the knowledge entry authoring trail.
165
+ **Rationale:** The `learn/SKILL.md` orchestrator writes phase artifacts here **only in `detailed` mode**. Durable entries and the index are always written elsewhere.
174
166
 
175
- **Action:** Create all four directories if they don't exist.
167
+ **Action:** Do **not** create them. The learn skill creates them lazily on first `detailed` run.
176
168
 
177
- ### Step 12: Create End-Session Skill Hidden Artifact Directory
169
+ ### Step 11: Create End-Session Skill Hidden Artifact Directory
178
170
 
179
171
  **Folder:**
180
172
 
@@ -184,7 +176,7 @@ _No review reports yet._
184
176
 
185
177
  **Action:** Create the directory if it doesn't exist.
186
178
 
187
- ### Step 13: Create Learn Category Folders
179
+ ### Step 12: Create Learn Category Folders
188
180
 
189
181
  **Folders:**
190
182
 
@@ -208,20 +200,15 @@ After initialization, verify:
208
200
  - `.agents/skills/learn/`
209
201
  - `.agents/skills/end-session/`
210
202
  - `.agents/skills/arreio-init/`
211
- - ✓ All five core folders exist: `docs/plans/`, `docs/learn/`, `docs/reports/`, `docs/tasks/`, `docs/archives/`
203
+ - ✓ All five core folders exist: `docs/plans/`, `docs/learn/`, `docs/review/`, `docs/tasks/`, `docs/archives/`
212
204
  - ✓ `ARCHITECTURE.md` exists at project root
213
205
  - ✓ Root-level index files exist:
214
206
  - `docs/plans/index.md` (registry of all plans)
215
207
  - `docs/learn/index.md` (central knowledge base)
216
- - ✓ Plan skill hidden artifact directories exist:
217
- - `docs/plans/.scope/`, `docs/plans/.research/`, `docs/plans/.design/`
218
- - ✓ Work skill hidden artifact directories exist:
219
- - `docs/plans/.work/.triage/`, `docs/plans/.work/.prepare/`, `docs/plans/.work/.execute/`, `docs/plans/.work/.review/`
220
- - ✓ Review skill hidden artifact directories exist:
221
- - `docs/plans/.review/.scope/`, `docs/plans/.review/.prepare/`, `docs/plans/.review/.analyze/`, `docs/plans/.review/.report/`
222
- - `docs/plans/.review/index.md` (review reports registry)
223
- - ✓ Learn skill hidden artifact directories exist:
224
- - `docs/plans/.learn/.capture/`, `docs/plans/.learn/.refine/`, `docs/plans/.learn/.index/`, `docs/plans/.learn/.maintain/`
208
+ - ✓ Always-written report directories exist:
209
+ - `docs/plans/.work/.review/` (Work Reports), `docs/review/.report/` (Review Reports)
210
+ - `docs/review/index.md` (review reports registry)
211
+ - ✓ Intermediate phase-artifact directories (`.scope/`, `.research/`, `.design/`, `.triage/`, `.prepare/`, `.execute/`, `.analyze/`, `.capture/`, `.refine/`, `.index/`, `.maintain/`) are **not** created — skills create them lazily, only in `detailed` interaction mode
225
212
  - ✓ End-session skill hidden artifact directory exists:
226
213
  - `docs/plans/.end-session/`
227
214
  - ✓ Learn category folders exist:
@@ -233,10 +220,10 @@ After initialization, verify:
233
220
 
234
221
  Downstream skills (plan, learn, work, review) automatically create missing folders and indexes if arreio-init wasn't explicitly run:
235
222
 
236
- - **plan** skill creates missing `docs/plans/` core folders, and allocates `docs/plans/.scope/`, `.research/`, `.design/` directories on first use.
237
- - **work** skill creates missing `docs/plans/.work/` directories (`.triage/`, `.prepare/`, `.execute/`, `.review/`) on first execution.
238
- - **review** skill creates missing `docs/plans/.review/` directories and `index.md` registry on first review.
239
- - **learn** skill creates missing `docs/plans/.learn/` directories and `docs/learn/` category folders on first learning capture.
223
+ - **plan** skill creates missing `docs/plans/` core folders; creates `docs/plans/.scope/`, `.research/`, `.design/` only in `detailed` mode.
224
+ - **work** skill creates `docs/plans/.work/.review/` on first execution; creates `.triage/`, `.prepare/`, `.execute/` only in `detailed` mode.
225
+ - **review** skill creates `docs/review/.report/` and the `index.md` registry on first review; creates `.scope/`, `.prepare/`, `.analyze/` only in `detailed` mode.
226
+ - **learn** skill creates the `docs/learn/` category folders on first learning capture; creates `.capture/`, `.refine/`, `.index/`, `.maintain/` only in `detailed` mode.
240
227
  - **end-session** skill creates missing `docs/plans/.end-session/` directory (and the `## Session Ends` section in `docs/plans/index.md`) on first session end.
241
228
 
242
229
  **However**, running `arreio-init` upfront provides several benefits:
@@ -38,6 +38,8 @@ Store in the context object:
38
38
  interactionMode: detailed | smart | autopilot
39
39
  ```
40
40
 
41
+ **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.
42
+
41
43
  **Propagation:** `interactionMode` flows into the `capture`, `refine`, `index`, and `maintain` artifacts; each downstream phase reads it to adjust confirmation behaviour (detailed = pause every transition + before destructive writes; autopilot = run all; smart = pause only on duplicates, prunes, and migrations).
42
44
 
43
45
  ## Orchestration Implementation
@@ -49,7 +51,7 @@ Each phase runs sequentially: the orchestrator calls the phase module, receives
49
51
  - Receives a context object from the user, a saved prompt, a document, or a combination.
50
52
  - **Three input shapes:**
51
53
  1. **Explicit** — `/learn <type> <text>`. Capture drafts an entry of the named type from the text. The canonical path for authoring a decision/pattern/gotcha/workflow.
52
- 2. **Candidate** — `/learn <candidate-ref>`. The ref resolves to a Work `review-id` (`docs/plans/.work/.review/<id>.md`) or a Review `report-id` (`docs/plans/.review/.report/<id>.md`); Capture reads its `learnings-to-capture` list and, for each candidate, drafts the corresponding entry. The user confirms which candidates become durable entries.
54
+ 2. **Candidate** — `/learn <candidate-ref>`. The ref resolves to a Work `review-id` (`docs/plans/.work/.review/<id>.md`) or a Review `report-id` (`docs/review/.report/<id>.md`); Capture reads its `learnings-to-capture` list and, for each candidate, drafts the corresponding entry. The user confirms which candidates become durable entries.
53
55
  3. **Maintain** — `/learn maintain`. Runs only the Maintain phase (dedup / refresh / prune); bypasses Capture → Refine → Index (no new entry is authored).
54
56
  - **If no context is provided**, ask: "What would you like to capture? Provide a type and text, a candidate ref, or `maintain`."
55
57
  - **Unified key:** downstream phases key off a `learn-id` umbrella (`YYYY-MM-DD-NNN`), allocated by Capture. For Maintain-only runs, Maintain allocates its own `maintain-id` (no `learn-id` umbrella — there is no newly authored entry).
@@ -60,7 +62,7 @@ Each phase runs sequentially: the orchestrator calls the phase module, receives
60
62
  Before starting the learn pipeline, the orchestrator verifies that required folders exist:
61
63
 
62
64
  - `docs/learn/` — must exist for writing entries and the index; the seed `docs/learn/index.md` must exist (empty `entries:` block is valid — the legacy migration populates 28 entries)
63
- - `docs/plans/.learn/.capture/`, `docs/plans/.learn/.refine/`, `docs/plans/.learn/.index/`, `docs/plans/.learn/.maintain/` — must exist for saving the phase artifacts
65
+ - `docs/learn/.capture/`, `docs/learn/.refine/`, `docs/learn/.index/`, `docs/learn/.maintain/` — **`detailed` mode only**, for saving the phase artifacts; do not create them in `smart`/`autopilot`
64
66
 
65
67
  **Self-Healing:** If any are missing, the orchestrator automatically creates them (`mkdir -p`), and seeds `docs/learn/index.md` from the [index-format.md](references/index-format.md) template. This allows the Learn skill to run even if `arreio-init` wasn't explicitly run.
66
68
 
@@ -70,10 +72,10 @@ For **explicit** input, verify `<type>` is one of the four; if not, ask to pick
70
72
 
71
73
  | Phase | Phase Module | Output Artifact | Saved to |
72
74
  | ----- | ------------------------------------ | ---------------------------------------------------------------------------- | -------------------------------------- |
73
- | 1 | [Capture](modules/capture.md) | [Captured entry](references/templates/artifacts/captured-entry.md) | `docs/plans/.learn/.capture/<id>.md` |
74
- | 2 | [Refine](modules/refine.md) | [Refined entry](references/templates/artifacts/refined-entry.md) | `docs/plans/.learn/.refine/<id>.md` |
75
- | 3 | [Index](modules/index.md) | [Index update](references/templates/artifacts/index-update.md) | `docs/plans/.learn/.index/<id>.md` |
76
- | 4 | [Maintain](modules/maintain.md) _(on demand)_ | [Maintain log](references/templates/artifacts/maintain-log.md) | `docs/plans/.learn/.maintain/<id>.md` |
75
+ | 1 | [Capture](modules/capture.md) | [Captured entry](references/templates/artifacts/captured-entry.md) | `docs/learn/.capture/<id>.md` _(detailed only)_ |
76
+ | 2 | [Refine](modules/refine.md) | [Refined entry](references/templates/artifacts/refined-entry.md) | `docs/learn/.refine/<id>.md` _(detailed only)_ |
77
+ | 3 | [Index](modules/index.md) | [Index update](references/templates/artifacts/index-update.md) | `docs/learn/.index/<id>.md` _(detailed only)_ |
78
+ | 4 | [Maintain](modules/maintain.md) _(on demand)_ | [Maintain log](references/templates/artifacts/maintain-log.md) | `docs/learn/.maintain/<id>.md` _(detailed only)_ |
77
79
 
78
80
  **Phase 4 is on-demand.** A normal `/learn <type> <text>` run executes Phases 1–3 and writes one entry; Maintain runs only via `/learn maintain`. The migration procedure (legacy → canonical) is a Maintain operation, run once.
79
81
 
@@ -104,7 +106,7 @@ The **Index phase** is the skill's only index writer for authored entries; the *
104
106
 
105
107
  - **Entry file:** Saved to `docs/learn/<type>/<slug>.md` with the [entry-schema.md](references/entry-schema.md) frontmatter (`type`, `domain`, `tags`, `applicability`, `summary`, plus `created_at`/`updated_at`, `source`, `confidence`, and `related`).
106
108
  - **Index:** `docs/learn/index.md` updated — a YAML `entries:` block (the `filename` / `domain` / `tags` / `applicability` / `summary` record per entry — the **read contract** that Plan/Work/Review's [learnings-gate-logic.md](../plan/references/learnings-gate-logic.md) parses) plus the human-readable By Category / By Domain tables.
107
- - **Maintain Log (if `/learn maintain`):** Saved to `docs/plans/.learn/.maintain/<maintain-id>.md`, recording the dedup/refresh/prune operations performed and any migration applied.
109
+ - **Maintain Log (if `/learn maintain`, `detailed` mode only):** Saved to `docs/learn/.maintain/<maintain-id>.md`, recording the dedup/refresh/prune operations performed and any migration applied.
108
110
  - **Not produced:** This skill produces **no session log, no event transcript, no "what we did."** Only durable entries and the index.
109
111
 
110
112
  ## References
@@ -135,6 +137,17 @@ Artifact templates live in [references/templates/artifacts/](references/template
135
137
 
136
138
  > The Learn skill **owns the write side** — the per-entry frontmatter schema ([entry-schema.md](references/entry-schema.md)) and the `docs/learn/index.md` format ([index-format.md](references/index-format.md)). The Plan skill **owns the read side** — the keyword/relevance search in [learnings-gate-logic.md](../plan/references/learnings-gate-logic.md), reused cross-skill by Work and Review. The two contracts share the **index-record shape** (`filename`, `domain`, `tags`, `applicability`, `summary` + the `applicability` enum). Learn **guarantees** its index satisfies that shape; it does **not** re-encode the search algorithm (honoring the secondary-spec-contradicts-authoritative-matrix gotcha — one algorithm lives in Plan's gate-logic, one schema lives here; see `docs/learn/gotcha/2026-08-07-secondary-spec-contradicts-authoritative-matrix.md` post-migration).
137
139
 
140
+ ## Execution Rules
141
+
142
+ Follow these literally; they exist to keep runs consistent across agents.
143
+
144
+ 1. **Run each module's steps in order**, starting with its Step 0 verification. Do not skip, merge, or reorder steps.
145
+ 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.
146
+ 3. **Compute, don't copy.** Values defined by a rule (`slug`, `applicability` enum, duplicate/analog matches, prune candidates) must be derived with the canonical reference and the real entry — never copied from an example or guessed. Example values in references and templates are illustrations, never defaults.
147
+ 4. **One question at a time**, with 2–4 concrete options; build the question text from the current values.
148
+ 5. **Announce phase transitions in one line** (e.g., "Phase 2/3 Refine complete: <key result>") so the user can follow progress, even in Autopilot.
149
+ 6. **Honor write rules:** intermediate phase artifacts only in `detailed` mode; final deliverables always.
150
+
138
151
  ## Core Principles
139
152
 
140
153
  - **Source of Truth, Not Memory:** `docs/learn/` is the project's durable, authoritative knowledge base. Plan/Work/Review search it; this skill authors and maintains it. Not a session memory, not an event log.
@@ -143,6 +156,7 @@ Artifact templates live in [references/templates/artifacts/](references/template
143
156
  - **Idempotent Writes:** Authoring a known `slug` upserts the entry file and its index record — never duplicates. Maintain rebuilds the index from the file tree and is idempotent. Re-running a normal `/learn` over the same content merges, it does not pile up.
144
157
  - **Dedup Welcomed, Lineage Preserved:** Decisions don't duplicate, but analogs exist; dedup merges an analog into the canonical entry and records the merge (the path-convention-split entry is the model — a migrated entry carries both the old and new path knowledge, not just the new; see `docs/learn/gotcha/2026-08-07-path-convention-split-silently-noops.md` post-migration).
145
158
  - **Write Side / Read Side Split:** Learn owns the entry schema and the index format; Plan owns the search algorithm. Both agree on the index-record shape. Never re-encode the other side's logic inline.
159
+ - **Lean Persistence:** Phase artifacts hit disk only in `detailed` mode; `smart`/`autopilot` pass them in context to save tokens and time.
146
160
  - **Transparent Artifacts:** Each phase produces an explicit output artifact for the next phase.
147
161
  - **Behavior-Described, Tool-Agnostic:** Steps describe required capabilities ("write the entry file", "rebuild the index", "ask the user to confirm"), not specific tool names.
148
162
  - **Stay Portable:** Use repository-relative paths only — `docs/learn/<type>/<slug>.md`, never absolute.
@@ -30,7 +30,7 @@ If the input is empty or ambiguous, ask the user one question: "What would you l
30
30
  Determine which of the two authoring shapes applies (maintain is rejected in Step 0):
31
31
 
32
32
  1. **Explicit** — the input carries a `<type>` (one of `decision` / `pattern` / `gotcha` / `workflow`) and `<text>` (prose, a file/commit ref, or a short description to expand).
33
- 2. **Candidate** — the input carries a ref to a Work `review-id` (`docs/plans/.work/.review/<id>.md`) or a Review `report-id` (`docs/plans/.review/.report/<id>.md`).
33
+ 2. **Candidate** — the input carries a ref to a Work `review-id` (`docs/plans/.work/.review/<id>.md`) or a Review `report-id` (`docs/review/.report/<id>.md`).
34
34
 
35
35
  Record `input-shape: explicit | candidate`. If `<type>` is provided but is not one of the four, ask the user to pick from the four (Step 2 confirms intent either way).
36
36
 
@@ -48,7 +48,7 @@ Capture produces **one** Captured Entry per run (single-shape artifact). The sha
48
48
 
49
49
  1. Resolve the ref to the artifact file:
50
50
  - Work `review-id` → `docs/plans/.work/.review/<review-id>.md` → read its `learnings-to-capture` list.
51
- - Review `report-id` → `docs/plans/.review/.report/<report-id>.md` → read its `learnings-to-capture` list.
51
+ - Review `report-id` → `docs/review/.report/<report-id>.md` → read its `learnings-to-capture` list.
52
52
  2. If the list is empty, inform the user (no candidates to curate) and stop — do not fabricate an entry.
53
53
  3. Present the candidate list to the user (each has a `title`, `domain`, `source` {finding-id or task-id+gate}, `summary`, `type`) and ask which to author **first** (one entry per Captured Entry). If the candidate's recorded `type` is one of the four, use it; otherwise map: `confirmed-pattern` → `pattern`, `refuted-assumption` → `gotcha`, `gotcha` → `gotcha`, `forced-decision` → `decision`. The user may override the inferred type.
54
54
  4. Record the selected candidate as `capture.source-candidate` (carried for traceability into the entry's `source` frontmatter).
@@ -70,8 +70,8 @@ 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/plans/.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`).
74
- 3. **Assign a `capture-id`** per [id-generation.md](../references/id-generation.md) (format `YYYY-MM-DD-NNN-capture`, saved to `docs/plans/.learn/.capture/`). Reuse it if the user later picks **Edit & Retry**.
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
+ 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
77
77
 
@@ -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/plans/.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/plans/.learn/.capture/<capture-id>.md` (ensure `
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/plans/.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.
@@ -55,7 +55,7 @@ Update `docs/learn/index.md` per the authoritative **[index-format.md](../refere
55
55
 
56
56
  ### Step 4: Allocate the index-id
57
57
 
58
- Assign an `index-id` per [id-generation.md](../references/id-generation.md) (format `YYYY-MM-DD-NNN-index`, saved to `docs/plans/.learn/.index/`). Reuse it if the user later picks **Edit & Retry**. The `learn-id` umbrella is inherited unchanged.
58
+ Assign an `index-id` per [id-generation.md](../references/id-generation.md) (format `YYYY-MM-DD-NNN-index`, saved to `docs/learn/.index/`). Reuse it if the user later picks **Edit & Retry**. The `learn-id` umbrella is inherited unchanged.
59
59
 
60
60
  ### Step 5: Generate the Index Update Artifact
61
61
 
@@ -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/plans/.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/plans/.learn/.index/<index-id>.md` (ensure `inte
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/plans/.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).
@@ -74,7 +74,7 @@ Rebuild `docs/learn/index.md` from the on-disk file tree — the file tree is th
74
74
 
75
75
  ### Step 6: Allocate the maintain-id
76
76
 
77
- Assign a `maintain-id` per [id-generation.md](../references/id-generation.md) (format `YYYY-MM-DD-NNN-maintain`, saved to `docs/plans/.learn/.maintain/`). Maintain has **no `learn-id` umbrella** (it authors no new entry). Reuse the `maintain-id` if the user picks **Edit & Retry**.
77
+ Assign a `maintain-id` per [id-generation.md](../references/id-generation.md) (format `YYYY-MM-DD-NNN-maintain`, saved to `docs/learn/.maintain/`). Maintain has **no `learn-id` umbrella** (it authors no new entry). Reuse the `maintain-id` if the user picks **Edit & Retry**.
78
78
 
79
79
  ### Step 7: Generate the Maintain Log Artifact
80
80
 
@@ -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/plans/.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/plans/.learn/.maintain/<maintain-id>.md` (ensure
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/plans/.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.
@@ -65,7 +65,7 @@ Record the matches (`dup-status: exact | analog | none`, the matched `slug`/file
65
65
 
66
66
  ### Step 4: Allocate the refine-id
67
67
 
68
- Assign a `refine-id` per [id-generation.md](../references/id-generation.md) (format `YYYY-MM-DD-NNN-refine`, saved to `docs/plans/.learn/.refine/`). Reuse it if the user later picks **Edit & Retry**. The `learn-id` umbrella is inherited unchanged.
68
+ Assign a `refine-id` per [id-generation.md](../references/id-generation.md) (format `YYYY-MM-DD-NNN-refine`, saved to `docs/learn/.refine/`). Reuse it if the user later picks **Edit & Retry**. The `learn-id` umbrella is inherited unchanged.
69
69
 
70
70
  ### Step 5: Generate the Refined Entry Artifact
71
71
 
@@ -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/plans/.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/plans/.learn/.refine/<refine-id>.md` (ensure `in
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/plans/.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,12 +12,12 @@ 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
- | Capture | `YYYY-MM-DD-NNN-capture` | `docs/plans/.learn/.capture/<id>.md` |
18
- | Refine | `YYYY-MM-DD-NNN-refine` | `docs/plans/.learn/.refine/<id>.md` |
19
- | Index | `YYYY-MM-DD-NNN-index` | `docs/plans/.learn/.index/<id>.md` |
20
- | Maintain | `YYYY-MM-DD-NNN-maintain` | `docs/plans/.learn/.maintain/<id>.md` |
17
+ | Capture | `YYYY-MM-DD-NNN-capture` | `docs/learn/.capture/<id>.md` |
18
+ | Refine | `YYYY-MM-DD-NNN-refine` | `docs/learn/.refine/<id>.md` |
19
+ | Index | `YYYY-MM-DD-NNN-index` | `docs/learn/.index/<id>.md` |
20
+ | Maintain | `YYYY-MM-DD-NNN-maintain` | `docs/learn/.maintain/<id>.md` |
21
21
 
22
22
  `learn-id` (see below) is the umbrella shared across Capture → Refine → Index. **Maintain has no `learn-id`** — it authors no new entry; it allocates only a standalone `maintain-id`.
23
23
 
@@ -27,7 +27,7 @@ Allocated **only in Capture** Step 4:
27
27
 
28
28
  ```
29
29
  1. Get the current date in UTC
30
- 2. List existing files under docs/plans/.learn/.capture/ matching YYYY-MM-DD-NNN-capture.md for that date
30
+ 2. List existing files under docs/learn/.capture/ matching YYYY-MM-DD-NNN-capture.md for that date
31
31
  3. NNN = (highest existing NNN for that date), zero-padded to 3 digits
32
32
  - if none exist for that date, start at 001
33
33
  4. learn-id = "<date>-<NNN>" (the same NNN as the capture-id being allocated)
@@ -42,7 +42,7 @@ Allocated **only in Maintain** Step 6:
42
42
 
43
43
  ```
44
44
  1. Get the current date in UTC
45
- 2. List existing files under docs/plans/.learn/.maintain/ matching YYYY-MM-DD-NNN-maintain.md for that date
45
+ 2. List existing files under docs/learn/.maintain/ matching YYYY-MM-DD-NNN-maintain.md for that date
46
46
  3. NNN = (count + 1), zero-padded to 3 digits
47
47
  4. maintain-id = "<date>-<NNN>-maintain"
48
48
  ```
@@ -69,15 +69,17 @@ 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
  ```
75
77
  1. Get the current date in UTC (e.g., 2026-08-08)
76
78
  2. List existing files for today in the phase's save directory:
77
- - capture -> docs/plans/.learn/.capture/ matching YYYY-MM-DD-*-capture.md
78
- - refine -> docs/plans/.learn/.refine/ matching YYYY-MM-DD-*-refine.md
79
- - index -> docs/plans/.learn/.index/ matching YYYY-MM-DD-*-index.md
80
- - maintain -> docs/plans/.learn/.maintain/ matching YYYY-MM-DD-*-maintain.md
79
+ - capture -> docs/learn/.capture/ matching YYYY-MM-DD-*-capture.md
80
+ - refine -> docs/learn/.refine/ matching YYYY-MM-DD-*-refine.md
81
+ - index -> docs/learn/.index/ matching YYYY-MM-DD-*-index.md
82
+ - maintain -> docs/learn/.maintain/ matching YYYY-MM-DD-*-maintain.md
81
83
  3. NNN = (count + 1), zero-padded to 3 digits (001, 002, ..., 010, ...)
82
84
  4. id = "<date>-<NNN>-<phase>"
83
85
  ```
@@ -108,7 +110,7 @@ The legacy `docs/learnings/` store uses filenames, not slugs, as the key. The mi
108
110
 
109
111
  ## Notes
110
112
 
111
- - IDs reuse the daily-counter algorithm for cross-skill consistency with `/plan`, `/work`, and `/review`; the Learn skill's counters are independent from those skills (separate save directories under `docs/plans/.learn/`).
113
+ - IDs reuse the daily-counter algorithm for cross-skill consistency with `/plan`, `/work`, and `/review`; the Learn skill's counters are independent from those skills (separate save directories under `docs/learn/`).
112
114
  - `learn-id` carries through Capture → Refine → Index; Maintain uses the standalone `maintain-id` only. Cross-phase chaining is `capture-id → refine-id → index-id`, all sharing one `learn-id` (see [error-handling.md](error-handling.md) "Cross-Phase Consistency Checks").
113
115
  - The `slug` is a **separate** key from the phase ids — it identifies the durable knowledge entry across re-authors, not the pipeline run. A single `slug` may be authored by many `learn-id` runs over time (each upsert overwrites); the `slug` is stable, the `learn-id` is per-run.
114
116
  - Counter collisions are impossible within a date because each phase writes to its own directory and recomputes the count from the directory listing.
@@ -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/plans/.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/plans/.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