specpulse 1.0.4__py3-none-any.whl → 1.0.6__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 +617 -631
- specpulse/core/specpulse.py +8 -2
- specpulse/resources/commands/claude/plan.md +156 -45
- specpulse/resources/commands/claude/pulse.md +63 -24
- specpulse/resources/commands/claude/spec.md +110 -31
- specpulse/resources/commands/claude/task.md +202 -43
- specpulse/resources/commands/gemini/plan.toml +13 -5
- specpulse/resources/commands/gemini/pulse.toml +4 -1
- specpulse/resources/commands/gemini/spec.toml +12 -4
- specpulse/resources/commands/gemini/task.toml +17 -5
- specpulse/resources/memory/constitution.md +2 -2
- specpulse/resources/scripts/pulse-init.ps1 +186 -0
- specpulse/resources/scripts/pulse-init.py +171 -0
- specpulse/resources/scripts/pulse-init.sh +80 -21
- specpulse/resources/scripts/pulse-plan.ps1 +251 -0
- specpulse/resources/scripts/pulse-plan.py +191 -0
- specpulse/resources/scripts/pulse-plan.sh +113 -12
- specpulse/resources/scripts/pulse-spec.ps1 +185 -0
- specpulse/resources/scripts/pulse-spec.py +167 -0
- specpulse/resources/scripts/pulse-spec.sh +86 -11
- specpulse/resources/scripts/pulse-task.ps1 +263 -0
- specpulse/resources/scripts/pulse-task.py +237 -0
- specpulse/resources/scripts/pulse-task.sh +123 -9
- specpulse/resources/templates/plan.md +142 -287
- specpulse/resources/templates/spec.md +80 -246
- specpulse/resources/templates/task.md +114 -93
- {specpulse-1.0.4.dist-info → specpulse-1.0.6.dist-info}/METADATA +29 -19
- specpulse-1.0.6.dist-info/RECORD +41 -0
- specpulse-1.0.4.dist-info/RECORD +0 -33
- {specpulse-1.0.4.dist-info → specpulse-1.0.6.dist-info}/WHEEL +0 -0
- {specpulse-1.0.4.dist-info → specpulse-1.0.6.dist-info}/entry_points.txt +0 -0
- {specpulse-1.0.4.dist-info → specpulse-1.0.6.dist-info}/licenses/LICENSE +0 -0
- {specpulse-1.0.4.dist-info → specpulse-1.0.6.dist-info}/top_level.txt +0 -0
@@ -1,23 +1,137 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
# Generate task breakdown
|
3
3
|
|
4
|
-
|
4
|
+
set -euo pipefail # Exit on error, unset vars, pipe failures
|
5
5
|
|
6
|
+
# Configuration
|
7
|
+
SCRIPT_NAME="$(basename "$0")"
|
8
|
+
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
9
|
+
|
10
|
+
# Function to log messages
|
11
|
+
log() {
|
12
|
+
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $SCRIPT_NAME: $1" >&2
|
13
|
+
}
|
14
|
+
|
15
|
+
# Function to handle errors
|
16
|
+
error_exit() {
|
17
|
+
log "ERROR: $1"
|
18
|
+
exit 1
|
19
|
+
}
|
20
|
+
|
21
|
+
# Validate arguments
|
22
|
+
if [ $# -eq 0 ]; then
|
23
|
+
error_exit "Usage: $SCRIPT_NAME <feature-dir>"
|
24
|
+
fi
|
25
|
+
|
26
|
+
FEATURE_DIR="$1"
|
27
|
+
|
28
|
+
# Sanitize feature directory
|
29
|
+
SANITIZED_DIR=$(echo "$FEATURE_DIR" | sed 's/[^a-zA-Z0-9_-]//g')
|
30
|
+
|
31
|
+
if [ -z "$SANITIZED_DIR" ]; then
|
32
|
+
error_exit "Invalid feature directory: '$FEATURE_DIR'"
|
33
|
+
fi
|
34
|
+
|
35
|
+
# Find feature directory if not provided
|
6
36
|
if [ -z "$FEATURE_DIR" ]; then
|
7
|
-
|
8
|
-
|
37
|
+
CONTEXT_FILE="$PROJECT_ROOT/memory/context.md"
|
38
|
+
if [ -f "$CONTEXT_FILE" ]; then
|
39
|
+
FEATURE_DIR=$(grep -A1 "Active Feature" "$CONTEXT_FILE" | tail -1 | cut -d: -f2 | xargs)
|
40
|
+
if [ -z "$FEATURE_DIR" ]; then
|
41
|
+
error_exit "No active feature found in context file"
|
42
|
+
fi
|
43
|
+
log "Using active feature from context: $FEATURE_DIR"
|
44
|
+
else
|
45
|
+
error_exit "No feature directory provided and no context file found"
|
46
|
+
fi
|
9
47
|
fi
|
10
48
|
|
11
|
-
TASK_FILE="tasks/${FEATURE_DIR}/tasks.md"
|
49
|
+
TASK_FILE="$PROJECT_ROOT/tasks/${FEATURE_DIR}/tasks.md"
|
50
|
+
TEMPLATE_FILE="$PROJECT_ROOT/templates/task.md"
|
51
|
+
PLAN_FILE="$PROJECT_ROOT/plans/${FEATURE_DIR}/plan.md"
|
52
|
+
SPEC_FILE="$PROJECT_ROOT/specs/${FEATURE_DIR}/spec.md"
|
53
|
+
|
54
|
+
# Ensure tasks directory exists
|
55
|
+
mkdir -p "$(dirname "$TASK_FILE")"
|
56
|
+
|
57
|
+
# Check if specification and plan exist first
|
58
|
+
if [ ! -f "$SPEC_FILE" ]; then
|
59
|
+
error_exit "Specification file not found: $SPEC_FILE. Please create specification first."
|
60
|
+
fi
|
12
61
|
|
13
|
-
|
62
|
+
if [ ! -f "$PLAN_FILE" ]; then
|
63
|
+
error_exit "Implementation plan not found: $PLAN_FILE. Please create plan first."
|
64
|
+
fi
|
65
|
+
|
66
|
+
# Ensure task template exists
|
67
|
+
if [ ! -f "$TEMPLATE_FILE" ]; then
|
68
|
+
error_exit "Template not found: $TEMPLATE_FILE"
|
69
|
+
fi
|
70
|
+
|
71
|
+
# Create task file if it doesn't exist
|
14
72
|
if [ ! -f "$TASK_FILE" ]; then
|
15
|
-
|
73
|
+
log "Creating task breakdown from template: $TASK_FILE"
|
74
|
+
cp "$TEMPLATE_FILE" "$TASK_FILE" || error_exit "Failed to copy task template"
|
75
|
+
else
|
76
|
+
log "Task breakdown already exists: $TASK_FILE"
|
77
|
+
fi
|
78
|
+
|
79
|
+
# Validate task structure
|
80
|
+
log "Validating task breakdown..."
|
81
|
+
|
82
|
+
# Check for required sections
|
83
|
+
REQUIRED_SECTIONS=("## Task List:" "## Task Organization" "## Critical Path" "## Execution Schedule")
|
84
|
+
MISSING_SECTIONS=()
|
85
|
+
|
86
|
+
for section in "${REQUIRED_SECTIONS[@]}"; do
|
87
|
+
if ! grep -q "$section" "$TASK_FILE"; then
|
88
|
+
MISSING_SECTIONS+=("$section")
|
89
|
+
fi
|
90
|
+
done
|
91
|
+
|
92
|
+
if [ ${#MISSING_SECTIONS[@]} -gt 0 ]; then
|
93
|
+
log "WARNING: Missing required sections: ${MISSING_SECTIONS[*]}"
|
94
|
+
fi
|
95
|
+
|
96
|
+
# Count tasks and analyze structure
|
97
|
+
TOTAL_TASKS=$(grep -c "^- \[.\]" "$TASK_FILE" 2>/dev/null || echo "0")
|
98
|
+
COMPLETED_TASKS=$(grep -c "^- \[x\]" "$TASK_FILE" 2>/dev/null || echo "0")
|
99
|
+
PENDING_TASKS=$(grep -c "^- \[ \]" "$TASK_FILE" 2>/dev/null || echo "0")
|
100
|
+
BLOCKED_TASKS=$(grep -c "^- \[!\]" "$TASK_FILE" 2>/dev/null || echo "0")
|
101
|
+
|
102
|
+
# Check for parallel tasks
|
103
|
+
PARALLEL_TASKS=$(grep -c "\[P\]" "$TASK_FILE" 2>/dev/null || echo "0")
|
104
|
+
|
105
|
+
# Check constitutional gates compliance
|
106
|
+
CONSTITUTIONAL_SECTION=$(grep -A 20 "Constitutional Gates Compliance" "$TASK_FILE" 2>/dev/null || echo "")
|
107
|
+
GATES_COUNT=$(echo "$CONSTITUTIONAL_SECTION" | grep -c "\[ \]" 2>/dev/null || echo "0")
|
108
|
+
|
109
|
+
# Check if plan has constitutional gates completed
|
110
|
+
PLAN_GATE_STATUS=$(grep -A5 "Gate Status:" "$PLAN_FILE" | tail -1 | sed 's/.*\[\(.*\)\].*/\1/' || echo "PENDING")
|
111
|
+
|
112
|
+
if [ "$PLAN_GATE_STATUS" != "COMPLETED" ]; then
|
113
|
+
log "WARNING: Implementation plan constitutional gates not completed. Task generation may be premature."
|
114
|
+
fi
|
115
|
+
|
116
|
+
# Calculate completion percentage
|
117
|
+
if [ "$TOTAL_TASKS" -gt 0 ]; then
|
118
|
+
COMPLETION_PERCENTAGE=$((COMPLETED_TASKS * 100 / TOTAL_TASKS))
|
119
|
+
else
|
120
|
+
COMPLETION_PERCENTAGE=0
|
16
121
|
fi
|
17
122
|
|
18
|
-
|
19
|
-
TASK_COUNT=$(grep -c "^- \[" "$TASK_FILE" 2>/dev/null || echo "0")
|
123
|
+
log "Task analysis completed - Total: $TOTAL_TASKS, Completed: $COMPLETED_TASKS ($COMPLETION_PERCENTAGE%), Parallel: $PARALLEL_TASKS"
|
20
124
|
|
125
|
+
# Output comprehensive status
|
21
126
|
echo "TASK_FILE=$TASK_FILE"
|
22
|
-
echo "
|
127
|
+
echo "SPEC_FILE=$SPEC_FILE"
|
128
|
+
echo "PLAN_FILE=$PLAN_FILE"
|
129
|
+
echo "TOTAL_TASKS=$TOTAL_TASKS"
|
130
|
+
echo "COMPLETED_TASKS=$COMPLETED_TASKS"
|
131
|
+
echo "PENDING_TASKS=$PENDING_TASKS"
|
132
|
+
echo "BLOCKED_TASKS=$BLOCKED_TASKS"
|
133
|
+
echo "PARALLEL_TASKS=$PARALLEL_TASKS"
|
134
|
+
echo "CONSTITUTIONAL_GATES_PENDING=$GATES_COUNT"
|
135
|
+
echo "COMPLETION_PERCENTAGE=$COMPLETION_PERCENTAGE"
|
136
|
+
echo "MISSING_SECTIONS=${#MISSING_SECTIONS[@]}"
|
23
137
|
echo "STATUS=generated"
|
@@ -1,13 +1,13 @@
|
|
1
|
-
<!-- SpecPulse Implementation Plan Template
|
2
|
-
<!-- AI Instructions: Generate plan from specification following
|
1
|
+
<!-- SpecPulse Implementation Plan Template v4.0 - AI-Optimized -->
|
2
|
+
<!-- AI Instructions: Generate plan from specification following constitutional gates -->
|
3
3
|
|
4
|
-
# Implementation Plan:
|
4
|
+
# Implementation Plan: {{ feature_name }}
|
5
5
|
|
6
6
|
## Specification Reference
|
7
|
-
- **Spec ID**: SPEC-
|
8
|
-
- **Branch**:
|
9
|
-
- **Generated**:
|
10
|
-
- **Optimization Focus**:
|
7
|
+
- **Spec ID**: SPEC-{{ feature_id }}
|
8
|
+
- **Branch**: {{ branch_name }}
|
9
|
+
- **Generated**: {{ date }}
|
10
|
+
- **Optimization Focus**: {{ optimization_focus | default("SIMPLICITY") }}
|
11
11
|
|
12
12
|
## Phase -1: Pre-Implementation Gates
|
13
13
|
|
@@ -20,8 +20,6 @@
|
|
20
20
|
- [ ] Direct framework usage (no unnecessary wrappers)?
|
21
21
|
- [ ] Single model representation per concept?
|
22
22
|
|
23
|
-
**If any checkbox is unchecked, document in Complexity Tracking below**
|
24
|
-
|
25
23
|
#### Anti-Abstraction Gate (Article VII)
|
26
24
|
- [ ] Using framework features directly?
|
27
25
|
- [ ] No unnecessary abstraction layers?
|
@@ -44,308 +42,165 @@
|
|
44
42
|
- [ ] Library options researched?
|
45
43
|
- [ ] Performance implications documented?
|
46
44
|
- [ ] Security considerations analyzed?
|
47
|
-
- [ ] Trade-offs documented
|
45
|
+
- [ ] Trade-offs documented?
|
48
46
|
|
49
|
-
**Gate Status**:
|
47
|
+
**Gate Status**: {{ gate_status | default("[ ] PENDING") }}
|
50
48
|
|
51
49
|
## Complexity Tracking
|
50
|
+
{% if complexity_exceptions %}
|
51
|
+
{% for exception in complexity_exceptions %}
|
52
|
+
### Exception {{ loop.index }}
|
53
|
+
- **Article**: {{ exception.article }}
|
54
|
+
- **Violation**: {{ exception.violation }}
|
55
|
+
- **Justification**: {{ exception.justification }}
|
56
|
+
- **Mitigation**: {{ exception.mitigation }}
|
57
|
+
{% endfor %}
|
58
|
+
{% else %}
|
59
|
+
No complexity exceptions documented.
|
60
|
+
{% endif %}
|
52
61
|
|
53
|
-
|
54
|
-
```yaml
|
55
|
-
complexity_exceptions:
|
56
|
-
# Example:
|
57
|
-
# - article: VII
|
58
|
-
# violation: "Using 4 modules instead of 3"
|
59
|
-
# justification: "Authentication requires separate service for security isolation"
|
60
|
-
# approved_by: "[Approver]"
|
61
|
-
# date: "[DATE]"
|
62
|
-
```
|
63
|
-
|
64
|
-
### Simplification Opportunities
|
65
|
-
- [ ] Areas identified for future simplification
|
66
|
-
- [ ] Technical debt documented
|
67
|
-
- [ ] Refactoring planned for Phase X
|
62
|
+
## Technology Stack
|
68
63
|
|
69
|
-
|
70
|
-
|
64
|
+
### Core Technologies
|
65
|
+
{% for tech in core_technologies %}
|
66
|
+
- **{{ tech.name }}**: {{ tech.version }} - {{ tech.purpose }}
|
67
|
+
{% endfor %}
|
71
68
|
|
72
|
-
###
|
73
|
-
|
74
|
-
|
75
|
-
|
69
|
+
### Dependencies
|
70
|
+
{% for dep in dependencies %}
|
71
|
+
- **{{ dep.name }}**: {{ dep.reason }}
|
72
|
+
{% endfor %}
|
76
73
|
|
77
|
-
|
78
|
-
- Expected load: [metrics]
|
79
|
-
- Bottlenecks identified: [list]
|
80
|
-
- Optimization strategy: [approach]
|
74
|
+
## Architecture Overview
|
81
75
|
|
82
|
-
###
|
83
|
-
|
84
|
-
|
85
|
-
-
|
76
|
+
### System Components
|
77
|
+
{% for component in components %}
|
78
|
+
#### {{ component.name }}
|
79
|
+
- **Purpose**: {{ component.purpose }}
|
80
|
+
- **Key Features**: {{ component.features }}
|
81
|
+
- **Dependencies**: {{ component.dependencies | join(", ") }}
|
82
|
+
{% endfor %}
|
83
|
+
|
84
|
+
### Data Models
|
85
|
+
{% for model in data_models %}
|
86
|
+
#### {{ model.name }}
|
87
|
+
- **Fields**: {{ model.fields | join(", ") }}
|
88
|
+
- **Relationships**: {{ model.relationships }}
|
89
|
+
- **Validation**: {{ model.validation }}
|
90
|
+
{% endfor %}
|
86
91
|
|
87
|
-
##
|
92
|
+
## Implementation Phases
|
88
93
|
|
89
|
-
###
|
90
|
-
|
91
|
-
[
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
94
|
+
### Phase 0: Critical Path (Week {{ phase_0.weeks | default(1) }})
|
95
|
+
{% for task in phase_0.tasks %}
|
96
|
+
- [ ] {{ task.description }}
|
97
|
+
{% endfor %}
|
98
|
+
|
99
|
+
### Phase 1: Foundation (Week {{ phase_1.weeks | default(2) }})
|
100
|
+
{% for task in phase_1.tasks %}
|
101
|
+
- [ ] {{ task.description }}
|
102
|
+
{% endfor %}
|
103
|
+
|
104
|
+
### Phase 2: Core Features (Week {{ phase_2.weeks | default(3) }})
|
105
|
+
{% for task in phase_2.tasks %}
|
106
|
+
- [ ] {{ task.description }}
|
107
|
+
{% endfor %}
|
108
|
+
|
109
|
+
### Phase 3: Polish (Week {{ phase_3.weeks | default(1) }})
|
110
|
+
{% for task in phase_3.tasks %}
|
111
|
+
- [ ] {{ task.description }}
|
112
|
+
{% endfor %}
|
113
|
+
|
114
|
+
## API Contracts
|
115
|
+
|
116
|
+
### Endpoints
|
117
|
+
{% for endpoint in endpoints %}
|
118
|
+
#### {{ endpoint.method }} {{ endpoint.path }}
|
119
|
+
- **Description**: {{ endpoint.description }}
|
120
|
+
- **Request**: {{ endpoint.request }}
|
121
|
+
- **Response**: {{ endpoint.response }}
|
122
|
+
- **Authentication**: {{ endpoint.auth | default("Required") }}
|
123
|
+
{% endfor %}
|
124
|
+
|
125
|
+
### Data Schemas
|
126
|
+
{% for schema in schemas %}
|
127
|
+
#### {{ schema.name }}
|
128
|
+
```json
|
129
|
+
{{ schema.json | indent(4) }}
|
103
130
|
```
|
131
|
+
{% endfor %}
|
104
132
|
|
105
|
-
|
106
|
-
```mermaid
|
107
|
-
graph TB
|
108
|
-
subgraph "Library Architecture"
|
109
|
-
CLI[CLI Interface] --> Core[Core Library]
|
110
|
-
Core --> Data[Data Layer]
|
111
|
-
Core --> Services[Service Layer]
|
112
|
-
end
|
113
|
-
|
114
|
-
subgraph "Testing Strategy"
|
115
|
-
CT[Contract Tests] --> IT[Integration Tests]
|
116
|
-
IT --> E2E[E2E Tests]
|
117
|
-
E2E --> UT[Unit Tests]
|
118
|
-
end
|
119
|
-
```
|
133
|
+
## Testing Strategy
|
120
134
|
|
121
|
-
|
135
|
+
### Test Categories
|
136
|
+
- **Unit Tests**: {{ testing.unit.target | default("80% coverage") }}
|
137
|
+
- **Integration Tests**: {{ testing.integration.target | default("Critical paths") }}
|
138
|
+
- **E2E Tests**: {{ testing.e2e.target | default("Key user workflows") }}
|
139
|
+
- **Performance Tests**: {{ testing.performance.target | default("Load testing") }}
|
122
140
|
|
123
|
-
###
|
124
|
-
- **
|
125
|
-
- **
|
126
|
-
- **
|
127
|
-
- **Testing**: [Choice] - [Integration capability rationale]
|
141
|
+
### Test Environment
|
142
|
+
- **Database**: {{ testing.environment.database | default("PostgreSQL") }}
|
143
|
+
- **Services**: {{ testing.environment.services | join(", ") }}
|
144
|
+
- **Test Data**: {{ testing.environment.data_strategy | default("Seed with realistic data") }}
|
128
145
|
|
129
|
-
|
130
|
-
- Module 1: [Purpose]
|
131
|
-
- Module 2: [Purpose]
|
132
|
-
- Module 3: [Purpose] (if needed)
|
133
|
-
- **Total Modules**: [2-3] ✓
|
146
|
+
## Security Considerations
|
134
147
|
|
135
|
-
|
148
|
+
### Authentication & Authorization
|
149
|
+
- **Method**: {{ security.auth_method | default("JWT tokens") }}
|
150
|
+
- **Roles**: {{ security.roles | join(", ") }}
|
151
|
+
- **Permissions**: {{ security.permissions_model | default("Role-based access control") }}
|
136
152
|
|
137
|
-
###
|
138
|
-
**
|
139
|
-
**
|
140
|
-
|
141
|
-
1. **Setup Test Environment**
|
142
|
-
- [ ] Real database instance (not mocks)
|
143
|
-
- [ ] Service dependencies running
|
144
|
-
- [ ] Production-like configuration
|
145
|
-
|
146
|
-
2. **Write Contract Tests** (Article VIII priority)
|
147
|
-
```python
|
148
|
-
# contracts/test_api_contract.py
|
149
|
-
def test_api_contract_failing():
|
150
|
-
"""This test MUST fail initially per Article III"""
|
151
|
-
assert False # Red phase
|
152
|
-
```
|
153
|
-
|
154
|
-
3. **Write Integration Tests**
|
155
|
-
```python
|
156
|
-
# integration/test_service_integration.py
|
157
|
-
def test_service_integration_failing():
|
158
|
-
"""Test service with real dependencies"""
|
159
|
-
assert False # Red phase
|
160
|
-
```
|
161
|
-
|
162
|
-
### Phase 1: Library Core Implementation
|
163
|
-
**Duration**: [Estimate]
|
164
|
-
**Gate**: All tests from Phase 0 must be failing
|
165
|
-
|
166
|
-
1. **CLI Interface** (Article II)
|
167
|
-
```python
|
168
|
-
# cli/main.py structure
|
169
|
-
def main():
|
170
|
-
"""Accept text input, produce text output"""
|
171
|
-
pass
|
172
|
-
```
|
173
|
-
|
174
|
-
2. **Core Library** (Article I)
|
175
|
-
- [ ] Minimal implementation to pass first test
|
176
|
-
- [ ] No premature optimization
|
177
|
-
- [ ] Direct framework usage
|
178
|
-
|
179
|
-
3. **Make Tests Pass** (Green phase)
|
180
|
-
- [ ] Contract tests passing
|
181
|
-
- [ ] Integration tests passing
|
182
|
-
- [ ] Refactor while green
|
183
|
-
|
184
|
-
### Phase 2: Feature Completion
|
185
|
-
**Duration**: [Estimate]
|
186
|
-
**Gate**: Core tests passing, ready for features
|
187
|
-
|
188
|
-
1. **User Story Implementation**
|
189
|
-
- [ ] Story 1: [Title] - Tests first, then code
|
190
|
-
- [ ] Story 2: [Title] - Tests first, then code
|
191
|
-
- [ ] Story 3: [Title] - Tests first, then code
|
192
|
-
|
193
|
-
2. **End-to-End Testing**
|
194
|
-
- [ ] Critical path tests with real services
|
195
|
-
- [ ] Performance benchmarks
|
196
|
-
- [ ] Security scenarios
|
197
|
-
|
198
|
-
### Phase 3: Production Readiness
|
199
|
-
**Duration**: [Estimate]
|
200
|
-
**Gate**: All acceptance criteria met
|
201
|
-
|
202
|
-
1. **Documentation** (Article IX - Executable)
|
203
|
-
```markdown
|
204
|
-
# Quick Start (executable)
|
205
|
-
$ pip install feature-lib
|
206
|
-
$ feature-cli --help
|
207
|
-
$ echo "input" | feature-cli process
|
208
|
-
```
|
209
|
-
|
210
|
-
2. **Observability**
|
211
|
-
- [ ] Logging with structure
|
212
|
-
- [ ] Metrics exposed
|
213
|
-
- [ ] Health checks
|
214
|
-
|
215
|
-
3. **Deployment**
|
216
|
-
- [ ] CI/CD pipeline
|
217
|
-
- [ ] Rollback capability
|
218
|
-
- [ ] Feature flags
|
219
|
-
|
220
|
-
## Test-First Development Plan
|
221
|
-
|
222
|
-
### Test Execution Order (Article III & VIII)
|
223
|
-
1. **Contract Tests** → Define boundaries
|
224
|
-
2. **Integration Tests** → Verify interactions
|
225
|
-
3. **E2E Tests** → Validate workflows
|
226
|
-
4. **Unit Tests** → Isolate logic
|
227
|
-
|
228
|
-
### Test Coverage Requirements
|
229
|
-
- Contract Tests: 100% of API surface
|
230
|
-
- Integration Tests: 100% of service interactions
|
231
|
-
- E2E Tests: 100% of critical paths
|
232
|
-
- Unit Tests: 80% of business logic
|
233
|
-
|
234
|
-
### Example Test Structure
|
235
|
-
```python
|
236
|
-
# Step 1: Write failing test (Red)
|
237
|
-
def test_feature_behavior():
|
238
|
-
result = feature.process("input")
|
239
|
-
assert result == "expected" # Fails
|
240
|
-
|
241
|
-
# Step 2: Implement minimum to pass (Green)
|
242
|
-
def process(input):
|
243
|
-
return "expected" # Passes
|
244
|
-
|
245
|
-
# Step 3: Refactor (Refactor)
|
246
|
-
def process(input):
|
247
|
-
# Clean, maintainable implementation
|
248
|
-
return transform(validate(input))
|
249
|
-
```
|
153
|
+
### Data Protection
|
154
|
+
- **Encryption**: {{ security.encryption.transit | default("TLS 1.3") }} in transit, {{ security.encryption.at_rest | default("AES-256") }} at rest
|
155
|
+
- **Compliance**: {{ security.compliance | join(", ") }}
|
250
156
|
|
251
|
-
##
|
252
|
-
|
253
|
-
### Contract: [Feature API]
|
254
|
-
```yaml
|
255
|
-
# contracts/feature-api.yaml
|
256
|
-
openapi: 3.0.0
|
257
|
-
paths:
|
258
|
-
/process:
|
259
|
-
post:
|
260
|
-
request:
|
261
|
-
required: true
|
262
|
-
content:
|
263
|
-
text/plain:
|
264
|
-
schema:
|
265
|
-
type: string
|
266
|
-
responses:
|
267
|
-
'200':
|
268
|
-
content:
|
269
|
-
application/json:
|
270
|
-
schema:
|
271
|
-
type: object
|
272
|
-
```
|
157
|
+
## Deployment Strategy
|
273
158
|
|
274
|
-
###
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
assert "result" in response.json()
|
282
|
-
```
|
159
|
+
### Environments
|
160
|
+
{% for env in environments %}
|
161
|
+
#### {{ env.name }}
|
162
|
+
- **URL**: {{ env.url }}
|
163
|
+
- **Auto-deploy**: {{ env.auto_deploy | default("Manual") }}
|
164
|
+
- **Health Checks**: {{ env.health_checks | default("Basic monitoring") }}
|
165
|
+
{% endfor %}
|
283
166
|
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
# Single, simple model - no premature abstraction
|
289
|
-
@dataclass
|
290
|
-
class Feature:
|
291
|
-
id: str
|
292
|
-
data: str
|
293
|
-
created_at: datetime
|
294
|
-
|
295
|
-
def process(self) -> str:
|
296
|
-
"""Direct, simple processing"""
|
297
|
-
return self.data.upper() # No unnecessary layers
|
298
|
-
```
|
167
|
+
### Rollback Plan
|
168
|
+
- **Strategy**: {{ rollback.strategy | default("Blue-green deployment") }}
|
169
|
+
- **Triggers**: {{ rollback.triggers | join(", ") }}
|
170
|
+
- **Recovery Time**: {{ rollback.recovery_time | default("< 5 minutes") }}
|
299
171
|
|
300
|
-
##
|
172
|
+
## Success Criteria
|
301
173
|
|
302
|
-
###
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
| Premature optimization | Start simple, measure first |
|
307
|
-
| Abstraction creep | Direct framework usage required |
|
174
|
+
### Must-Have Metrics
|
175
|
+
{% for metric in success_criteria.must %}
|
176
|
+
- {{ metric.name }}: {{ metric.target }} ({{ metric.measurement }})
|
177
|
+
{% endfor %}
|
308
178
|
|
309
|
-
###
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
| Mock overuse | Real services required |
|
314
|
-
| Low coverage | Coverage gates enforced |
|
179
|
+
### Should-Have Metrics
|
180
|
+
{% for metric in success_criteria.should %}
|
181
|
+
- {{ metric.name }}: {{ metric.target }} ({{ metric.measurement }})
|
182
|
+
{% endfor %}
|
315
183
|
|
316
|
-
##
|
184
|
+
## Risk Assessment
|
185
|
+
|
186
|
+
| Risk | Probability | Impact | Mitigation | Owner |
|
187
|
+
|------|------------|--------|------------|-------|
|
188
|
+
{% for risk in risks %}
|
189
|
+
| {{ risk.description }} | {{ risk.probability }} | {{ risk.impact }} | {{ risk.mitigation }} | {{ risk.owner }} |
|
190
|
+
{% endfor %}
|
191
|
+
|
192
|
+
## Monitoring & Observability
|
193
|
+
|
194
|
+
### Key Metrics
|
195
|
+
{% for metric in monitoring.metrics %}
|
196
|
+
- **{{ metric.name }}**: {{ metric.target }} ({{ metric.unit }})
|
197
|
+
{% endfor %}
|
317
198
|
|
318
|
-
###
|
319
|
-
-
|
320
|
-
-
|
321
|
-
- [ ] Test-First cycle followed
|
322
|
-
- [ ] Library-First architecture
|
323
|
-
|
324
|
-
### Functional Completion
|
325
|
-
- [ ] All user stories implemented
|
326
|
-
- [ ] Acceptance criteria met
|
327
|
-
- [ ] Contract tests passing
|
328
|
-
- [ ] E2E scenarios validated
|
329
|
-
|
330
|
-
### Quality Metrics
|
331
|
-
- [ ] Test coverage > 80%
|
332
|
-
- [ ] Performance targets met
|
333
|
-
- [ ] Security audit passed
|
334
|
-
- [ ] Documentation executable
|
335
|
-
|
336
|
-
## Continuous Refinement (Article V)
|
337
|
-
|
338
|
-
### Specification Feedback Loop
|
339
|
-
- [ ] Implementation discoveries documented
|
340
|
-
- [ ] Specification updated with learnings
|
341
|
-
- [ ] [NEEDS CLARIFICATION] items resolved
|
342
|
-
- [ ] Future improvements noted
|
343
|
-
|
344
|
-
### Post-Implementation Review
|
345
|
-
- [ ] Complexity assessment
|
346
|
-
- [ ] Simplification opportunities
|
347
|
-
- [ ] Architecture decisions validated
|
348
|
-
- [ ] Constitution compliance verified
|
199
|
+
### Alerting
|
200
|
+
- **Critical Alerts**: {{ monitoring.alerts.critical | join(", ") }}
|
201
|
+
- **Warning Alerts**: {{ monitoring.alerts.warnings | join(", ") }}
|
349
202
|
|
350
203
|
---
|
351
|
-
**
|
204
|
+
**Generated by**: {{ ai_assistant }} on {{ date }}
|
205
|
+
**Constitutional Gates**: {{ gate_status | default("PENDING") }}
|
206
|
+
**Next Steps**: Use `/task` to break down into executable tasks
|