specpulse 1.3.4__py3-none-any.whl → 1.4.1__py3-none-any.whl

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,166 +1,166 @@
1
- # Generate task breakdown - PowerShell Version
2
-
3
- param(
4
- [Parameter(Mandatory=$true, Position=0)]
5
- [string]$FeatureDir
6
- )
7
-
8
- # Configuration
9
- $ScriptName = Split-Path -Leaf $PSCommandPath
10
- $ScriptDir = Split-Path -Parent $PSCommandPath
11
- $ProjectRoot = Split-Path -Parent $ScriptDir
12
-
13
- # Logging function
14
- function Log-Message {
15
- param([string]$Message)
16
- $timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
17
- Write-Host "[$timestamp] ${ScriptName}: $Message" -ForegroundColor Cyan
18
- }
19
-
20
- # Error handling function
21
- function Exit-WithError {
22
- param([string]$Message)
23
- Write-Host "ERROR: $Message" -ForegroundColor Red
24
- exit 1
25
- }
26
-
27
- # Extract feature ID
28
- $FeatureId = if ($FeatureDir -match '^(\d{3})') { $Matches[1] } else { "001" }
29
-
30
- # Sanitize feature directory
31
- $SanitizedDir = $FeatureDir -replace '[^a-zA-Z0-9_-]', ''
32
-
33
- if ([string]::IsNullOrEmpty($SanitizedDir)) {
34
- Exit-WithError "Invalid feature directory: '$FeatureDir'"
35
- }
36
-
37
- $TaskDir = Join-Path $ProjectRoot "tasks\$FeatureDir"
38
- $PlanDir = Join-Path $ProjectRoot "plans\$FeatureDir"
39
- $SpecDir = Join-Path $ProjectRoot "specs\$FeatureDir"
40
- $TemplateFile = Join-Path $ProjectRoot "templates\task.md"
41
-
42
- # Ensure tasks directory exists
43
- if (-not (Test-Path $TaskDir)) {
44
- New-Item -ItemType Directory -Path $TaskDir -Force | Out-Null
45
- }
46
-
47
- # Find latest spec file
48
- if (Test-Path $SpecDir) {
49
- $SpecFile = Get-ChildItem -Path $SpecDir -Filter "spec-*.md" -ErrorAction SilentlyContinue |
50
- Sort-Object LastWriteTime -Descending |
51
- Select-Object -First 1
52
-
53
- if (-not $SpecFile) {
54
- Exit-WithError "No specification files found in $SpecDir. Please create specification first."
55
- }
56
- $SpecFile = $SpecFile.FullName
57
- } else {
58
- Exit-WithError "Specifications directory not found: $SpecDir. Please create specification first."
59
- }
60
-
61
- # Find latest plan file
62
- if (Test-Path $PlanDir) {
63
- $PlanFile = Get-ChildItem -Path $PlanDir -Filter "plan-*.md" -ErrorAction SilentlyContinue |
64
- Sort-Object LastWriteTime -Descending |
65
- Select-Object -First 1
66
-
67
- if (-not $PlanFile) {
68
- Exit-WithError "No plan files found in $PlanDir. Please create plan first."
69
- }
70
- $PlanFile = $PlanFile.FullName
71
- } else {
72
- Exit-WithError "Plans directory not found: $PlanDir. Please create plan first."
73
- }
74
-
75
- # Find next available task number or create new one
76
- $existingTasks = Get-ChildItem -Path $TaskDir -Filter "task-*.md" -ErrorAction SilentlyContinue
77
- $taskNumber = if ($existingTasks) { $existingTasks.Count + 1 } else { 1 }
78
- $TaskFile = Join-Path $TaskDir ("task-{0:D3}.md" -f $taskNumber)
79
-
80
- # Ensure task template exists
81
- if (-not (Test-Path $TemplateFile)) {
82
- Exit-WithError "Template not found: $TemplateFile"
83
- }
84
-
85
- # Create task file
86
- Log-Message "Creating task breakdown from template: $TaskFile"
87
- try {
88
- Copy-Item -Path $TemplateFile -Destination $TaskFile -Force
89
- } catch {
90
- Exit-WithError "Failed to copy task template: $_"
91
- }
92
-
93
- # Validate task structure
94
- Log-Message "Validating task breakdown..."
95
-
96
- # Check for required sections
97
- $RequiredSections = @(
98
- "## Task List:",
99
- "## Task Organization",
100
- "## Critical Path",
101
- "## Execution Schedule"
102
- )
103
-
104
- $content = Get-Content -Path $TaskFile -Raw
105
- $MissingSections = @()
106
-
107
- foreach ($section in $RequiredSections) {
108
- if ($content -notmatch [regex]::Escape($section)) {
109
- $MissingSections += $section
110
- }
111
- }
112
-
113
- if ($MissingSections.Count -gt 0) {
114
- Log-Message "WARNING: Missing required sections: $($MissingSections -join ', ')"
115
- }
116
-
117
- # Count tasks and analyze structure
118
- $TotalTasks = ([regex]::Matches($content, "^- \[.\]", [System.Text.RegularExpressions.RegexOptions]::Multiline)).Count
119
- $CompletedTasks = ([regex]::Matches($content, "^- \[x\]", [System.Text.RegularExpressions.RegexOptions]::Multiline)).Count
120
- $PendingTasks = ([regex]::Matches($content, "^- \[ \]", [System.Text.RegularExpressions.RegexOptions]::Multiline)).Count
121
- $BlockedTasks = ([regex]::Matches($content, "^- \[!\]", [System.Text.RegularExpressions.RegexOptions]::Multiline)).Count
122
-
123
- # Check for parallel tasks
124
- $ParallelTasks = ([regex]::Matches($content, "\[P\]")).Count
125
-
126
- # Check constitutional gates compliance
127
- $GatesCount = 0
128
- if ($content -match "Constitutional Gates Compliance") {
129
- $gatesSection = $content.Substring($content.IndexOf("Constitutional Gates Compliance"))
130
- if ($gatesSection.Length -gt 0) {
131
- $GatesCount = ([regex]::Matches($gatesSection.Substring(0, [Math]::Min(1000, $gatesSection.Length)), "\[ \]")).Count
132
- }
133
- }
134
-
135
- # Check if plan has constitutional gates completed
136
- $planContent = Get-Content -Path $PlanFile -Raw
137
- $PlanGateStatus = "PENDING"
138
- if ($planContent -match "Gate Status:.*\[(.*?)\]") {
139
- $PlanGateStatus = $Matches[1]
140
- }
141
-
142
- if ($PlanGateStatus -ne "COMPLETED") {
143
- Log-Message "WARNING: Implementation plan constitutional gates not completed. Task generation may be premature."
144
- }
145
-
146
- # Calculate completion percentage
147
- $CompletionPercentage = 0
148
- if ($TotalTasks -gt 0) {
149
- $CompletionPercentage = [math]::Round(($CompletedTasks * 100) / $TotalTasks)
150
- }
151
-
152
- Log-Message "Task analysis completed - Total: $TotalTasks, Completed: $CompletedTasks ($CompletionPercentage%), Parallel: $ParallelTasks"
153
-
154
- # Output comprehensive status
155
- Write-Output "TASK_FILE=$TaskFile"
156
- Write-Output "SPEC_FILE=$SpecFile"
157
- Write-Output "PLAN_FILE=$PlanFile"
158
- Write-Output "TOTAL_TASKS=$TotalTasks"
159
- Write-Output "COMPLETED_TASKS=$CompletedTasks"
160
- Write-Output "PENDING_TASKS=$PendingTasks"
161
- Write-Output "BLOCKED_TASKS=$BlockedTasks"
162
- Write-Output "PARALLEL_TASKS=$ParallelTasks"
163
- Write-Output "CONSTITUTIONAL_GATES_PENDING=$GatesCount"
164
- Write-Output "COMPLETION_PERCENTAGE=$CompletionPercentage"
165
- Write-Output "MISSING_SECTIONS=$($MissingSections.Count)"
1
+ # Generate task breakdown - PowerShell Version
2
+
3
+ param(
4
+ [Parameter(Mandatory=$true, Position=0)]
5
+ [string]$FeatureDir
6
+ )
7
+
8
+ # Configuration
9
+ $ScriptName = Split-Path -Leaf $PSCommandPath
10
+ $ScriptDir = Split-Path -Parent $PSCommandPath
11
+ $ProjectRoot = Split-Path -Parent $ScriptDir
12
+
13
+ # Logging function
14
+ function Log-Message {
15
+ param([string]$Message)
16
+ $timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
17
+ Write-Host "[$timestamp] ${ScriptName}: $Message" -ForegroundColor Cyan
18
+ }
19
+
20
+ # Error handling function
21
+ function Exit-WithError {
22
+ param([string]$Message)
23
+ Write-Host "ERROR: $Message" -ForegroundColor Red
24
+ exit 1
25
+ }
26
+
27
+ # Extract feature ID
28
+ $FeatureId = if ($FeatureDir -match '^(\d{3})') { $Matches[1] } else { "001" }
29
+
30
+ # Sanitize feature directory
31
+ $SanitizedDir = $FeatureDir -replace '[^a-zA-Z0-9_-]', ''
32
+
33
+ if ([string]::IsNullOrEmpty($SanitizedDir)) {
34
+ Exit-WithError "Invalid feature directory: '$FeatureDir'"
35
+ }
36
+
37
+ $TaskDir = Join-Path $ProjectRoot "tasks\$FeatureDir"
38
+ $PlanDir = Join-Path $ProjectRoot "plans\$FeatureDir"
39
+ $SpecDir = Join-Path $ProjectRoot "specs\$FeatureDir"
40
+ $TemplateFile = Join-Path $ProjectRoot "templates\task.md"
41
+
42
+ # Ensure tasks directory exists
43
+ if (-not (Test-Path $TaskDir)) {
44
+ New-Item -ItemType Directory -Path $TaskDir -Force | Out-Null
45
+ }
46
+
47
+ # Find latest spec file
48
+ if (Test-Path $SpecDir) {
49
+ $SpecFile = Get-ChildItem -Path $SpecDir -Filter "spec-*.md" -ErrorAction SilentlyContinue |
50
+ Sort-Object LastWriteTime -Descending |
51
+ Select-Object -First 1
52
+
53
+ if (-not $SpecFile) {
54
+ Exit-WithError "No specification files found in $SpecDir. Please create specification first."
55
+ }
56
+ $SpecFile = $SpecFile.FullName
57
+ } else {
58
+ Exit-WithError "Specifications directory not found: $SpecDir. Please create specification first."
59
+ }
60
+
61
+ # Find latest plan file
62
+ if (Test-Path $PlanDir) {
63
+ $PlanFile = Get-ChildItem -Path $PlanDir -Filter "plan-*.md" -ErrorAction SilentlyContinue |
64
+ Sort-Object LastWriteTime -Descending |
65
+ Select-Object -First 1
66
+
67
+ if (-not $PlanFile) {
68
+ Exit-WithError "No plan files found in $PlanDir. Please create plan first."
69
+ }
70
+ $PlanFile = $PlanFile.FullName
71
+ } else {
72
+ Exit-WithError "Plans directory not found: $PlanDir. Please create plan first."
73
+ }
74
+
75
+ # Find next available task number or create new one
76
+ $existingTasks = Get-ChildItem -Path $TaskDir -Filter "task-*.md" -ErrorAction SilentlyContinue
77
+ $taskNumber = if ($existingTasks) { $existingTasks.Count + 1 } else { 1 }
78
+ $TaskFile = Join-Path $TaskDir ("task-{0:D3}.md" -f $taskNumber)
79
+
80
+ # Ensure task template exists
81
+ if (-not (Test-Path $TemplateFile)) {
82
+ Exit-WithError "Template not found: $TemplateFile"
83
+ }
84
+
85
+ # Create task file
86
+ Log-Message "Creating task breakdown from template: $TaskFile"
87
+ try {
88
+ Copy-Item -Path $TemplateFile -Destination $TaskFile -Force
89
+ } catch {
90
+ Exit-WithError "Failed to copy task template: $_"
91
+ }
92
+
93
+ # Validate task structure
94
+ Log-Message "Validating task breakdown..."
95
+
96
+ # Check for required sections
97
+ $RequiredSections = @(
98
+ "## Task List:",
99
+ "## Task Organization",
100
+ "## Critical Path",
101
+ "## Execution Schedule"
102
+ )
103
+
104
+ $content = Get-Content -Path $TaskFile -Raw
105
+ $MissingSections = @()
106
+
107
+ foreach ($section in $RequiredSections) {
108
+ if ($content -notmatch [regex]::Escape($section)) {
109
+ $MissingSections += $section
110
+ }
111
+ }
112
+
113
+ if ($MissingSections.Count -gt 0) {
114
+ Log-Message "WARNING: Missing required sections: $($MissingSections -join ', ')"
115
+ }
116
+
117
+ # Count tasks and analyze structure
118
+ $TotalTasks = ([regex]::Matches($content, "^- \[.\]", [System.Text.RegularExpressions.RegexOptions]::Multiline)).Count
119
+ $CompletedTasks = ([regex]::Matches($content, "^- \[x\]", [System.Text.RegularExpressions.RegexOptions]::Multiline)).Count
120
+ $PendingTasks = ([regex]::Matches($content, "^- \[ \]", [System.Text.RegularExpressions.RegexOptions]::Multiline)).Count
121
+ $BlockedTasks = ([regex]::Matches($content, "^- \[!\]", [System.Text.RegularExpressions.RegexOptions]::Multiline)).Count
122
+
123
+ # Check for parallel tasks
124
+ $ParallelTasks = ([regex]::Matches($content, "\[P\]")).Count
125
+
126
+ # Check SDD gates compliance
127
+ $GatesCount = 0
128
+ if ($content -match "SDD Gates Compliance") {
129
+ $gatesSection = $content.Substring($content.IndexOf("SDD Gates Compliance"))
130
+ if ($gatesSection.Length -gt 0) {
131
+ $GatesCount = ([regex]::Matches($gatesSection.Substring(0, [Math]::Min(1000, $gatesSection.Length)), "\[ \]")).Count
132
+ }
133
+ }
134
+
135
+ # Check if plan has SDD gates completed
136
+ $planContent = Get-Content -Path $PlanFile -Raw
137
+ $PlanGateStatus = "PENDING"
138
+ if ($planContent -match "Gate Status:.*\[(.*?)\]") {
139
+ $PlanGateStatus = $Matches[1]
140
+ }
141
+
142
+ if ($PlanGateStatus -ne "COMPLETED") {
143
+ Log-Message "WARNING: Implementation plan SDD gates not completed. Task generation may be premature."
144
+ }
145
+
146
+ # Calculate completion percentage
147
+ $CompletionPercentage = 0
148
+ if ($TotalTasks -gt 0) {
149
+ $CompletionPercentage = [math]::Round(($CompletedTasks * 100) / $TotalTasks)
150
+ }
151
+
152
+ Log-Message "Task analysis completed - Total: $TotalTasks, Completed: $CompletedTasks ($CompletionPercentage%), Parallel: $ParallelTasks"
153
+
154
+ # Output comprehensive status
155
+ Write-Output "TASK_FILE=$TaskFile"
156
+ Write-Output "SPEC_FILE=$SpecFile"
157
+ Write-Output "PLAN_FILE=$PlanFile"
158
+ Write-Output "TOTAL_TASKS=$TotalTasks"
159
+ Write-Output "COMPLETED_TASKS=$CompletedTasks"
160
+ Write-Output "PENDING_TASKS=$PendingTasks"
161
+ Write-Output "BLOCKED_TASKS=$BlockedTasks"
162
+ Write-Output "PARALLEL_TASKS=$ParallelTasks"
163
+ Write-Output "SDD_GATES_PENDING=$GatesCount"
164
+ Write-Output "COMPLETION_PERCENTAGE=$CompletionPercentage"
165
+ Write-Output "MISSING_SECTIONS=$($MissingSections.Count)"
166
166
  Write-Output "STATUS=generated"
