@leeovery/claude-technical-workflows 2.0.35 → 2.0.37

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.
package/README.md CHANGED
@@ -251,7 +251,9 @@ agents/
251
251
  └── chain-verifier.md # Parallel task verification for review
252
252
 
253
253
  scripts/ # Helper scripts for commands
254
- └── specification-discovery.sh # Discovery for specification command
254
+ ├── migrate.sh # Migration orchestrator
255
+ ├── specification-discovery.sh # Discovery for specification command
256
+ └── migrations/ # Individual migration scripts (numbered)
255
257
  ```
256
258
 
257
259
  ## Skills
@@ -286,10 +288,11 @@ Sequential commands in `commands/workflow/`. They expect files from previous pha
286
288
 
287
289
  ### Utility Commands
288
290
 
289
- Helpers for navigating and understanding the workflow.
291
+ Helpers for navigating and maintaining the workflow.
290
292
 
291
293
  | Command | Description |
292
294
  |--------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
295
+ | [**/migrate**](commands/migrate.md) | Keep workflow files in sync with the current system design. Runs automatically at the start of every workflow command. |
293
296
  | [**/status**](commands/workflow/status.md) | Show workflow status - what topics exist at each phase, and suggested next steps. |
294
297
  | [**/view-plan**](commands/workflow/view-plan.md) | View a plan's tasks and progress, regardless of output format. |
295
298
 
@@ -0,0 +1,43 @@
1
+ ---
2
+ description: Run migrations to keep workflow files in sync with the current system design. This command is mandatory before running any workflow command.
3
+ allowed-tools: Bash(.claude/scripts/migrate.sh)
4
+ ---
5
+
6
+ # Migrate
7
+
8
+ Keeps your workflow files up to date with how the system is designed to work. Runs all pending migrations automatically.
9
+
10
+ ## Instructions
11
+
12
+ Run the migration script:
13
+
14
+ ```bash
15
+ .claude/scripts/migrate.sh
16
+ ```
17
+
18
+ ### If files were updated
19
+
20
+ The script will list which files were updated. Present this to the user:
21
+
22
+ ```
23
+ {list from script output}
24
+
25
+ Review changes with `git diff`, then proceed when ready.
26
+ ```
27
+
28
+ Wait for user acknowledgment before returning control to the calling command.
29
+
30
+ ### If no updates needed
31
+
32
+ ```
33
+ All documents up to date.
34
+ ```
35
+
36
+ Return control silently - no user interaction needed.
37
+
38
+ ## Notes
39
+
40
+ - This command is run automatically at the start of every workflow command
41
+ - Migrations are tracked in `docs/workflow/.cache/migrations.log`
42
+ - To force re-running all migrations, delete the tracking file
43
+ - Each migration is idempotent - safe to run multiple times
@@ -31,6 +31,14 @@ Before beginning, discover existing work and determine the best entry path.
31
31
 
32
32
  Use simple, individual commands. Never combine multiple operations into bash loops or one-liners. Execute commands one at a time.
33
33
 
34
+ ## Step 0: Run Migrations
35
+
36
+ **This step is mandatory. You must complete it before proceeding.**
37
+
38
+ Invoke the `/migrate` command and assess its output before proceeding to Step 1.
39
+
40
+ ---
41
+
34
42
  ## Step 1: Discover Existing Work
35
43
 
36
44
  Scan the codebase for research and discussions:
@@ -44,8 +52,8 @@ Scan the codebase for research and discussions:
44
52
  - Each file is named `{topic}.md`
45
53
 
46
54
  3. **Check discussion status**: For each discussion file
47
- - Run `head -10 docs/workflow/discussion/{topic}.md` to extract the `Status:` field
48
- - Status values: `Exploring`, `Deciding`, or `Concluded`
55
+ - Run `head -10 docs/workflow/discussion/{topic}.md` to read the frontmatter
56
+ - Extract the `status:` field from YAML frontmatter: `in-progress` or `concluded`
49
57
  - Do NOT use bash loops - run separate commands for each file
50
58
 
51
59
  4. **Check for cached analysis** (if research files exist):
@@ -177,13 +185,13 @@ Then skip to Step 5 (Gather Context) with the fresh topic path.
177
185
  • {topic}.md — {Status}
178
186
  "{Brief description from context section}"
179
187
 
180
- • {topic}.md — Concluded
188
+ • {topic}.md — concluded
181
189
  "{Brief description}"
182
190
  ```
