arreio 1.0.0-dev.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 (81) hide show
  1. package/README.md +81 -0
  2. package/package.json +42 -0
  3. package/scripts/postinstall.js +50 -0
  4. package/skills/arreio-init/SKILL.md +214 -0
  5. package/skills/arreio-init/references/architecture-template.md +85 -0
  6. package/skills/arreio-init/references/learn-index-template.md +15 -0
  7. package/skills/arreio-init/references/plan-index-template.md +29 -0
  8. package/skills/arreio-init/references/tasks-index-template.md +15 -0
  9. package/skills/learn/SKILL.md +151 -0
  10. package/skills/learn/modules/capture.md +108 -0
  11. package/skills/learn/modules/index.md +94 -0
  12. package/skills/learn/modules/maintain.md +116 -0
  13. package/skills/learn/modules/refine.md +104 -0
  14. package/skills/learn/references/dedup-rules.md +129 -0
  15. package/skills/learn/references/entry-schema.md +152 -0
  16. package/skills/learn/references/error-handling.md +178 -0
  17. package/skills/learn/references/id-generation.md +114 -0
  18. package/skills/learn/references/index-format.md +140 -0
  19. package/skills/learn/references/interaction-mode-propagation.md +89 -0
  20. package/skills/learn/references/migration-bootstrap.md +142 -0
  21. package/skills/learn/references/templates/artifacts/captured-entry.md +172 -0
  22. package/skills/learn/references/templates/artifacts/index-update.md +135 -0
  23. package/skills/learn/references/templates/artifacts/learn-input.md +100 -0
  24. package/skills/learn/references/templates/artifacts/maintain-log.md +142 -0
  25. package/skills/learn/references/templates/artifacts/refined-entry.md +168 -0
  26. package/skills/plan/SKILL.md +129 -0
  27. package/skills/plan/modules/design.md +140 -0
  28. package/skills/plan/modules/generate.md +156 -0
  29. package/skills/plan/modules/research.md +122 -0
  30. package/skills/plan/modules/scope.md +121 -0
  31. package/skills/plan/modules/tasks.md +190 -0
  32. package/skills/plan/references/design-complexity-assessment.md +118 -0
  33. package/skills/plan/references/error-handling.md +155 -0
  34. package/skills/plan/references/external-research-guidance.md +61 -0
  35. package/skills/plan/references/high-risk-detection.md +111 -0
  36. package/skills/plan/references/id-generation.md +55 -0
  37. package/skills/plan/references/interaction-mode-propagation.md +75 -0
  38. package/skills/plan/references/learnings-gate-logic.md +93 -0
  39. package/skills/plan/references/plan-tier-selection.md +174 -0
  40. package/skills/plan/references/task-slicing-rules.md +220 -0
  41. package/skills/plan/references/templates/artifacts/design.md +134 -0
  42. package/skills/plan/references/templates/artifacts/final-plan.md +265 -0
  43. package/skills/plan/references/templates/artifacts/research-findings.md +50 -0
  44. package/skills/plan/references/templates/artifacts/scoped-context.md +53 -0
  45. package/skills/plan/references/templates/artifacts/task.md +192 -0
  46. package/skills/plan/references/templates/artifacts/user-input.md +112 -0
  47. package/skills/review/SKILL.md +163 -0
  48. package/skills/review/modules/analyze.md +104 -0
  49. package/skills/review/modules/prepare.md +103 -0
  50. package/skills/review/modules/report.md +109 -0
  51. package/skills/review/modules/scope.md +126 -0
  52. package/skills/review/references/approval-criteria.md +101 -0
  53. package/skills/review/references/change-set-resolution.md +126 -0
  54. package/skills/review/references/error-handling.md +172 -0
  55. package/skills/review/references/id-generation.md +80 -0
  56. package/skills/review/references/interaction-mode-propagation.md +80 -0
  57. package/skills/review/references/review-categories.md +124 -0
  58. package/skills/review/references/scope-creep-detection.md +120 -0
  59. package/skills/review/references/severity-rubric.md +107 -0
  60. package/skills/review/references/templates/artifacts/findings.md +161 -0
  61. package/skills/review/references/templates/artifacts/review-input.md +116 -0
  62. package/skills/review/references/templates/artifacts/review-kit.md +135 -0
  63. package/skills/review/references/templates/artifacts/review-report.md +175 -0
  64. package/skills/review/references/templates/artifacts/review-scope.md +146 -0
  65. package/skills/work/SKILL.md +163 -0
  66. package/skills/work/modules/execute.md +109 -0
  67. package/skills/work/modules/prepare.md +140 -0
  68. package/skills/work/modules/review.md +164 -0
  69. package/skills/work/modules/triage.md +181 -0
  70. package/skills/work/references/ad-hoc-input-resolution.md +122 -0
  71. package/skills/work/references/error-handling.md +183 -0
  72. package/skills/work/references/execution-mode-selection.md +95 -0
  73. package/skills/work/references/id-generation.md +85 -0
  74. package/skills/work/references/interaction-mode-propagation.md +80 -0
  75. package/skills/work/references/review-checklist.md +94 -0
  76. package/skills/work/references/task-execution-rules.md +116 -0
  77. package/skills/work/references/templates/artifacts/execution-log.md +123 -0
  78. package/skills/work/references/templates/artifacts/execution-plan.md +111 -0
  79. package/skills/work/references/templates/artifacts/work-input.md +78 -0
  80. package/skills/work/references/templates/artifacts/work-manifest.md +119 -0
  81. package/skills/work/references/templates/artifacts/work-report.md +143 -0
