@leeovery/claude-technical-workflows 2.1.40 → 2.1.41

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 (110) hide show
  1. package/README.md +1 -1
  2. package/agents/implementation-analysis-architecture.md +2 -2
  3. package/agents/implementation-analysis-duplication.md +2 -2
  4. package/agents/implementation-analysis-standards.md +2 -2
  5. package/agents/implementation-analysis-synthesizer.md +3 -3
  6. package/agents/implementation-analysis-task-writer.md +1 -1
  7. package/agents/implementation-task-executor.md +3 -0
  8. package/agents/planning-phase-designer.md +8 -6
  9. package/agents/planning-task-designer.md +8 -6
  10. package/agents/review-findings-synthesizer.md +2 -2
  11. package/agents/review-task-verifier.md +1 -1
  12. package/hooks/workflows/compact-recovery.sh +1 -1
  13. package/hooks/workflows/session-cleanup.sh +1 -1
  14. package/hooks/workflows/write-session-state.sh +1 -1
  15. package/package.json +1 -1
  16. package/skills/begin-implementation/SKILL.md +5 -5
  17. package/skills/begin-planning/SKILL.md +2 -1
  18. package/skills/begin-review/SKILL.md +1 -1
  19. package/skills/continue-feature/references/detect-phase.md +5 -5
  20. package/skills/continue-feature/references/invoke-implementation.md +2 -2
  21. package/skills/continue-feature/references/invoke-planning.md +2 -2
  22. package/skills/continue-feature/references/invoke-review.md +2 -2
  23. package/skills/continue-feature/references/invoke-specification.md +3 -3
  24. package/skills/continue-feature/scripts/discovery.sh +5 -5
  25. package/skills/link-dependencies/SKILL.md +5 -5
  26. package/skills/migrate/SKILL.md +1 -1
  27. package/skills/migrate/scripts/migrate.sh +56 -25
  28. package/skills/migrate/scripts/migrations/011-rename-workflow-directory.sh +73 -0
  29. package/skills/migrate/scripts/migrations/012-environment-setup-to-state.sh +23 -0
  30. package/skills/start-discussion/SKILL.md +2 -2
  31. package/skills/start-discussion/references/gather-context-research.md +1 -1
  32. package/skills/start-discussion/references/handle-selection.md +1 -1
  33. package/skills/start-discussion/references/invoke-skill.md +3 -3
  34. package/skills/start-discussion/references/research-analysis.md +3 -3
  35. package/skills/start-discussion/scripts/discovery.sh +3 -3
  36. package/skills/start-feature/SKILL.md +5 -5
  37. package/skills/start-feature/references/phase-bridge.md +1 -1
  38. package/skills/start-implementation/SKILL.md +6 -6
  39. package/skills/start-implementation/scripts/discovery.sh +4 -4
  40. package/skills/start-planning/SKILL.md +5 -3
  41. package/skills/start-planning/references/display-state.md +31 -1
  42. package/skills/start-planning/references/invoke-skill.md +3 -3
  43. package/skills/start-planning/scripts/discovery.sh +32 -3
  44. package/skills/start-research/SKILL.md +1 -1
  45. package/skills/start-research/references/invoke-skill.md +1 -1
  46. package/skills/start-review/SKILL.md +1 -1
  47. package/skills/start-review/references/invoke-skill.md +4 -4
  48. package/skills/start-review/scripts/discovery.sh +5 -5
  49. package/skills/start-specification/SKILL.md +1 -1
  50. package/skills/start-specification/references/analysis-flow.md +2 -2
  51. package/skills/start-specification/references/confirm-continue.md +3 -3
  52. package/skills/start-specification/references/confirm-create.md +2 -2
  53. package/skills/start-specification/references/confirm-refine.md +1 -1
  54. package/skills/start-specification/references/confirm-unify.md +2 -2
  55. package/skills/start-specification/references/display-analyze.md +1 -1
  56. package/skills/start-specification/references/display-groupings.md +3 -3
  57. package/skills/start-specification/references/display-specs-menu.md +1 -1
  58. package/skills/start-specification/references/handoffs/continue-concluded.md +4 -4
  59. package/skills/start-specification/references/handoffs/continue.md +4 -4
  60. package/skills/start-specification/references/handoffs/create-with-incorporation.md +5 -5
  61. package/skills/start-specification/references/handoffs/create.md +4 -4
  62. package/skills/start-specification/references/handoffs/unify-with-incorporation.md +6 -6
  63. package/skills/start-specification/references/handoffs/unify.md +4 -4
  64. package/skills/start-specification/scripts/discovery.sh +3 -3
  65. package/skills/status/SKILL.md +1 -1
  66. package/skills/status/scripts/discovery.sh +5 -5
  67. package/skills/technical-discussion/SKILL.md +3 -3
  68. package/skills/technical-discussion/references/template.md +2 -2
  69. package/skills/technical-implementation/SKILL.md +11 -10
  70. package/skills/technical-implementation/references/analysis-loop.md +45 -9
  71. package/skills/technical-implementation/references/environment-setup.md +3 -3
  72. package/skills/technical-implementation/references/invoke-task-writer.md +1 -1
  73. package/skills/technical-implementation/references/task-loop.md +1 -1
  74. package/skills/technical-planning/SKILL.md +8 -7
  75. package/skills/technical-planning/references/analyze-task-graph.md +1 -1
  76. package/skills/technical-planning/references/author-tasks.md +5 -5
  77. package/skills/technical-planning/references/define-phases.md +5 -2
  78. package/skills/technical-planning/references/define-tasks.md +6 -3
  79. package/skills/technical-planning/references/invoke-review-integrity.md +1 -1
  80. package/skills/technical-planning/references/invoke-review-traceability.md +1 -1
  81. package/skills/technical-planning/references/output-formats/local-markdown/about.md +2 -2
  82. package/skills/technical-planning/references/output-formats/local-markdown/authoring.md +2 -2
  83. package/skills/technical-planning/references/output-formats/local-markdown/reading.md +3 -3
  84. package/skills/technical-planning/references/output-formats/local-markdown/updating.md +1 -1
  85. package/skills/technical-planning/references/phase-design/bugfix.md +75 -0
  86. package/skills/technical-planning/references/phase-design/feature.md +77 -0
  87. package/skills/technical-planning/references/phase-design/greenfield.md +75 -0
  88. package/skills/technical-planning/references/phase-design.md +7 -57
  89. package/skills/technical-planning/references/plan-index-schema.md +3 -1
  90. package/skills/technical-planning/references/review-integrity.md +1 -1
  91. package/skills/technical-planning/references/review-traceability.md +1 -1
  92. package/skills/technical-planning/references/task-design/bugfix.md +65 -0
  93. package/skills/technical-planning/references/task-design/feature.md +61 -0
  94. package/skills/technical-planning/references/task-design/greenfield.md +47 -0
  95. package/skills/technical-planning/references/task-design.md +6 -39
  96. package/skills/technical-planning/references/verify-source-material.md +2 -2
  97. package/skills/technical-research/SKILL.md +2 -2
  98. package/skills/technical-research/references/interview.md +2 -2
  99. package/skills/technical-review/SKILL.md +1 -1
  100. package/skills/technical-review/references/invoke-review-synthesizer.md +3 -3
  101. package/skills/technical-review/references/invoke-review-task-writer.md +2 -2
  102. package/skills/technical-review/references/invoke-task-verifiers.md +3 -3
  103. package/skills/technical-review/references/produce-review.md +1 -1
  104. package/skills/technical-review/references/review-actions-loop.md +7 -5
  105. package/skills/technical-specification/SKILL.md +5 -5
  106. package/skills/technical-specification/references/dependencies.md +2 -2
  107. package/skills/technical-specification/references/review-tracking-format.md +1 -1
  108. package/skills/technical-specification/references/specification-format.md +1 -1
  109. package/skills/technical-specification/references/verify-source-material.md +2 -2
  110. package/skills/view-plan/SKILL.md +2 -2
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: technical-planning
3
- description: "Transform specifications into actionable implementation plans with phases, tasks, and acceptance criteria. Use when: (1) User asks to create/write an implementation plan, (2) User asks to plan implementation from a specification, (3) Converting specifications from docs/workflow/specification/{topic}/specification.md into implementation plans, (4) User says 'plan this' or 'create a plan', (5) Need to structure how to build something with phases and concrete steps. Creates plans in docs/workflow/planning/{topic}/plan.md that can be executed via strict TDD."
3
+ description: "Transform specifications into actionable implementation plans with phases, tasks, and acceptance criteria. Use when: (1) User asks to create/write an implementation plan, (2) User asks to plan implementation from a specification, (3) Converting specifications from .workflows/specification/{topic}/specification.md into implementation plans, (4) User says 'plan this' or 'create a plan', (5) Need to structure how to build something with phases and concrete steps. Creates plans in .workflows/planning/{topic}/plan.md that can be executed via strict TDD."
4
4
  user-invocable: false