183
191
 
184
192
  **Key:**
185
- - Exploring/Deciding = In progress
186
- - Concluded = Complete (can still be reopened)
193
+ - in-progress = Active discussion
194
+ - concluded = Complete (can still be reopened)
187
195
 
188
196
  **Then present the options based on what exists:**
189
197
 
@@ -37,6 +37,14 @@ Before beginning, discover existing work and gather necessary information.
37
37
 
38
38
  Use simple, individual commands. Never combine multiple operations into bash loops or one-liners. Execute commands one at a time.
39
39
 
40
+ ## Step 0: Run Migrations
41
+
42
+ **This step is mandatory. You must complete it before proceeding.**
43
+
44
+ Invoke the `/migrate` command and assess its output before proceeding to Step 1.
45
+
46
+ ---
47
+
40
48
  ## Step 1: Discover Existing Plans
41
49
 
42
50
  Scan the codebase for plans:
@@ -31,6 +31,14 @@ Before beginning, discover existing work and gather necessary information.
31
31
 
32
32
  Use simple, individual commands. Never combine multiple operations into bash loops or one-liners. Execute commands one at a time.
33
33
 
34
+ ## Step 0: Run Migrations
35
+
36
+ **This step is mandatory. You must complete it before proceeding.**
37
+
38
+ Invoke the `/migrate` command and assess its output before proceeding to Step 1.
39
+
40
+ ---
41
+
34
42
  ## Step 1: Discover Existing Work
35
43
 
36
44
  Scan the codebase for specifications and plans:
@@ -23,6 +23,14 @@ This is **Phase 1** of the six-phase workflow:
23
23
 
24
24
  ## Instructions
25
25
 
26
+ ## Step 0: Run Migrations
27
+
28
+ **This step is mandatory. You must complete it before proceeding.**
29
+
30
+ Invoke the `/migrate` command and assess its output before proceeding.
31
+
32
+ ---
33
+
26
34
  Ask these questions to gather context:
27
35
 
28
36
  1. **What's on your mind?**
@@ -31,6 +31,14 @@ Before beginning, discover existing work and gather necessary information.
31
31
 
32
32
  Use simple, individual commands. Never combine multiple operations into bash loops or one-liners. Execute commands one at a time.
33
33
 
34
+ ## Step 0: Run Migrations
35
+
36
+ **This step is mandatory. You must complete it before proceeding.**
37
+
38
+ Invoke the `/migrate` command and assess its output before proceeding to Step 1.
39
+
40
+ ---
41
+
34
42
  ## Step 1: Discover Existing Plans
35
43
 
36
44
  Scan the codebase for plans:
@@ -30,6 +30,14 @@ Follow these steps EXACTLY as written. Do not skip steps or combine them. Presen
30
30
 
31
31
  ---
32
32
 
33
+ ## Step 0: Run Migrations
34
+
35
+ **This step is mandatory. You must complete it before proceeding.**
36
+
37
+ Invoke the `/migrate` command and assess its output before proceeding to Step 1.
38
+
39
+ ---
40
+
33
41
  ## Step 1: Run Discovery Script
34
42
 
35
43
  Run the discovery script to gather current state:
@@ -78,9 +86,9 @@ The specification phase requires a completed discussion. Please run /start-discu
78
86
  ```
79
87
  No concluded discussions found.
80
88
 
81
- The following discussions are still exploring:
82
- - {topic-1} (exploring)
83
- - {topic-2} (exploring)
89
+ The following discussions are still in progress:
90
+ - {topic-1} (in-progress)
91
+ - {topic-2} (in-progress)
84
92
 
85
93
  Please complete the discussion phase before creating specifications. Run /start-discussion to continue a discussion.
86
94
  ```