@@ -109,15 +109,15 @@ BLOCKED_TASKS=$(grep -c "^- \[!\]" "$TASK_FILE" 2>/dev/null || echo "0")
109
109
  # Check for parallel tasks
110
110
  PARALLEL_TASKS=$(grep -c "\[P\]" "$TASK_FILE" 2>/dev/null || echo "0")
111
111
 
112
- # Check constitutional gates compliance
113
- CONSTITUTIONAL_SECTION=$(grep -A 20 "Constitutional Gates Compliance" "$TASK_FILE" 2>/dev/null || echo "")
114
- GATES_COUNT=$(echo "$CONSTITUTIONAL_SECTION" | grep -c "\[ \]" 2>/dev/null || echo "0")
112
+ # Check SDD gates compliance
113
+ SDD_SECTION=$(grep -A 20 "SDD Gates Compliance" "$TASK_FILE" 2>/dev/null || echo "")
114
+ GATES_COUNT=$(echo "$SDD_SECTION" | grep -c "\[ \]" 2>/dev/null || echo "0")
115
115
 
116
- # Check if plan has constitutional gates completed
116
+ # Check if plan has SDD gates completed
117
117
  PLAN_GATE_STATUS=$(grep -A5 "Gate Status:" "$PLAN_FILE" | tail -1 | sed 's/.*\[\(.*\)\].*/\1/' || echo "PENDING")