5
5
  ---
6
6
 
@@ -24,6 +24,7 @@ Either way: Transform specifications into actionable phases, tasks, and acceptan
24
24
  - **Topic name** (optional) - Will derive from specification if not provided
25
25
  - **Output format preference** (optional) - Will ask if not specified
26
26
  - **Recommended output format** (optional) - A format suggestion for consistency with existing plans
27
+ - **Work type** (optional) — `greenfield`, `feature`, or `bugfix`. Determines which context-specific guidance is loaded during phase and task design. Defaults to `greenfield` when not provided.
27
28
  - **Cross-cutting references** (optional) - Cross-cutting specifications that inform technical decisions in this plan
28
29
 
29
30
  **Before proceeding**, verify the required input is available and unambiguous. If anything is missing or unclear, **STOP** — do not proceed until resolved.
@@ -34,7 +35,7 @@ Either way: Transform specifications into actionable phases, tasks, and acceptan
34
35
 
35
36
  ```
36
37
  I need the specification content to plan from. Could you point me to the
37
- specification file (e.g., docs/workflow/specification/{topic}/specification.md),
38
+ specification file (e.g., .workflows/specification/{topic}/specification.md),
38
39
  or provide the content directly?
39
40
  ```
40
41
 
@@ -59,7 +60,7 @@ this, or is there a more complete version?
59
60
  Context refresh (compaction) summarizes the conversation, losing procedural detail. When you detect a context refresh has occurred — the conversation feels abruptly shorter, you lack memory of recent steps, or a summary precedes this message — follow this recovery protocol:
60
61
 
61
62
  1. **Re-read this skill file completely.** Do not rely on your summary of it. The full process, steps, and rules must be reloaded.