@@ -0,0 +1,116 @@
1
+ ---
2
+ title: Task Execution Rules
3
+ description: Authoritative reference for the Execute phase (and the gates Prepare records). Defines the per-task Red/Green/Refactor gates, the retry-limit and blocked-transition policy, the resume policy, the skip transition, and the snapshot-and-continue regression policy. Execute and Prepare defer to these definitions; neither re-encodes them.
4
+ type: reference
5
+ version: 1.0
6
+ timestamp: "2026-08-07"
7
+ ---
8
+
9
+ # Task Execution Rules
10
+
11
+ Authoritative reference for the **Execute** phase and the per-task gates Prepare records. Defines the per-task **Red/Green/Refactor** gates, the **retry-limit** and **blocked** transition, the **resume** policy, the **skip** transition, and the **snapshot-and-continue** regression policy. Execute enforces these; Prepare records the applicable set and thresholds read-only; neither re-encodes them.
12
+
13
+ ## Core Invariants (inherited from `/plan`)
14
+
15
+ - **One Acceptance Criterion per task** — each task carries exactly one AC and exactly one `files.test` asserting it.
16
+ - **Test-first** — every task runs Red → Green → Refactor; the failing test is written and confirmed **before** implementation.
17
+ - **Idempotent status** — `completed` tasks are never re-opened and index checkboxes are ticked forward only (never reset).
18
+
19
+ ## Per-Task Gates
20
+
21
+ | Gate | Criteria (authoritative) | On pass | On fail |
22
+ | --------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------- | --------------------------- |
23
+ | **Red** | The new test at `files.test[0]` exists and **fails for the right reason** — the assertion matching the AC fires; not a setup/import/compile error. On resume, if the test already passes, the task may already be done (re-check the AC). | Proceed to Green | If it passes immediately: re-check AC → may be `completed`; if setup error: log and fix the test |
24
+ | **Green** | The task's single AC test now passes **and** there is no new regression beyond the Prepare baseline (see Regression Policy). | Proceed to Refactor | Increment retry; on retry-limit → `blocked` |
25
+ | **Refactor** | Cleanup of naming/duplication/structure; the AC test stays green **and** no regression. No behavior change. | Complete transition | Revert the refactor; retry once; then `blocked` |
26
+
27
+ ## Retry-Limit and Blocked Transition
28
+
29
+ - **Default retry-limit per task: 2** attempts to reach Green from a confirmed Red.
30
+ - Reaching the limit without Green transitions the task to **`blocked`**:
31
+ - Set frontmatter `status: blocked` with a recorded `reason` (the failing assertion snapshot, which gate failed, the last error).
32
+ - Leave the index checklist as `- [ ]` and append `— blocked: <reason>`.
33
+ - Per the execution mode: `inline`/`serial` pause and surface; `parallel` blocks only dependents in later waves.
34
+ - A `blocked` task is **not auto-retried** on resume — it is carried with its reason (see Resume Policy). To retry it, the user re-runs Work and explicitly proceeds (the task's `status` is reset to `not-started` only on an Edit & Retry of Triage/Prepare).
35
+
36
+ ## Resume Policy (authoritative)
37
+
38
+ On re-entry (re-running Work), before running each task, read its task-file frontmatter `status`:
39
+
40
+ | status | Action on resume |
41
+ | ------------- | ------------------------------------------------------------------------- |
42
+ | `completed` | Skip (never re-open); checkbox stays `- [x]` (never reset) |
43
+ | `blocked` | Carry with recorded reason; not auto-retried |
44
+ | `skipped` | Carry with recorded reason; not auto-retried |
45
+ | `in-progress` | Re-enter the cycle at the appropriate gate (the last-run gate); do not tick the checkbox until a gate passes |
46
+ | `not-started` | Run the full Red → Green → Refactor cycle |
47
+
48
+ The orchestrator's quality gate #4 requires the end state to be coherent: no task left `in-progress`; the index checklist matches task files.
49
+
50
+ ## Skip Transition
51
+
52
+ - Skipping a task requires **explicit user confirmation** — never auto-skip.
53
+ - Set frontmatter `status: skipped` with a recorded `reason`.
54
+ - Leave the index checkbox as `- [ ]` and append `— skipped: <reason>`.
55
+ - A `skipped` task is not auto-retried on resume (Resume Policy).
56
+
57
+ ## Complete Transition
58
+
59
+ When the Refactor gate passes:
60
+ - Set frontmatter `status: completed`.
61
+ - Flip the task file's `## Acceptance Criteria` checkbox to `- [x]`.
62
+ - In `docs/tasks/<work-id>/index.md`, tick that task's row from `- [ ]` to `- [x]` (forward only).
63
+
64
+ ## Snapshot-and-Continue Regression Policy (authoritative)
65
+
66
+ When Prepare recorded `baseline: snapshot-and-continue` (the suite was red at baseline), a Prepare-recorded **known-failing test set** is the snapshot. Execute's regression gate behaves as follows:
67
+
68
+ - A failing test in the snapshot is **not** a regression (it was already failing).
69
+ - A **new** failing test (not in the snapshot) **is** a regression and fails the Green/Refactor gate.
70
+ - A snapshot test that now **passes** is an improvement, not a regression (do not block on it; record it for Review).
71
+
72
+ When `baseline: green`, the snapshot is empty — any failure is a regression.
73
+
74
+ When `baseline: red` without a snapshot-and-continue decision, Prepare must resolve the policy before Execute runs (it is a Prepare Smart pause trigger).
75
+
76
+ ## Mid-Task Interruption
77
+
78
+ If Execute is interrupted mid-task:
79
+ - Set frontmatter `status: in-progress` (so a resume re-enters the cycle at the right gate).
80
+ - Do **not** tick the checkbox.
81
+ - On resume, re-enter at the last-attempted gate for that task.
82
+
83
+ ## Per-Task Execution Cycle (Execute Step 3 follows this)
84
+
85
+ ```
86
+ for each runnable task (status not-started | in-progress):
87
+ gate Red:
88
+ write/confirm the AC test at files.test[0]
89
+ run it; assert it fails for the right reason
90
+ if passes immediately -> re-check AC (may be completed on resume)
91
+ gate Green:
92
+ implement minimum code in files.create / files.modify
93
+ run the AC test; assert green with no new regression (snapshot policy)
94
+ on fail -> increment retry; on retry-limit -> blocked
95
+ gate Refactor:
96
+ clean up; re-run the AC test; assert green with no regression
97
+ on fail -> revert refactor; retry once -> else blocked
98
+ complete transition:
99
+ status -> completed; checkbox -> - [x]; index ticked - [ ] -> - [x]
100
+ ```
101
+
102
+ ## Failure-Condition Reference
103
+
104
+ | Trigger | Outcome per this reference |
105
+ | ------------------------------------------------------ | ----------------------------------------------------------- |
106
+ | Red passes immediately on a `not-started` task | Re-check AC; if genuinely satisfied, mark `completed` |
107
+ | Green not reached within retry-limit (2) | Task → `blocked` with reason + assertion snapshot |
108
+ | Refactor introduces a regression | Revert the refactor; retry once; then `blocked` |
109
+ | New regression on a `completed` task's Refactor re-run | Surfaced as a Review Smart pause trigger (do not auto-mark) |
110
+ | Runner command fails (not an assertion failure) | Category 6 recovery per [error-handling.md](error-handling.md) |
111
+
112
+ ## Notes
113
+
114
+ - This reference is the single source of truth for gate criteria, the retry-limit, blocked/skip/complete/resume transitions, and the snapshot-and-continue regression policy.
115
+ - Prepare records the applicable set and thresholds **read-only** in the Execution Plan; Execute enforces them; Review verifies they were enforced (not re-defined inline).
116
+ - The 2-attempt default mirrors the per-phase retry-limit philosophy in [error-handling.md](error-handling.md) but is task-scoped (a blocked task is not a phase termination).
@@ -0,0 +1,123 @@
1
+ ---
2
+ title: Execution Log Artifact
3
+ description: Template for the Execution Log produced by the Execute phase. Carries the per-task result table (outcome + gate trace + reason), aggregator counts, and the regression-detection summary; consumed by Review.
4
+ type: template
5
+ version: 1.0
6
+ timestamp: "2026-08-07"
7
+ ---
8
+
9
+ # Execution Log Artifact
10
+
11
+ The product of the **Execute** phase is an Execution Log: a per-task result table with outcomes (`completed` / `blocked` / `skipped`), the Red/Green/Refactor gate trace, and any `reason`, plus aggregator counts and a regression-detection summary. Review consumes it.
12
+
13
+ ## Schema
14
+
15
+ ```yaml
16
+ execute-id: YYYY-MM-DD-NNN-execute
17
+ prepare-id: YYYY-MM-DD-NNN-prepare
18
+ triage-id: YYYY-MM-DD-NNN-triage
19
+ work-id: YYYY-MM-DD-NNN
20
+ work-branch: work/<short-description> | null # inherited from the Work Manifest
21
+ input-shape: plan-based | task-file | ad-hoc
22
+ interactionMode: detailed | smart | autopilot
23
+ executionMode: inline | serial | parallel
24
+ status: complete
25
+ timestamp: ISO-8601 timestamp
26
+
27
+ results: # one row per task in execution-list
28
+ - task-id: <work-id>-T<NN>
29
+ outcome: completed | blocked | skipped
30
+ gate-trace:
31
+ red: { passed: true | false, at: ISO-8601, note: "..." }
32
+ green: { passed: true | false, at: ISO-8601, note: "..." }
33
+ refactor: { passed: true | false, at: ISO-8601, note: "..." }
34
+ retries-used: 0 | 1 | 2
35
+ reason: null | "[failing assertion snapshot, which gate failed, last error]" # blocked/skipped only
36
+ index-checkbox-flipped: true | false # true only when outcome == completed
37
+
38
+ aggregators:
39
+ total: <N>
40
+ completed: <N>
41
+ blocked: <N>
42
+ skipped: <N>
43
+ in-progress-left: 0 # must be 0 for task-status coherence (orchestrator gate #4)
44
+
45
+ regression-detection:
46
+ baseline-state: green | snapshot-and-continue
47
+ new-regressions: [test-path or test-id, ...] # failures beyond the known-failing snapshot
48
+ snapshot-now-passing: [test-path or test-id, ...] # baseline failures now passing (improvements)
49
+
50
+ final-index-state:
51
+ checklist-matches-task-files: true # docs/tasks/<work-id>/index.md matches task frontmatter status
52
+ uncompleted-rows: [<task-id>, ...] # rows still - [] (blocked/skipped)
53
+ ```
54
+
55
+ Also save the Execution Log to `docs/plans/.work/.execute/<execute-id>.md`.
56
+
57
+ ## Validation Rules
58
+
59
+ - **execute-id:** Required. Format `YYYY-MM-DD-NNN-execute`.
60
+ - **prepare-id, triage-id, work-id, work-branch, input-shape:** Required, inherited (cross-phase consistency).
61
+ - **interactionMode, executionMode:** Both required, identical to the Prepare artifact.
62
+ - **results:** Required. One row per task in `execution-list`. Each row:
63
+ - `outcome` one of `completed`, `blocked`, `skipped`
64
+ - `gate-trace` with the three gates; for a `completed` task all three `passed: true`
65
+ - `reason` recorded for `blocked`/`skipped`; `null` for `completed`
66
+ - `index-checkbox-flipped` true iff `outcome == completed`
67
+ - **aggregators:** Required. `in-progress-left` must be `0` (task-status coherence — no task left `in-progress`).
68
+ - **regression-detection:** Required. `new-regressions` lists failures beyond the baseline snapshot (per the snapshot-and-continue policy in [task-execution-rules.md](../../task-execution-rules.md)).
69
+ - **final-index-state.checklist-matches-task-files:** Required, must be `true`; else Execute did not leave a coherent state (orchestrator quality gate #4 fails).
70
+ - **status:** Required. `complete`.
71
+
72
+ ## Example (one blocked, rest completed)
73
+
74
+ ```yaml
75
+ execute-id: 2026-08-07-003-execute
76
+ prepare-id: 2026-08-07-002-prepare
77
+ triage-id: 2026-08-07-001-triage
78
+ work-id: 2026-07-10-001
79
+ work-branch: work/redis-session-store
80
+ input-shape: plan-based
81
+ interactionMode: smart
82
+ executionMode: serial
83
+ status: complete
84
+ timestamp: 2026-08-07T15:30:00Z
85
+ results:
86
+ - task-id: 2026-07-10-001-T01
87
+ outcome: completed
88
+ gate-trace:
89
+ red: { passed: true, at: 2026-08-07T15:01:00Z, note: "fails on missing client" }
90
+ green: { passed: true, at: 2026-08-07T15:05:00Z, note: "all 3 scenarios green" }
91
+ refactor: { passed: true, at: 2026-08-07T15:06:00Z, note: "thinned wrapper" }
92
+ retries-used: 0
93
+ reason: null
94
+ index-checkbox-flipped: true
95
+ - task-id: 2026-07-10-001-T02a
96
+ outcome: blocked
97
+ gate-trace:
98
+ red: { passed: true, at: 2026-08-07T15:10:00Z, note: "fails on store impl" }
99
+ green: { passed: false, at: 2026-08-07T15:14:00Z, note: "TTL test still red after 2 retries" }
100
+ refactor: { passed: false, at: null, note: "skipped (green not reached)" }
101
+ retries-used: 2
102
+ reason: "Green gate: TTL test 'returns null after 1s' fails after 2 retries; TTL not propagated to Redis SET"
103
+ index-checkbox-flipped: false
104
+ aggregators:
105
+ total: 2
106
+ completed: 1
107
+ blocked: 1
108
+ skipped: 0
109
+ in-progress-left: 0
110
+ regression-detection:
111
+ baseline-state: green
112
+ new-regressions: []
113
+ snapshot-now-passing: []
114
+ final-index-state:
115
+ checklist-matches-task-files: true
116
+ uncompleted-rows: [2026-07-10-001-T02a]
117
+ ```
118
+
119
+ ## Notes
120
+
121
+ - Task-status coherence (orchestrator quality gate #4) is verified at Review Step 0 and by the `final-index-state` block: every task `completed`/`blocked`/`skipped`, none `in-progress`, and the index checklist matches the task files.
122
+ - `new-regressions` feeds Review's regression check (a non-empty list is a Review Smart pause trigger).
123
+ - The gate trace + `reason` are the primary inputs to Review's learnings-capture (a blocked gate or a refuted assumption becomes a learning candidate).
@@ -0,0 +1,111 @@
1
+ ---
2
+ title: Execution Plan Artifact
3
+ description: Template for the Execution Plan produced by the Prepare phase. Carries the ordered execution-list, selected execution mode, test runner + packageManager, baseline policy, applicable gates, and resume/blocked/skip policy; consumed by Execute.
4
+ type: template
5
+ version: 1.0
6
+ timestamp: "2026-08-07"
7
+ ---
8
+
9
+ # Execution Plan Artifact
10
+
11
+ The product of the **Prepare** phase is an Execution Plan: an ordered `execution-list` to run, the selected `executionMode`, the resolved test `runner` (+ `packageManager` for Node.js), the `baseline` policy and any known-failing snapshot, and the `applicable-gates` + thresholds (recorded read-only from [task-execution-rules.md](../../task-execution-rules.md)). Execute consumes it.
12
+
13
+ ## Schema
14
+
15
+ ```yaml
16
+ prepare-id: YYYY-MM-DD-NNN-prepare
17
+ triage-id: YYYY-MM-DD-NNN-triage
18
+ work-id: YYYY-MM-DD-NNN
19
+ work-branch: work/<short-description> | null # inherited from the Work Manifest
20
+ input-shape: plan-based | task-file | ad-hoc
21
+ interactionMode: detailed | smart | autopilot
22
+ executionMode: inline | serial | parallel
23
+ status: complete
24
+ timestamp: ISO-8601 timestamp
25
+
26
+ test-environment:
27
+ runner: npm | pnpm | pytest | go | cargo | rspec | phpunit | mvn | gradle | unknown
28
+ packageManager: npm | pnpm | null # Node.js only
29
+ test-command: "[resolved test invocation pattern]"
30
+
31
+ baseline:
32
+ state: green | red | snapshot-and-continue
33
+ known-failing-snapshot: [test-path or test-id, ...] # only when state == snapshot-and-continue
34
+
35
+ execution-list: # flat for inline/serial; wave-grouped for parallel
36
+ inline | serial:
37
+ - <task-id>
38
+ - <task-id>
39
+ parallel:
40
+ waves:
41
+ - [ <task-id>, ... ] # Wave 0 (independent)
42
+ - [ <task-id>, ... ] # Wave 1 (depends on Wave 0)
43
+ upstream-skipped: false | true # task-file "Proceed anyway" only
44
+
45
+ applicable-gates: [red, green, refactor, complete] # the gates Execute enforces (read-only)
46
+ retry-limit: 2 # task-scoped; authorized in task-execution-rules.md
47
+
48
+ policy: # recorded read-only from task-execution-rules.md; not re-derived
49
+ resume: "completed skipped; blocked/skipped carried; in-progress re-enters; not-started runs"
50
+ blocked: "green-not-reached-within-retry-limit -> status blocked + reason; checkbox stays -[]"
51
+ skip: "explicit user confirm only -> status skipped + reason; checkbox stays -[]"
52
+ complete: "refactor green -> status completed; checkbox -[x]; index tick -[x]"
53
+ regression: "snapshot-and-continue ignores known-failing-snapshot; green requires no NEW failure"
54
+
55
+ work-state: ready | nothing-ready # echoes the Work Manifest if carried through
56
+ ```
57
+
58
+ Also save the Execution Plan to `docs/plans/.work/.prepare/<prepare-id>.md`.
59
+
60
+ ## Validation Rules
61
+
62
+ - **prepare-id:** Required. Format `YYYY-MM-DD-NNN-prepare`.
63
+ - **triage-id, work-id, work-branch, input-shape:** Required, inherited from Triage (cross-phase consistency).
64
+ - **interactionMode, executionMode:** Both required. `executionMode` must respect the risk floor in [execution-mode-selection.md](../../execution-mode-selection.md) (any HIGH-risk task → `inline`).
65
+ - **test-environment.runner:** Required; `unknown` only allowed when the user was asked to supply the command (Prepare should normally resolve it).
66
+ - **test-environment.packageManager:** Required for Node.js (`npm` | `pnpm`), else `null`.
67
+ - **baseline.state:** Required. `red` without `snapshot-and-continue` is invalid here (Prepare must resolve the policy first).
68
+ - **execution-list:** Required. Preserves the manifest's dependency order; wave-grouping (if `parallel`) respects dependency layers. Empty only when `work-state: nothing-ready`.
69
+ - **applicable-gates, retry-limit, policy:** Required, recorded **read-only** from [task-execution-rules.md](../../task-execution-rules.md) — Execute enforces them; Prepare must not re-encode altered definitions.
70
+ - **status:** Required. `complete`.
71
+
72
+ ## Example (serial, green baseline)
73
+
74
+ ```yaml
75
+ prepare-id: 2026-08-07-002-prepare
76
+ triage-id: 2026-08-07-001-triage
77
+ work-id: 2026-07-10-001
78
+ work-branch: work/redis-session-store
79
+ input-shape: plan-based
80
+ interactionMode: smart
81
+ executionMode: serial
82
+ status: complete
83
+ timestamp: 2026-08-07T14:35:00Z
84
+ test-environment:
85
+ runner: pnpm
86
+ packageManager: pnpm
87
+ test-command: "pnpm test -- <test-path>"
88
+ baseline:
89
+ state: green
90
+ known-failing-snapshot: []
91
+ execution-list:
92
+ - 2026-07-10-001-T01
93
+ - 2026-07-10-001-T02a
94
+ - 2026-07-10-001-T02b
95
+ upstream-skipped: false
96
+ applicable-gates: [red, green, refactor, complete]
97
+ retry-limit: 2
98
+ policy:
99
+ resume: "completed skipped; blocked/skipped carried; in-progress re-enters; not-started runs"
100
+ blocked: "green-not-reached-within-retry-limit -> status blocked + reason"
101
+ skip: "explicit user confirm only -> status skipped + reason"
102
+ complete: "refactor green -> status completed; checkbox -[x]; index tick -[x]"
103
+ regression: "green requires no NEW failure (snapshot empty for green baseline)"
104
+ work-state: ready
105
+ ```
106
+
107
+ ## Notes
108
+
109
+ - The orchestrator's quality gate #2 cross-checks `interactionMode` and `executionMode` are identical across Prepare/Execute/Review artifacts.
110
+ - `upstream-skipped: true` is set only for the task-file shape when the user chose "Proceed anyway" (Triage Step 2b); the execution-list then contains just that single task.
111
+ - Gate/policy values are **read-only** here: Execute enforces the definitions in [task-execution-rules.md](../../task-execution-rules.md); Prepare must not redefine them (single-source-of-truth).
@@ -0,0 +1,78 @@
1
+ ---
2
+ title: Work Input Artifact
3
+ description: Template for the Work Input Artifact produced by the Orchestrator. Carries the input shape (plan-id, task-file, or ad-hoc description) and interactionMode; consumed by Triage.
4
+ type: template
5
+ version: 1.0
6
+ timestamp: "2026-08-07"
7
+ ---
8
+
9
+ # Work Input Artifact
10
+
11
+ The Orchestrator produces a Work Input Artifact as the entry point to the Work workflow. It carries the input shape (one of plan-id, task-file, or ad-hoc description) and the user-selected `interactionMode`. Triage consumes it.
12
+
13
+ ## Schema
14
+
15
+ ```yaml
16
+ type: work-input
17
+ timestamp: ISO-8601 timestamp (e.g., 2026-08-07T14:30:00Z)
18
+ source: user | saved-prompt | document | combination
19
+ status: complete
20
+ interactionMode: detailed | smart | autopilot
21
+
22
+ # Input shape — exactly one of the following:
23
+ plan-id: YYYY-MM-DD-NNN | null # plan-based: points at docs/tasks/<plan-id>/index.md
24
+ task-file: docs/tasks/<plan-id>/T<NN>-<name>.md | null # task-file input (also accepts a task-id like <plan-id>-T03)
25
+ ad-hoc: "<raw work description>" | null # ad-hoc input
26
+
27
+ # Optional context carried for ad-hoc:
28
+ goals: [ ... ]
29
+ constraints: [ ... ]
30
+ references: [ ... ]
31
+ ```
32
+
33
+ ## Validation Rules
34
+
35
+ - **type:** Required. Must be `work-input`.
36
+ - **timestamp:** Required. ISO-8601.
37
+ - **source:** Required. One of `user`, `saved-prompt`, `document`, `combination`.
38
+ - **status:** Required. `complete` (the Orchestrator marks it complete once it has the input and the interaction mode).
39
+ - **interactionMode:** Required. One of `detailed`, `smart`, `autopilot`. (If missing, default to `smart`; see [error-handling.md](../../error-handling.md) Category 5.)
40
+ - **Input shape:** Exactly one of `plan-id`, `task-file`, `ad-hoc` must be non-null. If all three are null/empty, the Orchestrator asks: "What would you like to work on? Provide a plan-id, a task file, or describe the task." (Category 3.)
41
+ - **plan-id:** When present, matches `YYYY-MM-DD-NNN` and resolves to a non-empty `docs/tasks/<plan-id>/index.md`. If not, ask to run `/plan <id>` first or switch to ad-hoc.
42
+ - **task-file:** When present, resolves to exactly one task file (or a task-id resolving uniquely). If it matches multiple files, ask the user to disambiguate.
43
+ - **ad-hoc:** When present, a non-empty work description.
44
+
45
+ ## Example
46
+
47
+ ```yaml
48
+ type: work-input
49
+ timestamp: 2026-08-07T09:00:00Z
50
+ source: user
51
+ status: complete
52
+ interactionMode: smart
53
+ plan-id: 2026-07-10-001
54
+ goals: null
55
+ constraints: null
56
+ references: null
57
+ ```
58
+
59
+ Ad-hoc example:
60
+
61
+ ```yaml
62
+ type: work-input
63
+ timestamp: 2026-08-07T09:05:00Z
64
+ source: user
65
+ status: complete
66
+ interactionMode: detailed
67
+ plan-id: null
68
+ task-file: null
69
+ ad-hoc: "Fix the login redirect loop when a session expires mid-request"
70
+ goals: ["Users land on the login page instead of a 500"]
71
+ constraints: ["No new dependencies"]
72
+ references: null
73
+ ```
74
+
75
+ ## Notes
76
+
77
+ - The Orchestrator's Pre-Flight Check ensures `docs/tasks/` and `docs/plans/.work/.{triage,prepare,execute,review}/` exist (self-healing via `mkdir -p`) before handing the Work Input Artifact to Triage.
78
+ - `interactionMode` flows from this artifact into every downstream artifact (Triage → Prepare → Execute → Review); the orchestrator quality gate #2 cross-checks it is identical across all.
@@ -0,0 +1,119 @@
1
+ ---
2
+ title: Work Manifest Artifact
3
+ description: Template for the Work Manifest produced by the Triage phase. Carries the resolved, dependency-ordered task list (one AC per task, one test per task), ready-tasks, related learnings, and any dependency-warning; consumed by Prepare.
4
+ type: template
5
+ version: 1.0
6
+ timestamp: "2026-08-07"
7
+ ---
8
+
9
+ # Work Manifest Artifact
10
+
11
+ The product of the **Triage** phase is a resolved, dependency-ordered Work Manifest. It normalizes the three input shapes (plan-based, task-file, ad-hoc) into one structure: a list of tasks, each carrying exactly one Acceptance Criterion and one test, ordered by dependency, with status and readiness flags. Prepare consumes it.
12
+
13
+ ## Schema
14
+
15
+ ```yaml
16
+ triage-id: YYYY-MM-DD-NNN-triage
17
+ work-id: YYYY-MM-DD-NNN
18
+ work-branch: work/<short-description> | null # git branch for this run (Triage Step 2d)
19
+ work-branch-base: <branch-name> | null # base used when the branch was created
20
+ work-branch-state: created | checked-out | already-on | skipped-by-user | not-a-git-repo
21
+ input-shape: plan-based | task-file | ad-hoc
22
+ interactionMode: detailed | smart | autopilot
23
+ status: complete
24
+ timestamp: ISO-8601 timestamp
25
+
26
+ # Resolved task list (dependency-ordered; one AC per task)
27
+ tasks:
28
+ - id: <work-id>-T<NN>
29
+ title: "[Task title]"
30
+ unit: U<NN> | U<NN><letter>
31
+ acceptance-criterion: "[exactly one, verifiable]"
32
+ files:
33
+ create: [path/to/file, ...]
34
+ modify: [path/to/file, ...]
35
+ test: [path/to/test] # exactly one
36
+ priority: P0 | P1 | P2
37
+ dependencies: [<task-id>, ...]
38
+ status: not-started | in-progress | completed | blocked | skipped # current task-file status
39
+ risk: low | medium | high # carried for execution-mode selection
40
+ ready: true | false # deps completed and status not completed
41
+
42
+ ready-tasks: [<task-id>, ...] # subset of tasks runnable this session
43
+ already-complete-tasks: [<task-id>, ...] # completed tasks (skipped on resume)
44
+
45
+ related-learnings: # per-task; from docs/learn/index.md
46
+ <task-id>:
47
+ - docs/learn/XXX.md — [1-line applicability note]
48
+
49
+ learning-gaps:
50
+ - gap_name: "[Domain] — [what's missing]"
51
+ domain: [primary domain]
52
+ relevance: why this matters for the task
53
+ suggested_action: "Research external resource" | "Document post-implementation"
54
+
55
+ dependency-warning: null | proceeded-without-upstream | expanded-to-upstream # task-file shape only
56
+ work-state: ready | nothing-ready # nothing-ready if no task is runnable
57
+ ```
58
+
59
+ Also save the manifest to `docs/plans/.work/.triage/<triage-id>.md` for future reference or reuse.
60
+
61
+ ## Validation Rules
62
+
63
+ - **triage-id:** Required. Format `YYYY-MM-DD-NNN-triage`.
64
+ - **work-id:** Required. For plan-based/task-file, equals the `plan-id` (inherited). For ad-hoc, a freshly allocated `YYYY-MM-DD-NNN` (per [id-generation.md](../../id-generation.md)). The `docs/tasks/<work-id>/` directory must exist (ad-hoc creates it; plan-based already has it).
65
+ - **work-branch:** Required. Format `work/<slug>` (kebab-case, ≤ 50 chars); `null` only when `work-branch-state` is `skipped-by-user` or `not-a-git-repo`. Must be consistent with `work-branch-state` (`created`/`checked-out`/`already-on` require a branch).
66
+ - **work-branch-base:** Required. The base branch used at creation (Triage Step 2d.4); `null` when no branch was created.
67
+ - **work-branch-state:** Required. One of `created`, `checked-out`, `already-on`, `skipped-by-user`, `not-a-git-repo`.
68
+ - **input-shape:** Required. One of `plan-based`, `task-file`, `ad-hoc`.
69
+ - **interactionMode:** Required, propagated from the Work Input Artifact.
70
+ - **status:** Required. `complete`.
71
+ - **tasks:** Required, non-empty unless `work-state: nothing-ready`. Each task must carry:
72
+ - exactly one `acceptance-criterion` and exactly one `files.test` entry
73
+ - `files` repository-relative
74
+ - `dependencies` referencing task-ids that exist (plan-based: in the index; task-file/ad-hoc: in the manifest or parent plan)
75
+ - **ready-tasks:** Required (may be empty). Subset of `tasks` whose dependencies are all `completed` and whose status is not `completed`.
76
+ - **already-complete-tasks:** Required (may be empty). Tasks with `status: completed` — skipped on resume.
77
+ - **related-learnings:** Required (may be empty per task). References `docs/learn/index.md` entries.
78
+ - **dependency-warning:** Required for the task-file shape (`proceeded-without-upstream` or `expanded-to-upstream` record the upstream-dep decision); `null` for other shapes.
79
+ - **work-state:** Required. `nothing-ready` if `ready-tasks` is empty and no task is runnable.
80
+
81
+ ## Example (plan-based)
82
+
83
+ ```yaml
84
+ triage-id: 2026-08-07-001-triage
85
+ work-id: 2026-07-10-001
86
+ work-branch: work/redis-session-store
87
+ work-branch-base: main
88
+ work-branch-state: created
89
+ input-shape: plan-based
90
+ interactionMode: smart
91
+ status: complete
92
+ timestamp: 2026-08-07T14:30:00Z
93
+ tasks:
94
+ - id: 2026-07-10-001-T01
95
+ title: "Redis client connects and backs the SessionStore interface"
96
+ unit: U1
97
+ acceptance-criterion: "The Redis client connects from REDIS_URL with retry, and SessionStore exports get/save/delete"
98
+ files: { create: [src/lib/redis-client.ts, src/lib/session-store.ts], modify: [], test: [src/lib/redis-client.test.ts] }
99
+ priority: P0
100
+ dependencies: []
101
+ status: not-started
102
+ risk: high
103
+ ready: true
104
+ ready-tasks: [2026-07-10-001-T01]
105
+ already-complete-tasks: []
106
+ related-learnings:
107
+ 2026-07-10-001-T01:
108
+ - docs/learn/pattern/redis-retry-2026-07-02.md — connection retry pattern reused here
109
+ learning-gaps: []
110
+ dependency-warning: null
111
+ work-state: ready
112
+ ```
113
+
114
+ ## Notes
115
+
116
+ - The manifest is in **dependency order**: no task appears before its dependencies (topological, stable by unit number).
117
+ - The work branch is created in Triage Step 2d, before any task file or index is written; branch setup is idempotent, so a re-run resumes on the same branch. The orchestrator's quality gate verifies branch coherence before Execute.
118
+ - Resume-safe: Prepare/Execute read each task's current `status` from its task file, not from the manifest alone — the manifest is the resolved plan, the task files are the live state.
119
+ - For `task-file` input with the "Proceed anyway" choice, the manifest contains only the single task and `dependency-warning: proceeded-without-upstream`; for "Run upstream first", it contains the unmet upstream tasks plus this task and `dependency-warning: expanded-to-upstream`. Downstream dependents are never included.