@leeovery/claude-technical-workflows 2.1.33 → 2.1.35

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 (52) hide show
  1. package/README.md +14 -5
  2. package/agents/implementation-analysis-task-writer.md +3 -2
  3. package/agents/planning-task-author.md +46 -16
  4. package/agents/review-findings-synthesizer.md +108 -0
  5. package/agents/review-task-verifier.md +4 -3
  6. package/package.json +1 -1
  7. package/skills/begin-implementation/SKILL.md +5 -1
  8. package/skills/begin-planning/SKILL.md +5 -1
  9. package/skills/migrate/SKILL.md +2 -1
  10. package/skills/migrate/scripts/migrate.sh +31 -28
  11. package/skills/migrate/scripts/migrations/001-discussion-frontmatter.sh +1 -15
  12. package/skills/migrate/scripts/migrations/002-specification-frontmatter.sh +0 -14
  13. package/skills/migrate/scripts/migrations/003-planning-frontmatter.sh +0 -14
  14. package/skills/migrate/scripts/migrations/004-sources-object-format.sh +0 -12
  15. package/skills/migrate/scripts/migrations/005-plan-external-deps-frontmatter.sh +0 -12
  16. package/skills/migrate/scripts/migrations/006-directory-restructure.sh +2 -22
  17. package/skills/migrate/scripts/migrations/007-tasks-subdirectory.sh +1 -17
  18. package/skills/migrate/scripts/migrations/008-review-directory-structure.sh +96 -0
  19. package/skills/migrate/scripts/migrations/009-review-per-plan-storage.sh +117 -0
  20. package/skills/migrate/scripts/migrations/010-gitignore-sessions.sh +67 -0
  21. package/skills/start-discussion/SKILL.md +1 -1
  22. package/skills/start-discussion/references/handle-selection.md +1 -1
  23. package/skills/start-discussion/references/research-analysis.md +3 -3
  24. package/skills/start-discussion/scripts/discovery.sh +1 -1
  25. package/skills/start-review/SKILL.md +48 -16
  26. package/skills/start-review/references/display-plans.md +11 -3
  27. package/skills/start-review/references/invoke-skill.md +41 -13
  28. package/skills/start-review/references/select-plans.md +31 -2
  29. package/skills/start-review/scripts/discovery.sh +89 -0
  30. package/skills/start-specification/SKILL.md +1 -1
  31. package/skills/start-specification/references/analysis-flow.md +2 -2
  32. package/skills/start-specification/references/display-analyze.md +1 -1
  33. package/skills/start-specification/references/display-groupings.md +3 -3
  34. package/skills/start-specification/references/display-specs-menu.md +1 -1
  35. package/skills/start-specification/scripts/discovery.sh +1 -1
  36. package/skills/technical-implementation/references/invoke-task-writer.md +1 -0
  37. package/skills/technical-planning/SKILL.md +4 -3
  38. package/skills/technical-planning/references/author-tasks.md +119 -35
  39. package/skills/technical-planning/references/output-formats/tick/about.md +3 -2
  40. package/skills/technical-planning/references/output-formats/tick/graph.md +2 -0
  41. package/skills/technical-planning/references/output-formats/tick/reading.md +2 -0
  42. package/skills/technical-planning/references/plan-construction.md +11 -15
  43. package/skills/technical-planning/references/review-integrity.md +1 -1
  44. package/skills/technical-review/SKILL.md +10 -34
  45. package/skills/technical-review/references/invoke-review-synthesizer.md +64 -0
  46. package/skills/technical-review/references/invoke-review-task-writer.md +44 -0
  47. package/skills/technical-review/references/invoke-task-verifiers.md +7 -6
  48. package/skills/technical-review/references/produce-review.md +25 -0
  49. package/skills/technical-review/references/review-actions-loop.md +295 -0
  50. package/skills/technical-review/references/template.md +1 -21
  51. package/agents/review-product-assessor.md +0 -112
  52. package/skills/technical-review/references/invoke-product-assessor.md +0 -57
@@ -4,11 +4,40 @@
4
4
 
5
5
  ---
6
6
 
