specweave 0.3.13 → 0.4.0
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/CLAUDE.md +17 -1
- package/README.md +1 -1
- package/bin/install-all.sh +9 -2
- package/bin/install-hooks.sh +57 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +55 -0
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/core/agent-model-manager.d.ts +52 -0
- package/dist/core/agent-model-manager.d.ts.map +1 -0
- package/dist/core/agent-model-manager.js +120 -0
- package/dist/core/agent-model-manager.js.map +1 -0
- package/dist/core/cost-tracker.d.ts +108 -0
- package/dist/core/cost-tracker.d.ts.map +1 -0
- package/dist/core/cost-tracker.js +281 -0
- package/dist/core/cost-tracker.js.map +1 -0
- package/dist/core/model-selector.d.ts +57 -0
- package/dist/core/model-selector.d.ts.map +1 -0
- package/dist/core/model-selector.js +115 -0
- package/dist/core/model-selector.js.map +1 -0
- package/dist/core/phase-detector.d.ts +62 -0
- package/dist/core/phase-detector.d.ts.map +1 -0
- package/dist/core/phase-detector.js +229 -0
- package/dist/core/phase-detector.js.map +1 -0
- package/dist/types/cost-tracking.d.ts +43 -0
- package/dist/types/cost-tracking.d.ts.map +1 -0
- package/dist/types/cost-tracking.js +8 -0
- package/dist/types/cost-tracking.js.map +1 -0
- package/dist/types/model-selection.d.ts +53 -0
- package/dist/types/model-selection.d.ts.map +1 -0
- package/dist/types/model-selection.js +12 -0
- package/dist/types/model-selection.js.map +1 -0
- package/dist/utils/cost-reporter.d.ts +58 -0
- package/dist/utils/cost-reporter.d.ts.map +1 -0
- package/dist/utils/cost-reporter.js +224 -0
- package/dist/utils/cost-reporter.js.map +1 -0
- package/dist/utils/pricing-constants.d.ts +70 -0
- package/dist/utils/pricing-constants.d.ts.map +1 -0
- package/dist/utils/pricing-constants.js +71 -0
- package/dist/utils/pricing-constants.js.map +1 -0
- package/package.json +1 -1
- package/src/agents/architect/AGENT.md +3 -0
- package/src/agents/code-reviewer.md +156 -0
- package/src/agents/data-scientist/AGENT.md +181 -0
- package/src/agents/database-optimizer/AGENT.md +147 -0
- package/src/agents/devops/AGENT.md +3 -0
- package/src/agents/diagrams-architect/AGENT.md +3 -0
- package/src/agents/docs-writer/AGENT.md +3 -0
- package/src/agents/kubernetes-architect/AGENT.md +142 -0
- package/src/agents/ml-engineer/AGENT.md +150 -0
- package/src/agents/mlops-engineer/AGENT.md +201 -0
- package/src/agents/network-engineer/AGENT.md +149 -0
- package/src/agents/observability-engineer/AGENT.md +213 -0
- package/src/agents/payment-integration/AGENT.md +35 -0
- package/src/agents/performance/AGENT.md +3 -0
- package/src/agents/performance-engineer/AGENT.md +153 -0
- package/src/agents/pm/AGENT.md +3 -0
- package/src/agents/qa-lead/AGENT.md +3 -0
- package/src/agents/security/AGENT.md +3 -0
- package/src/agents/sre/AGENT.md +3 -0
- package/src/agents/tdd-orchestrator/AGENT.md +169 -0
- package/src/agents/tech-lead/AGENT.md +3 -0
- package/src/commands/specweave.costs.md +261 -0
- package/src/commands/specweave.ml-pipeline.md +292 -0
- package/src/commands/specweave.monitor-setup.md +501 -0
- package/src/commands/specweave.slo-implement.md +1055 -0
- package/src/commands/specweave.sync-github.md +1 -1
- package/src/commands/specweave.tdd-cycle.md +199 -0
- package/src/commands/specweave.tdd-green.md +842 -0
- package/src/commands/specweave.tdd-red.md +135 -0
- package/src/commands/specweave.tdd-refactor.md +165 -0
- package/src/skills/SKILLS-INDEX.md +18 -10
- package/src/skills/billing-automation/SKILL.md +559 -0
- package/src/skills/distributed-tracing/SKILL.md +438 -0
- package/src/skills/e2e-playwright/README.md +1 -1
- package/src/skills/e2e-playwright/package.json +1 -1
- package/src/skills/gitops-workflow/SKILL.md +285 -0
- package/src/skills/gitops-workflow/references/argocd-setup.md +134 -0
- package/src/skills/gitops-workflow/references/sync-policies.md +131 -0
- package/src/skills/grafana-dashboards/SKILL.md +369 -0
- package/src/skills/helm-chart-scaffolding/SKILL.md +544 -0
- package/src/skills/helm-chart-scaffolding/assets/Chart.yaml.template +42 -0
- package/src/skills/helm-chart-scaffolding/assets/values.yaml.template +185 -0
- package/src/skills/helm-chart-scaffolding/references/chart-structure.md +500 -0
- package/src/skills/helm-chart-scaffolding/scripts/validate-chart.sh +244 -0
- package/src/skills/k8s-manifest-generator/SKILL.md +511 -0
- package/src/skills/k8s-manifest-generator/assets/configmap-template.yaml +296 -0
- package/src/skills/k8s-manifest-generator/assets/deployment-template.yaml +203 -0
- package/src/skills/k8s-manifest-generator/assets/service-template.yaml +171 -0
- package/src/skills/k8s-manifest-generator/references/deployment-spec.md +753 -0
- package/src/skills/k8s-manifest-generator/references/service-spec.md +724 -0
- package/src/skills/k8s-security-policies/SKILL.md +334 -0
- package/src/skills/k8s-security-policies/assets/network-policy-template.yaml +177 -0
- package/src/skills/k8s-security-policies/references/rbac-patterns.md +187 -0
- package/src/skills/ml-pipeline-workflow/SKILL.md +245 -0
- package/src/skills/paypal-integration/SKILL.md +467 -0
- package/src/skills/pci-compliance/SKILL.md +466 -0
- package/src/skills/prometheus-configuration/SKILL.md +392 -0
- package/src/skills/slo-implementation/SKILL.md +329 -0
- package/src/skills/stripe-integration/SKILL.md +442 -0
- package/src/skills/tdd-workflow/SKILL.md +378 -0
- package/src/templates/README.md.template +1 -1
- package/src/skills/bmad-method-expert/SKILL.md +0 -626
- package/src/skills/bmad-method-expert/scripts/analyze-project.js +0 -318
- package/src/skills/bmad-method-expert/scripts/check-setup.js +0 -208
- package/src/skills/bmad-method-expert/scripts/generate-template.js +0 -1149
- package/src/skills/bmad-method-expert/scripts/validate-documents.js +0 -340
- package/src/skills/context-optimizer/SKILL.md +0 -588
- package/src/skills/figma-designer/SKILL.md +0 -149
- package/src/skills/figma-implementer/SKILL.md +0 -148
- package/src/skills/figma-mcp-connector/SKILL.md +0 -136
- package/src/skills/figma-to-code/SKILL.md +0 -128
- package/src/skills/spec-kit-expert/SKILL.md +0 -1010
|
@@ -226,7 +226,7 @@ When creating GitHub issues from increments, use this format:
|
|
|
226
226
|
[From spec.md]
|
|
227
227
|
|
|
228
228
|
---
|
|
229
|
-
*Created by SpecWeave - [Learn more](https://github.com/
|
|
229
|
+
*Created by SpecWeave - [Learn more](https://github.com/anton-abyzov/specweave)*
|
|
230
230
|
```
|
|
231
231
|
|
|
232
232
|
## Bidirectional Sync
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
Execute a comprehensive Test-Driven Development (TDD) workflow with strict red-green-refactor discipline:
|
|
2
|
+
|
|
3
|
+
[Extended thinking: This workflow enforces test-first development through coordinated agent orchestration. Each phase of the TDD cycle is strictly enforced with fail-first verification, incremental implementation, and continuous refactoring. The workflow supports both single test and test suite approaches with configurable coverage thresholds.]
|
|
4
|
+
|
|
5
|
+
## Configuration
|
|
6
|
+
|
|
7
|
+
### Coverage Thresholds
|
|
8
|
+
- Minimum line coverage: 80%
|
|
9
|
+
- Minimum branch coverage: 75%
|
|
10
|
+
- Critical path coverage: 100%
|
|
11
|
+
|
|
12
|
+
### Refactoring Triggers
|
|
13
|
+
- Cyclomatic complexity > 10
|
|
14
|
+
- Method length > 20 lines
|
|
15
|
+
- Class length > 200 lines
|
|
16
|
+
- Duplicate code blocks > 3 lines
|
|
17
|
+
|
|
18
|
+
## Phase 1: Test Specification and Design
|
|
19
|
+
|
|
20
|
+
### 1. Requirements Analysis
|
|
21
|
+
- Use Task tool with subagent_type="comprehensive-review::architect-review"
|
|
22
|
+
- Prompt: "Analyze requirements for: $ARGUMENTS. Define acceptance criteria, identify edge cases, and create test scenarios. Output a comprehensive test specification."
|
|
23
|
+
- Output: Test specification, acceptance criteria, edge case matrix
|
|
24
|
+
- Validation: Ensure all requirements have corresponding test scenarios
|
|
25
|
+
|
|
26
|
+
### 2. Test Architecture Design
|
|
27
|
+
- Use Task tool with subagent_type="unit-testing::test-automator"
|
|
28
|
+
- Prompt: "Design test architecture for: $ARGUMENTS based on test specification. Define test structure, fixtures, mocks, and test data strategy. Ensure testability and maintainability."
|
|
29
|
+
- Output: Test architecture, fixture design, mock strategy
|
|
30
|
+
- Validation: Architecture supports isolated, fast, reliable tests
|
|
31
|
+
|
|
32
|
+
## Phase 2: RED - Write Failing Tests
|
|
33
|
+
|
|
34
|
+
### 3. Write Unit Tests (Failing)
|
|
35
|
+
- Use Task tool with subagent_type="unit-testing::test-automator"
|
|
36
|
+
- Prompt: "Write FAILING unit tests for: $ARGUMENTS. Tests must fail initially. Include edge cases, error scenarios, and happy paths. DO NOT implement production code."
|
|
37
|
+
- Output: Failing unit tests, test documentation
|
|
38
|
+
- **CRITICAL**: Verify all tests fail with expected error messages
|
|
39
|
+
|
|
40
|
+
### 4. Verify Test Failure
|
|
41
|
+
- Use Task tool with subagent_type="tdd-workflows::code-reviewer"
|
|
42
|
+
- Prompt: "Verify that all tests for: $ARGUMENTS are failing correctly. Ensure failures are for the right reasons (missing implementation, not test errors). Confirm no false positives."
|
|
43
|
+
- Output: Test failure verification report
|
|
44
|
+
- **GATE**: Do not proceed until all tests fail appropriately
|
|
45
|
+
|
|
46
|
+
## Phase 3: GREEN - Make Tests Pass
|
|
47
|
+
|
|
48
|
+
### 5. Minimal Implementation
|
|
49
|
+
- Use Task tool with subagent_type="backend-development::backend-architect"
|
|
50
|
+
- Prompt: "Implement MINIMAL code to make tests pass for: $ARGUMENTS. Focus only on making tests green. Do not add extra features or optimizations. Keep it simple."
|
|
51
|
+
- Output: Minimal working implementation
|
|
52
|
+
- Constraint: No code beyond what's needed to pass tests
|
|
53
|
+
|
|
54
|
+
### 6. Verify Test Success
|
|
55
|
+
- Use Task tool with subagent_type="unit-testing::test-automator"
|
|
56
|
+
- Prompt: "Run all tests for: $ARGUMENTS and verify they pass. Check test coverage metrics. Ensure no tests were accidentally broken."
|
|
57
|
+
- Output: Test execution report, coverage metrics
|
|
58
|
+
- **GATE**: All tests must pass before proceeding
|
|
59
|
+
|
|
60
|
+
## Phase 4: REFACTOR - Improve Code Quality
|
|
61
|
+
|
|
62
|
+
### 7. Code Refactoring
|
|
63
|
+
- Use Task tool with subagent_type="tdd-workflows::code-reviewer"
|
|
64
|
+
- Prompt: "Refactor implementation for: $ARGUMENTS while keeping tests green. Apply SOLID principles, remove duplication, improve naming, and optimize performance. Run tests after each refactoring."
|
|
65
|
+
- Output: Refactored code, refactoring report
|
|
66
|
+
- Constraint: Tests must remain green throughout
|
|
67
|
+
|
|
68
|
+
### 8. Test Refactoring
|
|
69
|
+
- Use Task tool with subagent_type="unit-testing::test-automator"
|
|
70
|
+
- Prompt: "Refactor tests for: $ARGUMENTS. Remove test duplication, improve test names, extract common fixtures, and enhance test readability. Ensure tests still provide same coverage."
|
|
71
|
+
- Output: Refactored tests, improved test structure
|
|
72
|
+
- Validation: Coverage metrics unchanged or improved
|
|
73
|
+
|
|
74
|
+
## Phase 5: Integration and System Tests
|
|
75
|
+
|
|
76
|
+
### 9. Write Integration Tests (Failing First)
|
|
77
|
+
- Use Task tool with subagent_type="unit-testing::test-automator"
|
|
78
|
+
- Prompt: "Write FAILING integration tests for: $ARGUMENTS. Test component interactions, API contracts, and data flow. Tests must fail initially."
|
|
79
|
+
- Output: Failing integration tests
|
|
80
|
+
- Validation: Tests fail due to missing integration logic
|
|
81
|
+
|
|
82
|
+
### 10. Implement Integration
|
|
83
|
+
- Use Task tool with subagent_type="backend-development::backend-architect"
|
|
84
|
+
- Prompt: "Implement integration code for: $ARGUMENTS to make integration tests pass. Focus on component interaction and data flow."
|
|
85
|
+
- Output: Integration implementation
|
|
86
|
+
- Validation: All integration tests pass
|
|
87
|
+
|
|
88
|
+
## Phase 6: Continuous Improvement Cycle
|
|
89
|
+
|
|
90
|
+
### 11. Performance and Edge Case Tests
|
|
91
|
+
- Use Task tool with subagent_type="unit-testing::test-automator"
|
|
92
|
+
- Prompt: "Add performance tests and additional edge case tests for: $ARGUMENTS. Include stress tests, boundary tests, and error recovery tests."
|
|
93
|
+
- Output: Extended test suite
|
|
94
|
+
- Metric: Increased test coverage and scenario coverage
|
|
95
|
+
|
|
96
|
+
### 12. Final Code Review
|
|
97
|
+
- Use Task tool with subagent_type="comprehensive-review::architect-review"
|
|
98
|
+
- Prompt: "Perform comprehensive review of: $ARGUMENTS. Verify TDD process was followed, check code quality, test quality, and coverage. Suggest improvements."
|
|
99
|
+
- Output: Review report, improvement suggestions
|
|
100
|
+
- Action: Implement critical suggestions while maintaining green tests
|
|
101
|
+
|
|
102
|
+
## Incremental Development Mode
|
|
103
|
+
|
|
104
|
+
For test-by-test development:
|
|
105
|
+
1. Write ONE failing test
|
|
106
|
+
2. Make ONLY that test pass
|
|
107
|
+
3. Refactor if needed
|
|
108
|
+
4. Repeat for next test
|
|
109
|
+
|
|
110
|
+
Use this approach by adding `--incremental` flag to focus on one test at a time.
|
|
111
|
+
|
|
112
|
+
## Test Suite Mode
|
|
113
|
+
|
|
114
|
+
For comprehensive test suite development:
|
|
115
|
+
1. Write ALL tests for a feature/module (failing)
|
|
116
|
+
2. Implement code to pass ALL tests
|
|
117
|
+
3. Refactor entire module
|
|
118
|
+
4. Add integration tests
|
|
119
|
+
|
|
120
|
+
Use this approach by adding `--suite` flag for batch test development.
|
|
121
|
+
|
|
122
|
+
## Validation Checkpoints
|
|
123
|
+
|
|
124
|
+
### RED Phase Validation
|
|
125
|
+
- [ ] All tests written before implementation
|
|
126
|
+
- [ ] All tests fail with meaningful error messages
|
|
127
|
+
- [ ] Test failures are due to missing implementation
|
|
128
|
+
- [ ] No test passes accidentally
|
|
129
|
+
|
|
130
|
+
### GREEN Phase Validation
|
|
131
|
+
- [ ] All tests pass
|
|
132
|
+
- [ ] No extra code beyond test requirements
|
|
133
|
+
- [ ] Coverage meets minimum thresholds
|
|
134
|
+
- [ ] No test was modified to make it pass
|
|
135
|
+
|
|
136
|
+
### REFACTOR Phase Validation
|
|
137
|
+
- [ ] All tests still pass after refactoring
|
|
138
|
+
- [ ] Code complexity reduced
|
|
139
|
+
- [ ] Duplication eliminated
|
|
140
|
+
- [ ] Performance improved or maintained
|
|
141
|
+
- [ ] Test readability improved
|
|
142
|
+
|
|
143
|
+
## Coverage Reports
|
|
144
|
+
|
|
145
|
+
Generate coverage reports after each phase:
|
|
146
|
+
- Line coverage
|
|
147
|
+
- Branch coverage
|
|
148
|
+
- Function coverage
|
|
149
|
+
- Statement coverage
|
|
150
|
+
|
|
151
|
+
## Failure Recovery
|
|
152
|
+
|
|
153
|
+
If TDD discipline is broken:
|
|
154
|
+
1. **STOP** immediately
|
|
155
|
+
2. Identify which phase was violated
|
|
156
|
+
3. Rollback to last valid state
|
|
157
|
+
4. Resume from correct phase
|
|
158
|
+
5. Document lesson learned
|
|
159
|
+
|
|
160
|
+
## TDD Metrics Tracking
|
|
161
|
+
|
|
162
|
+
Track and report:
|
|
163
|
+
- Time in each phase (Red/Green/Refactor)
|
|
164
|
+
- Number of test-implementation cycles
|
|
165
|
+
- Coverage progression
|
|
166
|
+
- Refactoring frequency
|
|
167
|
+
- Defect escape rate
|
|
168
|
+
|
|
169
|
+
## Anti-Patterns to Avoid
|
|
170
|
+
|
|
171
|
+
- Writing implementation before tests
|
|
172
|
+
- Writing tests that already pass
|
|
173
|
+
- Skipping the refactor phase
|
|
174
|
+
- Writing multiple features without tests
|
|
175
|
+
- Modifying tests to make them pass
|
|
176
|
+
- Ignoring failing tests
|
|
177
|
+
- Writing tests after implementation
|
|
178
|
+
|
|
179
|
+
## Success Criteria
|
|
180
|
+
|
|
181
|
+
- 100% of code written test-first
|
|
182
|
+
- All tests pass continuously
|
|
183
|
+
- Coverage exceeds thresholds
|
|
184
|
+
- Code complexity within limits
|
|
185
|
+
- Zero defects in covered code
|
|
186
|
+
- Clear test documentation
|
|
187
|
+
- Fast test execution (< 5 seconds for unit tests)
|
|
188
|
+
|
|
189
|
+
## Notes
|
|
190
|
+
|
|
191
|
+
- Enforce strict RED-GREEN-REFACTOR discipline
|
|
192
|
+
- Each phase must be completed before moving to next
|
|
193
|
+
- Tests are the specification
|
|
194
|
+
- If a test is hard to write, the design needs improvement
|
|
195
|
+
- Refactoring is NOT optional
|
|
196
|
+
- Keep test execution fast
|
|
197
|
+
- Tests should be independent and isolated
|
|
198
|
+
|
|
199
|
+
TDD implementation for: $ARGUMENTS
|