@leeovery/claude-technical-workflows 2.1.34 → 2.1.36

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 (48) hide show
  1. package/README.md +1 -2
  2. package/agents/planning-task-author.md +46 -16
  3. package/agents/review-findings-synthesizer.md +14 -18
  4. package/agents/review-task-verifier.md +3 -4
  5. package/package.json +1 -1
  6. package/skills/begin-implementation/SKILL.md +5 -1
  7. package/skills/begin-planning/SKILL.md +5 -1
  8. package/skills/migrate/SKILL.md +2 -1
  9. package/skills/migrate/scripts/migrate.sh +31 -28
  10. package/skills/migrate/scripts/migrations/001-discussion-frontmatter.sh +1 -15
  11. package/skills/migrate/scripts/migrations/002-specification-frontmatter.sh +0 -14
  12. package/skills/migrate/scripts/migrations/003-planning-frontmatter.sh +0 -14
  13. package/skills/migrate/scripts/migrations/004-sources-object-format.sh +0 -12
  14. package/skills/migrate/scripts/migrations/005-plan-external-deps-frontmatter.sh +0 -12
  15. package/skills/migrate/scripts/migrations/006-directory-restructure.sh +2 -22
  16. package/skills/migrate/scripts/migrations/007-tasks-subdirectory.sh +1 -17
  17. package/skills/migrate/scripts/migrations/008-review-directory-structure.sh +0 -10
  18. package/skills/migrate/scripts/migrations/009-review-per-plan-storage.sh +117 -0
  19. package/skills/migrate/scripts/migrations/010-gitignore-sessions.sh +67 -0
  20. package/skills/start-discussion/SKILL.md +1 -1
  21. package/skills/start-discussion/references/handle-selection.md +1 -1
  22. package/skills/start-discussion/references/research-analysis.md +3 -3
  23. package/skills/start-discussion/scripts/discovery.sh +1 -1
  24. package/skills/start-review/references/display-plans.md +2 -2
  25. package/skills/start-review/references/invoke-skill.md +20 -26
  26. package/skills/start-review/references/select-plans.md +1 -1
  27. package/skills/start-review/scripts/discovery.sh +15 -64
  28. package/skills/start-specification/SKILL.md +1 -1
  29. package/skills/start-specification/references/analysis-flow.md +2 -2
  30. package/skills/start-specification/references/display-analyze.md +1 -1
  31. package/skills/start-specification/references/display-groupings.md +3 -3
  32. package/skills/start-specification/references/display-specs-menu.md +1 -1
  33. package/skills/start-specification/scripts/discovery.sh +1 -1
  34. package/skills/technical-planning/SKILL.md +4 -3
  35. package/skills/technical-planning/references/author-tasks.md +119 -35
  36. package/skills/technical-planning/references/output-formats/tick/about.md +3 -2
  37. package/skills/technical-planning/references/output-formats/tick/graph.md +2 -0
  38. package/skills/technical-planning/references/output-formats/tick/reading.md +2 -0
  39. package/skills/technical-planning/references/plan-construction.md +11 -15
  40. package/skills/technical-planning/references/review-integrity.md +1 -1
  41. package/skills/technical-review/SKILL.md +3 -13
  42. package/skills/technical-review/references/invoke-review-synthesizer.md +3 -3
  43. package/skills/technical-review/references/invoke-task-verifiers.md +5 -12
  44. package/skills/technical-review/references/produce-review.md +2 -4
  45. package/skills/technical-review/references/review-actions-loop.md +14 -22
  46. package/skills/technical-review/references/template.md +1 -21
  47. package/agents/review-product-assessor.md +0 -112
  48. package/skills/technical-review/references/invoke-product-assessor.md +0 -57
@@ -24,8 +24,6 @@
24
24
  # Idempotent: skips if tasks/ already exists and contains .md files.
25
25
  #
26
26
  # This script is sourced by migrate.sh and has access to:
27
- # - is_migrated "filepath" "migration_id"
28
- # - record_migration "filepath" "migration_id"
29
27
  # - report_update "filepath" "description"
30
28
  # - report_skip "filepath"
31
29
  #
@@ -44,12 +42,6 @@ for topic_dir in "$PLAN_DIR"/*/; do
44
42
  topic=$(basename "$topic_dir")
45
43
  marker="${topic_dir}plan.md"
46
44
 
47
- # Use plan.md as the migration tracking key
48
- if is_migrated "$marker" "$MIGRATION_ID"; then
49
- report_skip "$marker"
50
- continue
51
- fi
52
-
53
45
  # Skip if no plan.md exists (not a valid topic directory)
54
46
  if [ ! -f "$marker" ]; then
55
47
  continue
@@ -59,14 +51,7 @@ for topic_dir in "$PLAN_DIR"/*/; do
59
51
  task_files=("$topic_dir${topic}-"*.md)
