@leeovery/claude-technical-workflows 2.1.42 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/hooks/workflows/compact-recovery.sh +3 -23
  2. package/hooks/workflows/write-session-state.sh +2 -26
  3. package/package.json +1 -1
  4. package/skills/link-dependencies/SKILL.md +0 -1
  5. package/skills/migrate/SKILL.md +0 -1
  6. package/skills/migrate/scripts/migrations/013-discussion-work-type.sh +76 -0
  7. package/skills/migrate/scripts/migrations/014-specification-work-type.sh +76 -0
  8. package/skills/migrate/scripts/migrations/015-plan-work-type.sh +76 -0
  9. package/skills/start-bugfix/SKILL.md +80 -0
  10. package/skills/start-bugfix/references/gather-bug-context.md +75 -0
  11. package/skills/start-bugfix/references/invoke-investigation.md +46 -0
  12. package/skills/start-bugfix/references/topic-name-check.md +59 -0
  13. package/skills/start-discussion/SKILL.md +51 -46
  14. package/skills/start-discussion/references/gather-context.md +54 -10
  15. package/skills/start-discussion/references/handle-selection.md +14 -4
  16. package/skills/start-discussion/references/invoke-skill.md +71 -3
  17. package/skills/start-discussion/references/research-analysis.md +2 -0
  18. package/skills/start-discussion/references/route-scenario.md +39 -0
  19. package/skills/start-discussion/references/validate-topic.md +46 -0
  20. package/skills/start-discussion/scripts/discovery.sh +3 -0
  21. package/skills/start-feature/SKILL.md +28 -84
  22. package/skills/start-feature/references/invoke-discussion.md +8 -4
  23. package/skills/start-feature/references/invoke-research.md +29 -0
  24. package/skills/start-feature/references/invoke-skill.md +35 -0
  25. package/skills/start-feature/references/research-gating.md +65 -0
  26. package/skills/start-feature/references/topic-name-check.md +61 -0
  27. package/skills/start-implementation/SKILL.md +35 -289
  28. package/skills/start-implementation/references/check-dependencies.md +65 -0
  29. package/skills/start-implementation/references/display-plans.md +159 -0
  30. package/skills/start-implementation/references/environment-check.md +45 -0
  31. package/skills/start-implementation/references/invoke-skill.md +42 -0
  32. package/skills/start-implementation/references/route-scenario.md +32 -0
  33. package/skills/start-implementation/references/validate-plan.md +45 -0
  34. package/skills/start-implementation/scripts/discovery.sh +3 -0
  35. package/skills/start-investigation/SKILL.md +145 -0
  36. package/skills/start-investigation/references/gather-context-fresh.md +72 -0
  37. package/skills/start-investigation/references/gather-context.md +31 -0
  38. package/skills/start-investigation/references/invoke-skill.md +54 -0
  39. package/skills/start-investigation/references/route-scenario.md +69 -0
  40. package/skills/start-investigation/references/validate-investigation.md +46 -0
  41. package/skills/start-investigation/scripts/discovery.sh +92 -0
  42. package/skills/start-planning/SKILL.md +32 -72
  43. package/skills/start-planning/references/cross-cutting-context.md +5 -5
  44. package/skills/start-planning/references/invoke-skill.md +27 -4
  45. package/skills/start-planning/references/route-plan-state.md +30 -0
  46. package/skills/start-planning/references/route-scenario.md +38 -0
  47. package/skills/start-planning/references/validate-spec.md +47 -0
  48. package/skills/start-planning/scripts/discovery.sh +7 -0
  49. package/skills/start-research/SKILL.md +17 -6
  50. package/skills/start-research/references/invoke-skill.md +3 -0
  51. package/skills/start-review/SKILL.md +32 -60
  52. package/skills/start-review/references/determine-review-version.md +24 -0
  53. package/skills/start-review/references/display-plans.md +2 -2
  54. package/skills/start-review/references/route-scenario.md +74 -0
  55. package/skills/start-review/references/select-plans.md +8 -6
  56. package/skills/start-review/references/validate-artifacts.md +63 -0
  57. package/skills/start-review/scripts/discovery.sh +3 -0
  58. package/skills/start-specification/SKILL.md +44 -20
  59. package/skills/start-specification/references/check-existing-spec.md +57 -0
  60. package/skills/start-specification/references/check-prerequisites.md +15 -0
  61. package/skills/start-specification/references/handoffs/continue-concluded.md +3 -0
  62. package/skills/start-specification/references/handoffs/continue.md +3 -0
  63. package/skills/start-specification/references/handoffs/create-with-incorporation.md +3 -0
  64. package/skills/start-specification/references/handoffs/create.md +3 -0
  65. package/skills/start-specification/references/handoffs/unify-with-incorporation.md +3 -0
  66. package/skills/start-specification/references/handoffs/unify.md +3 -0
  67. package/skills/start-specification/references/invoke-skill-bridge.md +74 -0
  68. package/skills/start-specification/references/route-scenario.md +23 -0
  69. package/skills/start-specification/references/validate-source.md +91 -0
  70. package/skills/start-specification/scripts/discovery.sh +6 -0
  71. package/skills/status/SKILL.md +6 -3
  72. package/skills/status/scripts/discovery.sh +9 -0
  73. package/skills/technical-discussion/SKILL.md +15 -4
  74. package/skills/technical-discussion/references/template.md +9 -1
  75. package/skills/technical-implementation/SKILL.md +24 -1
  76. package/skills/technical-implementation/references/analysis-loop.md +4 -4
  77. package/skills/technical-implementation/references/task-loop.md +2 -2
  78. package/skills/technical-investigation/SKILL.md +239 -0
  79. package/skills/technical-investigation/references/analysis-patterns.md +181 -0
  80. package/skills/technical-investigation/references/symptom-gathering.md +164 -0
  81. package/skills/technical-investigation/references/template.md +164 -0
  82. package/skills/technical-planning/SKILL.md +24 -1
  83. package/skills/technical-planning/references/author-tasks.md +16 -16
  84. package/skills/technical-planning/references/define-tasks.md +2 -2
  85. package/skills/technical-planning/references/plan-construction.md +11 -30
  86. package/skills/technical-planning/references/plan-review.md +3 -3
  87. package/skills/technical-research/SKILL.md +38 -2
  88. package/skills/technical-review/SKILL.md +1 -2
  89. package/skills/technical-review/references/review-actions-loop.md +43 -1
  90. package/skills/technical-specification/SKILL.md +1 -2
  91. package/skills/technical-specification/references/spec-completion.md +34 -6
  92. package/skills/technical-specification/references/spec-construction.md +1 -1
  93. package/skills/technical-specification/references/spec-review.md +5 -5
  94. package/skills/view-plan/SKILL.md +0 -1
  95. package/skills/workflow/bridge/SKILL.md +82 -0
  96. package/skills/workflow/bridge/references/bugfix-continuation.md +59 -0
  97. package/skills/workflow/bridge/references/feature-continuation.md +60 -0
  98. package/skills/workflow/bridge/references/greenfield-continuation.md +224 -0
  99. package/skills/workflow/bridge/scripts/discovery.sh +512 -0
  100. package/skills/workflow/start/SKILL.md +97 -0
  101. package/skills/workflow/start/references/bugfix-routing.md +117 -0
  102. package/skills/workflow/start/references/feature-routing.md +117 -0
  103. package/skills/workflow/start/references/greenfield-routing.md +140 -0
  104. package/skills/workflow/start/references/work-type-selection.md +83 -0
  105. package/skills/workflow/start/scripts/discovery.sh +577 -0
  106. package/skills/begin-implementation/SKILL.md +0 -162
  107. package/skills/begin-planning/SKILL.md +0 -92
  108. package/skills/begin-review/SKILL.md +0 -90
  109. package/skills/continue-feature/SKILL.md +0 -186
  110. package/skills/continue-feature/references/detect-phase.md +0 -99
  111. package/skills/continue-feature/references/invoke-implementation.md +0 -43
  112. package/skills/continue-feature/references/invoke-planning.md +0 -43
  113. package/skills/continue-feature/references/invoke-review.md +0 -43
  114. package/skills/continue-feature/references/invoke-specification.md +0 -55
  115. package/skills/continue-feature/references/phase-bridge.md +0 -57
  116. package/skills/continue-feature/scripts/discovery.sh +0 -233
  117. package/skills/start-feature/references/phase-bridge.md +0 -37