@@ -106,7 +114,7 @@ Discussions:
106
114
  ✓ {topic-1} - concluded - ready
107
115
  ✓ {topic-2} - concluded - ready
108
116
  ○ {topic-3} - concluded - has individual spec
109
- · {topic-4} - exploring - not ready
117
+ · {topic-4} - in-progress - not ready
110
118
 
111
119
  Specifications:
112
120
  • {spec-1} (active) - sources: {topic-1}
@@ -118,7 +126,7 @@ Specifications:
118
126
  **Legend:**
119
127
  - `✓` = concluded, no spec yet (ready to specify)
120
128
  - `○` = concluded, has individual spec (can be combined or continued)
121
- - `·` = not concluded (not ready)
129
+ - `·` = in-progress (not ready)
122
130
 
123
131
  #### Routing Based on State
124
132
 
@@ -4,6 +4,14 @@ description: Show workflow status - what exists, where you are, and what to do n
4
4
 
5
5
  Show the current state of the workflow for this project.
6
6
 
7
+ ## Step 0: Run Migrations
8
+
9
+ **This step is mandatory. You must complete it before proceeding.**
10
+
11
+ Invoke the `/migrate` command and assess its output before proceeding to Step 1.
12
+
13
+ ---
14
+
7
15
  ## Step 1: Scan Directories
8
16
 
9
17
  Check for files in each workflow directory:
@@ -4,6 +4,14 @@ description: View a plan's tasks and progress, regardless of output format.
4
4
 
5
5
  Display a readable summary of a plan's phases, tasks, and status.
6
6
 
7
+ ## Step 0: Run Migrations
8
+
9
+ **This step is mandatory. You must complete it before proceeding.**
10
+
11
+ Invoke the `/migrate` command and assess its output before proceeding to Step 1.
12
+
13
+ ---
14
+
7
15
  ## Step 1: Identify the Plan
8
16
 
9
17
  If no topic is specified, list available plans:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leeovery/claude-technical-workflows",
3
- "version": "2.0.35",
3
+ "version": "2.0.37",
4
4
  "description": "Technical workflow skills & commands for Claude Code",
5
5
  "license": "MIT",
6
6
  "author": "Lee Overy <me@leeovery.com>",