62
- 2. **Read all tracking and state files** for the current topic — plan index files, review tracking files, implementation tracking files, or any working documents this skill creates. These are your source of truth for progress. Check for scratch files at `docs/workflow/.cache/planning/{topic}/`. If a scratch file exists, you are mid-authoring for that phase — resume the approval loop in author-tasks.md.
63
+ 2. **Read all tracking and state files** for the current topic — plan index files, review tracking files, implementation tracking files, or any working documents this skill creates. These are your source of truth for progress. Check for scratch files at `.workflows/.cache/planning/{topic}/`. If a scratch file exists, you are mid-authoring for that phase — resume the approval loop in author-tasks.md.
63
64
  3. **Check git state.** Run `git status` and `git log --oneline -10` to see recent commits. Commit messages follow a conventional pattern that reveals what was completed.
64
65
  4. **Announce your position** to the user before continuing: what step you believe you're at, what's been completed, and what comes next. Wait for confirmation.
65
66
  5. **Check `task_list_gate_mode`, `author_gate_mode`, and `finding_gate_mode`** in the Plan Index File frontmatter — if `auto`, the user previously opted in during this session. Preserve these values.
@@ -72,7 +73,7 @@ Do not guess at progress or continue from memory. The files on disk and git hist
72
73
 
73
74
  This process constructs a plan from a specification. A plan consists of:
74
75
 
75
- - **Plan Index File** — `docs/workflow/planning/{topic}/plan.md`. Contains frontmatter (topic, format, status, progress), phases with acceptance criteria, and task tables tracking status. This is the single source of truth for planning progress.
76
+ - **Plan Index File** — `.workflows/planning/{topic}/plan.md`. Contains frontmatter (topic, format, status, progress), phases with acceptance criteria, and task tables tracking status. This is the single source of truth for planning progress.
76
77
  - **Authored Tasks** — Detailed task files written to the chosen **Output Format** (selected during planning). The output format determines where and how task detail is stored.
77
78
 
78
79
  Follow every step in sequence. No steps are optional.
@@ -85,7 +86,7 @@ When announcing a new step, output `── ── ── ── ──` on its o
85
86
 
86
87
  ## Step 0: Resume Detection
87
88
 
88
- Check if a Plan Index File already exists at `docs/workflow/planning/{topic}/plan.md`.
89
+ Check if a Plan Index File already exists at `.workflows/planning/{topic}/plan.md`.
89
90
 
90
91
  #### If no Plan Index File exists
91
92
 
@@ -126,7 +127,7 @@ Reset `task_list_gate_mode`, `author_gate_mode`, and `finding_gate_mode` to `gat
126
127
 
127
128
  1. Read **[output-formats.md](references/output-formats.md)**, find the entry matching the `format:` field in the Plan Index File, and load the format's **[authoring.md](references/output-formats/{format}/authoring.md)**
128
129
  2. Follow the authoring file's cleanup instructions to remove Authored Tasks for this topic
129
- 3. Delete the scratch directory if it exists: `rm -rf docs/workflow/.cache/planning/{topic}/`
130
+ 3. Delete the scratch directory if it exists: `rm -rf .workflows/.cache/planning/{topic}/`
130
131
  4. Delete the Plan Index File
131
132
  5. Commit: `planning({topic}): restart planning`
132
133
 
@@ -173,7 +174,7 @@ Once selected:
173
174
 
174
175
  1. Read **[output-formats.md](references/output-formats.md)**, find the chosen format entry, and load the format's **[about.md](references/output-formats/{format}/about.md)** and **[authoring.md](references/output-formats/{format}/authoring.md)**
175
176
  2. Capture the current git commit hash: `git rev-parse HEAD`
176
- 3. Create the Plan Index File at `docs/workflow/planning/{topic}/plan.md` using the **Frontmatter** and **Title** templates from **[plan-index-schema.md](references/plan-index-schema.md)**. Set `status: planning`, `spec_commit` to the captured git hash, and today's actual date for `created` and `updated`.
177
+ 3. Create the Plan Index File at `.workflows/planning/{topic}/plan.md` using the **Frontmatter** and **Title** templates from **[plan-index-schema.md](references/plan-index-schema.md)**. Set `status: planning`, `spec_commit` to the captured git hash, today's actual date for `created` and `updated`, and `work_type` to the value provided by the caller (or `greenfield` if not provided).
177
178
 
178
179
  3. Commit: `planning({topic}): initialize plan`
179
180
 
@@ -23,7 +23,7 @@ Read **[output-formats.md](output-formats.md)**, find the entry matching the `fo
23
23
 
24
24
  Invoke `planning-dependency-grapher` with these file paths:
25
25
 
26
- 1. **Plan Index File path**: `docs/workflow/planning/{topic}/plan.md`
26
+ 1. **Plan Index File path**: `.workflows/planning/{topic}/plan.md`
27
27
  2. **reading.md**: the format's reading reference loaded above
28
28
  3. **graph.md**: the format's graph reference loaded above
29
29
 
