@leeovery/claude-technical-workflows 2.1.18 → 2.1.20

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 (45) hide show
  1. package/agents/implementation-analysis-architecture.md +1 -0
  2. package/agents/review-product-assessor.md +112 -0
  3. package/agents/review-task-verifier.md +2 -1
  4. package/package.json +1 -1
  5. package/skills/start-discussion/SKILL.md +21 -246
  6. package/skills/start-discussion/references/display-options.md +71 -0
  7. package/skills/start-discussion/references/gather-context-continue.md +17 -0
  8. package/skills/start-discussion/references/gather-context-fresh.md +41 -0
  9. package/skills/start-discussion/references/gather-context-research.md +25 -0
  10. package/skills/start-discussion/references/gather-context.md +31 -0
  11. package/skills/start-discussion/references/handle-selection.md +54 -0
  12. package/skills/start-discussion/references/invoke-skill.md +30 -0
  13. package/skills/start-discussion/references/research-analysis.md +72 -0
  14. package/skills/start-implementation/SKILL.md +2 -0
  15. package/skills/start-planning/SKILL.md +2 -0
  16. package/skills/start-review/SKILL.md +88 -21
  17. package/skills/start-review/scripts/discovery.sh +19 -0
  18. package/skills/start-specification/SKILL.md +21 -758
  19. package/skills/start-specification/references/analysis-flow.md +103 -0
  20. package/skills/start-specification/references/confirm-and-handoff.md +30 -0
  21. package/skills/start-specification/references/confirm-continue.md +90 -0
  22. package/skills/start-specification/references/confirm-create.md +73 -0
  23. package/skills/start-specification/references/confirm-refine.md +41 -0
  24. package/skills/start-specification/references/confirm-unify.md +63 -0
  25. package/skills/start-specification/references/display-analyze.md +85 -0
  26. package/skills/start-specification/references/display-blocks.md +42 -0
  27. package/skills/start-specification/references/display-groupings.md +171 -0
  28. package/skills/start-specification/references/display-single-grouped.md +69 -0
  29. package/skills/start-specification/references/display-single-has-spec.md +60 -0
  30. package/skills/start-specification/references/display-single-no-spec.md +55 -0
  31. package/skills/start-specification/references/display-single.md +25 -0
  32. package/skills/start-specification/references/display-specs-menu.md +134 -0
  33. package/skills/start-specification/references/handoffs/continue-concluded.md +24 -0
  34. package/skills/start-specification/references/handoffs/continue.md +22 -0
  35. package/skills/start-specification/references/handoffs/create-with-incorporation.md +30 -0
  36. package/skills/start-specification/references/handoffs/create.md +20 -0
  37. package/skills/start-specification/references/handoffs/unify-with-incorporation.md +32 -0
  38. package/skills/start-specification/references/handoffs/unify.md +21 -0
  39. package/skills/start-specification/scripts/discovery.sh +66 -12
  40. package/skills/technical-implementation/references/steps/analysis-loop.md +10 -6
  41. package/skills/technical-review/SKILL.md +72 -70
  42. package/skills/technical-review/references/invoke-product-assessor.md +57 -0
  43. package/skills/technical-review/references/invoke-task-verifiers.md +104 -0
  44. package/skills/technical-review/references/review-checklist.md +1 -55
  45. package/skills/technical-review/references/template.md +34 -12
