sdd-pipeline 1.2.6 → 1.2.7

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.
@@ -1,29 +1,27 @@
1
1
  ---
2
- # SDD Cook — Phase 4 Implementation Command
3
- # Parses MASTER-TASKS.md and executes implementation
2
+ # SDD Cook — Phase 4 Implementation
3
+ # Single command for task execution
4
4
  ---
5
5
  tool: Bash
6
6
  when: always
7
7
  args: optional
8
- description: Phase 4 — Execute tasks from MASTER-TASKS.md. Args: [--all | --task T-XXX] [--auto-mark] [--dry-run]. Implements tasks and marks them complete.
8
+ description: Phase 4 — Implement tasks from MASTER-TASKS.md. Args: [--all | --task T-XXX] [--dry-run]. Reads task file, shows requirements, guides implementation, marks complete.
9
9
  ---
10
10
  $ErrorActionPreference = 'Continue'
11
11
 
12
12
  # ============================================================
13
- # SDD Cook Command — Phase 4
13
+ # SDD Cook — Unified Phase 4 Command
14
14
  # ============================================================
15
- # This command:
16
- # 1. Loads tasks from MASTER-TASKS.md
17
- # 2. Shows execution plan
18
- # 3. Provides commands to implement each task
19
- # 4. Auto-marks tasks complete after implementation (with --auto-mark)
15
+ # Usage:
16
+ # claude "/sdd-cook" # Show plan, guide next task
17
+ # claude "/sdd-cook --all" # Implement all pending tasks
18
+ # claude "/sdd-cook --task T-001" # Implement specific task
20
19
  # ============================================================
21
20
 
22
21
  # --- Parse arguments ---
23
22
  $rawArgs = $args -join ' '
24
23
  $targetTask = ""
25
24
  $executeAll = $false
26
- $autoMark = $false
27
25
  $dryRun = $false
28
26
 
29
27
  # Parse flags