@@ -0,0 +1,123 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # migrate.sh
4
+ #
5
+ # Keeps workflow files in sync with the current system design.
6
+ # Runs all migration scripts in order, tracking progress to avoid redundant processing.
7
+ #
8
+ # Usage:
9
+ # ./scripts/migrate.sh
10
+ #
11
+ # Tracking:
12
+ # Migrations are tracked in docs/workflow/.cache/migrations.log
13
+ # Format: "filepath: migration_id" (one per line, append-only)
14
+ # Delete the log file to force re-running all migrations.
15
+ #
16
+ # Adding new migrations:
17
+ # 1. Create scripts/migrations/NNN-description.sh (e.g., 002-spec-frontmatter.sh)
18
+ # 2. The script will be run automatically in numeric order
19
+ # 3. Each migration script receives helper functions via source
20
+ #
21
+
22
+ set -eo pipefail
23
+
24
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
25
+ MIGRATIONS_DIR="$SCRIPT_DIR/migrations"
26
+ TRACKING_FILE="docs/workflow/.cache/migrations.log"
27
+
28
+ # Track counts for final report
29
+ FILES_UPDATED=0
30
+ FILES_SKIPPED=0
31
+ MIGRATIONS_RUN=0
32
+
33
+ # Ensure cache directory exists
34
+ mkdir -p "$(dirname "$TRACKING_FILE")"
35
+
36
+ # Touch tracking file if it doesn't exist
37
+ touch "$TRACKING_FILE"
38
+
39
+ #
40
+ # Helper function: Check if a migration has been applied to a file
41
+ # Usage: is_migrated "filepath" "migration_id"
42
+ # Returns: 0 if migrated, 1 if not
43
+ #
44
+ is_migrated() {
45
+ local filepath="$1"
46
+ local migration_id="$2"
47
+ grep -q "^${filepath}: ${migration_id}$" "$TRACKING_FILE" 2>/dev/null
48
+ }
49
+
50
+ #
51
+ # Helper function: Record that a migration was applied to a file
52
+ # Usage: record_migration "filepath" "migration_id"
53
+ #
54
+ record_migration() {
55
+ local filepath="$1"
56
+ local migration_id="$2"
57
+ echo "${filepath}: ${migration_id}" >> "$TRACKING_FILE"
58
+ }
59
+
60
+ #
61
+ # Helper function: Report a file update (for migration scripts to call)
62
+ # Usage: report_update "filepath" "description"
63
+ #
64
+ report_update() {
65
+ local filepath="$1"
66
+ local description="$2"
67
+ echo " ✓ $filepath ($description)"
68
+ FILES_UPDATED=$((FILES_UPDATED + 1))
69
+ }
70
+
71
+ #
72
+ # Helper function: Report a file skip (for migration scripts to call)
73
+ # Usage: report_skip "filepath"
74
+ #
75
+ report_skip() {
76
+ local filepath="$1"
77
+ FILES_SKIPPED=$((FILES_SKIPPED + 1))
78
+ }
79
+
80
+ # Export functions and variables for migration scripts
81
+ export -f is_migrated record_migration report_update report_skip
82
+ export TRACKING_FILE FILES_UPDATED FILES_SKIPPED
83
+
84
+ #
85
+ # Main: Run all migrations in order
86
+ #
87
+
88
+ # Check if migrations directory exists and has scripts
89
+ if [ ! -d "$MIGRATIONS_DIR" ]; then
90
+ echo "No migrations directory found at $MIGRATIONS_DIR"
91
+ exit 0
92
+ fi
93
+
94
+ # Find all migration scripts, sorted by name (numeric order)
95
+ mapfile -t MIGRATION_SCRIPTS < <(find "$MIGRATIONS_DIR" -name "*.sh" -type f | sort)
96
+
97
+ if [ ${#MIGRATION_SCRIPTS[@]} -eq 0 ]; then
98
+ echo "No migration scripts found."
99
+ exit 0
100
+ fi
101
+
102
+ for script in "${MIGRATION_SCRIPTS[@]}"; do
103
+ # Extract migration ID from filename (e.g., "001" from "001-discussion-frontmatter.sh")
104
+ migration_id=$(basename "$script" .sh | grep -oE '^[0-9]+')
105
+
106
+ if [ -z "$migration_id" ]; then
107
+ echo "Warning: Skipping $script (no numeric prefix)"
108
+ continue
109
+ fi
110
+
111
+ # Source and run the migration script
112
+ # The script has access to: is_migrated, record_migration, report_update, report_skip
113
+ # shellcheck source=/dev/null
114
+ source "$script"
115
+
116
+ MIGRATIONS_RUN=$((MIGRATIONS_RUN + 1))
117
+ done
118
+
119
+ # Only output if files were actually updated
120
+ if [ "$FILES_UPDATED" -gt 0 ]; then
121
+ echo ""
122
+ echo "$FILES_UPDATED file(s) migrated. Review with \`git diff\`, then proceed."
123
+ fi
@@ -0,0 +1,140 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # 001-discussion-frontmatter.sh
4
+ #
5
+ # Migrates discussion documents from legacy markdown header format to YAML frontmatter.
6
+ #
7
+ # Legacy format:
8
+ # # Discussion: {Topic}
9
+ #
10
+ # **Date**: YYYY-MM-DD
11
+ # **Status**: Exploring | Deciding | Concluded | Complete | ✅ Complete
12
+ # **Status:** Concluded (alternate: colon outside bold)
13
+ #
14
+ # New format:
15
+ # ---
16
+ # topic: {topic-name}
17
+ # status: in-progress | concluded
18
+ # date: YYYY-MM-DD
19
+ # ---
20
+ #
21
+ # # Discussion: {Topic}
22
+ #
23
+ # Status mapping:
24
+ # Exploring, Deciding → in-progress
25
+ # Concluded, Complete, ✅ Complete → concluded
26
+ #
27
+ # This script is sourced by migrate-documents.sh and has access to:
28
+ # - is_migrated "filepath" "migration_id"
29
+ # - record_migration "filepath" "migration_id"
30
+ # - report_update "filepath" "description"
31
+ # - report_skip "filepath"
32
+ #
33
+
34
+ MIGRATION_ID="001"
35
+ DISCUSSION_DIR="docs/workflow/discussion"
36
+
37
+ # Skip if no discussion directory
38
+ if [ ! -d "$DISCUSSION_DIR" ]; then
39
+ return 0
40
+ fi
41
+
42
+ # Process each discussion file
43
+ for file in "$DISCUSSION_DIR"/*.md; do
44
+ [ -f "$file" ] || continue
45
+
46
+ # Check if already migrated via tracking
47
+ if is_migrated "$file" "$MIGRATION_ID"; then
48
+ report_skip "$file"
49
+ continue
50
+ fi
51
+
52
+ # Check if file already has YAML frontmatter
53
+ if head -1 "$file" 2>/dev/null | grep -q "^---$"; then
54
+ # Already has frontmatter - just record and skip
55
+ record_migration "$file" "$MIGRATION_ID"
56
+ report_skip "$file"
57
+ continue
58
+ fi
59
+
60
+ # Check if file has legacy format (look for **Status**: or **Status:** or **Date**: or **Started:**)
61
+ if ! grep -q '^\*\*Status\*\*:\|^\*\*Status:\*\*\|^\*\*Date\*\*:\|^\*\*Started:\*\*' "$file" 2>/dev/null; then
62
+ # No legacy format found - might be malformed, skip
63
+ record_migration "$file" "$MIGRATION_ID"
64
+ report_skip "$file"
65
+ continue
66
+ fi
67
+
68
+ #
69
+ # Extract values from legacy format
70
+ #
71
+
72
+ # Use filename as topic (canonical identifier throughout the workflow)
73
+ topic_kebab=$(basename "$file" .md)
74
+
75
+ # Extract date from **Date**: YYYY-MM-DD or **Started:** YYYY-MM-DD
76
+ date_value=$(grep -m1 '^\*\*Date\*\*:\|^\*\*Started:\*\*' "$file" | grep -oE '[0-9]{4}-[0-9]{2}-[0-9]{2}' || echo "")
77
+
78
+ # Extract status from **Status**: Value or **Status:** Value (colon inside or outside bold)
79
+ # First extract the line, then remove all variations of the prefix
80
+ status_raw=$(grep -m1 '^\*\*Status' "$file" | sed 's/^\*\*Status\*\*:[[:space:]]*//' | sed 's/^\*\*Status:\*\*[[:space:]]*//' | tr '[:upper:]' '[:lower:]')
81
+ # Remove any emoji characters (like ✅) and trim whitespace
82
+ status_raw=$(echo "$status_raw" | sed 's/✅//g' | xargs)
83
+
84
+ # Map legacy status to new values
85
+ case "$status_raw" in
86
+ exploring|deciding)
87
+ status_new="in-progress"
88
+ ;;
89
+ concluded|complete)
90
+ status_new="concluded"
91
+ ;;
92
+ *)
93
+ status_new="in-progress" # Default for unknown
94
+ ;;
95
+ esac
96
+
97
+ # Use today's date if none found
98
+ if [ -z "$date_value" ]; then
99
+ date_value=$(date +%Y-%m-%d)
100
+ fi
101
+
102
+ #
103
+ # Build new file content
104
+ #
105
+
106
+ # Create frontmatter
107
+ frontmatter="---
108
+ topic: $topic_kebab
109
+ status: $status_new
110
+ date: $date_value
111
+ ---"
112
+
113
+ # Extract H1 heading (preserve original)
114
+ h1_heading=$(grep -m1 "^# " "$file")
115
+
116
+ # Find line number of first ## heading (start of real content)
117
+ first_section_line=$(grep -n "^## " "$file" | head -1 | cut -d: -f1)
118
+
119
+ # Get content from first ## onwards (preserves all content including **Status:** in decisions)
120
+ if [ -n "$first_section_line" ]; then
121
+ content=$(tail -n +$first_section_line "$file")
122
+ else
123
+ # No ## found - take everything after metadata block
124
+ # Find first blank line after H1, then take from there
125
+ content=""
126
+ fi
127
+
128
+ # Write new content: frontmatter + H1 + blank line + content
129
+ {
130
+ echo "$frontmatter"
131
+ echo ""
132
+ echo "$h1_heading"
133
+ echo ""
134
+ echo "$content"
135
+ } > "$file"
136
+
137
+ # Record and report
138
+ record_migration "$file" "$MIGRATION_ID"
139
+ report_update "$file" "added frontmatter"
140
+ done
@@ -15,28 +15,17 @@ SPEC_DIR="docs/workflow/specification"
15
15
  CACHE_FILE="docs/workflow/.cache/discussion-consolidation-analysis.md"