60
52
  if [ ! -f "${task_files[0]}" ]; then
61
53
  # No task files — format may not be local-markdown, or tasks already moved
62
- # Check if tasks/ already has files (idempotent check)
63
- if [ -d "${topic_dir}tasks" ] && ls -1 "${topic_dir}tasks/"*.md >/dev/null 2>&1; then
64
- record_migration "$marker" "$MIGRATION_ID"
65
- report_skip "$marker"
66
- else
67
- record_migration "$marker" "$MIGRATION_ID"
68
- report_skip "$marker"
69
- fi
54
+ report_skip "$marker"
70
55
  continue
71
56
  fi
72
57
 
@@ -81,6 +66,5 @@ for topic_dir in "$PLAN_DIR"/*/; do
81
66
  moved=$((moved + 1))
82
67
  done
83
68
 
84
- record_migration "$marker" "$MIGRATION_ID"
85
69
  report_update "$marker" "moved $moved task file(s) to tasks/ subdirectory"
86
70
  done
@@ -31,8 +31,6 @@
31
31
  # Idempotent: skips if r1/ already exists.
32
32
  #
33
33
  # This script is sourced by migrate.sh and has access to:
34
- # - is_migrated "filepath" "migration_id"
35
- # - record_migration "filepath" "migration_id"
36
34
  # - report_update "filepath" "description"
37
35
  # - report_skip "filepath"
38
36
  #
@@ -52,15 +50,8 @@ for review_file in "$REVIEW_DIR"/*.md; do
52
50
  scope_dir="$REVIEW_DIR/$scope"
53
51
  r1_dir="$scope_dir/r1"
54
52
 
55
- # Use the review file as migration tracking key
56
- if is_migrated "$review_file" "$MIGRATION_ID"; then
57
- report_skip "$review_file"
58
- continue
59
- fi
60
-
61
53
  # Skip if r1/ already exists (idempotent)
62
54
  if [ -d "$r1_dir" ]; then
63
- record_migration "$review_file" "$MIGRATION_ID"
64
55
  report_skip "$review_file"
65
56
  continue
66
57
  fi
@@ -101,6 +92,5 @@ for review_file in "$REVIEW_DIR"/*.md; do
101
92
  done
102
93
  fi
103
94
 
104
- record_migration "$r1_dir/review.md" "$MIGRATION_ID"
105
95
  report_update "$r1_dir/review.md" "migrated to r1/ structure ($moved items)"
106
96
  done
@@ -0,0 +1,117 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # 009-review-per-plan-storage.sh
4
+ #
5
+ # Restructures review directories to per-plan storage.
6
+ #
7
+ # Handles three patterns:
8
+ #
9
+ # 1. Product assessment files inside review versions — deleted (feature removed)
10
+ #
11
+ # 2. Multi-plan review with per-plan QA subdirectories:
12
+ # review/{scope}/r{N}/{plan}/qa-task-*.md → review/{plan}/r{N}/qa-task-*.md
13
+ #
14
+ # 3. Orphaned per-plan directories at review root (no r{N}/ structure):
15
+ # review/{topic}/qa-task-*.md → review/{topic}/r1/qa-task-*.md
16
+ #
17
+ # Idempotent: skips directories that already have proper r{N}/ structure.
18
+ #
19
+ # This script is sourced by migrate.sh and has access to:
20
+ # - report_update "filepath" "description"
21
+ # - report_skip "filepath"
22
+ #
23
+
24
+ MIGRATION_ID="009"
25
+ REVIEW_DIR="docs/workflow/review"
26
+
27
+ # Skip if no review directory
28
+ if [ ! -d "$REVIEW_DIR" ]; then
29
+ return 0
30
+ fi
31
+
32
+ #
33
+ # Phase 1: Delete product-assessment.md files (feature removed)
34
+ #
35
+ for rdir in "$REVIEW_DIR"/*/r*/; do
36
+ [ -d "$rdir" ] || continue
37
+ pa_file="${rdir}product-assessment.md"
38
+ [ -f "$pa_file" ] || continue
39
+ rm "$pa_file"
40
+ report_update "$pa_file" "removed product assessment (feature removed)"
41
+ done
42
+
43
+ #
44
+ # Phase 2: Move per-plan QA subdirectories from multi-plan reviews
45
+ #
46
+ # Detect multi-plan reviews: r{N}/ directories that contain subdirectories
47
+ # with qa-task-*.md files (not just qa-task files at the r{N} level)
48
+ #
49
+ for scope_dir in "$REVIEW_DIR"/*/; do
50
+ [ -d "$scope_dir" ] || continue
51
+ scope=$(basename "$scope_dir")
52
+
53
+ for rdir in "$scope_dir"r*/; do
54
+ [ -d "$rdir" ] || continue
55
+ rnum=${rdir##*r}
56
+ rnum=${rnum%/}
57
+
58
+ # Look for per-plan subdirectories containing qa-task files
59
+ for plan_subdir in "$rdir"*/; do
60
+ [ -d "$plan_subdir" ] || continue
61
+ plan_name=$(basename "$plan_subdir")
62
+
63
+ # Only process directories that have qa-task files
64
+ ls -1 "$plan_subdir"/qa-task-*.md >/dev/null 2>&1 || continue
65
+
66
+ # Create destination: review/{plan}/r{N}/
67
+ dest_dir="$REVIEW_DIR/$plan_name/r${rnum}"
68
+ mkdir -p "$dest_dir"
69
+
70
+ # Move QA files
71
+ moved=0
72
+ for qa_file in "$plan_subdir"/qa-task-*.md; do
73
+ [ -f "$qa_file" ] || continue
74
+ mv "$qa_file" "$dest_dir/"
75
+ moved=$((moved + 1))
76
+ done
77
+
78
+ # Remove empty source directory
79
+ rmdir "$plan_subdir" 2>/dev/null || true
80
+
81
+ if [ "$moved" -gt 0 ]; then
82
+ report_update "$dest_dir" "moved $moved QA files from multi-plan review $scope/r${rnum}"
83
+ fi
84
+ done
85
+ done
86
+ done
87
+
88
+ #
89
+ # Phase 3: Fix orphaned per-plan directories (QA files at root, no r{N}/)
90
+ #
91
+ # Pattern: review/{topic}/qa-task-*.md (no r1/ directory)
92
+ #
93
+ for topic_dir in "$REVIEW_DIR"/*/; do
94
+ [ -d "$topic_dir" ] || continue
95
+ topic=$(basename "$topic_dir")
96
+
97
+ # Skip if r1/ already exists with content
98
+ if [ -d "${topic_dir}r1" ]; then
99
+ continue
100
+ fi
101
+
102
+ # Check for QA files directly in the topic directory
103
+ ls -1 "$topic_dir"/qa-task-*.md >/dev/null 2>&1 || continue
104
+
105
+ # Create r1/ and move QA files
106
+ mkdir -p "${topic_dir}r1"
107
+ moved=0
108
+ for qa_file in "${topic_dir}"qa-task-*.md; do
109
+ [ -f "$qa_file" ] || continue
110
+ mv "$qa_file" "${topic_dir}r1/"
111
+ moved=$((moved + 1))
112
+ done
113
+
114
+ if [ "$moved" -gt 0 ]; then
115
+ report_update "${topic_dir}r1" "moved $moved orphaned QA files into r1/"
116
+ fi
117
+ done
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # 010-cache-state-restructure.sh
4
+ #
5
+ # Restructures docs/workflow/.cache/ → .state/ + .cache/:
6
+ # - .state/ = committed persistent workflow state (analysis files)
7
+ # - .cache/ = gitignored ephemeral runtime data (sessions)
8
+ #
9
+ # Steps:
10
+ # 1. Move analysis files from .cache/ → .state/ (if they exist)
11
+ # 2. Clean up orphaned .cache/migrations / .cache/migrations.log
12
+ # 3. Add docs/workflow/.cache/ to .gitignore
13
+ # 4. Remove old docs/workflow/.cache/sessions/ entry from .gitignore
14
+ #
15
+ # Idempotent: safe to run multiple times.
16
+ #
17
+ # This script is sourced by migrate.sh and has access to:
18
+ # - report_update "filepath" "description"
19
+ # - report_skip "filepath"
20
+
21
+ STATE_DIR="docs/workflow/.state"
22
+ CACHE_DIR="docs/workflow/.cache"
23
+ GITIGNORE=".gitignore"
24
+ NEW_ENTRY="docs/workflow/.cache/"
25
+ OLD_ENTRY="docs/workflow/.cache/sessions/"
26
+
27
+ # --- Step 1: Move analysis files from .cache/ to .state/ ---
28
+
29
+ ANALYSIS_FILES=(
30
+ "discussion-consolidation-analysis.md"
31
+ "research-analysis.md"
32
+ )
33
+
34
+ for file in "${ANALYSIS_FILES[@]}"; do
35
+ if [ -f "$CACHE_DIR/$file" ]; then
36
+ mkdir -p "$STATE_DIR"
37
+ mv "$CACHE_DIR/$file" "$STATE_DIR/$file"
38
+ report_update "$STATE_DIR/$file" "moved from .cache/"
39
+ fi
40
+ done
41
+
42
+ # --- Step 2: Clean up orphaned migration tracking in .cache/ ---
43
+
44
+ for old_file in "$CACHE_DIR/migrations" "$CACHE_DIR/migrations.log"; do
45
+ if [ -f "$old_file" ]; then
46
+ rm "$old_file"
47
+ report_update "$old_file" "removed orphaned tracking file"
48
+ fi
49
+ done
50
+
51
+ # --- Step 3: Add docs/workflow/.cache/ to .gitignore ---
52
+
53
+ if [ -f "$GITIGNORE" ] && grep -qxF "$NEW_ENTRY" "$GITIGNORE"; then
54
+ report_skip "$GITIGNORE"
55
+ else
56
+ echo "$NEW_ENTRY" >> "$GITIGNORE"
57
+ report_update "$GITIGNORE" "added .cache/ to gitignore"
58
+ fi
59
+
60
+ # --- Step 4: Remove old sessions/ entry from .gitignore (now redundant) ---
61
+
62
+ if [ -f "$GITIGNORE" ] && grep -qF "$OLD_ENTRY" "$GITIGNORE"; then
63
+ # Remove the old entry (and its comment if present)
64
+ grep -vF "$OLD_ENTRY" "$GITIGNORE" > "${GITIGNORE}.tmp"
65
+ mv "${GITIGNORE}.tmp" "$GITIGNORE"
66
+ report_update "$GITIGNORE" "removed redundant sessions/ entry"
67
+ fi
@@ -2,7 +2,7 @@
2
2
  name: start-discussion
3
3
  description: "Start a technical discussion. Discovers research and existing discussions, offers multiple entry paths, and invokes the technical-discussion skill."
4
4
  disable-model-invocation: true
5
- allowed-tools: Bash(.claude/skills/start-discussion/scripts/discovery.sh), Bash(mkdir -p docs/workflow/.cache), Bash(rm docs/workflow/.cache/research-analysis.md), Bash(.claude/hooks/workflows/write-session-state.sh)
5
+ allowed-tools: Bash(.claude/skills/start-discussion/scripts/discovery.sh), Bash(mkdir -p docs/workflow/.state), Bash(rm docs/workflow/.state/research-analysis.md), Bash(.claude/hooks/workflows/write-session-state.sh)
6
6
  hooks:
7
7
  PreToolUse:
8
8
  - hooks:
@@ -56,7 +56,7 @@ Refreshing analysis...
56
56
 
57
57
  Delete the cache file:
58
58
  ```bash
59
- rm docs/workflow/.cache/research-analysis.md
59
+ rm docs/workflow/.state/research-analysis.md
60
60
  ```
61
61
 
62
62
  → Return to **Step 3** to re-analyze.
@@ -14,7 +14,7 @@ Use `cache.status` from discovery to determine the approach:
14
14
  Using cached research analysis (unchanged since {cache.generated})
15
15
  ```
16
16
 
17
- Load the topics from `docs/workflow/.cache/research-analysis.md` and proceed.
17
+ Load the topics from `docs/workflow/.state/research-analysis.md` and proceed.
18
18
 
19
19
  #### If cache.status is "stale" or "none"
20
20
 
@@ -40,10 +40,10 @@ Read each research file and extract key themes and potential discussion topics.
40
40
 
41
41
  Ensure the cache directory exists:
42
42
  ```bash
43
- mkdir -p docs/workflow/.cache
43
+ mkdir -p docs/workflow/.state
44
44
  ```
45
45
 
46
- Create/update `docs/workflow/.cache/research-analysis.md`:
46
+ Create/update `docs/workflow/.state/research-analysis.md`:
47
47
 
48
48
  ```markdown
49
49
  ---
@@ -10,7 +10,7 @@ set -eo pipefail
10
10
 
11
11
  RESEARCH_DIR="docs/workflow/research"
12
12
  DISCUSSION_DIR="docs/workflow/discussion"
13
- CACHE_FILE="docs/workflow/.cache/research-analysis.md"
13
+ CACHE_FILE="docs/workflow/.state/research-analysis.md"
14
14
 
15
15
  # Helper: Extract a frontmatter field value from a file
16
16
  # Usage: extract_field <file> <field_name>
@@ -98,8 +98,8 @@ Scope: single
98
98
  What would you like to do?
99
99
 
100
100
  - **`s`/`single`** — Review one plan's implementation
101
- - **`m`/`multi`** — Review selected plans together (cross-cutting)
102
- - **`a`/`all`** — Review all implemented plans (full product)
101
+ - **`m`/`multi`** — Review selected plans
102
+ - **`a`/`all`** — Review all implemented plans
103
103
  @if(has_any_review) - **`analysis`** — Synthesize findings from existing reviews into tasks @endif
104
104
 
105
105
  Select an option:
@@ -25,42 +25,36 @@ Saving session state so Claude can pick up where it left off if the conversation
25
25
 
26
26
  ## Invoke the Skill
27
27
 
28
- Invoke the [technical-review](../../technical-review/SKILL.md) skill for your next instructions. Do not act on the gathered information until the skill is loaded - it contains the instructions for how to proceed. Use the appropriate handoff format based on the gathered context (review or analysis-only).
28
+ Invoke the [technical-review](../../technical-review/SKILL.md) skill for your next instructions. Do not act on the gathered information until the skill is loaded - it contains the instructions for how to proceed.
29
29
 
30
- **Example handoff (single):**
31
- ```
32
- Review session for: {topic}
33
- Review scope: single
34
- Plan: docs/workflow/planning/{topic}/plan.md
35
- Format: {format}
36
- Plan ID: {plan_id} (if applicable)
37
- Specification: {specification} (exists: {true|false})
38
-
39
- Invoke the technical-review skill.
40
- ```
30
+ Each plan is reviewed independently. When multiple plans are selected, pass all plans in the handoff — the orchestrator will loop through them one at a time.
41
31
 
42
- **Example handoff (multi/all):**
32
+ **Example handoff:**
43
33
  ```
44
- Review session for: {scope description}
45
- Review scope: {multi | all}
46
- Plans:
47
- - docs/workflow/planning/{topic-1}/plan.md (format: {format}, spec: {spec})
48
- - docs/workflow/planning/{topic-2}/plan.md (format: {format}, spec: {spec})
34
+ Review session
35
+ Plans to review:
36
+ - topic: {topic-1}
37
+ plan: docs/workflow/planning/{topic-1}/plan.md
38
+ format: {format}
39
+ plan_id: {plan_id} (if applicable)
40
+ specification: {specification} (exists: {true|false})
41
+ review_version: r{N}
42
+ - topic: {topic-2}
43
+ plan: docs/workflow/planning/{topic-2}/plan.md
44
+ format: {format}
45
+ specification: {specification} (exists: {true|false})
46
+ review_version: r{N}
49
47
 
50
48
  Invoke the technical-review skill.
51
49
  ```
52
50
 
53
51
  **Example handoff (analysis-only):**
54
52
  ```
55
- Analysis session for: {scope description}
53
+ Analysis session for: {topic}
56
54
  Review mode: analysis-only
57
- Review scope: {single | multi | all}
58
- Reviews:
59
- - scope: {scope}
60
- path: docs/workflow/review/{scope}/r{N}/
61
- plans: [{plan topics}]
62
- format: {format}
63
- specification: {spec path}
55
+ Review path: docs/workflow/review/{topic}/r{N}/
56
+ Format: {format}
57
+ Specification: {spec path}
64
58
 
65
59
  Invoke the technical-review skill.
66
60
  ```
@@ -37,7 +37,7 @@ Automatically proceed with the only available review.
37
37
 
38
38
  #### If scope is "all"
39
39
 
40
- All reviewable plans are included. No selection needed.
40
+ All reviewable plans are included. No selection needed. Each plan will be reviewed independently.
41
41
 
42
42
  → Proceed directly to **Step 5**.
43
43
 
@@ -127,9 +127,9 @@ reviewed_plans=""
127
127
  if [ -d "$REVIEW_DIR" ]; then
128
128
  # Check for any review directories with r*/review.md
129
129
  has_reviews="false"
130
- for scope_dir in "$REVIEW_DIR"/*/; do
131
- [ -d "$scope_dir" ] || continue
132
- if ls -d "$scope_dir"r*/review.md >/dev/null 2>&1; then
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
133
  has_reviews="true"
134
134
  break
135
135
  fi
@@ -140,15 +140,14 @@ if [ -d "$REVIEW_DIR" ]; then
140
140
  if [ "$has_reviews" = "true" ]; then
141
141
  echo " entries:"
142
142
 
143
- for scope_dir in "$REVIEW_DIR"/*/; do
144
- [ -d "$scope_dir" ] || continue
145
- scope=$(basename "$scope_dir")
146
-
143
+ for topic_dir in "$REVIEW_DIR"/*/; do
144
+ [ -d "$topic_dir" ] || continue
145
+ topic=$(basename "$topic_dir")
147
146
  # Count r*/ versions
148
147
  versions=0
149
148
  latest_version=0
150
149
  latest_path=""
151
- for rdir in "$scope_dir"r*/; do
150
+ for rdir in "$topic_dir"r*/; do
152
151
  [ -d "$rdir" ] || continue
153
152
  [ -f "${rdir}review.md" ] || continue
154
153
  rnum=${rdir##*r}
@@ -169,67 +168,19 @@ if [ -d "$REVIEW_DIR" ]; then
169
168
  sed -E 's/.*\*\*QA Verdict\*\*:[[:space:]]*//' || true)
170
169
  fi
171
170
 
172
- # Determine type (single/multi) from Scope line
173
- review_type="single"
174
- review_plans=""
175
- if [ -f "${latest_path}review.md" ]; then
176
- scope_line=$(grep -m1 '\*\*Scope\*\*:' "${latest_path}review.md" 2>/dev/null || true)
177
- if echo "$scope_line" | grep -qi "multi-plan\|multi plan"; then
178
- review_type="multi"
179
- # Extract plan names from parentheses: Multi-Plan (plan1, plan2, plan3)
180
- review_plans=$(echo "$scope_line" | sed -E 's/.*\(([^)]+)\).*/\1/' | tr ',' '\n' | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$//')
181
- elif echo "$scope_line" | grep -qi "full product"; then
182
- review_type="multi"
183
- fi
184
- fi
185
-
186
- # For single-plan reviews, plan name is the scope
187
- if [ "$review_type" = "single" ]; then
188
- review_plans="$scope"
189
- fi
190
-
191
- # Check for synthesis: look for review-tasks-c*.md in implementation dirs
171
+ # Check for synthesis: look for review-tasks-c*.md in implementation dir
192
172
  has_synthesis="false"
193
- if [ "$review_type" = "single" ]; then
194
- if ls "$IMPL_DIR/$scope"/review-tasks-c*.md >/dev/null 2>&1; then
195
- has_synthesis="true"
196
- fi
197
- else
198
- # For multi-plan, check each plan's implementation dir
199
- for plan_name in $review_plans; do
200
- plan_name=$(echo "$plan_name" | tr -d '[:space:]')
201
- if ls "$IMPL_DIR/$plan_name"/review-tasks-c*.md >/dev/null 2>&1; then
202
- has_synthesis="true"
203
- break
204
- fi
205
- done
173
+ if ls "$IMPL_DIR/$topic"/review-tasks-c*.md >/dev/null 2>&1; then
174
+ has_synthesis="true"
206
175
  fi
207
176
 
208
177
  # Track reviewed plans
209
- for plan_name in $review_plans; do
210
- plan_name=$(echo "$plan_name" | tr -d '[:space:]')
211
- if ! echo " $reviewed_plans " | grep -q " $plan_name "; then
212
- reviewed_plans="$reviewed_plans $plan_name"
213
- reviewed_plan_count=$((reviewed_plan_count + 1))
214
- fi
215
- done
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
216
182
 
217
- echo " - scope: \"$scope\""
218
- echo " type: \"$review_type\""
219
- # Format plans as YAML array
220
- printf " plans: ["
221
- first="true"
222
- for plan_name in $review_plans; do
223
- plan_name=$(echo "$plan_name" | tr -d '[:space:]')
224
- [ -z "$plan_name" ] && continue
225
- if [ "$first" = "true" ]; then
226
- printf "\"%s\"" "$plan_name"
227
- first="false"
228
- else
229
- printf ", \"%s\"" "$plan_name"
230
- fi
231
- done
232
- echo "]"
183
+ echo " - topic: \"$topic\""
233
184
  echo " versions: $versions"
234
185
  echo " latest_version: $latest_version"
235
186
  echo " latest_verdict: \"$latest_verdict\""
@@ -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>
@@ -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