7
- This step only applies for `single` or `multi` scope chosen in Step 3.
7
+ This step only applies for `single`, `multi`, or `all` scope chosen in Step 3.
8
+
9
+ #### If scope is "analysis"
10
+
11
+ Select which reviews to analyze.
12
+
13
+ #### If multiple reviews exist
14
+
15
+ > *Output the next fenced block as markdown (not a code block):*
16
+
17
+ ```
18
+ · · · · · · · · · · · ·
19
+ Which reviews to analyze?
20
+
21
+ - **`a`/`all`** — All reviewed plans
22
+ - **`s`/`select`** — Choose specific reviews
23
+
24
+ Select an option:
25
+ · · · · · · · · · · · ·
26
+ ```
27
+
28
+ **STOP.** Wait for user response.
29
+
30
+ If `select`, present numbered list of reviewed plans for the user to choose from (comma-separated numbers).
31
+
32
+ #### If single review exists
33
+
34
+ Automatically proceed with the only available review.
35
+
36
+ → Proceed to **Step 5**.
8
37
 
9
38
  #### If scope is "all"
10
39
 
11
- All reviewable plans are included. No selection needed.
40
+ All reviewable plans are included. No selection needed. Each plan will be reviewed independently.
12
41
 
13
42
  → Proceed directly to **Step 5**.
14
43
 
@@ -9,6 +9,8 @@ set -eo pipefail
9
9
 
10
10
  PLAN_DIR="docs/workflow/planning"
11
11
  SPEC_DIR="docs/workflow/specification"
12
+ REVIEW_DIR="docs/workflow/review"
13
+ IMPL_DIR="docs/workflow/implementation"
12
14
 
13
15
  # Helper: Extract a frontmatter field value from a file
14
16
  # Usage: extract_field <file> <field_name>
@@ -113,6 +115,85 @@ fi
113
115
 
114
116
  echo ""
115
117
 