16
16
 
17
17
  # Helper: Extract a frontmatter field value from a file
18
- # Supports both YAML frontmatter and markdown format (**Field**: Value)
19
18
  # Usage: extract_field <file> <field_name>
20
19
  extract_field() {
21
20
  local file="$1"
22
21
  local field="$2"
23
22
  local value=""
24
23
 
25
- # Try YAML frontmatter first (only if file starts with ---)
24
+ # Extract from YAML frontmatter (file must start with ---)
26
25
  if head -1 "$file" 2>/dev/null | grep -q "^---$"; then
27
26
  value=$(sed -n '2,/^---$/p' "$file" 2>/dev/null | \
28
- grep -m1 "^${field}:" | \
29
- sed "s/^${field}:[[:space:]]*//" || true)
30
- fi
31
-
32
- # If empty, try markdown format: **Field**: Value
33
- # Only search the header (before first ## heading) to avoid body matches
34
- if [ -z "$value" ]; then
35
- value=$(awk '/^## /{exit} {print}' "$file" 2>/dev/null | \
36
- grep -i -m1 "^\*\*${field}\*\*:" | \
37
- sed -E "s/^\*\*[^*]+\*\*:[[:space:]]*//" || true)
38
- # Normalize to lowercase for consistency
39
- value=$(echo "$value" | tr '[:upper:]' '[:lower:]')
27
+ grep -i -m1 "^${field}:" | \
28
+ sed -E "s/^${field}:[[:space:]]*//i" || true)
40
29
  fi