118
118
 
119
119
  if [ "$PLAN_GATE_STATUS" != "COMPLETED" ]; then
120
- log "WARNING: Implementation plan constitutional gates not completed. Task generation may be premature."
120
+ log "WARNING: Implementation plan SDD gates not completed. Task generation may be premature."
121
121
  fi
122
122
 
123
123
  # Calculate completion percentage
@@ -137,7 +137,7 @@ echo "COMPLETED_TASKS=$COMPLETED_TASKS"
137
137
  echo "PENDING_TASKS=$PENDING_TASKS"
138
138
  echo "BLOCKED_TASKS=$BLOCKED_TASKS"
139
139
  echo "PARALLEL_TASKS=$PARALLEL_TASKS"
140
- echo "CONSTITUTIONAL_GATES_PENDING=$GATES_COUNT"
140
+ echo "SDD_GATES_PENDING=$GATES_COUNT"
141
141
  echo "COMPLETION_PERCENTAGE=$COMPLETION_PERCENTAGE"
142
142
  echo "MISSING_SECTIONS=${#MISSING_SECTIONS[@]}"
143
143
  echo "STATUS=generated"
@@ -112,11 +112,12 @@ dependencies:
112
112
  ### Rollback Plan
113
113
  {{ rollback_plan }}
114
114
 
