specpulse 1.3.3__py3-none-any.whl → 1.4.0__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.
- specpulse/__init__.py +1 -1
- specpulse/cli/main.py +32 -6
- specpulse/core/specpulse.py +24 -90
- specpulse/core/validator.py +38 -34
- specpulse/resources/commands/claude/sp-decompose.md +17 -17
- specpulse/resources/commands/claude/sp-plan.md +47 -47
- specpulse/resources/commands/claude/sp-pulse.md +10 -10
- specpulse/resources/commands/claude/sp-spec.md +15 -10
- specpulse/resources/commands/claude/sp-task.md +15 -15
- specpulse/resources/commands/gemini/sp-plan.toml +17 -17
- specpulse/resources/memory/constitution.md +237 -128
- specpulse/resources/scripts/sp-pulse-init.ps1 +131 -0
- specpulse/resources/scripts/sp-pulse-plan.ps1 +147 -0
- specpulse/resources/scripts/sp-pulse-plan.sh +131 -127
- specpulse/resources/scripts/sp-pulse-spec.ps1 +126 -0
- specpulse/resources/scripts/sp-pulse-task.ps1 +166 -0
- specpulse/resources/scripts/sp-pulse-task.sh +6 -6
- specpulse/resources/templates/decomposition/integration-plan.md +6 -5
- specpulse/resources/templates/decomposition/microservices.md +6 -5
- specpulse/resources/templates/decomposition/service-plan.md +6 -5
- specpulse/resources/templates/plan.md +229 -205
- specpulse/resources/templates/task.md +165 -165
- specpulse/utils/version_check.py +128 -0
- {specpulse-1.3.3.dist-info → specpulse-1.4.0.dist-info}/METADATA +70 -29
- {specpulse-1.3.3.dist-info → specpulse-1.4.0.dist-info}/RECORD +29 -24
- {specpulse-1.3.3.dist-info → specpulse-1.4.0.dist-info}/WHEEL +0 -0
- {specpulse-1.3.3.dist-info → specpulse-1.4.0.dist-info}/entry_points.txt +0 -0
- {specpulse-1.3.3.dist-info → specpulse-1.4.0.dist-info}/licenses/LICENSE +0 -0
- {specpulse-1.3.3.dist-info → specpulse-1.4.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +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 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
|
+
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
|
113
|
-
|
114
|
-
GATES_COUNT=$(echo "$
|
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
|
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
|
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 "
|
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
|
-
##
|
116
|
-
- [ ]
|
117
|
-
- [ ]
|
118
|
-
- [ ]
|
119
|
-
- [ ]
|
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
|
-
##
|
25
|
-
- [ ]
|
26
|
-
- [ ]
|
27
|
-
- [ ]
|
28
|
-
- [ ]
|
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
|
-
##
|
155
|
-
- [ ] Service
|
156
|
-
- [ ]
|
157
|
-
- [ ]
|
158
|
-
- [ ]
|
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 }}
|