@@ -0,0 +1,69 @@
1
+ # Display: Single Discussion — Grouped Spec
2
+
3
+ *Reference for **[display-single.md](display-single.md)***
4
+
5
+ ---
6
+
7
+ This discussion is covered by a specification with multiple sources.
8
+
9
+ Use the spec for display. Show the spec name as the title. Show ALL the spec's sources (not just this discussion) with their statuses:
10
+ - `incorporated` + `discussion_status: concluded` or `not-found` → `(extracted)`
11
+ - `incorporated` + `discussion_status: other` (e.g. `in-progress`) → `(extracted, reopened)`
12
+ - `pending` → `(pending)`
13
+
14
+ Extraction count: X = sources with `status: incorporated`, Y = total source count from the spec's `sources` array.
15
+
16
+ ## Display
17
+
18
+ ```
19
+ Specification Overview
20
+
21
+ Single concluded discussion found with existing multi-source specification.
22
+
23
+ 1. {Spec Title Case Name}
24
+ └─ Spec: {spec_status} ({X} of {Y} sources extracted)
25
+ └─ Discussions:
26
+ ├─ {source-name} (extracted)
27
+ └─ {source-name} (extracted, reopened)
28
+ ```
29
+
30
+ Indentation: `└─` starts at column 4 (under the name text, not the number). Discussion entries start at column 7.
31
+
32
+ ### If in-progress discussions exist
33
+
34
+ ```
35
+ Discussions not ready for specification:
36
+ These discussions are still in progress and must be concluded
37
+ before they can be included in a specification.
38
+ · {discussion-name} (in-progress)
39
+ ```
40
+
41
+ ### Key/Legend
42
+
43
+ Show only the statuses that appear in the current display. No `---` separator before this section.
44
+
45
+ ```
46
+ Key:
47
+
48
+ Discussion status:
49
+ extracted — content has been incorporated into the specification
50
+ pending — listed as source but content not yet extracted
51
+ reopened — was extracted but discussion has regressed to in-progress
52
+
53
+ Spec status:
54
+ in-progress — specification work is ongoing
55
+ concluded — specification is complete
56
+ ```
57
+
58
+ ## After Display
59
+
60
+ ```
61
+ Automatically proceeding with "{Spec Title Case Name}".
62
+ ```
63
+
64
+ Auto-proceed uses the spec name. Verb rule:
65
+ - Spec is `in-progress` → **"Continuing"**
66
+ - Spec is `concluded` with pending sources → **"Continuing"**
67
+ - Spec is `concluded` with all sources extracted → **"Refining"**
68
+
69
+ → Load **[confirm-and-handoff.md](confirm-and-handoff.md)** and follow its instructions.
@@ -0,0 +1,60 @@
1
+ # Display: Single Discussion — Has Spec
2
+
3
+ *Reference for **[display-single.md](display-single.md)***
4
+
5
+ ---
6
+
7
+ An individual specification exists for this discussion.
8
+
9
+ Determine extraction count: check the spec's `sources` array from discovery. Count how many have `status: incorporated` vs total.
10
+
11
+ ## Display
12
+
13
+ ```
14
+ Specification Overview
15
+
16
+ Single concluded discussion found with existing specification.
17
+
18
+ 1. {Title Case Name}
19
+ └─ Spec: {spec_status} ({X} of {Y} sources extracted)
20
+ └─ Discussions:
21
+ └─ {discussion-name} (extracted)
22
+ ```
23
+
24
+ Indentation: `└─` starts at column 4 (under the name text, not the number). Discussion entries start at column 7.
25
+
26
+ ### If in-progress discussions exist
27
+
28
+ ```
29
+ Discussions not ready for specification:
30
+ These discussions are still in progress and must be concluded
31
+ before they can be included in a specification.
32
+ · {discussion-name} (in-progress)
33
+ ```
34
+
35
+ ### Key/Legend
36
+
37
+ No `---` separator before this section.
38
+
39
+ ```
40
+ Key:
41
+
42
+ Discussion status:
43
+ extracted — content has been incorporated into the specification
44
+
45
+ Spec status:
46
+ {spec_status} — {in-progress: "specification work is ongoing" | concluded: "specification is complete"}
47
+ ```
48
+
49
+ ## After Display
50
+
51
+ ```
52
+ Automatically proceeding with "{Title Case Name}".
53
+ ```
54
+
55
+ Auto-proceed. Verb rule:
56
+ - Spec is `in-progress` → **"Continuing"**
57
+ - Spec is `concluded` with pending sources → **"Continuing"**
58
+ - Spec is `concluded` with all sources extracted → **"Refining"**
59
+
60
+ → Load **[confirm-and-handoff.md](confirm-and-handoff.md)** and follow its instructions.
@@ -0,0 +1,55 @@
1
+ # Display: Single Discussion — No Spec
2
+
3
+ *Reference for **[display-single.md](display-single.md)***
4
+
5
+ ---
6
+
7
+ No specification exists for this discussion.
8
+
9
+ ## Display
10
+
11
+ ```
12
+ Specification Overview
13
+
14
+ Single concluded discussion found.
15
+
16
+ 1. {Title Case Name}
17
+ └─ Spec: none
18
+ └─ Discussions:
19
+ └─ {discussion-name} (ready)
20
+ ```
21
+
22
+ Indentation: `└─` starts at column 4 (under the name text, not the number). Discussion entries start at column 7.
23
+
24
+ ### If in-progress discussions exist
25
+
26
+ ```
27
+ Discussions not ready for specification:
28
+ These discussions are still in progress and must be concluded
29
+ before they can be included in a specification.
30
+ · {discussion-name} (in-progress)
31
+ ```
32
+
33
+ ### Key/Legend
34
+
35
+ No `---` separator before this section.
36
+
37
+ ```
38
+ Key:
39
+
40
+ Discussion status:
41
+ ready — concluded and available to be specified
42
+
43
+ Spec status:
44
+ none — no specification file exists yet
45
+ ```
46
+
47
+ ## After Display
48
+
49
+ ```
50
+ Automatically proceeding with "{Title Case Name}".
51
+ ```
52
+
53
+ Auto-proceed with verb **"Creating"**.
54
+
55
+ → Load **[confirm-and-handoff.md](confirm-and-handoff.md)** and follow its instructions.
@@ -0,0 +1,25 @@
1
+ # Display: Single Discussion
2
+
3
+ *Reference for **[start-specification](../SKILL.md)***
4
+
5
+ ---
6
+
7
+ Auto-proceed path — only one concluded discussion exists, so no selection menu is needed.
8
+
9
+ Convert discussion filename to title case (`auth-flow` → `Auth Flow`).
10
+
11
+ ## Route by Spec Coverage
12
+
13
+ Check if a spec covers this discussion — either by name match (`has_individual_spec`) or by listing it in a spec's `sources` array.
14
+
15
+ #### If a spec covers this discussion and has a single source
16
+
17
+ → Load **[display-single-has-spec.md](display-single-has-spec.md)** and follow its instructions.
18
+
19
+ #### If a spec covers this discussion and has multiple sources
20
+
21
+ → Load **[display-single-grouped.md](display-single-grouped.md)** and follow its instructions.
22
+
23
+ #### Otherwise
24
+
25
+ → Load **[display-single-no-spec.md](display-single-no-spec.md)** and follow its instructions.
@@ -0,0 +1,134 @@
1
+ # Display: Specs Menu
2
+
3
+ *Reference for **[start-specification](../SKILL.md)***
4
+
5
+ ---
6
+
7
+ Shows when multiple concluded discussions exist, specifications exist, and cache is none or stale. Displays existing specs from discovery frontmatter (NOT from cache), lists unassigned discussions, and offers analysis or continue options.
8
+
9
+ ## A. Display
10
+
11
+ ```
12
+ Specification Overview
13
+
14
+ {N} concluded discussions found. {M} specifications exist.
15
+
16
+ Existing specifications:
17
+ ```
18
+
19
+ For each non-superseded specification from discovery output, display as nested tree:
20
+
21
+ ```
22
+ 1. {Spec Title Case Name}
23
+ └─ Spec: {status} ({X} of {Y} sources extracted)
24
+ └─ Discussions:
25
+ ├─ {source-name} (extracted)
26
+ └─ {source-name} (extracted)
27
+ ```
28
+
29
+ Indentation: `└─` starts at column 4 (under the name text, not the number). Discussion entries start at column 7.
30
+
31
+ Determine discussion status from the spec's `sources` array:
32
+ - `incorporated` + `discussion_status: concluded` or `not-found` → `extracted`
33
+ - `incorporated` + `discussion_status: other` (e.g. `in-progress`) → `extracted, reopened`
34
+ - `pending` → `pending`
35
+
36
+ Extraction count: X = sources with `status: incorporated`, Y = total source count from the spec's `sources` array.
37
+
38
+ ### Unassigned Discussions
39
+
40
+ List concluded discussions that are not in any specification's `sources` array:
41
+
42
+ ```
43
+ Concluded discussions not in a specification:
44
+ • {discussion-name}
45
+ • {discussion-name}
46
+ ```
47
+
48
+ ### If in-progress discussions exist
49
+
50
+ ```
51
+ Discussions not ready for specification:
52
+ These discussions are still in progress and must be concluded
53
+ before they can be included in a specification.
54
+ · {discussion-name} (in-progress)
55
+ ```
56
+
57
+ ### Key/Legend
58
+
59
+ Show only the statuses that appear in the current display. No `---` separator before this section.
60
+
61
+ ```
62
+ Key:
63
+
64
+ Discussion status:
65
+ extracted — content has been incorporated into the specification
66
+ reopened — was extracted but discussion has regressed to in-progress
67
+
68
+ Spec status:
69
+ in-progress — specification work is ongoing
70
+ concluded — specification is complete
71
+ ```
72
+
73
+ ### Cache-Aware Message
74
+
75
+ No `---` separator before these messages.
76
+
77
+ #### If cache status is "none"
78
+
79
+ ```
80
+ No grouping analysis exists.
81
+ ```
82
+
83
+ #### If cache status is "stale"
84
+
85
+ ```
86
+ A previous grouping analysis exists but is outdated — discussions
87
+ have changed since it was created. Re-analysis is required.
88
+ ```
89
+
90
+ → Proceed to **B. Menu**.
91
+
92
+ ---
93
+
94
+ ## B. Menu
95
+
96
+ List "Analyze for groupings (recommended)" first, then one entry per existing non-superseded specification. The verb depends on the spec's state:
97
+
98
+ - Spec is `in-progress` → **Continue** "{Name}" — in-progress
99
+ - Spec is `concluded` with pending sources → **Continue** "{Name}" — {N} source(s) pending extraction
100
+ - Spec is `concluded` with no pending sources → **Refine** "{Name}" — concluded
101
+
102
+ **Example assembled menu** (2 specs exist):
103
+
104
+ ```
105
+ · · · · · · · · · · · ·
106
+ 1. Analyze for groupings (recommended)
107
+ `All discussions are analyzed for natural groupings. Existing`
108
+ `specification names are preserved. You can provide guidance`
109
+ `in the next step.`
110
+ 2. Continue "Auth Flow" — in-progress
111
+ 3. Refine "Data Model" — concluded
112
+
113
+ Select an option (enter number):
114
+ · · · · · · · · · · · ·
115
+ ```
116
+
117
+ Menu descriptions are wrapped in backticks to visually distinguish them from the choice labels.
118
+
119
+ **STOP.** Wait for user response.
120
+
121
+ #### If user picks "Analyze for groupings"
122
+
123
+ If cache is stale, delete it first:
124
+ ```bash
125
+ rm docs/workflow/.cache/discussion-consolidation-analysis.md
126
+ ```
127
+
128
+ → Load **[analysis-flow.md](analysis-flow.md)** and follow its instructions.
129
+
130
+ #### If user picks "Continue" or "Refine" for a spec
131
+
132
+ The selected spec and its sources become the context for confirmation.
133
+
134
+ → Load **[confirm-and-handoff.md](confirm-and-handoff.md)** and follow its instructions.
@@ -0,0 +1,24 @@
1
+ # Handoff: Continue Concluded Specification
2
+
3
+ *Reference for **[confirm-continue.md](../confirm-continue.md)***
4
+
5
+ ---
6
+
7
+ This skill's purpose is now fulfilled. Invoke the [technical-specification](../../../technical-specification/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.
8
+
9
+ ```
10
+ Specification session for: {Title Case Name}
11
+
12
+ Continuing existing: docs/workflow/specification/{kebab-case-name}.md (concluded)
13
+
14
+ New sources to extract:
15
+ - docs/workflow/discussion/{new-discussion-name}.md
16
+
17
+ Previously extracted (for reference):
18
+ - docs/workflow/discussion/{existing-discussion-name}.md
19
+
20
+ Context: This specification was previously concluded. New source discussions have been identified. Extract and incorporate their content while maintaining consistency with the existing specification.
21
+
22
+ ---
23
+ Invoke the technical-specification skill.
24
+ ```
@@ -0,0 +1,22 @@
1
+ # Handoff: Continue Specification
2
+
3
+ *Reference for **[confirm-continue.md](../confirm-continue.md)** and **[confirm-refine.md](../confirm-refine.md)***
4
+
5
+ ---
6
+
7
+ This skill's purpose is now fulfilled. Invoke the [technical-specification](../../../technical-specification/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.
8
+
9
+ ```
10
+ Specification session for: {Title Case Name}
11
+
12
+ Continuing existing: docs/workflow/specification/{kebab-case-name}.md
13
+
14
+ Sources for reference:
15
+ - docs/workflow/discussion/{discussion-name}.md
16
+ - docs/workflow/discussion/{discussion-name}.md
17
+
18
+ Context: This specification already exists. Review and refine it based on the source discussions.
19
+
20
+ ---
21
+ Invoke the technical-specification skill.
22
+ ```
@@ -0,0 +1,30 @@
1
+ # Handoff: Create With Incorporation
2
+
3
+ *Reference for **[confirm-create.md](../confirm-create.md)***
4
+
5
+ ---
6
+
7
+ This skill's purpose is now fulfilled. Invoke the [technical-specification](../../../technical-specification/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.
8
+
9
+ ```
10
+ Specification session for: {Title Case Name}
11
+
12
+ Source discussions:
13
+ - docs/workflow/discussion/{discussion-name}.md
14
+ - docs/workflow/discussion/{discussion-name}.md
15
+
16
+ Existing specifications to incorporate:
17
+ - docs/workflow/specification/{spec-name}.md (covers: {discussion-name} discussion)
18
+
19
+ Output: docs/workflow/specification/{kebab-case-name}.md
20
+
21
+ Context: This consolidates multiple sources. The existing {spec-name}.md specification should be incorporated - extract and adapt its content alongside the discussion material. The result should be a unified specification, not a simple merge.
22
+
23
+ After the {kebab-case-name} specification is complete, mark the incorporated specs as superseded by updating their frontmatter:
24
+
25
+ status: superseded
26
+ superseded_by: {kebab-case-name}
27
+
28
+ ---
29
+ Invoke the technical-specification skill.
30
+ ```
@@ -0,0 +1,20 @@
1
+ # Handoff: Create Specification
2
+
3
+ *Reference for **[confirm-create.md](../confirm-create.md)***
4
+
5
+ ---
6
+
7
+ This skill's purpose is now fulfilled. Invoke the [technical-specification](../../../technical-specification/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.
8
+
9
+ ```
10
+ Specification session for: {Title Case Name}
11
+
12
+ Sources:
13
+ - docs/workflow/discussion/{discussion-name}.md
14
+ - docs/workflow/discussion/{discussion-name}.md
15
+
16
+ Output: docs/workflow/specification/{kebab-case-name}.md
17
+
18
+ ---
19
+ Invoke the technical-specification skill.
20
+ ```
@@ -0,0 +1,32 @@
1
+ # Handoff: Unify With Incorporation
2
+
3
+ *Reference for **[confirm-unify.md](../confirm-unify.md)***
4
+
5
+ ---
6
+
7
+ This skill's purpose is now fulfilled. Invoke the [technical-specification](../../../technical-specification/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.
8
+
9
+ ```
10
+ Specification session for: Unified
11
+
12
+ Source discussions:
13
+ - docs/workflow/discussion/{discussion-name}.md
14
+ - docs/workflow/discussion/{discussion-name}.md
15
+ ...
16
+
17
+ Existing specifications to incorporate:
18
+ - docs/workflow/specification/{spec-name}.md
19
+ - docs/workflow/specification/{spec-name}.md
20
+
21
+ Output: docs/workflow/specification/unified.md
22
+
23
+ Context: This consolidates all discussions into a single unified specification. The existing specifications should be incorporated - extract and adapt their content alongside the discussion material.
24
+
25
+ After the unified specification is complete, mark the incorporated specs as superseded by updating their frontmatter:
26
+
27
+ status: superseded
28
+ superseded_by: unified
29
+
30
+ ---
31
+ Invoke the technical-specification skill.
32
+ ```
@@ -0,0 +1,21 @@
1
+ # Handoff: Unify All
2
+
3
+ *Reference for **[confirm-unify.md](../confirm-unify.md)***
4
+
5
+ ---
6
+
7
+ This skill's purpose is now fulfilled. Invoke the [technical-specification](../../../technical-specification/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.
8
+
9
+ ```
10
+ Specification session for: Unified
11
+
12
+ Sources:
13
+ - docs/workflow/discussion/{discussion-name}.md
14
+ - docs/workflow/discussion/{discussion-name}.md
15
+ ...
16
+
17
+ Output: docs/workflow/specification/unified.md
18
+
19
+ ---
20
+ Invoke the technical-specification skill.
21
+ ```
@@ -46,17 +46,35 @@ extract_array_field() {
46
46
  }