118
+ #
119
+ # REVIEWS
120
+ #
121
+ echo "reviews:"
122
+
123
+ reviewed_plan_count=0
124
+ # Track which plan names have been reviewed (space-separated)
125
+ reviewed_plans=""
126
+
127
+ if [ -d "$REVIEW_DIR" ]; then
128
+ # Check for any review directories with r*/review.md
129
+ has_reviews="false"
130
+ for topic_dir in "$REVIEW_DIR"/*/; do
131
+ [ -d "$topic_dir" ] || continue
132
+ if ls -d "$topic_dir"r*/review.md >/dev/null 2>&1; then
133
+ has_reviews="true"
134
+ break
135
+ fi
136
+ done
137
+
138
+ echo " exists: $has_reviews"
139
+
140
+ if [ "$has_reviews" = "true" ]; then
141
+ echo " entries:"
142
+
143
+ for topic_dir in "$REVIEW_DIR"/*/; do
144
+ [ -d "$topic_dir" ] || continue
145
+ topic=$(basename "$topic_dir")
146
+ # Count r*/ versions
147
+ versions=0
148
+ latest_version=0
149
+ latest_path=""
150
+ for rdir in "$topic_dir"r*/; do
151
+ [ -d "$rdir" ] || continue
152
+ [ -f "${rdir}review.md" ] || continue
153
+ rnum=${rdir##*r}
154
+ rnum=${rnum%/}
155
+ versions=$((versions + 1))
156
+ if [ "$rnum" -gt "$latest_version" ] 2>/dev/null; then
157
+ latest_version=$rnum
158
+ latest_path="$rdir"
159
+ fi
160
+ done
161
+
162
+ [ "$versions" -eq 0 ] && continue
163
+
164
+ # Extract verdict from latest review.md
165
+ latest_verdict=""
166
+ if [ -f "${latest_path}review.md" ]; then
167
+ latest_verdict=$(grep -m1 '\*\*QA Verdict\*\*:' "${latest_path}review.md" 2>/dev/null | \
168
+ sed -E 's/.*\*\*QA Verdict\*\*:[[:space:]]*//' || true)
169
+ fi
170
+
171
+ # Check for synthesis: look for review-tasks-c*.md in implementation dir
172
+ has_synthesis="false"
173
+ if ls "$IMPL_DIR/$topic"/review-tasks-c*.md >/dev/null 2>&1; then
174
+ has_synthesis="true"
175
+ fi
176
+
177
+ # Track reviewed plans
178
+ if ! echo " $reviewed_plans " | grep -q " $topic "; then
179
+ reviewed_plans="$reviewed_plans $topic"
180
+ reviewed_plan_count=$((reviewed_plan_count + 1))
181
+ fi
182
+
183
+ echo " - topic: \"$topic\""
184
+ echo " versions: $versions"
185
+ echo " latest_version: $latest_version"
186
+ echo " latest_verdict: \"$latest_verdict\""
187
+ echo " latest_path: \"$latest_path\""
188
+ echo " has_synthesis: $has_synthesis"
189
+ done
190
+ fi
191
+ else
192
+ echo " exists: false"
193
+ fi
194
+
195
+ echo ""
196
+
116
197
  #
117
198
  # WORKFLOW STATE SUMMARY
118
199
  #
@@ -122,6 +203,14 @@ echo " has_plans: $([ "$plan_count" -gt 0 ] && echo "true" || echo "false")"
122
203
  echo " plan_count: $plan_count"
123
204
  echo " implemented_count: $implemented_count"
124
205
  echo " completed_count: $completed_count"
206
+ echo " reviewed_plan_count: $reviewed_plan_count"
207
+
208
+ # Determine if all implemented plans have been reviewed
209
+ all_reviewed="false"
210
+ if [ "$implemented_count" -gt 0 ] && [ "$reviewed_plan_count" -ge "$implemented_count" ]; then
211
+ all_reviewed="true"
212
+ fi
213
+ echo " all_reviewed: $all_reviewed"
125
214
 
126
215
  # Determine workflow state for routing
127
216
  if [ "$plan_count" -eq 0 ]; then
@@ -2,7 +2,7 @@
2
2
  name: start-specification
3
3
  description: "Start a specification session from concluded discussions. Discovers available discussions, offers consolidation assessment for multiple discussions, and invokes the technical-specification skill."
4
4
  disable-model-invocation: true
5
- allowed-tools: Bash(.claude/skills/start-specification/scripts/discovery.sh), Bash(mkdir -p docs/workflow/.cache), Bash(rm docs/workflow/.cache/discussion-consolidation-analysis.md), Bash(.claude/hooks/workflows/write-session-state.sh)
5
+ allowed-tools: Bash(.claude/skills/start-specification/scripts/discovery.sh), Bash(mkdir -p docs/workflow/.state), Bash(rm docs/workflow/.state/discussion-consolidation-analysis.md), Bash(.claude/hooks/workflows/write-session-state.sh)
6
6
  hooks:
7
7
  PreToolUse:
8
8
  - hooks:
@@ -65,10 +65,10 @@ When forming groupings:
65
65
 
66
66
  Create the cache directory if needed:
67
67
  ```bash
68
- mkdir -p docs/workflow/.cache
68
+ mkdir -p docs/workflow/.state
69
69
  ```
70
70
 
71
- Write to `docs/workflow/.cache/discussion-consolidation-analysis.md`:
71
+ Write to `docs/workflow/.state/discussion-consolidation-analysis.md`:
72
72
 
73
73
  ```markdown
74
74
  ---
@@ -87,7 +87,7 @@ Proceed with analysis?
87
87
 
88
88
  If cache is stale, delete it first:
89
89
  ```bash
90
- rm docs/workflow/.cache/discussion-consolidation-analysis.md
90
+ rm docs/workflow/.state/discussion-consolidation-analysis.md
91
91
  ```
92
92
 
93
93
  → Load **[analysis-flow.md](analysis-flow.md)** and follow its instructions.
@@ -8,7 +8,7 @@ Shows when cache is valid (directly from routing) or after analysis completes. T
8
8
 
9
9
  ## A. Load Groupings
10
10
 
11
- Load groupings from `docs/workflow/.cache/discussion-consolidation-analysis.md`. Parse the `### {Name}` headings and their discussion lists.
11
+ Load groupings from `docs/workflow/.state/discussion-consolidation-analysis.md`. Parse the `### {Name}` headings and their discussion lists.
12
12
 
13
13
  → Proceed to **B. Determine Discussion Status**.
14
14
 
@@ -160,7 +160,7 @@ Every meta option (Unify, Re-analyze) MUST include its description lines.
160
160
 
161
161
  #### If user picks "Unify all"
162
162
 
163
- Update the cache: rewrite `docs/workflow/.cache/discussion-consolidation-analysis.md` with a single "Unified" grouping containing all concluded discussions. Keep the same checksum, update the generated timestamp. Add note: `Custom groupings confirmed by user (unified).`
163
+ Update the cache: rewrite `docs/workflow/.state/discussion-consolidation-analysis.md` with a single "Unified" grouping containing all concluded discussions. Keep the same checksum, update the generated timestamp. Add note: `Custom groupings confirmed by user (unified).`
164
164
 
165
165
  Spec name: "Unified". Sources: all concluded discussions.
166
166
 
@@ -170,7 +170,7 @@ Spec name: "Unified". Sources: all concluded discussions.
170
170
 
171
171
  Delete the cache:
172
172
  ```bash
173
- rm docs/workflow/.cache/discussion-consolidation-analysis.md
173
+ rm docs/workflow/.state/discussion-consolidation-analysis.md
174
174
  ```
175
175
 
176
176
  → Load **[analysis-flow.md](analysis-flow.md)** and follow its instructions.
@@ -139,7 +139,7 @@ Menu descriptions are wrapped in backticks to visually distinguish them from the
139
139
 
140
140
  If cache is stale, delete it first:
141
141
  ```bash
142
- rm docs/workflow/.cache/discussion-consolidation-analysis.md
142
+ rm docs/workflow/.state/discussion-consolidation-analysis.md
143
143
  ```
144
144
 
145
145
  → Load **[analysis-flow.md](analysis-flow.md)** and follow its instructions.
@@ -10,7 +10,7 @@ set -eo pipefail
10
10
 
11
11
  DISCUSSION_DIR="docs/workflow/discussion"
12
12
  SPEC_DIR="docs/workflow/specification"
13
- CACHE_FILE="docs/workflow/.cache/discussion-consolidation-analysis.md"
13
+ CACHE_FILE="docs/workflow/.state/discussion-consolidation-analysis.md"
14
14
 
15
15
  # Helper: Extract a frontmatter field value from a file
16
16
  # Usage: extract_field <file> <field_name>
@@ -20,6 +20,7 @@ Pass via the orchestrator's prompt:
20
20
  4. **Plan format reading adapter path** — `../../technical-planning/references/output-formats/{format}/reading.md`
21
21
  5. **Plan format authoring adapter path** — `../../technical-planning/references/output-formats/{format}/authoring.md`
22
22
  6. **plan-index-schema.md** — `../../technical-planning/references/plan-index-schema.md`
23
+ 7. **Phase label** — `Analysis (Cycle {N})`
23
24
 
24
25
  ---
25
26
 
@@ -59,7 +59,7 @@ this, or is there a more complete version?
59
59
  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
60
 
61
61
  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.
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
63
  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
64
  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
65
  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.
@@ -126,8 +126,9 @@ Reset `task_list_gate_mode`, `author_gate_mode`, and `finding_gate_mode` to `gat
126
126
 
127
127
  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
128
  2. Follow the authoring file's cleanup instructions to remove Authored Tasks for this topic
129
- 3. Delete the Plan Index File
130
- 4. Commit: `planning({topic}): restart planning`
129
+ 3. Delete the scratch directory if it exists: `rm -rf docs/workflow/.cache/planning/{topic}/`
130
+ 4. Delete the Plan Index File
131
+ 5. Commit: `planning({topic}): restart planning`
131
132
 
132
133
  → Proceed to **Step 1**.
133
134
 
@@ -4,13 +4,25 @@
4
4
 
5
5
  ---
6
6
 
7
- This step uses the `planning-task-author` agent (`../../../agents/planning-task-author.md`) to write full detail for a single task. You invoke the agent, present its output, and handle the approval gate.
7
+ This step uses the `planning-task-author` agent (`../../../agents/planning-task-author.md`) to write full detail for all tasks in a phase. One sub-agent authors all tasks, writing to a scratch file. The orchestrator then handles per-task approval and format-specific writing to the plan.
8
8
 
9
9
  ---
10
10
 
11
- ## Author the Task
11
+ ## Section 1: Prepare the Scratch File
12
12
 
13
- ### Invoke the Agent
13
+ Scratch file path: `docs/workflow/.cache/planning/{topic}/phase-{N}.md`
14
+
15
+ Create the `docs/workflow/.cache/planning/{topic}/` directory if it does not exist.
16
+
17
+ ---
18
+
19
+ ## Section 2: Invoke the Agent (Batch)
20
+
21
+ > *Output the next fenced block as a code block:*
22
+
23
+ ```
24
+ Authoring {count} tasks for Phase {N}: {Phase Name}...
25
+ ```
14
26
 
15
27
  Invoke `planning-task-author` with these file paths:
16
28
 
@@ -19,36 +31,65 @@ Invoke `planning-task-author` with these file paths:
19
31
  3. **Cross-cutting specs**: paths from the Plan Index File's `cross_cutting_specs:` field (if any)
20
32
  4. **task-design.md**: `task-design.md`
21
33
  5. **All approved phases**: the complete phase structure from the Plan Index File body
22
- 6. **Task list for current phase**: the approved task table
23
- 7. **Target task**: the task name, edge cases, and ID from the table
24
- 8. **Output format authoring reference**: path to the format's `authoring.md` (e.g., `output-formats/{format}/authoring.md`)
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`
25
36
 
26
- ### Check Gate Mode
37
+ The agent writes all tasks to the scratch file and returns.
27
38
 
28
- The agent returns complete task detail following the task template from task-design.md. What the user sees is what gets logged.
39
+ ---
29
40
 
30
- > *Output the next fenced block as markdown (not a code block):*
41
+ ## Section 3: Validate Scratch File
31
42
 
32
- ```
33
- {task detail from planning-task-author agent}
34
- ```
43
+ Read the scratch file and count tasks. Verify task count matches the task table in the Plan Index File for this phase.
44
+
45
+ #### If mismatch
46
+
47
+ Re-invoke the agent with the same inputs.
48
+
49
+ #### If valid
50
+
51
+ → Proceed to **Section 4**.
52
+
53
+ ---
54
+
55
+ ## Section 4: Check Gate Mode
35
56
 
36
57
  Check `author_gate_mode` in the Plan Index File frontmatter.
37
58
 
38
59
  #### If `author_gate_mode: auto`
39
60
 
40
- **Auto mode removes the approval pause — not the sequential process.** Each task is still invoked, authored, and logged one at a time, in order. Do not batch, skip ahead, or create multiple tasks concurrently.
41
-
42
61
  > *Output the next fenced block as a code block:*
43
62
 
44
63
  ```
45
- Task {M} of {total}: {Task Name} authored. Logging to plan.
64
+ Phase {N}: {count} tasks authored. Auto-approved. Writing to plan.
46
65
  ```
47
66
 
48
- Skip to **If approved** below.
67
+ Jump to **Section 6**.
49
68
 
50
69
  #### If `author_gate_mode: gated`
51
70
 
71
+ → Enter **Section 5**.
72
+
73
+ ---
74
+
75
+ ## Section 5: Approval Loop
76
+
77
+ For each task in the scratch file, in order:
78
+
79
+ #### If task status is `approved`
80
+
81
+ Skip — already approved from a previous pass.
82
+
83
+ #### If task status is `pending`
84
+
85
+ Present the full task content:
86
+
87
+ > *Output the next fenced block as markdown (not a code block):*
88
+
89
+ ```
90
+ {task detail from scratch file}
91
+ ```
92
+
52
93
  **Task {M} of {total}: {Task Name}**
53
94
 
54
95
  > *Output the next fenced block as markdown (not a code block):*
@@ -56,8 +97,8 @@ Task {M} of {total}: {Task Name} — authored. Logging to plan.
56
97
  ```
57
98
  · · · · · · · · · · · ·
58
99
  **To proceed:**
59
- - **`y`/`yes`** — Approved. I'll log it to the plan.
60
- - **`a`/`auto`** — Approve this and all remaining task authoring gates automatically
100
+ - **`y`/`yes`** — Approved. I'll write it to the plan.
101
+ - **`a`/`auto`** — Approve this and all remaining tasks automatically
61
102
  - **Or tell me what to change.**
62
103
  - **Or navigate** — a different phase or task, or the leading edge.
63
104
  · · · · · · · · · · · ·
@@ -65,36 +106,69 @@ Task {M} of {total}: {Task Name} — authored. Logging to plan.
65
106
 
66
107
  **STOP.** Wait for the user's response.
67
108
 
109
+ #### If approved (`y`/`yes`)
110
+
111
+ Mark the task `approved` in the scratch file. Continue to the next task.
112
+
113
+ #### If `auto`
114
+
115
+ Mark the task `approved` in the scratch file. Set all remaining `pending` tasks to `approved`. Update `author_gate_mode: auto` in the Plan Index File frontmatter.
116
+
117
+ → Jump to **Section 6**.
118
+
68
119
  #### If the user provides feedback
69
120
 
70
- Re-invoke `planning-task-author` with all original inputs PLUS:
71
- - **Previous output**: the current task detail
72
- - **User feedback**: what the user wants changed
121
+ Mark the task `rejected` in the scratch file and add the feedback as a blockquote:
73
122
 
74
- Present the revised task in full. Ask the same choice again. Repeat until approved.
123
+ ```markdown
124
+ ## {task-id} | rejected
125
+
126
+ > **Feedback**: {user's feedback here}
127
+
128
+ ### Task {seq}: {Task Name}
129
+ ...
130
+ ```
131
+
132
+ Continue to the next task.
75
133
 
76
134
  #### If the user navigates
77
135
 
78
- → Return to **Plan Construction**.
136
+ → Return to **Plan Construction**. The scratch file preserves approval state.
79
137
 
80
- #### If `auto`
138
+ ---
139
+
140
+ ### Section 5b: Revision
81
141
 
82
- Note that `author_gate_mode` should be updated to `auto` during the commit step below.
142
+ After completing the approval loop, check for rejected tasks.
83
143
 
84
- Proceed to **If approved** below.
144
+ #### If no rejected tasks
85
145
 
86
- #### If approved (`y`/`yes` or `auto`)
146
+ Proceed to **Section 6**.
87
147
 
88
- > **CHECKPOINT**: If `author_gate_mode: gated`, verify before logging: (1) You presented this exact content, (2) The user explicitly approved with `y`/`yes` or equivalent — not a question, comment, or "okay" in passing, (3) You are writing exactly what was approved with no modifications.
148
+ #### If rejected tasks exist
89
149
 
90
- See **[plan-index-schema.md](plan-index-schema.md)** for field definitions and lifecycle.
150
+ > *Output the next fenced block as a code block:*
151
+
152
+ ```
153
+ {N} tasks need revision. Re-invoking author agent...
154
+ ```
155
+
156
+ → Return to **Section 2**. The agent receives the scratch file with rejected tasks and feedback, rewrites only those, and the flow continues through validation, gate check, and approval as normal.
157
+
158
+ ---
159
+
160
+ ## Section 6: Write to Plan
91
161
 
92
- 1. Write the task to the output format (format-specific see authoring.md)
93
- 2. If the Plan Index File frontmatter `ext_id` is empty, set it to the external identifier for the plan as exposed by the output format.
94
- 3. If the current phase's `ext_id` is empty, set it to the external identifier for the phase as exposed by the output format.
95
- 4. Update the task table in the Plan Index File: set `status: authored` and set `Ext ID` to the external identifier for the task as exposed by the output format.
96
- 5. Advance the `planning:` block in frontmatter to the next pending task (or next phase if this was the last task)
97
- 6. If user chose `auto` at this gate: update `author_gate_mode: auto` in the Plan Index File frontmatter
162
+ > **CHECKPOINT**: If `author_gate_mode: gated`, verify all tasks in the scratch file are marked `approved` before writing.
163
+
164
+ For each approved task in the scratch file, in order:
165
+
166
+ 1. Read the task content from the scratch file
167
+ 2. Write to the output format (format-specific see the format's **[authoring.md](output-formats/{format}/authoring.md)**)
168
+ 3. Update the task table in the Plan Index File: set `status: authored` and set `Ext ID` to the external identifier for the task as exposed by the output format
169
+ 4. If the Plan Index File frontmatter `ext_id` is empty, set it to the external identifier for the plan as exposed by the output format
170
+ 5. If the current phase's `ext_id` is empty, set it to the external identifier for the phase as exposed by the output format
171
+ 6. Advance the `planning:` block in frontmatter to the next pending task (or next phase if this was the last task)
98
172
  7. Commit: `planning({topic}): author task {task-id} ({task name})`
99
173
 
100
174
  > *Output the next fenced block as a code block:*
@@ -103,4 +177,14 @@ See **[plan-index-schema.md](plan-index-schema.md)** for field definitions and l
103
177
  Task {M} of {total}: {Task Name} — authored.
104
178
  ```
105
179
 
180
+ Repeat for each task.
181
+
182
+ ---
183
+
184
+ ## Section 7: Cleanup
185
+
186
+ Delete the scratch file: `rm docs/workflow/.cache/planning/{topic}/phase-{N}.md`
187
+
188
+ Remove the `docs/workflow/.cache/planning/{topic}/` directory if empty.
189
+
106
190
  → Return to **Plan Construction**.
@@ -39,8 +39,9 @@ tick init
39
39
  Add to `.gitignore`:
40
40
 
41
41
  ```
42
- .tick/.store
42
+ .tick/cache.db
43
43
  .tick/lock
44
+ .tick/.tasks-*.jsonl.tmp
44
45
  ```
45
46
 
46
47
  ## Structure Mapping
@@ -66,7 +67,7 @@ Tasks are stored in a `.tick/` directory at the project root:
66
67
  ```
67
68
  .tick/
68
69
  ├── tasks.jsonl # Append-only source of truth (git-friendly)
69
- ├── .store # SQLite cache (auto-rebuilt, do not commit)
70
+ ├── cache.db # SQLite query cache (auto-rebuilt, do not commit)
70
71
  └── lock # File lock for concurrent access
71
72
  ```
72
73
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  Tick has native support for priority and blocking dependencies with cycle detection. This file is used by the graphing agent after all tasks have been authored.
4
4
 
5
+ **Natural ordering principle**: Tasks execute in natural order (by priority, then creation date) when no dependencies override it. The dependency grapher only adds edges that change execution order — if tasks are already in the right sequence, explicit dependencies add noise without value. See also the dependency grapher agent's "When NOT to add a dependency" rules.
6
+
5
7
  ## Priority
6
8
 
7
9
  | Level | Name | Value |
@@ -59,3 +59,5 @@ tick ready --parent <topic-id>
59
59
  ```
60
60
 
61
61
  If `tick ready` returns no results, either all tasks are complete or remaining tasks are blocked.
62
+
63
+ **Natural ordering convention**: `tick ready` always returns results in the correct execution order — by priority, then creation date. Consumers should take the first result as the next task. Because creation date preserves authoring order, sequential intra-phase tasks execute in natural order without needing explicit dependencies. Only add dependencies when the correct order differs from the natural order.
@@ -118,31 +118,27 @@ Phase {N}: {Phase Name} — task list confirmed. Proceeding to authoring.
118
118
 
119
119
  ## Author Tasks for the Phase
120
120
 
121
- Work through each task in the phase's task table, in order.
121
+ Tasks are authored in a single batch per phase. One sub-agent authors all tasks for the phase, writing to a scratch file. The orchestrator then handles approval and writing to the plan format. Never invoke multiple authoring agents concurrently. Never batch beyond a single phase.
122
122
 
123
- ### Sequential authoring (mandatory)
123
+ #### If all tasks in the phase have status `authored`
124
124
 
125
- Tasks **must** be authored one at a time, in order. Each task's authored detail builds context for the next — later tasks benefit from decisions, patterns, and structure established by earlier ones. This applies regardless of gate mode. Auto-gate removes the approval pause, not the sequential process.
126
-
127
- **Never** invoke multiple Step B agents concurrently. **Never** batch or skip ahead.
128
-
129
- #### If the task status is `authored`
130
-
131
- Already written.
125
+ All tasks already written.
132
126
 
133
127
  > *Output the next fenced block as a code block:*
134
128
 
135
129
  ```
136
- Task {M} of {total}: {Task Name} — already authored.
130
+ Phase {N}: {Phase Name} — all tasks already authored.
137
131
  ```
138
132
 
139
- Continue to the next task.
133
+ Continue to the next phase.
134
+
135
+ #### If any tasks in the phase have status `pending`
140
136
 
141
- #### If the task status is `pending`
137
+ Go to **Step B** for the entire phase.
142
138
 
143
- Go to **Step B** with this task.
139
+ After Step B returns, all tasks in the phase are authored.
144
140
 
145
- After Step B returns, the task is authored. Continue to the next task.
141
+ If the user navigates mid-approval, the scratch file preserves approval state. On return, resume from the first non-approved task.
146
142
 
147
143
  #### When all tasks in the phase are authored
148
144
 
@@ -178,4 +174,4 @@ Load **[define-tasks.md](define-tasks.md)** and follow its instructions as writt
178
174
 
179
175
  ## Step B: Author Tasks
180
176
 
181
- Load **[author-tasks.md](author-tasks.md)** and follow its instructions as written. This step authors **one task** and returns.
177
+ Load **[author-tasks.md](author-tasks.md)** and follow its instructions as written. This step authors **all tasks for the phase** via a batch agent and returns.
@@ -47,7 +47,7 @@ Read the plan end-to-end — carefully, as if you were about to implement it. Fo
47
47
  - Task dependencies are explicit and correct — each dependency reflects a genuine data or capability requirement
48
48
  - No circular dependencies exist in the task graph
49
49
  - Priority assignments reflect graph position — foundation tasks and tasks that unblock others are prioritised appropriately
50
- - An implementer can determine execution order from the dependency graph and priorities alone
50
+ - Tasks within a phase execute in natural order (by task ID) unless dependencies or priorities override it. Do not flag missing dependencies for sequential intra-phase tasks where natural order already produces the correct sequence. Only flag dependency issues where: execution would happen in the wrong order without an explicit dependency, a cross-phase dependency is missing, or a convergence point (task needing multiple predecessors) lacks explicit edges.
51
51
 
52
52
  5. **Task Self-Containment**
53
53
  - Each task contains all context needed for execution
@@ -49,6 +49,12 @@ having it provides better context for the review.
49
49
 
50
50
  The specification is optional — the review can proceed with just the plan.
51
51
 
52
+ #### If review mode is "analysis-only"
53
+
54
+ Analysis of existing review findings was requested. The review has already been completed.
55
+
56
+ → Go directly to **Step 6**.
57
+
52
58
  ---
53
59
 
54
60
  ## Resuming After Context Refresh
@@ -123,45 +129,15 @@ Load **[invoke-task-verifiers.md](references/invoke-task-verifiers.md)** and fol
123
129
 
124
130
  ---
125
131
 
126
- ## Step 4: Product Assessment
127
-
128
- Load **[invoke-product-assessor.md](references/invoke-product-assessor.md)** and follow its instructions as written.
132
+ ## Step 4: Produce Review
129
133
 
130
- **STOP.** Do not proceed until the product assessor has returned.
134
+ Load **[produce-review.md](references/produce-review.md)** and follow its instructions as written.
131
135
 
132
136
  → Proceed to **Step 5**.
133
137
 
134
138
  ---
135
139
 
136
- ## Step 5: Produce Review
137
-
138
- Aggregate findings from both stages into a review document using the **[template.md](references/template.md)**.
139
-
140
- Write the review to `docs/workflow/review/{topic}.md` (single) or `docs/workflow/review/{scope-description}.md` (multi/all).
141
-
142
- **QA Verdict** (from Step 3):
143
- - **Approve** — All acceptance criteria met, no blocking issues
144
- - **Request Changes** — Missing requirements, broken functionality, inadequate tests
145
- - **Comments Only** — Minor suggestions, non-blocking observations
146
-
147
- **Product Assessment** (from Step 4) — always advisory, presented alongside the verdict.
148
-
149
- Commit: `review({topic}): complete review`
150
-
151
- Present the review to the user.
152
-
153
- Your review feedback can be:
154
- - Addressed by implementation (same or new session)
155
- - Delegated to an agent for fixes
156
- - Overridden by user ("ship it anyway")
157
-
158
- You produce feedback. User decides what to do with it.
159
-
160
- ---
140
+ ## Step 5: Review Actions
161
141
 
162
- ## References
142
+ Load **[review-actions-loop.md](references/review-actions-loop.md)** and follow its instructions.
163
143
 
164
- - **[invoke-task-verifiers.md](references/invoke-task-verifiers.md)** — How to dispatch QA verifier agents
165
- - **[invoke-product-assessor.md](references/invoke-product-assessor.md)** — How to dispatch the product assessor agent
166
- - **[template.md](references/template.md)** — Review output structure and verdict guidelines
167
- - **[review-checklist.md](references/review-checklist.md)** — Per-task verification criteria (read by agents), plan completion checks, writing feedback guidance