@@ -0,0 +1,512 @@
1
+ #!/bin/bash
2
+ #
3
+ # Topic-specific discovery script for /workflow:bridge.
4
+ #
5
+ # Usage:
6
+ # discovery.sh --feature --topic <topic>
7
+ # discovery.sh --bugfix --topic <topic>
8
+ # discovery.sh --greenfield
9
+ #
10
+ # For feature/bugfix: Checks artifacts for a specific topic and computes next_phase.
11
+ # For greenfield: Does full phase-centric discovery across all phases.
12
+ #
13
+ # Outputs structured YAML that the skill can consume directly.
14
+ #
15
+
16
+ set -eo pipefail
17
+
18
+ RESEARCH_DIR=".workflows/research"
19
+ DISCUSSION_DIR=".workflows/discussion"
20
+ INVESTIGATION_DIR=".workflows/investigation"
21
+ SPEC_DIR=".workflows/specification"
22
+ PLAN_DIR=".workflows/planning"
23
+ IMPL_DIR=".workflows/implementation"
24
+ REVIEW_DIR=".workflows/review"
25
+
26
+ # Helper: Extract a frontmatter field value from a file
27
+ # Usage: extract_field <file> <field_name>
28
+ extract_field() {
29
+ local file="$1"
30
+ local field="$2"
31
+ local value=""
32
+
33
+ if head -1 "$file" 2>/dev/null | grep -q "^---$"; then
34
+ value=$(sed -n '2,/^---$/p' "$file" 2>/dev/null | \
35
+ grep -i -m1 "^${field}:" | \
36
+ sed -E "s/^${field}:[[:space:]]*//i" || true)
37
+ fi
38
+
39
+ echo "$value"
40
+ }
41
+
42
+ #
43
+ # Parse arguments
44
+ #
45
+ topic=""
46
+ work_type=""
47
+
48
+ while [ $# -gt 0 ]; do
49
+ case "$1" in
50
+ --topic)
51
+ topic="$2"
52
+ shift 2
53
+ ;;
54
+ --greenfield)
55
+ work_type="greenfield"
56
+ shift
57
+ ;;
58
+ --feature)
59
+ work_type="feature"
60
+ shift
61
+ ;;
62
+ --bugfix)
63
+ work_type="bugfix"
64
+ shift
65
+ ;;
66
+ *)
67
+ echo "error: \"Unknown argument: $1\""
68
+ echo "error: \"Usage: discovery.sh --feature|--bugfix --topic <topic> OR discovery.sh --greenfield\""
69
+ exit 1
70
+ ;;
71
+ esac
72
+ done
73
+
74
+ if [ -z "$work_type" ]; then
75
+ echo "error: \"Work type flag required: --greenfield, --feature, or --bugfix\""
76
+ exit 1
77
+ fi
78
+
79
+ if [ "$work_type" != "greenfield" ] && [ -z "$topic" ]; then
80
+ echo "error: \"--topic is required for --feature and --bugfix\""
81
+ exit 1
82
+ fi
83
+
84
+ # Start YAML output
85
+ echo "# Workflow Bridge Discovery"
86
+ echo "# Generated: $(date -Iseconds)"
87
+ echo ""
88
+ echo "work_type: \"$work_type\""
89
+ echo "topic: \"$topic\""
90
+ echo ""
91
+
92
+ #
93
+ # TOPIC-SPECIFIC DISCOVERY (feature/bugfix)
94
+ #
95
+ if [ "$work_type" = "feature" ] || [ "$work_type" = "bugfix" ]; then
96
+ echo "topic_state:"
97
+
98
+ # Research state (feature only)
99
+ research_exists="false"
100
+ research_status=""
101
+ if [ "$work_type" = "feature" ]; then
102
+ research_file="$RESEARCH_DIR/${topic}.md"
103
+ if [ -f "$research_file" ]; then
104
+ file_work_type=$(extract_field "$research_file" "work_type")
105
+ if [ "$file_work_type" = "feature" ]; then
106
+ research_exists="true"
107
+ research_status=$(extract_field "$research_file" "status")
108
+ research_status=${research_status:-"in-progress"}
109
+ fi
110
+ fi
111
+ fi
112
+ echo " research:"
113
+ echo " exists: $research_exists"
114
+ [ "$research_exists" = "true" ] && echo " status: \"$research_status\""
115
+
116
+ # Discussion state (feature only)
117
+ discussion_exists="false"
118
+ discussion_status=""
119
+ if [ "$work_type" = "feature" ]; then
120
+ discussion_file="$DISCUSSION_DIR/${topic}.md"
121
+ if [ -f "$discussion_file" ]; then
122
+ discussion_exists="true"
123
+ discussion_status=$(extract_field "$discussion_file" "status")
124
+ discussion_status=${discussion_status:-"in-progress"}
125
+ fi
126
+ fi
127
+ echo " discussion:"
128
+ echo " exists: $discussion_exists"
129
+ [ "$discussion_exists" = "true" ] && echo " status: \"$discussion_status\""
130
+
131
+ # Investigation state (bugfix only)
132
+ investigation_exists="false"
133
+ investigation_status=""
134
+ if [ "$work_type" = "bugfix" ]; then
135
+ investigation_file="$INVESTIGATION_DIR/${topic}/investigation.md"
136
+ if [ -f "$investigation_file" ]; then
137
+ investigation_exists="true"
138
+ investigation_status=$(extract_field "$investigation_file" "status")
139
+ investigation_status=${investigation_status:-"in-progress"}
140
+ fi
141
+ fi
142
+ echo " investigation:"
143
+ echo " exists: $investigation_exists"
144
+ [ "$investigation_exists" = "true" ] && echo " status: \"$investigation_status\""
145
+
146
+ # Specification state
147
+ spec_exists="false"
148
+ spec_status=""
149
+ spec_file="$SPEC_DIR/${topic}/specification.md"
150
+ if [ -f "$spec_file" ]; then
151
+ spec_exists="true"
152
+ spec_status=$(extract_field "$spec_file" "status")
153
+ spec_status=${spec_status:-"in-progress"}
154
+ fi
155
+ echo " specification:"
156
+ echo " exists: $spec_exists"
157
+ [ "$spec_exists" = "true" ] && echo " status: \"$spec_status\""
158
+
159
+ # Plan state
160
+ plan_exists="false"
161
+ plan_status=""
162
+ plan_file="$PLAN_DIR/${topic}/plan.md"
163
+ if [ -f "$plan_file" ]; then
164
+ plan_exists="true"
165
+ plan_status=$(extract_field "$plan_file" "status")
166
+ plan_status=${plan_status:-"in-progress"}
167
+ fi
168
+ echo " plan:"
169
+ echo " exists: $plan_exists"
170
+ [ "$plan_exists" = "true" ] && echo " status: \"$plan_status\""
171
+
172
+ # Implementation state
173
+ impl_exists="false"
174
+ impl_status=""
175
+ impl_file="$IMPL_DIR/${topic}/tracking.md"
176
+ if [ -f "$impl_file" ]; then
177
+ impl_exists="true"
178
+ impl_status=$(extract_field "$impl_file" "status")
179
+ impl_status=${impl_status:-"in-progress"}
180
+ fi
181
+ echo " implementation:"
182
+ echo " exists: $impl_exists"
183
+ [ "$impl_exists" = "true" ] && echo " status: \"$impl_status\""
184
+
185
+ # Review state
186
+ review_exists="false"
187
+ if [ -d "$REVIEW_DIR/${topic}" ]; then
188
+ for rdir in "$REVIEW_DIR/${topic}"/r*/; do
189
+ [ -d "$rdir" ] || continue
190
+ [ -f "${rdir}review.md" ] || continue
191
+ review_exists="true"
192
+ break
193
+ done
194
+ fi
195
+ echo " review:"
196
+ echo " exists: $review_exists"
197
+
198
+ echo ""
199
+
200
+ #
201
+ # Compute next_phase for feature pipeline
202
+ # (Research) → Discussion → Specification → Planning → Implementation → Review
203
+ #
204
+ if [ "$work_type" = "feature" ]; then
205
+ if [ "$impl_exists" = "true" ] && [ "$impl_status" = "completed" ] && [ "$review_exists" = "true" ]; then
206
+ next_phase="done"
207
+ elif [ "$impl_exists" = "true" ] && [ "$impl_status" = "completed" ]; then
208
+ next_phase="review"
209
+ elif [ "$impl_exists" = "true" ] && [ "$impl_status" = "in-progress" ]; then
210
+ next_phase="implementation"
211
+ elif [ "$plan_exists" = "true" ] && [ "$plan_status" = "concluded" ]; then
212
+ next_phase="implementation"
213
+ elif [ "$plan_exists" = "true" ]; then
214
+ next_phase="planning"
215
+ elif [ "$spec_exists" = "true" ] && [ "$spec_status" = "concluded" ]; then
216
+ next_phase="planning"
217
+ elif [ "$spec_exists" = "true" ]; then
218
+ next_phase="specification"
219
+ elif [ "$discussion_exists" = "true" ] && [ "$discussion_status" = "concluded" ]; then
220
+ next_phase="specification"
221
+ elif [ "$discussion_exists" = "true" ]; then
222
+ next_phase="discussion"
223
+ elif [ "$research_exists" = "true" ]; then
224
+ next_phase="discussion"
225
+ else
226
+ next_phase="unknown"
227
+ fi
228
+ fi
229
+
230
+ #
231
+ # Compute next_phase for bugfix pipeline
232
+ # Investigation → Specification → Planning → Implementation → Review
233
+ #
234
+ if [ "$work_type" = "bugfix" ]; then
235
+ if [ "$impl_exists" = "true" ] && [ "$impl_status" = "completed" ] && [ "$review_exists" = "true" ]; then
236
+ next_phase="done"
237
+ elif [ "$impl_exists" = "true" ] && [ "$impl_status" = "completed" ]; then
238
+ next_phase="review"
239
+ elif [ "$impl_exists" = "true" ] && [ "$impl_status" = "in-progress" ]; then
240
+ next_phase="implementation"
241
+ elif [ "$plan_exists" = "true" ] && [ "$plan_status" = "concluded" ]; then
242
+ next_phase="implementation"
243
+ elif [ "$plan_exists" = "true" ]; then
244
+ next_phase="planning"
245
+ elif [ "$spec_exists" = "true" ] && [ "$spec_status" = "concluded" ]; then
246
+ next_phase="planning"
247
+ elif [ "$spec_exists" = "true" ]; then
248
+ next_phase="specification"
249
+ elif [ "$investigation_exists" = "true" ] && [ "$investigation_status" = "concluded" ]; then
250
+ next_phase="specification"
251
+ elif [ "$investigation_exists" = "true" ]; then
252
+ next_phase="investigation"
253
+ else
254
+ next_phase="unknown"
255
+ fi
256
+ fi
257
+
258
+ echo "next_phase: \"$next_phase\""
259
+
260
+ #
261
+ # GREENFIELD DISCOVERY (phase-centric)
262
+ #
263
+ elif [ "$work_type" = "greenfield" ]; then
264
+
265
+ #
266
+ # RESEARCH
267
+ #
268
+ echo "research:"
269
+ research_count=0
270
+ if [ -d "$RESEARCH_DIR" ] && [ -n "$(ls -A "$RESEARCH_DIR" 2>/dev/null)" ]; then
271
+ echo " exists: true"
272
+ echo " files:"
273
+ for file in "$RESEARCH_DIR"/*; do
274
+ [ -f "$file" ] || continue
275
+ name=$(basename "$file" .md)
276
+ echo " - \"$name\""
277
+ research_count=$((research_count + 1))
278
+ done
279
+ echo " count: $research_count"
280
+ else
281
+ echo " exists: false"
282
+ echo " files: []"
283
+ echo " count: 0"
284
+ fi
285
+
286
+ echo ""
287
+
288
+ #
289
+ # DISCUSSIONS (greenfield only)
290
+ #
291
+ echo "discussions:"
292
+ disc_count=0
293
+ disc_concluded=0
294
+ disc_in_progress=0
295
+
296
+ if [ -d "$DISCUSSION_DIR" ] && [ -n "$(ls -A "$DISCUSSION_DIR" 2>/dev/null)" ]; then
297
+ first=true
298
+ for file in "$DISCUSSION_DIR"/*.md; do
299
+ [ -f "$file" ] || continue
300
+ file_work_type=$(extract_field "$file" "work_type")
301
+ file_work_type=${file_work_type:-"greenfield"}
302
+ [ "$file_work_type" = "greenfield" ] || continue
303
+
304
+ name=$(basename "$file" .md)
305
+ status=$(extract_field "$file" "status")
306
+ status=${status:-"in-progress"}
307
+
308
+ if $first; then
309
+ echo " files:"
310
+ first=false
311
+ fi
312
+
313
+ echo " - name: \"$name\""
314
+ echo " status: \"$status\""
315
+
316
+ disc_count=$((disc_count + 1))
317
+ [ "$status" = "concluded" ] && disc_concluded=$((disc_concluded + 1))
318
+ [ "$status" = "in-progress" ] && disc_in_progress=$((disc_in_progress + 1))
319
+ done
320
+ if $first; then
321
+ echo " files: []"
322
+ fi
323
+ else
324
+ echo " files: []"
325
+ fi
326
+
327
+ echo " count: $disc_count"
328
+ echo " concluded: $disc_concluded"
329
+ echo " in_progress: $disc_in_progress"
330
+
331
+ echo ""
332
+
333
+ #
334
+ # SPECIFICATIONS (greenfield only)
335
+ #
336
+ echo "specifications:"
337
+ spec_count=0
338
+ spec_concluded=0
339
+ spec_in_progress=0
340
+
341
+ if [ -d "$SPEC_DIR" ] && [ -n "$(ls -A "$SPEC_DIR" 2>/dev/null)" ]; then
342
+ first=true
343
+ for file in "$SPEC_DIR"/*/specification.md; do
344
+ [ -f "$file" ] || continue
345
+ file_work_type=$(extract_field "$file" "work_type")
346
+ file_work_type=${file_work_type:-"greenfield"}
347
+ [ "$file_work_type" = "greenfield" ] || continue
348
+
349
+ name=$(basename "$(dirname "$file")")
350
+ status=$(extract_field "$file" "status")
351
+ status=${status:-"in-progress"}
352
+ spec_type=$(extract_field "$file" "type")
353
+ spec_type=${spec_type:-"feature"}
354
+
355
+ has_plan="false"
356
+ [ -f "$PLAN_DIR/${name}/plan.md" ] && has_plan="true"
357
+
358
+ if $first; then
359
+ echo " files:"
360
+ first=false
361
+ fi
362
+
363
+ echo " - name: \"$name\""
364
+ echo " status: \"$status\""
365
+ echo " type: \"$spec_type\""
366
+ echo " has_plan: $has_plan"
367
+
368
+ spec_count=$((spec_count + 1))
369
+ [ "$status" = "concluded" ] && spec_concluded=$((spec_concluded + 1))
370
+ [ "$status" = "in-progress" ] && spec_in_progress=$((spec_in_progress + 1))
371
+ done
372
+ if $first; then
373
+ echo " files: []"
374
+ fi
375
+ else
376
+ echo " files: []"
377
+ fi
378
+
379
+ echo " count: $spec_count"
380
+ echo " concluded: $spec_concluded"
381
+ echo " in_progress: $spec_in_progress"
382
+
383
+ echo ""
384
+
385
+ #
386
+ # PLANS (greenfield only)
387
+ #
388
+ echo "plans:"
389
+ plan_count=0
390
+ plan_concluded=0
391
+ plan_in_progress=0
392
+
393
+ if [ -d "$PLAN_DIR" ] && [ -n "$(ls -A "$PLAN_DIR" 2>/dev/null)" ]; then
394
+ first=true
395
+ for file in "$PLAN_DIR"/*/plan.md; do
396
+ [ -f "$file" ] || continue
397
+ file_work_type=$(extract_field "$file" "work_type")
398
+ file_work_type=${file_work_type:-"greenfield"}
399
+ [ "$file_work_type" = "greenfield" ] || continue
400
+
401
+ name=$(basename "$(dirname "$file")")
402
+ status=$(extract_field "$file" "status")
403
+ status=${status:-"in-progress"}
404
+
405
+ has_impl="false"
406
+ [ -f "$IMPL_DIR/${name}/tracking.md" ] && has_impl="true"
407
+
408
+ if $first; then
409
+ echo " files:"
410
+ first=false
411
+ fi
412
+
413
+ echo " - name: \"$name\""
414
+ echo " status: \"$status\""
415
+ echo " has_implementation: $has_impl"
416
+
417
+ plan_count=$((plan_count + 1))
418
+ [ "$status" = "concluded" ] && plan_concluded=$((plan_concluded + 1))
419
+ { [ "$status" = "in-progress" ] || [ "$status" = "planning" ]; } && plan_in_progress=$((plan_in_progress + 1))
420
+ done
421
+ if $first; then
422
+ echo " files: []"
423
+ fi
424
+ else
425
+ echo " files: []"
426
+ fi
427
+
428
+ echo " count: $plan_count"
429
+ echo " concluded: $plan_concluded"
430
+ echo " in_progress: $plan_in_progress"
431
+
432
+ echo ""
433
+
434
+ #
435
+ # IMPLEMENTATION (greenfield only)
436
+ #
437
+ echo "implementation:"
438
+ impl_count=0
439
+ impl_completed=0
440
+ impl_in_progress=0
441
+
442
+ if [ -d "$IMPL_DIR" ] && [ -n "$(ls -A "$IMPL_DIR" 2>/dev/null)" ]; then
443
+ first=true
444
+ for file in "$IMPL_DIR"/*/tracking.md; do
445
+ [ -f "$file" ] || continue
446
+ file_work_type=$(extract_field "$file" "work_type")
447
+ file_work_type=${file_work_type:-"greenfield"}
448
+ [ "$file_work_type" = "greenfield" ] || continue
449
+
450
+ topic_name=$(basename "$(dirname "$file")")
451
+ status=$(extract_field "$file" "status")
452
+ status=${status:-"in-progress"}
453
+
454
+ has_review="false"
455
+ if [ -d "$REVIEW_DIR/${topic_name}" ]; then
456
+ for rdir in "$REVIEW_DIR/${topic_name}"/r*/; do
457
+ [ -d "$rdir" ] || continue
458
+ [ -f "${rdir}review.md" ] && has_review="true" && break
459
+ done
460
+ fi
461
+
462
+ if $first; then
463
+ echo " files:"
464
+ first=false
465
+ fi
466
+
467
+ echo " - topic: \"$topic_name\""
468
+ echo " status: \"$status\""
469
+ echo " has_review: $has_review"
470
+
471
+ impl_count=$((impl_count + 1))
472
+ [ "$status" = "completed" ] && impl_completed=$((impl_completed + 1))
473
+ [ "$status" = "in-progress" ] && impl_in_progress=$((impl_in_progress + 1))
474
+ done
475
+ if $first; then
476
+ echo " files: []"
477
+ fi
478
+ else
479
+ echo " files: []"
480
+ fi
481
+
482
+ echo " count: $impl_count"
483
+ echo " completed: $impl_completed"
484
+ echo " in_progress: $impl_in_progress"
485
+
486
+ echo ""
487
+
488
+ #
489
+ # STATE SUMMARY
490
+ #
491
+ echo "state:"
492
+ echo " research_count: $research_count"
493
+ echo " discussion_count: $disc_count"
494
+ echo " discussion_concluded: $disc_concluded"
495
+ echo " discussion_in_progress: $disc_in_progress"
496
+ echo " specification_count: $spec_count"
497
+ echo " specification_concluded: $spec_concluded"
498
+ echo " specification_in_progress: $spec_in_progress"
499
+ echo " plan_count: $plan_count"
500
+ echo " plan_concluded: $plan_concluded"
501
+ echo " plan_in_progress: $plan_in_progress"
502
+ echo " implementation_count: $impl_count"
503
+ echo " implementation_completed: $impl_completed"
504
+ echo " implementation_in_progress: $impl_in_progress"
505
+
506
+ has_any_work="false"
507
+ if [ "$research_count" -gt 0 ] || [ "$disc_count" -gt 0 ] || [ "$spec_count" -gt 0 ] || \
508
+ [ "$plan_count" -gt 0 ] || [ "$impl_count" -gt 0 ]; then
509
+ has_any_work="true"
510
+ fi
511
+ echo " has_any_work: $has_any_work"
512
+ fi
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: workflow:start
3
+ disable-model-invocation: true
4
+ allowed-tools: Bash(.claude/skills/workflow/start/scripts/discovery.sh)
5
+ hooks:
6
+ PreToolUse:
7
+ - hooks:
8
+ - type: command
9
+ command: "$CLAUDE_PROJECT_DIR/.claude/hooks/workflows/system-check.sh"
10
+ once: true
11
+ ---
12
+
13
+ Unified workflow entry point. Discovers state, determines work type, and routes appropriately.
14
+
15
+ > **ZERO OUTPUT RULE**: Do not narrate your processing. Produce no output until a step or reference file explicitly specifies display content. No "proceeding with...", no discovery summaries, no routing decisions, no transition text. Your first output must be content explicitly called for by the instructions.
16
+
17
+ ## Instructions
18
+
19
+ Follow these steps EXACTLY as written. Do not skip steps or combine them.
20
+
21
+ **CRITICAL**: This guidance is mandatory.
22
+
23
+ - After each user interaction, STOP and wait for their response before proceeding
24
+ - Never assume or anticipate user choices
25
+ - Complete each step fully before moving to the next
26
+
27
+ ---
28
+
29
+ ## Step 0: Run Migrations
30
+
31
+ **This step is mandatory. You must complete it before proceeding.**
32
+
33
+ Invoke the `/migrate` skill and assess its output.
34
+
35
+ #### If files were updated
36
+
37
+ **STOP.** Wait for the user to review the changes (e.g., via `git diff`) and confirm before proceeding.
38
+
39
+ #### If no updates needed
40
+
41
+ → Proceed to **Step 1**.
42
+
43
+ ---
44
+
45
+ ## Step 1: Run Discovery
46
+
47
+ !`.claude/skills/workflow/start/scripts/discovery.sh`
48
+
49
+ If the above shows a script invocation rather than YAML output, the dynamic content preprocessor did not run. Execute the script before continuing:
50
+
51
+ ```bash
52
+ .claude/skills/workflow/start/scripts/discovery.sh
53
+ ```
54
+
55
+ Parse the output to understand the current workflow state:
56
+
57
+ **From `greenfield` section:**
58
+ - Research files, discussions (name, status, work_type), specifications (name, status, work_type, type), plans, implementations
59
+
60
+ **From `features` section:**
61
+ - Topics with `work_type: feature` at any phase
62
+
63
+ **From `bugfixes` section:**
64
+ - Topics with `work_type: bugfix` at any phase (includes investigations)
65
+
66
+ **From `state` section:**
67
+ - Counts for each work type, `has_any_work` flag
68
+
69
+ → Proceed to **Step 2**.
70
+
71
+ ---
72
+
73
+ ## Step 2: Work Type Selection
74
+
75
+ Load **[work-type-selection.md](references/work-type-selection.md)** and follow its instructions.
76
+
77
+ The reference will present the current state and ask the user which work type they want to work on.
78
+
79
+ → Proceed to **Step 3** with the selected work type.
80
+
81
+ ---
82
+
83
+ ## Step 3: Route to Work Type
84
+
85
+ Based on the selected work type, load the appropriate routing reference:
86
+
87
+ #### If work type is "greenfield"
88
+
89
+ Load **[greenfield-routing.md](references/greenfield-routing.md)** and follow its instructions.
90
+
91
+ #### If work type is "feature"
92
+
93
+ Load **[feature-routing.md](references/feature-routing.md)** and follow its instructions.
94
+
95
+ #### If work type is "bugfix"
96
+
97
+ Load **[bugfix-routing.md](references/bugfix-routing.md)** and follow its instructions.