115
- ## Constitutional Compliance
116
- - [ ] Each integration point ≤ 3 dependencies (Article I: Simplicity)
117
- - [ ] Contract tests defined (Article III: Test-First)
118
- - [ ] Real services over mocks (Article VIII: Framework Selection)
119
- - [ ] Security at integration points (Article V: Security by Design)
115
+ ## SDD Compliance
116
+ - [ ] Specifications for each integration point (Principle 1: Specification First)
117
+ - [ ] Phased integration approach (Principle 2: Incremental Planning)
118
+ - [ ] Contract tests defined (Principle 6: Quality Assurance)
119
+ - [ ] Architecture decisions documented (Principle 7: Architecture Documentation)
120
+ - [ ] Stakeholder communication plan (Principle 9: Stakeholder Alignment)
120
121
 
121
122
  ## Risk Assessment
122
123
 
@@ -21,11 +21,12 @@
21
21
 
22
22
  {{ integration_points }}
23
23
 
24
- ## Constitutional Compliance
25
- - [ ] Each service 3 core modules (Article I: Simplicity)
26
- - [ ] Single responsibility per service (Article V)
27
- - [ ] Clear test boundaries defined (Article III)
28
- - [ ] Framework selection documented (Article VIII)
24
+ ## SDD Compliance
25
+ - [ ] Service specifications clear (Principle 1: Specification First)
26
+ - [ ] Phased service rollout planned (Principle 2: Incremental Planning)
27
+ - [ ] Service tasks decomposed (Principle 3: Task Decomposition)
28
+ - [ ] Test strategy defined per service (Principle 6: Quality Assurance)
29
+ - [ ] Architecture decisions documented (Principle 7: Architecture Documentation)
29
30
 
30
31
  ## Next Steps
31
32
  1. Review service boundaries with team
@@ -151,11 +151,12 @@
151
151
  ### Libraries
152
152
  {{ libraries }}
153
153
 
154
- ## Constitutional Compliance
155
- - [ ] Service has single responsibility (Article V)
156
- - [ ] 3 core modules (Article I: Simplicity)
157
- - [ ] Tests before implementation (Article III)
158
- - [ ] Direct framework usage (Article VIII)
154
+ ## SDD Compliance
155
+ - [ ] Service specifications clear (Principle 1: Specification First)
156
+ - [ ] Phased implementation plan (Principle 2: Incremental Planning)
157
+ - [ ] Tasks properly decomposed (Principle 3: Task Decomposition)
158
+ - [ ] Test strategy defined (Principle 6: Quality Assurance)
159
+ - [ ] Architecture documented (Principle 7: Architecture Documentation)
159
160
 
160
161
  ## Risk Assessment
161
162
  {{ risks }}