@@ -33,9 +31,6 @@ if ($rawArgs -match "--task\s+(\S+)") {
33
31
  if ($rawArgs -match "--all") {
34
32
  $executeAll = $true
35
33
  }
36
- if ($rawArgs -match "--auto-mark") {
37
- $autoMark = $true
38
- }
39
34
  if ($rawArgs -match "--dry-run") {
40
35
  $dryRun = $true
41
36
  }
@@ -49,38 +44,40 @@ Write-Host " SDD Cook — Phase 4 Implementation" -ForegroundColor Cyan
49
44
  Write-Host "========================================" -ForegroundColor Cyan
50
45
  Write-Host ""
51
46
 
52
- # SDD output paths
53
- $SDD_OUTPUT_BASE = "sdd"
54
- $SDD_TASKS_DIR = "$SDD_OUTPUT_BASE/tasks"
55
-
56
47
  # Find task directory
57
- $taskDirs = @()
48
+ $SDD_TASKS_DIR = "sdd/tasks"
49
+ $taskDir = $null
50
+
58
51
  if (Test-Path $SDD_TASKS_DIR) {
59
52
  $taskDirs = Get-ChildItem -Path $SDD_TASKS_DIR -Filter "task-*-*" -Directory -ErrorAction SilentlyContinue
53
+ if ($taskDirs) {
54
+ $taskDir = Join-Path $SDD_TASKS_DIR ($taskDirs[0].Name)
55
+ }
60
56
  }
61
- if (-not $taskDirs) {
62
- $taskDirs = Get-ChildItem -Filter "task-*-*" -Directory -ErrorAction SilentlyContinue
57
+
58
+ if (-not $taskDir) {
59
+ $legacyTaskDirs = Get-ChildItem -Filter "task-*-*" -Directory -ErrorAction SilentlyContinue
60
+ if ($legacyTaskDirs) {
61
+ $taskDir = $legacyTaskDirs[0].FullName
62
+ }
63
63
  }
64
64
 
65
- if (-not $taskDirs) {
65
+ if (-not $taskDir) {
66
66
  Write-Host "[ERROR] No task directory found." -ForegroundColor Red
67
67
  Write-Host "Run: claude `"/sdd-tasks`" first." -ForegroundColor Yellow
68
68
  exit 1
69
69
  }
70
70
 
71
- $taskDir = $taskDirs[0].FullName
72
- $taskDirName = $taskDirs[0].Name
71
+ $taskDirName = Split-Path $taskDir -Leaf
73
72
 
74
- # Check MASTER-TASKS.md
73
+ # Check files
75
74
  $masterTasksPath = Join-Path $taskDir "MASTER-TASKS.md"
76
75
  if (-not (Test-Path $masterTasksPath)) {
77
76
  Write-Host "[ERROR] MASTER-TASKS.md not found." -ForegroundColor Red
78
77
  exit 1
79
78
  }
80
79
 
81
- # Check SPEC.md
82
- $specPath = "$SDD_OUTPUT_BASE/SPEC.md"
83
- $specFile = if (Test-Path $specPath) { $specPath } else { "SPEC.md" }
80
+ $specFile = "sdd/SPEC.md"
84
81
  if (-not (Test-Path $specFile)) {
85
82
  Write-Host "[ERROR] SPEC.md not found." -ForegroundColor Red
86
83
  Write-Host "Run: claude `"/sdd-spec`" first." -ForegroundColor Yellow
@@ -88,7 +85,6 @@ if (-not (Test-Path $specFile)) {
88
85
  }
89
86
 
90
87
  Write-Host "[OK] Prerequisites verified" -ForegroundColor Green
91
- Write-Host " SPEC.md: $specFile" -ForegroundColor Gray
92
88
  Write-Host " Task dir: $taskDirName" -ForegroundColor Gray
93
89
  Write-Host ""
94
90
 
@@ -118,7 +114,7 @@ if ($tasks.Count -eq 0) {
118
114
  exit 1
119
115
  }
120
116
 
121
- # Helper function to check if task is complete
117
+ # Helper function
122
118
  function Test-TaskComplete($status) {
123
119
  return $status -in @("x", "X", "v", "V", "done", "completed")
124
120
  }
@@ -126,12 +122,13 @@ function Test-TaskComplete($status) {
126
122
  Write-Host ""
127
123
  Write-Host "Found $($tasks.Count) tasks:" -ForegroundColor Green
128
124
  $completedCount = 0
125
+ $pendingTasks = @()
129
126
  foreach ($t in $tasks) {
130
127
  $isComplete = Test-TaskComplete $t.Status
131
- if ($isComplete) { $completedCount++ }
128
+ if ($isComplete) { $completedCount++ } else { $pendingTasks += $t }
132
129
  $statusIcon = if ($isComplete) { "[V]" } else { "[ ]" }
133
130
  $color = if ($isComplete) { "Green" } else { "Gray" }
134
- Write-Host " $statusIcon $($t.Id): $($t.Name) ($($t.Estimate))" -ForegroundColor $color
131
+ Write-Host " $statusIcon $($t.Id): $($t.Name)" -ForegroundColor $color
135
132
  }
136
133
  Write-Host ""
137
134
  Write-Host "Progress: $completedCount/$($tasks.Count) complete" -ForegroundColor Cyan
@@ -140,17 +137,17 @@ Write-Host ""
140
137
  # ============================================================
141
138
  # Select Tasks to Execute
142
139
  # ============================================================
143
- $pendingTasks = $tasks | Where-Object { -not (Test-TaskComplete $_.Status) }
144
140
  $tasksToExecute = @()
145
141
 
146
142
  if ($targetTask) {
147
- $specific = $pendingTasks | Where-Object { $_.Id -eq $targetTask }
148
- if ($specific) {
149
- $tasksToExecute += $specific
143
+ # Specific task
144
+ $task = $pendingTasks | Where-Object { $_.Id -eq $targetTask }
145
+ if ($task) {
146
+ $tasksToExecute += $task
150
147
  Write-Host "Mode: specific - Task $targetTask" -ForegroundColor Cyan
151
148
  } else {
152
- $found = $tasks | Where-Object { $_.Id -eq $targetTask }
153
- if ($found) {
149
+ $existing = $tasks | Where-Object { $_.Id -eq $targetTask }
150
+ if ($existing) {
154
151
  Write-Host "[INFO] Task $targetTask already complete." -ForegroundColor Green
155
152
  } else {
156
153
  Write-Host "[ERROR] Task $targetTask not found." -ForegroundColor Red
@@ -158,9 +155,11 @@ if ($targetTask) {
158
155
  exit 0
159
156
  }
160
157
  } elseif ($executeAll) {
158
+ # All pending
161
159
  $tasksToExecute = $pendingTasks
162
160
  Write-Host "Mode: all - $($tasksToExecute.Count) tasks" -ForegroundColor Cyan
163
161
  } else {
162
+ # Interactive - next pending task
164
163
  if ($pendingTasks.Count -gt 0) {
165
164
  $tasksToExecute += $pendingTasks[0]
166
165
  Write-Host "Mode: next pending task" -ForegroundColor Cyan
@@ -176,20 +175,18 @@ Write-Host ""
176
175
  Write-Host "Tasks to execute: $($tasksToExecute.Count)" -ForegroundColor Green
177
176
 
178
177
  # ============================================================
179
- # Generate Execution Plan
178
+ # Implement Each Task
180
179
  # ============================================================
181
- Write-Host ""
182
- Write-Host "========================================" -ForegroundColor Cyan
183
- Write-Host " SDD Cook Execution Plan" -ForegroundColor Cyan
184
- Write-Host "========================================" -ForegroundColor Cyan
185
- Write-Host ""
186
-
187
- $taskNumber = 1
188
- $executionPlan = @()
189
-
190
180
  foreach ($task in $tasksToExecute) {
181
+ Write-Host ""
182
+ Write-Host "========================================" -ForegroundColor Magenta
183
+ Write-Host " Implementing: $($task.Id) - $($task.Name)" -ForegroundColor Magenta
184
+ Write-Host "========================================" -ForegroundColor Magenta
185
+
191
186
  # Find task file
192
- $taskFiles = Get-ChildItem -Path $taskDir -Filter "$($task.Id)-*.md" -File
187
+ $taskFiles = Get-ChildItem -Path $taskDir -Filter "$($task.Id)-*.md" -File -ErrorAction SilentlyContinue
188
+ $taskFiles = $taskFiles | Where-Object { $_.Name -ne "MASTER-TASKS.md" }
189
+
193
190
  if (-not $taskFiles) {
194
191
  Write-Host "[WARN] Task file not found: $($task.Id)-*.md" -ForegroundColor Yellow
195
192
  continue
@@ -198,6 +195,11 @@ foreach ($task in $tasksToExecute) {
198
195
  $taskFile = $taskFiles[0].FullName
199
196
  $taskContent = Get-Content $taskFile -Raw
200
197
 
198
+ # Extract task name override
199
+ if ($taskContent -match '(?m)^#\s+\S+:\s*(.+)') {
200
+ $task.Name = $matches[1].Trim()
201
+ }
202
+
201
203
  # Parse frontmatter
202
204
  $dependsOn = @()
203
205
  if ($taskContent -match 'depends_on:\s*\[([^\]]*)\]') {
@@ -218,117 +220,98 @@ foreach ($task in $tasksToExecute) {
218
220
  }
219
221
  }
220
222
 
221
- # Extract implementation summary
222
- $implSummary = ""
223
+ # Extract steps
224
+ $implSteps = @()
223
225
  if ($taskContent -match '(?s)## Implementation Steps\s*\n((?:\d+\. .+\n?)+)') {
224
- $implSummary = "Steps: " + ($matches[1] -replace '\n', ' | ').Trim()
226
+ $stepsBlock = $matches[1]
227
+ $implSteps = $stepsBlock -split '\n' | Where-Object { $_ -match '^\d+\.' }
228
+ }
229
+
230
+ # Extract verification
231
+ $verificationChecks = @()
232
+ if ($taskContent -match '(?s)## Verification\s*\n((?:- \[ \] .+\n?)+)') {
233
+ $checksBlock = $matches[1]
234
+ $verificationChecks = $checksBlock -split '\n' | Where-Object { $_ -match '- \[ \]' }
225
235
  }
226
236
 
227
- $planItem = @{
228
- Id = $task.Id
229
- Name = $task.Name
230
- File = $taskFile
231
- Dependencies = $dependsOn
232
- Files = $filesToModify
233
- Summary = $implSummary
237
+ # Extract SPEC sections
238
+ $specSections = @()
239
+ if ($taskContent -match 'spec_sections:\s*\[([^\]]+)\]') {
240
+ $sections = $matches[1] -split ',' | ForEach-Object { $_.Trim() -replace '"', '' }
241
+ $specSections += $sections
234
242
  }
235
- $executionPlan += $planItem
236
243
 
237
- Write-Host "--------------------------------------------" -ForegroundColor Magenta
238
- Write-Host "TASK $($task.Id): $($task.Name)" -ForegroundColor Magenta
239
- Write-Host "--------------------------------------------" -ForegroundColor Magenta
240
- Write-Host " File: $taskFile" -ForegroundColor Gray
244
+ # Display requirements
245
+ Write-Host ""
246
+ Write-Host "--- Requirements ---" -ForegroundColor Yellow
247
+
248
+ if ($taskContent -match '(?m)^description:\s*"([^"]+)"') {
249
+ Write-Host "Description: $($matches[1])" -ForegroundColor White
250
+ }
241
251
 
242
252
  if ($dependsOn.Count -gt 0) {
243
- Write-Host " Dependencies: $($dependsOn -join ', ')" -ForegroundColor Yellow
253
+ Write-Host "Dependencies: $($dependsOn -join ', ')" -ForegroundColor Yellow
244
254
  }
245
255
 
246
256
  if ($filesToModify.Count -gt 0) {
247
- Write-Host " Files: $($filesToModify -join ', ')" -ForegroundColor Gray
257
+ Write-Host ""
258
+ Write-Host "Files to create/modify:" -ForegroundColor Cyan
259
+ foreach ($f in $filesToModify) {
260
+ $exists = if (Test-Path $f) { "(exists)" } else { "(new)" }
261
+ Write-Host " - $f $exists" -ForegroundColor Gray
262
+ }
248
263
  }
249
264
 
250
- if ($implSummary) {
251
- Write-Host " $implSummary" -ForegroundColor Gray
265
+ if ($implSteps.Count -gt 0) {
266
+ Write-Host ""
267
+ Write-Host "Implementation Steps:" -ForegroundColor Cyan
268
+ foreach ($step in $implSteps) {
269
+ Write-Host " $step" -ForegroundColor Gray
270
+ }
252
271
  }
253
- Write-Host ""
254
-
255
- $taskNumber++
256
- }
257
-
258
- # ============================================================
259
- # Implementation Commands
260
- # ============================================================
261
- Write-Host "========================================" -ForegroundColor Cyan
262
- Write-Host " Implementation Commands" -ForegroundColor Cyan
263
- Write-Host "========================================" -ForegroundColor Cyan
264
- Write-Host ""
265
-
266
- if ($dryRun) {
267
- Write-Host "[DRY RUN] No changes will be made." -ForegroundColor Yellow
268
- Write-Host ""
269
- }
270
-
271
- Write-Host "To implement each task, run these commands in order:" -ForegroundColor White
272
- Write-Host ""
273
272
 
274
- $cmdNumber = 1
275
- foreach ($plan in $executionPlan) {
276
- Write-Host " $cmdNumber. Implement $($plan.Id): $($plan.Name)" -ForegroundColor Cyan
277
- Write-Host " claude `"/sdd-implement $($plan.Id)`"" -ForegroundColor Gray
278
- Write-Host ""
279
- $cmdNumber++
280
- }
281
-
282
- Write-Host " $cmdNumber. After implementation, mark tasks complete:" -ForegroundColor White
283
- Write-Host " pwsh commands/sdd-task-status.ps1 -TaskId <T-XXX> -Status completed" -ForegroundColor Gray
284
- Write-Host ""
273
+ if ($verificationChecks.Count -gt 0) {
274
+ Write-Host ""
275
+ Write-Host "Verification Checks:" -ForegroundColor Cyan
276
+ foreach ($check in $verificationChecks) {
277
+ $checkText = $check -replace '^\s*-\s+\[ \]\s*', ''
278
+ Write-Host " - [ ] $checkText" -ForegroundColor Gray
279
+ }
280
+ }
285
281
 
286
- # ============================================================
287
- # Auto-Mark Mode (if --auto-mark)
288
- # ============================================================
289
- if ($autoMark -and -not $dryRun) {
290
- Write-Host "========================================" -ForegroundColor Green
291
- Write-Host " Auto-Mark Mode Enabled" -ForegroundColor Green
292
- Write-Host "========================================" -ForegroundColor Green
282
+ # Implementation guidance
293
283
  Write-Host ""
294
- Write-Host "Tasks will be marked complete after implementation." -ForegroundColor White
295
- Write-Host "Run each implementation command, then:" -ForegroundColor White
284
+ Write-Host "--- Implementation ---" -ForegroundColor Yellow
296
285
  Write-Host ""
286
+ Write-Host "1. Read sdd/SPEC.md (sections: $($specSections -join ', '))" -ForegroundColor White
287
+ Write-Host "2. Implement $($task.Name)" -ForegroundColor White
288
+ Write-Host "3. Verify against checks above" -ForegroundColor White
297
289
 
298
- foreach ($plan in $executionPlan) {
299
- Write-Host " After implementing $($plan.Id):" -ForegroundColor Cyan
300
- Write-Host " pwsh commands/sdd-task-status.ps1 -TaskId '$($plan.Id)' -Status completed" -ForegroundColor Gray
290
+ if (-not $dryRun) {
301
291
  Write-Host ""
292
+ Write-Host "4. Mark task complete:" -ForegroundColor White
293
+ Write-Host " pwsh commands/sdd-task-status.ps1 -TaskId '$($task.Id)' -Status completed" -ForegroundColor Gray
302
294
  }
303
- }
304
-
305
- # ============================================================
306
- # Quick Execute Mode (non-interactive)
307
- # ============================================================
308
- if (-not $dryRun) {
309
- Write-Host "========================================" -ForegroundColor Cyan
310
- Write-Host " Quick Execute" -ForegroundColor Cyan
311
- Write-Host "========================================" -ForegroundColor Cyan
312
- Write-Host ""
313
295
 
314
- # Show one-liner for executing all pending tasks
315
- $taskIds = ($executionPlan | ForEach-Object { $_.Id }) -join ","
316
- Write-Host "To execute all shown tasks:" -ForegroundColor White
317
- Write-Host " claude `"/sdd-implement --all`"" -ForegroundColor Gray
318
296
  Write-Host ""
319
-
320
- # Check if skills are available
321
- $skillPath = "skills/sdd-cook/SKILL.md"
322
- if (Test-Path $skillPath) {
323
- Write-Host "[OK] Skill available: skills/sdd-cook/SKILL.md" -ForegroundColor Green
324
- Write-Host " Run: claude `"/sdd-implement $($executionPlan[0].Id)`"" -ForegroundColor Gray
325
- } else {
326
- Write-Host "[WARN] Skill not found: $skillPath" -ForegroundColor Yellow
327
- Write-Host " Run 'sdd init' to copy skills." -ForegroundColor Gray
328
- }
329
297
  }
330
298
 
299
+ # ============================================================
300
+ # Summary
301
+ # ============================================================
331
302
  Write-Host ""
332
303
  Write-Host "========================================" -ForegroundColor Cyan
333
- Write-Host "Ready to implement $($tasksToExecute.Count) task(s)" -ForegroundColor Green
304
+ Write-Host " Ready to implement $($tasksToExecute.Count) task(s)" -ForegroundColor Green
334
305
  Write-Host "========================================" -ForegroundColor Cyan
306
+ Write-Host ""
307
+
308
+ if ($executeAll) {
309
+ Write-Host "To execute all:" -ForegroundColor White
310
+ Write-Host " Run this command for each task in order" -ForegroundColor Gray
311
+ Write-Host ""
312
+ $cmdList = $tasksToExecute | ForEach-Object { "claude `"/sdd-cook --task $($_.Id)`"" }
313
+ Write-Host ($cmdList -join "`n") -ForegroundColor Gray
314
+ } else {
315
+ Write-Host "Next: Implement task, then mark complete" -ForegroundColor White
316
+ Write-Host "After: claude `"/sdd-cook --all`" for remaining tasks" -ForegroundColor Gray
317
+ }
@@ -9,8 +9,7 @@ const CMD_FILES = [
9
9
  'sdd-bmad.md', // Phase 0: BMAD
10
10
  'sdd-spec.md', // Phase 2: SPEC
11
11
  'sdd-tasks.md', // Phase 3: TASKS
12
- 'sdd-cook.md', // Phase 4: COOK
13
- 'sdd-implement.md', // Phase 4: Implement task
12
+ 'sdd-cook.md', // Phase 4: COOK + Implement (unified)
14
13
  'sdd-converge.md', // Phase 5: CONVERGE
15
14
  'sdd-check.md', // Real-time validation
16
15
  'sdd-task-status.md', // Task status update
package/lib/init.js CHANGED
@@ -9,8 +9,7 @@ const CMD_FILES = [
9
9
  'sdd-bmad.md', // Phase 0: BMAD
10
10
  'sdd-spec.md', // Phase 2: SPEC
11
11
  'sdd-tasks.md', // Phase 3: TASKS
12
- 'sdd-cook.md', // Phase 4: COOK
13
- 'sdd-implement.md', // Phase 4: Implement task
12
+ 'sdd-cook.md', // Phase 4: COOK + Implement (unified)
14
13
  'sdd-converge.md', // Phase 5: CONVERGE
15
14
  'sdd-check.md', // Real-time validation
16
15
  'sdd-task-status.md', // Task status update
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sdd-pipeline",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "description": "Spec-Driven Development pipeline for Claude Code CLI — transforms raw feature requests into validated, shipped code through a self-correcting converge loop",
5
5
  "type": "commonjs",
6
6
  "bin": {
@@ -1,212 +0,0 @@
1
- ---
2
- # SDD Implement — Execute Task Implementation
3
- # Reads task file and guides implementation
4
- ---
5
- tool: Bash
6
- when: always
7
- args: required
8
- description: Implement a specific task. Args: <T-XXX> [--mark-done]. Reads task file, extracts requirements, guides implementation.
9
- ---
10
- $ErrorActionPreference = 'Continue'
11
-
12
- # --- Parse arguments ---
13
- $rawArgs = $args -join ' '
14
- $targetTask = ""
15
- $markDone = $false
16
-
17
- # Parse flags
18
- if ($rawArgs -match "^([TW]-\d+)") {
19
- $targetTask = $matches[1]
20
- }
21
- if ($rawArgs -match "--mark-done") {
22
- $markDone = $true
23
- }
24
-
25
- if (-not $targetTask) {
26
- Write-Host ""
27
- Write-Host "Usage: claude `"/sdd-implement T-001`"" -ForegroundColor White
28
- Write-Host " claude `"/sdd-implement T-001 --mark-done`"" -ForegroundColor White
29
- Write-Host ""
30
- Write-Host "Arguments:" -ForegroundColor White
31
- Write-Host " T-XXX Task ID to implement" -ForegroundColor Gray
32
- Write-Host " --mark-done Mark task complete after implementation" -ForegroundColor Gray
33
- exit 1
34
- }
35
-
36
- # ============================================================
37
- # SDD Implement — Phase 4 Task Execution
38
- # ============================================================
39
- Write-Host ""
40
- Write-Host "========================================" -ForegroundColor Cyan
41
- Write-Host " SDD Implement — $targetTask" -ForegroundColor Cyan
42
- Write-Host "========================================" -ForegroundColor Cyan
43
- Write-Host ""
44
-
45
- # Find task directory
46
- $SDD_TASKS_DIR = "sdd/tasks"
47
- $taskDir = $null
48
-
49
- if (Test-Path $SDD_TASKS_DIR) {
50
- $taskDirs = Get-ChildItem -Path $SDD_TASKS_DIR -Filter "task-*-*" -Directory -ErrorAction SilentlyContinue
51
- if ($taskDirs) {
52
- $taskDir = Join-Path $SDD_TASKS_DIR ($taskDirs[0].Name)
53
- }
54
- }
55
-
56
- if (-not $taskDir) {
57
- $legacyTaskDirs = Get-ChildItem -Filter "task-*-*" -Directory -ErrorAction SilentlyContinue
58
- if ($legacyTaskDirs) {
59
- $taskDir = $legacyTaskDirs[0].FullName
60
- }
61
- }
62
-
63
- if (-not $taskDir) {
64
- Write-Host "[ERROR] No task directory found." -ForegroundColor Red
65
- exit 1
66
- }
67
-
68
- # Find task file
69
- $taskFiles = Get-ChildItem -Path $taskDir -Filter "${targetTask}-*.md" -File -ErrorAction SilentlyContinue
70
- $taskFiles = $taskFiles | Where-Object { $_.Name -ne "MASTER-TASKS.md" }
71
-
72
- if (-not $taskFiles) {
73
- Write-Host "[ERROR] Task $targetTask not found." -ForegroundColor Red
74
- exit 1
75
- }
76
-
77
- $taskFile = $taskFiles[0].FullName
78
- $taskContent = Get-Content $taskFile -Raw
79
-
80
- # Extract task name
81
- $taskName = $targetTask
82
- if ($taskContent -match '(?m)^#\s+\S+:\s*(.+)') {
83
- $taskName = $matches[1].Trim()
84
- }
85
-
86
- Write-Host "[OK] Found: $taskName" -ForegroundColor Green
87
- Write-Host " File: $taskFile" -ForegroundColor Gray
88
- Write-Host ""
89
-
90
- # ============================================================
91
- # Extract Task Requirements
92
- # ============================================================
93
- Write-Host "--- Task Requirements ---" -ForegroundColor Yellow
94
- Write-Host ""
95
-
96
- # Extract description
97
- if ($taskContent -match '(?m)^description:\s*"([^"]+)"') {
98
- Write-Host "Description: $($matches[1])" -ForegroundColor White
99
- }
100
-
101
- # Extract files to create/modify
102
- $filesToModify = @()
103
- if ($taskContent -match '(?s)## Files to (?:Modify|Create)\s*\n((?:- .+\n)+)') {
104
- $filesBlock = $matches[1]
105
- $files = $filesBlock -split '\n' | Where-Object { $_ -match '^\s*-\s+' }
106
- foreach ($f in $files) {
107
- $f = $f -replace '^\s*-\s+', '' -replace '\s+$', ''
108
- if ($f) {
109
- $filesToModify += $f
110
- Write-Host " - $f" -ForegroundColor Gray
111
- }
112
- }
113
- }
114
-
115
- if ($filesToModify.Count -eq 0) {
116
- Write-Host " (No files specified in task)" -ForegroundColor Gray
117
- }
118
- Write-Host ""
119
-
120
- # Extract implementation steps
121
- $implSteps = @()
122
- if ($taskContent -match '(?s)## Implementation Steps\s*\n((?:\d+\. .+\n?)+)') {
123
- $stepsBlock = $matches[1]
124
- $implSteps = $stepsBlock -split '\n' | Where-Object { $_ -match '^\d+\.' }
125
- }
126
-
127
- if ($implSteps.Count -gt 0) {
128
- Write-Host "Implementation Steps:" -ForegroundColor Yellow
129
- foreach ($step in $implSteps) {
130
- Write-Host " $step" -ForegroundColor Gray
131
- }
132
- Write-Host ""
133
- }
134
-
135
- # Extract verification checks
136
- $verificationChecks = @()
137
- if ($taskContent -match '(?s)## Verification\s*\n((?:- \[ \] .+\n?)+)') {
138
- $checksBlock = $matches[1]
139
- $verificationChecks = $checksBlock -split '\n' | Where-Object { $_ -match '- \[ \]' }
140
- }
141
-
142
- if ($verificationChecks.Count -gt 0) {
143
- Write-Host "Verification Checks:" -ForegroundColor Yellow
144
- foreach ($check in $verificationChecks) {
145
- $checkText = $check -replace '^\s*-\s+\[ \]\s*', ''
146
- Write-Host " - [ ] $checkText" -ForegroundColor Gray
147
- }
148
- Write-Host ""
149
- }
150
-
151
- # Extract SPEC sections
152
- $specSections = @()
153
- if ($taskContent -match 'spec_sections:\s*\[([^\]]+)\]') {
154
- $sections = $matches[1] -split ',' | ForEach-Object { $_.Trim() -replace '"', '' }
155
- $specSections += $sections
156
- }
157
-
158
- # ============================================================
159
- # Implementation Guidance
160
- # ============================================================
161
- Write-Host "========================================" -ForegroundColor Cyan
162
- Write-Host " Implementation Guidance" -ForegroundColor Cyan
163
- Write-Host "========================================" -ForegroundColor Cyan
164
- Write-Host ""
165
-
166
- Write-Host "1. Read SPEC.md for full requirements" -ForegroundColor White
167
- Write-Host " - Sections: $($specSections -join ', ')" -ForegroundColor Gray
168
- Write-Host ""
169
- Write-Host "2. Scout existing code" -ForegroundColor White
170
- foreach ($f in $filesToModify) {
171
- if (Test-Path $f) {
172
- Write-Host " - $f (exists - will modify)" -ForegroundColor Gray
173
- } else {
174
- Write-Host " - $f (new file)" -ForegroundColor Green
175
- }
176
- }
177
- Write-Host ""
178
- Write-Host "3. Implement following the steps above" -ForegroundColor White
179
- Write-Host ""
180
- Write-Host "4. Verify implementation" -ForegroundColor White
181
- Write-Host " Run checks marked [ ] above" -ForegroundColor Gray
182
- Write-Host ""
183
-
184
- # ============================================================
185
- # Mark Complete Option
186
- # ============================================================
187
- if ($markDone) {
188
- Write-Host "--- Marking Task Complete ---" -ForegroundColor Yellow
189
- Write-Host ""
190
-
191
- $cmd = "pwsh commands/sdd-task-status.ps1 -TaskId '$targetTask' -Status completed"
192
- Write-Host "Running: $cmd" -ForegroundColor Gray
193
-
194
- try {
195
- Invoke-Expression $cmd
196
- } catch {
197
- Write-Host "[WARN] Could not mark task complete: $_" -ForegroundColor Yellow
198
- }
199
- } else {
200
- Write-Host "--- Mark Complete ---" -ForegroundColor Yellow
201
- Write-Host ""
202
- Write-Host "After implementation, mark task complete:" -ForegroundColor White
203
- Write-Host " pwsh commands/sdd-task-status.ps1 -TaskId '$targetTask' -Status completed" -ForegroundColor Gray
204
- Write-Host ""
205
- Write-Host "Or run with --mark-done:" -ForegroundColor Gray
206
- Write-Host " claude `"/sdd-implement $targetTask --mark-done`"" -ForegroundColor Gray
207
- }
208
-
209
- Write-Host ""
210
- Write-Host "========================================" -ForegroundColor Cyan
211
- Write-Host "Ready to implement $targetTask" -ForegroundColor Green
212
- Write-Host "========================================" -ForegroundColor Cyan