@@ -10,9 +10,9 @@ This step uses the `planning-task-author` agent (`../../../agents/planning-task-
10
10
 
11
11
  ## Section 1: Prepare the Scratch File
12
12
 
13
- Scratch file path: `docs/workflow/.cache/planning/{topic}/phase-{N}.md`
13
+ Scratch file path: `.workflows/.cache/planning/{topic}/phase-{N}.md`
14
14
 
15
- Create the `docs/workflow/.cache/planning/{topic}/` directory if it does not exist.
15
+ Create the `.workflows/.cache/planning/{topic}/` directory if it does not exist.
16
16
 
17
17
  ---
18
18
 
@@ -32,7 +32,7 @@ Invoke `planning-task-author` with these file paths:
32
32
  4. **task-design.md**: `task-design.md`
33
33
  5. **All approved phases**: the complete phase structure from the Plan Index File body
34
34
  6. **Task list for current phase**: the approved task table (ALL tasks in the phase)
35
- 7. **Scratch file path**: `docs/workflow/.cache/planning/{topic}/phase-{N}.md`
35
+ 7. **Scratch file path**: `.workflows/.cache/planning/{topic}/phase-{N}.md`
36
36
 
37
37
  The agent writes all tasks to the scratch file and returns.
38
38
 
@@ -183,8 +183,8 @@ Repeat for each task.
183
183
 
184
184
  ## Section 7: Cleanup
185
185
 
186
- Delete the scratch file: `rm docs/workflow/.cache/planning/{topic}/phase-{N}.md`
186
+ Delete the scratch file: `rm .workflows/.cache/planning/{topic}/phase-{N}.md`
187
187
 
188
- Remove the `docs/workflow/.cache/planning/{topic}/` directory if empty.
188
+ Remove the `.workflows/.cache/planning/{topic}/` directory if empty.
189
189
 
190
190
  → Return to **Plan Construction**.
@@ -34,14 +34,17 @@ independently testable stages.
34
34
 
35
35
  ### Invoke the Agent
36
36
 
37
+ Read `work_type` from the Plan Index File frontmatter.
38
+
37
39
  Invoke `planning-phase-designer` with these file paths:
38
40
 
39
41
  1. **read-specification.md**: `read-specification.md`
40
42
  2. **Specification**: path from the Plan Index File's `specification:` field
41
43
  3. **Cross-cutting specs**: paths from the Plan Index File's `cross_cutting_specs:` field (if any)
42
44
  4. **phase-design.md**: `phase-design.md`
43
- 5. **task-design.md**: `task-design.md`
44
- 6. **plan-index-schema.md**: `plan-index-schema.md`
45
+ 5. **Context guidance**: `phase-design/{work_type}.md` (default to `greenfield` if `work_type` is empty)
46
+ 6. **task-design.md**: `task-design.md`
47
+ 7. **plan-index-schema.md**: `plan-index-schema.md`
45
48
 
46
49
  The agent returns a complete phase structure. Write it directly to the Plan Index File body.
47
50
 
@@ -20,15 +20,18 @@ propose a task list.
20
20
 
21
21
  ### Invoke the Agent
22
22
 
23
+ Read `work_type` from the Plan Index File frontmatter.
24
+
23
25
  Invoke `planning-task-designer` with these file paths:
24
26
 
25
27
  1. **read-specification.md**: `read-specification.md`
26
28
  2. **Specification**: path from the Plan Index File's `specification:` field
27
29
  3. **Cross-cutting specs**: paths from the Plan Index File's `cross_cutting_specs:` field (if any)
28
30
  4. **task-design.md**: `task-design.md`
29
- 5. **All approved phases**: the complete phase structure from the Plan Index File body
30
- 6. **Target phase number**: the phase being broken into tasks
31
- 7. **plan-index-schema.md**: `plan-index-schema.md`
31
+ 5. **Context guidance**: `task-design/{work_type}.md` (default to `greenfield` if `work_type` is empty)
32
+ 6. **All approved phases**: the complete phase structure from the Plan Index File body
33
+ 7. **Target phase number**: the phase being broken into tasks
34
+ 8. **plan-index-schema.md**: `plan-index-schema.md`
32
35
 
33
36
  ### Present the Output
34
37
 
@@ -13,7 +13,7 @@ This step invokes the `planning-review-integrity` agent (`../../../agents/planni
13
13
  Invoke `planning-review-integrity` with:
14
14
 
15
15
  1. **Review criteria path**: `review-integrity.md` (in this directory)
16
- 2. **Plan path**: `docs/workflow/planning/{topic}/plan.md`
16
+ 2. **Plan path**: `.workflows/planning/{topic}/plan.md`
17
17
  3. **Format reading.md path**: load **[output-formats.md](output-formats.md)**, find the entry matching the plan's `format:` field, and pass the format's `reading.md` path
18
18
  4. **Cycle number**: current `review_cycle` from the Plan Index File frontmatter
19
19
  5. **Topic name**: from the plan's `topic` frontmatter field
@@ -14,7 +14,7 @@ Invoke `planning-review-traceability` with:
14
14
 
15
15
  1. **Review criteria path**: `review-traceability.md` (in this directory)
16
16
  2. **Specification path**: from the plan's `specification` frontmatter field (resolved relative to the plan directory)
17
- 3. **Plan path**: `docs/workflow/planning/{topic}/plan.md`
17
+ 3. **Plan path**: `.workflows/planning/{topic}/plan.md`
18
18
  4. **Format reading.md path**: load **[output-formats.md](output-formats.md)**, find the entry matching the plan's `format:` field, and pass the format's `reading.md` path
19
19
  5. **Cycle number**: current `review_cycle` from the Plan Index File frontmatter
20
20
  6. **Topic name**: from the plan's `topic` frontmatter field
@@ -21,7 +21,7 @@ No external tools required. This format uses plain markdown files stored in the
21
21
 
22
22
  | Concept | Local Markdown Entity |
23
23
  |---------|-----------------------|
24
- | Topic | Directory (`docs/workflow/planning/{topic}/`) |
24
+ | Topic | Directory (`.workflows/planning/{topic}/`) |
25
25
  | Phase | Encoded in task ID (`{topic}-{phase}-{seq}`) |
26
26
  | Task | Markdown file (`{task-id}.md`) |
27
27
  | Dependency | Task ID reference in frontmatter (no native blocking) |
@@ -31,7 +31,7 @@ No external tools required. This format uses plain markdown files stored in the
31
31
  Tasks are stored as individual markdown files in a `tasks/` subdirectory under the topic directory:
32
32
 
33
33
  ```
34
- docs/workflow/planning/{topic}/
34
+ .workflows/planning/{topic}/
35
35
  ├── plan.md # Plan Index File (not a task)
36
36
  └── tasks/ # Task files
37
37
  ├── {topic}-1-1.md # Phase 1, task 1
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Task Storage
4
4
 
5
- Each task is written to `docs/workflow/planning/{topic}/tasks/{task-id}.md` — a markdown file with frontmatter and a description body.
5
+ Each task is written to `.workflows/planning/{topic}/tasks/{task-id}.md` — a markdown file with frontmatter and a description body.
6
6
 
7
7
  ```markdown
8
8
  ---
@@ -60,5 +60,5 @@ In the task file, add a **Needs Clarification** section:
60
60
  Delete the tasks directory — preserves `plan.md` (the Plan Index) and any review tracking files:
61
61
 
62
62
  ```bash
63
- rm -rf docs/workflow/planning/{topic}/tasks/
63
+ rm -rf .workflows/planning/{topic}/tasks/
64
64
  ```
@@ -4,7 +4,7 @@
4
4
 
5
5
  To retrieve all tasks for a plan:
6
6
 
7
- 1. List all `.md` files in `docs/workflow/planning/{topic}/tasks/` — every file in this directory is a task file, no filtering needed
7
+ 1. List all `.md` files in `.workflows/planning/{topic}/tasks/` — every file in this directory is a task file, no filtering needed
8
8
  2. Read each file's frontmatter to extract: `id`, `phase`, `status`, `priority`, `depends_on`
9
9
  3. Read the first heading for the task title
10
10
 
@@ -12,7 +12,7 @@ This provides the summary-level data needed for graphing, progress overview, or
12
12
 
13
13
  ## Extracting a Task
14
14
 
15
- To read a specific task, read the file at `docs/workflow/planning/{topic}/tasks/{task-id}.md`.
15
+ To read a specific task, read the file at `.workflows/planning/{topic}/tasks/{task-id}.md`.
16
16
 
17
17
  The task file is self-contained — frontmatter holds id, phase, and status. The body contains the title and full description.
18
18
 
@@ -20,7 +20,7 @@ The task file is self-contained — frontmatter holds id, phase, and status. The
20
20
 
21
21
  To find the next task to implement:
22
22
 
23
- 1. List all `.md` files in `docs/workflow/planning/{topic}/tasks/`
23
+ 1. List all `.md` files in `.workflows/planning/{topic}/tasks/`
24
24
  2. Filter to tasks where `status` is `pending` or `in-progress` (or missing — treat as `pending`)
25
25
  3. If any tasks have `depends_on`, check each referenced task's `status` — exclude the task unless all dependencies have `status: completed`
26
26
  4. Order by phase number (from task ID: `{topic}-{phase}-{seq}`) — complete all earlier phases first
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Status Transitions
4
4
 
5
- Update the `status` field in the task file frontmatter at `docs/workflow/planning/{topic}/tasks/{task-id}.md`:
5
+ Update the `status` field in the task file frontmatter at `.workflows/planning/{topic}/tasks/{task-id}.md`:
6
6
 
7
7
  | Transition | Value |
8
8
  |------------|-------|
@@ -0,0 +1,75 @@
1
+ # Bugfix Phase Design
2
+
3
+ *Context guidance for **[phase-design.md](../phase-design.md)** — bug fixes*
4
+
5
+ ---
6
+
7
+ ## Phase 1 Strategy
8
+
9
+ Reproduce the bug and implement the fix. Start with a failing test that demonstrates the bug, then fix it.
10
+
11
+ Phase 1 should:
12
+
13
+ - Include a test that reliably reproduces the bug (the test fails before the fix, passes after)
14
+ - Fix the root cause, not symptoms
15
+ - Verify that existing tests still pass (no regressions)
16
+ - Be as minimal as possible — change only what's necessary
17
+
18
+ ---
19
+
20
+ ## Single vs Multi-Phase Bugs
21
+
22
+ Most bugs are **single-phase**: reproduce → fix → regression tests. One phase is sufficient when the bug has a single root cause and the fix is contained.
23
+
24
+ Multiple phases are warranted when:
25
+
26
+ - **Multiple root causes** — the bug manifests in one place but originates in different subsystems that need independent fixes
27
+ - **Incremental refactoring required** — the fix requires restructuring code that can't be safely changed in one step
28
+ - **Large impact area** — the fix touches enough code that dedicated regression verification in a separate phase reduces risk
29
+
30
+ **Example** (Single-phase — N+1 query):
31
+
32
+ ```
33
+ Phase 1: Add eager loading to order query, verify performance, regression tests
34
+ ```
35
+
36
+ **Example** (Multi-phase — Race condition in payment processing):
37
+
38
+ ```
39
+ Phase 1: Add locking mechanism, fix the core race condition, verify with concurrent test
40
+ Phase 2: Add idempotency keys, handle edge cases (duplicate submissions, timeout recovery)
41
+ ```
42
+
43
+ ---
44
+
45
+ ## Minimal Change Principle
46
+
47
+ Fix the root cause, don't redesign. The goal is surgical correction:
48
+
49
+ - Change the minimum code needed to resolve the issue
50
+ - Don't expand scope beyond what the specification defines
51
+ - Resist the temptation to "improve" surrounding code
52
+ - The fix should be easy to review — a reviewer should immediately see what changed and why
53
+
54
+ ---
55
+
56
+ ## Regression Prevention
57
+
58
+ Regression tests are first-class deliverables, not afterthoughts:
59
+
60
+ - Every fix includes tests that would have caught the original bug
61
+ - Tests verify the fix doesn't break existing behaviour
62
+ - Edge cases related to the bug get their own test cases
63
+ - If the bug was in a poorly-tested area, the fix improves coverage for that specific area (not a general testing campaign)
64
+
65
+ ---
66
+
67
+ ## Codebase Awareness
68
+
69
+ Before designing bugfix phases, understand the affected area:
70
+
71
+ - **Trace the bug's scope** — what code is involved? What calls into it, what does it call? Understanding the boundaries helps design a fix that doesn't cause side effects.
72
+ - **Check existing tests** — what coverage exists? This informs whether the fix needs new test infrastructure or can extend existing tests.
73
+ - **Understand before fixing** — a minimal fix requires knowing exactly what's broken and why. Don't design phases until the root cause is understood.
74
+
75
+ This is targeted analysis, not a general codebase review — focus on the code paths involved in the bug.
@@ -0,0 +1,77 @@
1
+ # Feature Phase Design
2
+
3
+ *Context guidance for **[phase-design.md](../phase-design.md)** — feature additions to existing systems*
4
+
5
+ ---
6
+
7
+ ## Phase 1 Strategy
8
+
9
+ Deliver the most fundamental new capability first. The existing codebase IS the foundation — no need to re-prove architecture. Integration with established patterns is the priority.
10
+
11
+ Phase 1 should:
12
+
13
+ - Add the core new behaviour that all subsequent phases build on
14
+ - Integrate naturally with existing code and conventions
15
+ - Verify both the new functionality AND that existing behaviour isn't broken
16
+ - Follow the project's established architectural patterns
17
+
18
+ ---
19
+
20
+ ## Feature Vertical Phases
21
+
22
+ Each phase adds a complete slice of the new feature, building on the existing system.
23
+
24
+ **Example** (Adding OAuth to existing Express API):
25
+
26
+ ```
27
+ Phase 1: Basic OAuth flow — provider registration, callback, token exchange, session creation
28
+ Phase 2: Permission scoping — granular permissions, role mapping, scope enforcement
29
+ Phase 3: Token lifecycle — refresh tokens, expiry handling, revocation
30
+ Phase 4: Edge cases — concurrent sessions, provider downtime, account linking
31
+ ```
32
+
33
+ **Example** (Adding search to existing e-commerce app):
34
+
35
+ ```
36
+ Phase 1: Basic keyword search — index products, query endpoint, display results
37
+ Phase 2: Filtering and facets — category filters, price ranges, attribute facets
38
+ Phase 3: Relevance tuning — boosting, synonyms, typo tolerance
39
+ ```
40
+
41
+ Each phase delivers functionality that users or tests can validate against the existing system.
42
+
43
+ ### Progression
44
+
45
+ **Core new functionality → Extended capability → Edge cases → Refinement**
46
+
47
+ - **Core new functionality** (Phase 1): The fundamental new behaviour, integrated with existing code
48
+ - **Extended capability**: Richer variations, additional options, deeper integration
49
+ - **Edge cases**: Boundary conditions, failure modes, interaction with existing features
50
+ - **Refinement**: Performance, UX polish, hardening
51
+
52
+ ---
53
+
54
+ ## Integration Considerations
55
+
56
+ - **Follow existing patterns** — if the codebase uses service classes, add service classes. If it uses middleware, add middleware. Don't introduce new architectural patterns unless the specification calls for it.
57
+ - **Tests verify both directions** — new functionality works AND existing behaviour isn't broken
58
+ - **Existing infrastructure is available** — don't rebuild what exists. Use established models, services, and utilities.
59
+
60
+ ---
61
+
62
+ ## Codebase Awareness
63
+
64
+ Before designing phases, understand what exists. You cannot plan feature work without knowing how the feature integrates with the codebase:
65
+
66
+ - **Analyze the relevant areas** — read the code the feature touches. Understand existing patterns, conventions, and structure in those areas.
67
+ - **Identify integration points** — where does this feature connect to existing code? What modules, services, or APIs will it use or extend?
68
+ - **Follow established patterns** — if similar features exist, note how they're structured. New phases should follow the same approach unless the specification explicitly calls for something different.
69
+ - **Understand before designing** — phase boundaries should respect existing architectural seams. Don't design phases that cut across established module boundaries without good reason.
70
+
71
+ This is not a full codebase audit — focus on the specific areas relevant to the feature.
72
+
73
+ ---
74
+
75
+ ## Scope Discipline
76
+
77
+ Implement what the specification defines. Don't refactor surrounding code, even if it could be "improved". If the existing code works and the specification doesn't call for changing it, leave it alone.
@@ -0,0 +1,75 @@
1
+ # Greenfield Phase Design
2
+
3
+ *Context guidance for **[phase-design.md](../phase-design.md)** — new system builds*
4
+
5
+ ---
6
+
7
+ ## The Walking Skeleton
8
+
9
+ Phase 1 is always a **walking skeleton** — the thinnest possible end-to-end slice that threads through all system layers and proves the architecture works.
10
+
11
+ The walking skeleton:
12
+
13
+ - Touches every architectural component the system needs (database, API, UI, external services)
14
+ - Delivers one complete flow, however minimal
15
+ - Establishes the patterns subsequent phases will follow
16
+ - Is production code, not throwaway — it becomes the foundation
17
+
18
+ **Example** (Slack clone):
19
+
20
+ > Phase 1: "Any unauthenticated person can post messages in a hardcoded #general room. Messages persist through page refreshes."
21
+ >
22
+ > No auth, no accounts, no multiple rooms. Just the thinnest thread through the entire stack.
23
+
24
+ **Example** (Calendar app):
25
+
26
+ > Phase 1: "A single event can be created with title, start, and end time, persisted, and retrieved by ID."
27
+ >
28
+ > No recurrence, no sharing, no notifications. Just one thing working end-to-end.
29
+
30
+ The skeleton validates architecture assumptions at the cheapest possible moment. If the end-to-end flow doesn't work, you discover it in Phase 1 — not after building three phases of isolated components.
31
+
32
+ This is the **steel thread** principle: never have big-bang integration. By threading through all layers immediately, integration is the first thing you solve, not the last.
33
+
34
+ ---
35
+
36
+ ## Greenfield Vertical Phases
37
+
38
+ After the walking skeleton, each subsequent phase adds complete functionality — a vertical slice through the relevant layers.
39
+
40
+ ```
41
+ Phase 1: Walking skeleton — single event CRUD, end-to-end
42
+ Phase 2: Recurring events — rules, instance generation, single-instance editing
43
+ Phase 3: Sharing and permissions — invite users, permission levels, shared calendars
44
+ Phase 4: Notifications — email and push notifications for event changes
45
+ ```
46
+
47
+ Each phase delivers something a user or test suite can validate independently.
48
+
49
+ ### Progression
50
+
51
+ **Skeleton → Core features → Edge cases → Refinement**
52
+
53
+ - **Skeleton** (Phase 1): Thinnest end-to-end slice proving the architecture
54
+ - **Core features**: Each phase adds a complete capability, building on what exists
55
+ - **Edge cases**: Handling boundary conditions, error scenarios, unusual inputs
56
+ - **Refinement**: Performance optimisation, UX polish, hardening
57
+
58
+ This ordering means each phase builds on a working system. The skeleton establishes the pattern; core features flesh it out; edge cases harden it; refinement polishes it.
59
+
60
+ ---
61
+
62
+ ## Cross-Phase Coupling (Greenfield)
63
+
64
+ - **Walking skeleton first** — subsequent phases add to a working system rather than depending on future phases
65
+ - **Shared infrastructure in Phase 1** — if multiple phases need the same foundation, it belongs in the skeleton
66
+
67
+ ---
68
+
69
+ ## Phase 2+ Considerations
70
+
71
+ After Phase 1 is implemented, code exists. When designing subsequent phases:
72
+
73
+ - **Review what Phase 1 established** — understand the patterns, conventions, and architectural decisions that were made. Subsequent phases should build on these consistently.
74
+ - **Extend, don't reinvent** — Phase 2+ should use the infrastructure Phase 1 created. If something is missing, add it — don't create parallel structures.
75
+ - **Watch for drift** — if early decisions could be improved, note them but maintain consistency unless the specification calls for restructuring.
@@ -4,7 +4,9 @@
4
4
 
5
5
  ---
6
6
 
7
- This reference defines the principles for breaking specifications into implementation phases. It is loaded when phases are first proposed and stays in context through phase approval.
7
+ This reference defines generic principles for breaking specifications into implementation phases.
8
+
9
+ A work-type context file (greenfield, feature, or bugfix) is always loaded alongside this file. The context file provides the Phase 1 strategy, progression model, examples, and work-type-specific guidance. These generic principles apply across all work types.
8
10
 
9
11
  ## What Makes a Good Phase
10
12
 
@@ -18,49 +20,9 @@ Each phase should:
18
20
 
19
21
  ---
20
22
 
21
- ## The Walking Skeleton
22
-
23
- Phase 1 is always a **walking skeleton** — the thinnest possible end-to-end slice that threads through all system layers and proves the architecture works.
24
-
25
- The walking skeleton:
26
-
27
- - Touches every architectural component the system needs (database, API, UI, external services)
28
- - Delivers one complete flow, however minimal
29
- - Establishes the patterns subsequent phases will follow
30
- - Is production code, not throwaway — it becomes the foundation
31
-
32
- **Example** (Slack clone):
33
-
34
- > Phase 1: "Any unauthenticated person can post messages in a hardcoded #general room. Messages persist through page refreshes."
35
- >
36
- > No auth, no accounts, no multiple rooms. Just the thinnest thread through the entire stack.
37
-
38
- **Example** (Calendar app):
39
-
40
- > Phase 1: "A single event can be created with title, start, and end time, persisted, and retrieved by ID."
41
- >
42
- > No recurrence, no sharing, no notifications. Just one thing working end-to-end.
43
-
44
- The skeleton validates architecture assumptions at the cheapest possible moment. If the end-to-end flow doesn't work, you discover it in Phase 1 — not after building three phases of isolated components.
45
-
46
- This is the **steel thread** principle: never have big-bang integration. By threading through all layers immediately, integration is the first thing you solve, not the last.
47
-
48
- ---
49
-
50
23
  ## Vertical Phases
51
24
 
52
- After the walking skeleton, each subsequent phase adds complete functionality — a vertical slice through the relevant layers.
53
-
54
- **Vertical (prefer):**
55
-
56
- ```
57
- Phase 1: Walking skeleton — single event CRUD, end-to-end
58
- Phase 2: Recurring events — rules, instance generation, single-instance editing
59
- Phase 3: Sharing and permissions — invite users, permission levels, shared calendars
60
- Phase 4: Notifications — email and push notifications for event changes
61
- ```
62
-
63
- Each phase delivers something a user or test suite can validate independently.
25
+ Each phase adds complete functionality — a vertical slice through the relevant layers.
64
26
 
65
27
  **Horizontal (avoid):**
66
28
 
@@ -76,17 +38,6 @@ Nothing works until Phase 5. No phase is independently testable. Integration ris
76
38
 
77
39
  A phase may touch multiple architectural layers — that's expected. The test is: **does this phase deliver working functionality, or does it deliver infrastructure that only becomes useful later?**
78
40
 
79
- ### Progression
80
-
81
- **Skeleton → Core features → Edge cases → Refinement**
82
-
83
- - **Skeleton** (Phase 1): Thinnest end-to-end slice proving the architecture
84
- - **Core features**: Each phase adds a complete capability, building on what exists
85
- - **Edge cases**: Handling boundary conditions, error scenarios, unusual inputs
86
- - **Refinement**: Performance optimisation, UX polish, hardening
87
-
88
- This ordering means each phase builds on a working system. The skeleton establishes the pattern; core features flesh it out; edge cases harden it; refinement polishes it.
89
-
90
41
  ---
91
42
 
92
43
  ## Phase Boundaries
@@ -122,20 +73,19 @@ If a phase has only 1-2 trivial tasks, it's probably too thin — merge it. If a
122
73
 
123
74
  **Maximize cohesion within a phase, minimize dependencies between phases.**
124
75
 
125
- A well-bounded phase could theoretically be reordered or dropped without cascading failures across other phases. In practice, phases have a natural sequence (the skeleton must come first), but each phase should be as self-contained as possible.
76
+ A well-bounded phase could theoretically be reordered or dropped without cascading failures across other phases. In practice, phases have a natural sequence, but each phase should be as self-contained as possible.
126
77
 
127
78
  Strategies:
128
79
 
129
- - **Walking skeleton first** — subsequent phases add to a working system rather than depending on future phases
80
+ - **Strongest foundation first** — subsequent phases add to a working system rather than depending on future phases
130
81
  - **Clear interfaces between phases** — each phase produces defined contracts (API shapes, data models, test suites) that subsequent phases consume
131
- - **Shared infrastructure in Phase 1** — if multiple phases need the same foundation, it belongs in the skeleton
132
82
  - **No forward references** — a phase should never depend on something that hasn't been built yet
133
83
 
134
84
  ---
135
85
 
136
86
  ## Anti-Patterns
137
87
 
138
- **Horizontal phases** — organising by technical layer ("all models, then all services, then all controllers"). Defers integration risk, produces phases that aren't independently valuable. The walking skeleton eliminates this by integrating from the start.
88
+ **Horizontal phases** — organising by technical layer ("all models, then all services, then all controllers"). Defers integration risk, produces phases that aren't independently valuable. Vertical slicing eliminates this by integrating from the start.
139
89
 
140
90
  **God phase** — one massive phase covering too many concerns. Results in unclear success criteria, inability to track progress, and cognitive overload. If you can't summarise a phase's goal in one sentence, it needs splitting.
141
91
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  ---
6
6
 
7
- This file defines the canonical structure for Plan Index Files (`docs/workflow/planning/{topic}/plan.md`). All agents and references that create or update plan index content **must** follow these templates.
7
+ This file defines the canonical structure for Plan Index Files (`.workflows/planning/{topic}/plan.md`). All agents and references that create or update plan index content **must** follow these templates.
8
8
 
9
9
  ---
10
10
 
@@ -15,6 +15,7 @@ This file defines the canonical structure for Plan Index Files (`docs/workflow/p
15
15
  topic: {topic-name}
16
16
  status: {status}
17
17
  format: {chosen-format}
18
+ work_type:
18
19
  ext_id:
19
20
  specification: ../specification/{topic}/specification.md
20
21
  cross_cutting_specs:
@@ -37,6 +38,7 @@ planning:
37
38
  | `topic` | Plan creation (Step 1) |
38
39
  | `status` | Plan creation → `planning`; conclusion → `concluded` |
39
40
  | `format` | Plan creation — user-chosen output format |
41
+ | `work_type` | Plan creation — set by caller if known. Values: `greenfield`, `feature`, `bugfix`. Defaults to `greenfield` when empty. |
40
42
  | `ext_id` | First task authored — external identifier for the plan |
41
43
  | `specification` | Plan creation — relative path to source specification |
42
44
  | `cross_cutting_specs` | Plan creation — relative paths to cross-cutting specs (omit key if none) |
@@ -75,7 +75,7 @@ Read the plan end-to-end — carefully, as if you were about to implement it. Fo
75
75
 
76
76
  ## Tracking File
77
77
 
78
- After completing the analysis, create a tracking file at `docs/workflow/planning/{topic}/review-integrity-tracking-c{N}.md` (where N is the current review cycle).
78
+ After completing the analysis, create a tracking file at `.workflows/planning/{topic}/review-integrity-tracking-c{N}.md` (where N is the current review cycle).
79
79
 
80
80
  Categorize each finding by severity:
81
81
 
@@ -59,7 +59,7 @@ Is everything in the plan actually from the specification? This is the anti-hall
59
59
 
60
60
  ## Tracking File
61
61
 
62
- After completing the analysis, create a tracking file at `docs/workflow/planning/{topic}/review-traceability-tracking-c{N}.md` (where N is the current review cycle).
62
+ After completing the analysis, create a tracking file at `.workflows/planning/{topic}/review-traceability-tracking-c{N}.md` (where N is the current review cycle).
63
63
 
64
64
  Tracking files are **never deleted**. After all findings are processed, the orchestrator marks `status: complete`. Previous cycles' files persist as review history.
65
65