41
30
 
42
31
  echo "$value"
@@ -84,3 +84,5 @@ Before marking discussion complete:
84
84
  - ✅ Impact explained
85
85
  - ✅ Confidence stated
86
86
  - ✅ No hallucination
87
+
88
+ **When complete**: Update frontmatter `status: concluded`.
@@ -13,10 +13,13 @@ This is a single file per topic.
13
13
  ## Template
14
14
 
15
15
  ```markdown
16
- # Discussion: {Topic}
16
+ ---
17
+ topic: {topic-name}
18
+ status: in-progress
19
+ date: YYYY-MM-DD # Use today's actual date
20
+ ---
17
21
 
18
- **Date**: YYYY-MM-DD *(use today's actual date)*
19
- **Status**: Exploring | Deciding | Concluded
22
+ # Discussion: {Topic}
20
23
 
21
24
  ## Context
22
25
 
@@ -97,7 +100,7 @@ What we chose, why, the deciding factor, trade-offs accepted, confidence level.
97
100
  **When creating**:
98
101
  1. Ensure discussion directory exists: `docs/workflow/discussion/`
99
102
  2. Create file: `{topic}.md`
100
- 3. Fill header: date, status
103
+ 3. Fill frontmatter: topic, status, date
101
104
  4. Start with context: why discussing?
102
105
  5. List questions: what needs deciding?
103
106
 
@@ -125,3 +128,5 @@ What we chose, why, the deciding factor, trade-offs accepted, confidence level.
125
128
  - Major questions concluded with rationale
126
129
  - Trade-offs understood
127
130
  - Path forward clear
131
+
132
+ **When complete**: Update frontmatter `status: concluded` to signal ready for specification.