specweave 0.3.13 → 0.4.1

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.
Files changed (168) hide show
  1. package/CLAUDE.md +506 -17
  2. package/README.md +100 -58
  3. package/bin/install-all.sh +9 -2
  4. package/bin/install-hooks.sh +57 -0
  5. package/bin/specweave.js +16 -0
  6. package/dist/adapters/adapter-base.d.ts +21 -0
  7. package/dist/adapters/adapter-base.d.ts.map +1 -1
  8. package/dist/adapters/adapter-base.js +28 -0
  9. package/dist/adapters/adapter-base.js.map +1 -1
  10. package/dist/adapters/adapter-interface.d.ts +41 -0
  11. package/dist/adapters/adapter-interface.d.ts.map +1 -1
  12. package/dist/adapters/claude/adapter.d.ts +36 -0
  13. package/dist/adapters/claude/adapter.d.ts.map +1 -1
  14. package/dist/adapters/claude/adapter.js +135 -0
  15. package/dist/adapters/claude/adapter.js.map +1 -1
  16. package/dist/adapters/copilot/adapter.d.ts +25 -0
  17. package/dist/adapters/copilot/adapter.d.ts.map +1 -1
  18. package/dist/adapters/copilot/adapter.js +112 -0
  19. package/dist/adapters/copilot/adapter.js.map +1 -1
  20. package/dist/adapters/cursor/adapter.d.ts +36 -0
  21. package/dist/adapters/cursor/adapter.d.ts.map +1 -1
  22. package/dist/adapters/cursor/adapter.js +140 -0
  23. package/dist/adapters/cursor/adapter.js.map +1 -1
  24. package/dist/adapters/generic/adapter.d.ts +25 -0
  25. package/dist/adapters/generic/adapter.d.ts.map +1 -1
  26. package/dist/adapters/generic/adapter.js +111 -0
  27. package/dist/adapters/generic/adapter.js.map +1 -1
  28. package/dist/cli/commands/init.d.ts.map +1 -1
  29. package/dist/cli/commands/init.js +103 -1
  30. package/dist/cli/commands/init.js.map +1 -1
  31. package/dist/cli/commands/plugin.d.ts +37 -0
  32. package/dist/cli/commands/plugin.d.ts.map +1 -0
  33. package/dist/cli/commands/plugin.js +296 -0
  34. package/dist/cli/commands/plugin.js.map +1 -0
  35. package/dist/core/agent-model-manager.d.ts +52 -0
  36. package/dist/core/agent-model-manager.d.ts.map +1 -0
  37. package/dist/core/agent-model-manager.js +120 -0
  38. package/dist/core/agent-model-manager.js.map +1 -0
  39. package/dist/core/cost-tracker.d.ts +108 -0
  40. package/dist/core/cost-tracker.d.ts.map +1 -0
  41. package/dist/core/cost-tracker.js +281 -0
  42. package/dist/core/cost-tracker.js.map +1 -0
  43. package/dist/core/model-selector.d.ts +57 -0
  44. package/dist/core/model-selector.d.ts.map +1 -0
  45. package/dist/core/model-selector.js +115 -0
  46. package/dist/core/model-selector.js.map +1 -0
  47. package/dist/core/phase-detector.d.ts +62 -0
  48. package/dist/core/phase-detector.d.ts.map +1 -0
  49. package/dist/core/phase-detector.js +229 -0
  50. package/dist/core/phase-detector.js.map +1 -0
  51. package/dist/core/plugin-detector.d.ts +96 -0
  52. package/dist/core/plugin-detector.d.ts.map +1 -0
  53. package/dist/core/plugin-detector.js +349 -0
  54. package/dist/core/plugin-detector.js.map +1 -0
  55. package/dist/core/plugin-loader.d.ts +111 -0
  56. package/dist/core/plugin-loader.d.ts.map +1 -0
  57. package/dist/core/plugin-loader.js +319 -0
  58. package/dist/core/plugin-loader.js.map +1 -0
  59. package/dist/core/plugin-manager.d.ts +144 -0
  60. package/dist/core/plugin-manager.d.ts.map +1 -0
  61. package/dist/core/plugin-manager.js +393 -0
  62. package/dist/core/plugin-manager.js.map +1 -0
  63. package/dist/core/schemas/plugin-manifest.schema.json +253 -0
  64. package/dist/core/types/plugin.d.ts +252 -0
  65. package/dist/core/types/plugin.d.ts.map +1 -0
  66. package/dist/core/types/plugin.js +48 -0
  67. package/dist/core/types/plugin.js.map +1 -0
  68. package/dist/integrations/jira/jira-mapper.d.ts +2 -2
  69. package/dist/integrations/jira/jira-mapper.js +2 -2
  70. package/dist/types/cost-tracking.d.ts +43 -0
  71. package/dist/types/cost-tracking.d.ts.map +1 -0
  72. package/dist/types/cost-tracking.js +8 -0
  73. package/dist/types/cost-tracking.js.map +1 -0
  74. package/dist/types/model-selection.d.ts +53 -0
  75. package/dist/types/model-selection.d.ts.map +1 -0
  76. package/dist/types/model-selection.js +12 -0
  77. package/dist/types/model-selection.js.map +1 -0
  78. package/dist/utils/cost-reporter.d.ts +58 -0
  79. package/dist/utils/cost-reporter.d.ts.map +1 -0
  80. package/dist/utils/cost-reporter.js +224 -0
  81. package/dist/utils/cost-reporter.js.map +1 -0
  82. package/dist/utils/pricing-constants.d.ts +70 -0
  83. package/dist/utils/pricing-constants.d.ts.map +1 -0
  84. package/dist/utils/pricing-constants.js +71 -0
  85. package/dist/utils/pricing-constants.js.map +1 -0
  86. package/package.json +13 -9
  87. package/src/adapters/adapter-base.ts +33 -0
  88. package/src/adapters/adapter-interface.ts +46 -0
  89. package/src/adapters/claude/adapter.ts +164 -0
  90. package/src/adapters/copilot/adapter.ts +138 -0
  91. package/src/adapters/cursor/adapter.ts +170 -0
  92. package/src/adapters/generic/adapter.ts +137 -0
  93. package/src/agents/architect/AGENT.md +3 -0
  94. package/src/agents/code-reviewer.md +156 -0
  95. package/src/agents/data-scientist/AGENT.md +181 -0
  96. package/src/agents/database-optimizer/AGENT.md +147 -0
  97. package/src/agents/devops/AGENT.md +3 -0
  98. package/src/agents/diagrams-architect/AGENT.md +3 -0
  99. package/src/agents/docs-writer/AGENT.md +3 -0
  100. package/src/agents/kubernetes-architect/AGENT.md +142 -0
  101. package/src/agents/ml-engineer/AGENT.md +150 -0
  102. package/src/agents/mlops-engineer/AGENT.md +201 -0
  103. package/src/agents/network-engineer/AGENT.md +149 -0
  104. package/src/agents/observability-engineer/AGENT.md +213 -0
  105. package/src/agents/payment-integration/AGENT.md +35 -0
  106. package/src/agents/performance/AGENT.md +3 -0
  107. package/src/agents/performance-engineer/AGENT.md +153 -0
  108. package/src/agents/pm/AGENT.md +3 -0
  109. package/src/agents/qa-lead/AGENT.md +3 -0
  110. package/src/agents/security/AGENT.md +3 -0
  111. package/src/agents/sre/AGENT.md +3 -0
  112. package/src/agents/tdd-orchestrator/AGENT.md +169 -0
  113. package/src/agents/tech-lead/AGENT.md +3 -0
  114. package/src/commands/specweave.costs.md +261 -0
  115. package/src/commands/specweave.increment.md +48 -4
  116. package/src/commands/specweave.ml-pipeline.md +292 -0
  117. package/src/commands/specweave.monitor-setup.md +501 -0
  118. package/src/commands/specweave.slo-implement.md +1055 -0
  119. package/src/commands/specweave.sync-github.md +1 -1
  120. package/src/commands/specweave.tdd-cycle.md +199 -0
  121. package/src/commands/specweave.tdd-green.md +842 -0
  122. package/src/commands/specweave.tdd-red.md +135 -0
  123. package/src/commands/specweave.tdd-refactor.md +165 -0
  124. package/src/hooks/post-increment-plugin-detect.sh +142 -0
  125. package/src/hooks/post-task-completion.sh +53 -11
  126. package/src/hooks/pre-task-plugin-detect.sh +96 -0
  127. package/src/skills/SKILLS-INDEX.md +18 -10
  128. package/src/skills/billing-automation/SKILL.md +559 -0
  129. package/src/skills/distributed-tracing/SKILL.md +438 -0
  130. package/src/skills/e2e-playwright/README.md +1 -1
  131. package/src/skills/e2e-playwright/package.json +1 -1
  132. package/src/skills/gitops-workflow/SKILL.md +285 -0
  133. package/src/skills/gitops-workflow/references/argocd-setup.md +134 -0
  134. package/src/skills/gitops-workflow/references/sync-policies.md +131 -0
  135. package/src/skills/grafana-dashboards/SKILL.md +369 -0
  136. package/src/skills/helm-chart-scaffolding/SKILL.md +544 -0
  137. package/src/skills/helm-chart-scaffolding/assets/Chart.yaml.template +42 -0
  138. package/src/skills/helm-chart-scaffolding/assets/values.yaml.template +185 -0
  139. package/src/skills/helm-chart-scaffolding/references/chart-structure.md +500 -0
  140. package/src/skills/helm-chart-scaffolding/scripts/validate-chart.sh +244 -0
  141. package/src/skills/k8s-manifest-generator/SKILL.md +511 -0
  142. package/src/skills/k8s-manifest-generator/assets/configmap-template.yaml +296 -0
  143. package/src/skills/k8s-manifest-generator/assets/deployment-template.yaml +203 -0
  144. package/src/skills/k8s-manifest-generator/assets/service-template.yaml +171 -0
  145. package/src/skills/k8s-manifest-generator/references/deployment-spec.md +753 -0
  146. package/src/skills/k8s-manifest-generator/references/service-spec.md +724 -0
  147. package/src/skills/k8s-security-policies/SKILL.md +334 -0
  148. package/src/skills/k8s-security-policies/assets/network-policy-template.yaml +177 -0
  149. package/src/skills/k8s-security-policies/references/rbac-patterns.md +187 -0
  150. package/src/skills/ml-pipeline-workflow/SKILL.md +245 -0
  151. package/src/skills/paypal-integration/SKILL.md +467 -0
  152. package/src/skills/pci-compliance/SKILL.md +466 -0
  153. package/src/skills/prometheus-configuration/SKILL.md +392 -0
  154. package/src/skills/slo-implementation/SKILL.md +329 -0
  155. package/src/skills/stripe-integration/SKILL.md +442 -0
  156. package/src/skills/tdd-workflow/SKILL.md +378 -0
  157. package/src/templates/README.md.template +1 -1
  158. package/src/skills/bmad-method-expert/SKILL.md +0 -626
  159. package/src/skills/bmad-method-expert/scripts/analyze-project.js +0 -318
  160. package/src/skills/bmad-method-expert/scripts/check-setup.js +0 -208
  161. package/src/skills/bmad-method-expert/scripts/generate-template.js +0 -1149
  162. package/src/skills/bmad-method-expert/scripts/validate-documents.js +0 -340
  163. package/src/skills/context-optimizer/SKILL.md +0 -588
  164. package/src/skills/figma-designer/SKILL.md +0 -149
  165. package/src/skills/figma-implementer/SKILL.md +0 -148
  166. package/src/skills/figma-mcp-connector/SKILL.md +0 -136
  167. package/src/skills/figma-to-code/SKILL.md +0 -128
  168. 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/specweave/specweave)*
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