47
47
 
48
48
  # Helper: Extract sources with status from object format
49
- # Outputs YAML-formatted source entries with name and status
50
- # Usage: extract_sources_with_status <file>
49
+ # Outputs YAML-formatted source entries with name, status, and discussion_status
50
+ # Usage: extract_sources_with_status <file> [discussion_dir]
51
51
  #
52
52
  # Note: This only handles the object format. Legacy simple array format
53
53
  # is converted by migration 004 before discovery runs.
54
54
  extract_sources_with_status() {
55
55
  local file="$1"
56
+ local discussion_dir="$2"
56
57
  local in_sources=false
57
58
  local current_name=""
58
59
  local current_status=""
59
60
 
61
+ # Helper: output a single source entry with discussion_status lookup
62
+ _emit_source() {
63
+ local name="$1"
64
+ local status="$2"
65
+ echo " - name: \"$name\""
66
+ echo " status: \"$status\""
67
+ if [ -n "$discussion_dir" ]; then
68
+ if [ -f "$discussion_dir/${name}.md" ]; then
69
+ local disc_status
70
+ disc_status=$(extract_field "$discussion_dir/${name}.md" "status")
71
+ echo " discussion_status: \"${disc_status:-unknown}\""
72
+ else
73
+ echo " discussion_status: \"not-found\""
74
+ fi
75
+ fi
76
+ }
77
+
60
78
  # Read frontmatter and parse sources block
61
79
  while IFS= read -r line; do
62
80
  # Detect start of sources block
@@ -69,8 +87,7 @@ extract_sources_with_status() {
69
87
  if $in_sources && [[ "$line" =~ ^[a-z_]+: ]] && [[ ! "$line" =~ ^[[:space:]] ]]; then
70
88
  # Output last source if pending
71
89
  if [ -n "$current_name" ]; then
72
- echo " - name: \"$current_name\""
73
- echo " status: \"${current_status:-incorporated}\""
90
+ _emit_source "$current_name" "${current_status:-incorporated}"
74
91
  fi
75
92
  break
76
93
  fi
@@ -80,8 +97,7 @@ extract_sources_with_status() {
80
97
  if [[ "$line" =~ ^[[:space:]]*-[[:space:]]*name:[[:space:]]*(.+)$ ]]; then
81
98
  # Output previous source if exists
82
99
  if [ -n "$current_name" ]; then
83
- echo " - name: \"$current_name\""
84
- echo " status: \"${current_status:-incorporated}\""
100
+ _emit_source "$current_name" "${current_status:-incorporated}"
85
101
  fi
86
102
  current_name="${BASH_REMATCH[1]}"
87
103
  current_name=$(echo "$current_name" | sed 's/^"//' | sed 's/"$//' | xargs)
@@ -96,8 +112,7 @@ extract_sources_with_status() {
96
112
 
97
113
  # Output last source if pending (end of frontmatter)
98
114
  if [ -n "$current_name" ]; then
99
- echo " - name: \"$current_name\""
100
- echo " status: \"${current_status:-incorporated}\""
115
+ _emit_source "$current_name" "${current_status:-incorporated}"
101
116
  fi
102
117
  }
103
118
 
@@ -165,7 +180,7 @@ if [ -d "$SPEC_DIR" ] && [ -n "$(ls -A "$SPEC_DIR" 2>/dev/null)" ]; then
165
180
  fi
166
181
 
167
182
  # Extract sources with status (handles both old and new format)
168
- sources_output=$(extract_sources_with_status "$file")
183
+ sources_output=$(extract_sources_with_status "$file" "$DISCUSSION_DIR")
169
184
  if [ -n "$sources_output" ]; then
170
185
  echo " sources:"
171
186
  echo "$sources_output"
@@ -249,17 +264,56 @@ if [ -d "$DISCUSSION_DIR" ] && [ -n "$(ls -A "$DISCUSSION_DIR" 2>/dev/null)" ];
249
264
  current_checksum=$(cat "$DISCUSSION_DIR"/*.md 2>/dev/null | md5sum | cut -d' ' -f1)
250
265
  echo " discussions_checksum: \"$current_checksum\""
251
266
 
252
- # Count concluded discussions
267
+ # Count discussions by status
268
+ discussion_count=0
253
269
  concluded_count=0
270
+ in_progress_count=0
254
271
  for file in "$DISCUSSION_DIR"/*.md; do
255
272
  [ -f "$file" ] || continue
273
+ discussion_count=$((discussion_count + 1))
256
274
  status=$(extract_field "$file" "status")
257
275
  if [ "$status" = "concluded" ]; then
258
276
  concluded_count=$((concluded_count + 1))
277
+ elif [ "$status" = "in-progress" ]; then
278
+ in_progress_count=$((in_progress_count + 1))
259
279
  fi
260
280
  done
261
- echo " concluded_discussion_count: $concluded_count"
281
+ echo " discussion_count: $discussion_count"
282
+ echo " concluded_count: $concluded_count"
283
+ echo " in_progress_count: $in_progress_count"
284
+
285
+ # Count non-superseded specifications
286
+ spec_count=0
287
+ if [ -d "$SPEC_DIR" ] && [ -n "$(ls -A "$SPEC_DIR" 2>/dev/null)" ]; then
288
+ for file in "$SPEC_DIR"/*.md; do
289
+ [ -f "$file" ] || continue
290
+ spec_status=$(extract_field "$file" "status")
291
+ if [ "$spec_status" != "superseded" ]; then
292
+ spec_count=$((spec_count + 1))
293
+ fi
294
+ done
295
+ fi
296
+ echo " spec_count: $spec_count"
297
+
298
+ # Boolean helpers
299
+ echo " has_discussions: true"
300
+ if [ "$concluded_count" -gt 0 ]; then
301
+ echo " has_concluded: true"
302
+ else
303
+ echo " has_concluded: false"
304
+ fi
305
+ if [ "$spec_count" -gt 0 ]; then
306
+ echo " has_specs: true"
307
+ else
308
+ echo " has_specs: false"
309
+ fi
262
310
  else
263
311
  echo " discussions_checksum: null"
264
- echo " concluded_discussion_count: 0"
312
+ echo " discussion_count: 0"
313
+ echo " concluded_count: 0"
314
+ echo " in_progress_count: 0"
315
+ echo " spec_count: 0"
316
+ echo " has_discussions: false"
317
+ echo " has_concluded: false"
318
+ echo " has_specs: false"
265
319
  fi
@@ -22,21 +22,25 @@ F. Create tasks in plan → invoke-task-writer.md
22
22
 
23
23
  Increment `analysis_cycle` in the implementation tracking file.
24
24
 
25
+ → If `analysis_cycle <= 3`, proceed directly to **B. Git Checkpoint**.
26
+
25
27
  If `analysis_cycle > 3`:
26
28
 
27
- > **Analysis cycle {N}this is beyond the standard 3 cycles.**
29
+ **Do NOT skip analysis autonomously.** This gate is an escape hatch for the user not a signal to stop. The expected default is to continue running analysis until no issues are found. Present the choice and let the user decide.
30
+
31
+ > **Analysis cycle {N}**
32
+ >
33
+ > Analysis has run {N-1} times so far. You can continue (recommended if issues were still found last cycle) or skip to completion.
28
34
  >
29
35
  > · · · · · · · · · · · ·
36
+ > - **`p`/`proceed`** — Continue analysis *(default)*
30
37
  > - **`s`/`skip`** — Skip analysis, proceed to completion
31
- > - **`p`/`proceed`** — Run analysis anyway
32
38
  > · · · · · · · · · · · ·
33
39
 
34
- **STOP.** Wait for user choice.
40
+ **STOP.** Wait for user choice. You MUST NOT choose on the user's behalf.
35
41
 
36
- - **`skip`**: → Return to the skill for **Step 8**.
37
42
  - **`proceed`**: → Continue to **B. Git Checkpoint**.
38
-
39
- → If `analysis_cycle <= 3`, proceed to **B. Git Checkpoint**.
43
+ - **`skip`**: → Return to the skill for **Step 8**.
40
44
 
41
45
  ---
42
46