@qball-inc/the-bulwark 1.0.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.
Files changed (175) hide show
  1. package/.claude-plugin/plugin.json +43 -0
  2. package/agents/bulwark-fix-validator.md +633 -0
  3. package/agents/bulwark-implementer.md +391 -0
  4. package/agents/bulwark-issue-analyzer.md +308 -0
  5. package/agents/bulwark-standards-reviewer.md +221 -0
  6. package/agents/plan-creation-architect.md +323 -0
  7. package/agents/plan-creation-eng-lead.md +352 -0
  8. package/agents/plan-creation-po.md +300 -0
  9. package/agents/plan-creation-qa-critic.md +334 -0
  10. package/agents/product-ideation-competitive-analyzer.md +298 -0
  11. package/agents/product-ideation-idea-validator.md +268 -0
  12. package/agents/product-ideation-market-researcher.md +292 -0
  13. package/agents/product-ideation-pattern-documenter.md +308 -0
  14. package/agents/product-ideation-segment-analyzer.md +303 -0
  15. package/agents/product-ideation-strategist.md +259 -0
  16. package/agents/statusline-setup.md +97 -0
  17. package/hooks/hooks.json +59 -0
  18. package/package.json +45 -0
  19. package/scripts/hooks/cleanup-stale.sh +13 -0
  20. package/scripts/hooks/enforce-quality.sh +166 -0
  21. package/scripts/hooks/implementer-quality.sh +256 -0
  22. package/scripts/hooks/inject-protocol.sh +52 -0
  23. package/scripts/hooks/suggest-pipeline.sh +175 -0
  24. package/scripts/hooks/track-pipeline-start.sh +37 -0
  25. package/scripts/hooks/track-pipeline-stop.sh +52 -0
  26. package/scripts/init-rules.sh +35 -0
  27. package/scripts/init.sh +151 -0
  28. package/skills/anthropic-validator/SKILL.md +607 -0
  29. package/skills/anthropic-validator/references/agents-checklist.md +131 -0
  30. package/skills/anthropic-validator/references/commands-checklist.md +102 -0
  31. package/skills/anthropic-validator/references/hooks-checklist.md +151 -0
  32. package/skills/anthropic-validator/references/mcp-checklist.md +136 -0
  33. package/skills/anthropic-validator/references/plugins-checklist.md +148 -0
  34. package/skills/anthropic-validator/references/skills-checklist.md +85 -0
  35. package/skills/assertion-patterns/SKILL.md +296 -0
  36. package/skills/bug-magnet-data/SKILL.md +284 -0
  37. package/skills/bug-magnet-data/context/cli-args.md +91 -0
  38. package/skills/bug-magnet-data/context/db-query.md +104 -0
  39. package/skills/bug-magnet-data/context/file-contents.md +103 -0
  40. package/skills/bug-magnet-data/context/http-body.md +91 -0
  41. package/skills/bug-magnet-data/context/process-spawn.md +123 -0
  42. package/skills/bug-magnet-data/data/booleans/boundaries.yaml +143 -0
  43. package/skills/bug-magnet-data/data/collections/arrays.yaml +114 -0
  44. package/skills/bug-magnet-data/data/collections/objects.yaml +123 -0
  45. package/skills/bug-magnet-data/data/concurrency/race-conditions.yaml +118 -0
  46. package/skills/bug-magnet-data/data/concurrency/state-machines.yaml +115 -0
  47. package/skills/bug-magnet-data/data/dates/boundaries.yaml +137 -0
  48. package/skills/bug-magnet-data/data/dates/invalid.yaml +132 -0
  49. package/skills/bug-magnet-data/data/dates/timezone.yaml +118 -0
  50. package/skills/bug-magnet-data/data/encoding/charset.yaml +79 -0
  51. package/skills/bug-magnet-data/data/encoding/normalization.yaml +105 -0
  52. package/skills/bug-magnet-data/data/formats/email.yaml +154 -0
  53. package/skills/bug-magnet-data/data/formats/json.yaml +187 -0
  54. package/skills/bug-magnet-data/data/formats/url.yaml +165 -0
  55. package/skills/bug-magnet-data/data/language-specific/javascript.yaml +182 -0
  56. package/skills/bug-magnet-data/data/language-specific/python.yaml +174 -0
  57. package/skills/bug-magnet-data/data/language-specific/rust.yaml +148 -0
  58. package/skills/bug-magnet-data/data/numbers/boundaries.yaml +161 -0
  59. package/skills/bug-magnet-data/data/numbers/precision.yaml +89 -0
  60. package/skills/bug-magnet-data/data/numbers/special.yaml +69 -0
  61. package/skills/bug-magnet-data/data/strings/boundaries.yaml +109 -0
  62. package/skills/bug-magnet-data/data/strings/injection.yaml +208 -0
  63. package/skills/bug-magnet-data/data/strings/special-chars.yaml +190 -0
  64. package/skills/bug-magnet-data/data/strings/unicode.yaml +139 -0
  65. package/skills/bug-magnet-data/references/external-lists.md +115 -0
  66. package/skills/bulwark-brainstorm/SKILL.md +563 -0
  67. package/skills/bulwark-brainstorm/references/at-teammate-prompts.md +60 -0
  68. package/skills/bulwark-brainstorm/references/role-critical-analyst.md +78 -0
  69. package/skills/bulwark-brainstorm/references/role-development-lead.md +66 -0
  70. package/skills/bulwark-brainstorm/references/role-product-delivery-lead.md +79 -0
  71. package/skills/bulwark-brainstorm/references/role-product-manager.md +62 -0
  72. package/skills/bulwark-brainstorm/references/role-project-sme.md +59 -0
  73. package/skills/bulwark-brainstorm/references/role-technical-architect.md +66 -0
  74. package/skills/bulwark-research/SKILL.md +298 -0
  75. package/skills/bulwark-research/references/viewpoint-contrarian.md +63 -0
  76. package/skills/bulwark-research/references/viewpoint-direct-investigation.md +62 -0
  77. package/skills/bulwark-research/references/viewpoint-first-principles.md +65 -0
  78. package/skills/bulwark-research/references/viewpoint-practitioner.md +62 -0
  79. package/skills/bulwark-research/references/viewpoint-prior-art.md +66 -0
  80. package/skills/bulwark-scaffold/SKILL.md +330 -0
  81. package/skills/bulwark-statusline/SKILL.md +161 -0
  82. package/skills/bulwark-statusline/scripts/statusline.sh +144 -0
  83. package/skills/bulwark-verify/SKILL.md +519 -0
  84. package/skills/code-review/SKILL.md +428 -0
  85. package/skills/code-review/examples/anti-patterns/linting.ts +181 -0
  86. package/skills/code-review/examples/anti-patterns/security.ts +91 -0
  87. package/skills/code-review/examples/anti-patterns/standards.ts +195 -0
  88. package/skills/code-review/examples/anti-patterns/type-safety.ts +108 -0
  89. package/skills/code-review/examples/recommended/linting.ts +195 -0
  90. package/skills/code-review/examples/recommended/security.ts +154 -0
  91. package/skills/code-review/examples/recommended/standards.ts +231 -0
  92. package/skills/code-review/examples/recommended/type-safety.ts +181 -0
  93. package/skills/code-review/frameworks/angular.md +218 -0
  94. package/skills/code-review/frameworks/django.md +235 -0
  95. package/skills/code-review/frameworks/express.md +207 -0
  96. package/skills/code-review/frameworks/flask.md +298 -0
  97. package/skills/code-review/frameworks/generic.md +146 -0
  98. package/skills/code-review/frameworks/react.md +152 -0
  99. package/skills/code-review/frameworks/vue.md +244 -0
  100. package/skills/code-review/references/linting-patterns.md +221 -0
  101. package/skills/code-review/references/security-patterns.md +125 -0
  102. package/skills/code-review/references/standards-patterns.md +246 -0
  103. package/skills/code-review/references/type-safety-patterns.md +130 -0
  104. package/skills/component-patterns/SKILL.md +131 -0
  105. package/skills/component-patterns/references/pattern-cli-command.md +118 -0
  106. package/skills/component-patterns/references/pattern-database.md +166 -0
  107. package/skills/component-patterns/references/pattern-external-api.md +139 -0
  108. package/skills/component-patterns/references/pattern-file-parser.md +168 -0
  109. package/skills/component-patterns/references/pattern-http-server.md +162 -0
  110. package/skills/component-patterns/references/pattern-process-spawner.md +133 -0
  111. package/skills/continuous-feedback/SKILL.md +327 -0
  112. package/skills/continuous-feedback/references/collect-instructions.md +81 -0
  113. package/skills/continuous-feedback/references/specialize-code-review.md +82 -0
  114. package/skills/continuous-feedback/references/specialize-general.md +98 -0
  115. package/skills/continuous-feedback/references/specialize-test-audit.md +81 -0
  116. package/skills/create-skill/SKILL.md +359 -0
  117. package/skills/create-skill/references/agent-conventions.md +194 -0
  118. package/skills/create-skill/references/agent-template.md +195 -0
  119. package/skills/create-skill/references/content-guidance.md +291 -0
  120. package/skills/create-skill/references/decision-framework.md +124 -0
  121. package/skills/create-skill/references/template-pipeline.md +217 -0
  122. package/skills/create-skill/references/template-reference-heavy.md +111 -0
  123. package/skills/create-skill/references/template-research.md +210 -0
  124. package/skills/create-skill/references/template-script-driven.md +172 -0
  125. package/skills/create-skill/references/template-simple.md +80 -0
  126. package/skills/create-subagent/SKILL.md +353 -0
  127. package/skills/create-subagent/references/agent-conventions.md +268 -0
  128. package/skills/create-subagent/references/content-guidance.md +232 -0
  129. package/skills/create-subagent/references/decision-framework.md +134 -0
  130. package/skills/create-subagent/references/template-single-agent.md +192 -0
  131. package/skills/fix-bug/SKILL.md +241 -0
  132. package/skills/governance-protocol/SKILL.md +116 -0
  133. package/skills/init/SKILL.md +341 -0
  134. package/skills/issue-debugging/SKILL.md +385 -0
  135. package/skills/issue-debugging/references/anti-patterns.md +245 -0
  136. package/skills/issue-debugging/references/debug-report-schema.md +227 -0
  137. package/skills/mock-detection/SKILL.md +511 -0
  138. package/skills/mock-detection/references/false-positive-prevention.md +402 -0
  139. package/skills/mock-detection/references/stub-patterns.md +236 -0
  140. package/skills/pipeline-templates/SKILL.md +215 -0
  141. package/skills/pipeline-templates/references/code-change-workflow.md +277 -0
  142. package/skills/pipeline-templates/references/code-review.md +336 -0
  143. package/skills/pipeline-templates/references/fix-validation.md +421 -0
  144. package/skills/pipeline-templates/references/new-feature.md +335 -0
  145. package/skills/pipeline-templates/references/research-brainstorm.md +161 -0
  146. package/skills/pipeline-templates/references/research-planning.md +257 -0
  147. package/skills/pipeline-templates/references/test-audit.md +389 -0
  148. package/skills/pipeline-templates/references/test-execution-fix.md +238 -0
  149. package/skills/plan-creation/SKILL.md +497 -0
  150. package/skills/product-ideation/SKILL.md +372 -0
  151. package/skills/product-ideation/references/analysis-frameworks.md +161 -0
  152. package/skills/session-handoff/SKILL.md +139 -0
  153. package/skills/session-handoff/references/examples.md +223 -0
  154. package/skills/setup-lsp/SKILL.md +312 -0
  155. package/skills/setup-lsp/references/server-registry.md +85 -0
  156. package/skills/setup-lsp/references/troubleshooting.md +135 -0
  157. package/skills/subagent-output-templating/SKILL.md +415 -0
  158. package/skills/subagent-output-templating/references/examples.md +440 -0
  159. package/skills/subagent-prompting/SKILL.md +364 -0
  160. package/skills/subagent-prompting/references/examples.md +342 -0
  161. package/skills/test-audit/SKILL.md +531 -0
  162. package/skills/test-audit/references/known-limitations.md +41 -0
  163. package/skills/test-audit/references/priority-classification.md +30 -0
  164. package/skills/test-audit/references/prompts/deep-mode-detection.md +83 -0
  165. package/skills/test-audit/references/prompts/synthesis.md +57 -0
  166. package/skills/test-audit/references/rewrite-instructions.md +46 -0
  167. package/skills/test-audit/references/schemas/audit-output.yaml +100 -0
  168. package/skills/test-audit/references/schemas/diagnostic-output.yaml +49 -0
  169. package/skills/test-audit/scripts/data-flow-analyzer.ts +509 -0
  170. package/skills/test-audit/scripts/integration-mock-detector.ts +462 -0
  171. package/skills/test-audit/scripts/package.json +20 -0
  172. package/skills/test-audit/scripts/skip-detector.ts +211 -0
  173. package/skills/test-audit/scripts/verification-counter.ts +295 -0
  174. package/skills/test-classification/SKILL.md +310 -0
  175. package/skills/test-fixture-creation/SKILL.md +295 -0
@@ -0,0 +1,238 @@
1
+ # Test Execution & Fix Pipeline
2
+
3
+ ## Purpose
4
+
5
+ Run tests, analyze failures, and fix issues iteratively.
6
+
7
+ ## When to Use
8
+
9
+ - After code changes
10
+ - CI failure remediation
11
+ - Test suite maintenance
12
+ - Pre-merge verification
13
+
14
+ ## Pipeline Definition
15
+
16
+ ```fsharp
17
+ // Test Execution & Fix Pipeline
18
+ // Trigger: Code changes, CI failures
19
+ // Output: Passing tests with fixes applied
20
+
21
+ TestRunner (execute test suite) // Haiku - execution
22
+ |> (if failures > 0
23
+ then FailureAnalyzer (analyze failures) // Sonnet - analysis
24
+ else Done)
25
+ |> FixWriter (apply fixes) // Opus - write code
26
+ |> TestRunner (re-execute) // Haiku - verify
27
+ |> (if failures > 0 && iterations < max
28
+ then FailureAnalyzer // Loop back
29
+ else Done)
30
+ |> LOOP(max=3) // Max 3 fix attempts
31
+ ```
32
+
33
+ ## Stage Details
34
+
35
+ ### Stage 1: TestRunner
36
+
37
+ **Model**: Haiku (execution task)
38
+
39
+ **GOAL**: Run tests and capture results.
40
+
41
+ **CONSTRAINTS**:
42
+ - Do NOT modify any files
43
+ - Capture full output
44
+ - Parse failure details
45
+
46
+ **CONTEXT**:
47
+ - Test command (e.g., `just test`)
48
+ - Test scope (all, specific files, etc.)
49
+
50
+ **OUTPUT**: Test results
51
+ ```yaml
52
+ results:
53
+ command: "just test"
54
+ duration: "45s"
55
+ summary:
56
+ total: 142
57
+ passed: 138
58
+ failed: 4
59
+ skipped: 0
60
+ failures:
61
+ - test: "should start proxy on specified port"
62
+ file: tests/proxy.test.ts
63
+ line: 23
64
+ error: "EADDRINUSE: address already in use"
65
+ stack: |
66
+ Error: listen EADDRINUSE: address already in use :::8096
67
+ at Server.setupListenHandle [as _listen2]
68
+ - test: "should parse config file"
69
+ file: tests/config.test.ts
70
+ line: 45
71
+ error: "Expected 'production' but got 'development'"
72
+ stack: |
73
+ AssertionError: expected 'development' to equal 'production'
74
+ ```
75
+
76
+ ### Stage 2: FailureAnalyzer
77
+
78
+ **Model**: Sonnet (analysis task)
79
+
80
+ **Conditional**: Only run if failures > 0
81
+
82
+ **GOAL**: Analyze failures to understand root cause.
83
+
84
+ **CONSTRAINTS**:
85
+ - Do NOT modify any files
86
+ - Categorize failure types
87
+ - Identify common patterns
88
+ - Prioritize by fix complexity
89
+
90
+ **CONTEXT**:
91
+ - Test results from Stage 1
92
+ - Test file contents
93
+ - Related source files
94
+
95
+ **OUTPUT**: Failure analysis
96
+ ```yaml
97
+ analysis:
98
+ failure_count: 4
99
+ categories:
100
+ environment:
101
+ count: 1
102
+ tests: ["should start proxy on specified port"]
103
+ cause: "Port 8096 in use by another process"
104
+ fix_approach: "Use dynamic port assignment"
105
+ assertion:
106
+ count: 2
107
+ tests: ["should parse config file", "should return correct env"]
108
+ cause: "Test environment not properly set"
109
+ fix_approach: "Set NODE_ENV before test"
110
+ flaky:
111
+ count: 1
112
+ tests: ["should timeout on slow response"]
113
+ cause: "Race condition in timeout handling"
114
+ fix_approach: "Increase timeout or fix race"
115
+ priority_order:
116
+ - category: environment
117
+ reason: "Blocking other tests"
118
+ - category: assertion
119
+ reason: "Quick fix"
120
+ - category: flaky
121
+ reason: "May need investigation"
122
+ ```
123
+
124
+ ### Stage 3: FixWriter
125
+
126
+ **Model**: Opus (code writing required)
127
+
128
+ **GOAL**: Apply fixes for test failures.
129
+
130
+ **CONSTRAINTS**:
131
+ - Fix test issues, not production bugs
132
+ - One category at a time
133
+ - Verify fix doesn't break other tests
134
+
135
+ **CONTEXT**:
136
+ - Failure analysis from Stage 2
137
+ - Test files
138
+ - Related source files
139
+
140
+ **OUTPUT**: Applied fixes
141
+ ```yaml
142
+ fixes:
143
+ applied:
144
+ - file: tests/proxy.test.ts
145
+ change: "Use getAvailablePort() instead of hardcoded 8096"
146
+ tests_affected: ["should start proxy on specified port"]
147
+ - file: tests/config.test.ts
148
+ change: "Added beforeEach to set NODE_ENV"
149
+ tests_affected: ["should parse config file", "should return correct env"]
150
+ deferred:
151
+ - file: tests/timeout.test.ts
152
+ reason: "Flaky test needs deeper investigation"
153
+ recommendation: "Skip for now, create issue"
154
+ ```
155
+
156
+ ### Stage 4: TestRunner (Re-execution)
157
+
158
+ **Model**: Haiku (execution task)
159
+
160
+ **GOAL**: Verify fixes resolved failures.
161
+
162
+ Same as Stage 1, but with expectation of fewer failures.
163
+
164
+ ### Loop Condition
165
+
166
+ If failures remain and iterations < 3:
167
+ - Loop back to FailureAnalyzer
168
+ - Focus on remaining failures
169
+ - Avoid re-fixing already fixed issues
170
+
171
+ **Max iterations**: 3 (prevent infinite loop on unfixable issues)
172
+
173
+ ## Example Invocation
174
+
175
+ ```markdown
176
+ ## Pipeline: Test Execution & Fix
177
+
178
+ ### Stage 1: TestRunner
179
+ Task: subagent_type=Bash, model=haiku
180
+ Prompt: Run 'just test' and capture output
181
+
182
+ ### Stage 2: FailureAnalyzer
183
+ Condition: failures > 0
184
+ Task: subagent_type=general-purpose, model=sonnet
185
+ Prompt: [4-part prompt, analyzes failures]
186
+
187
+ ### Stage 3: FixWriter
188
+ Task: subagent_type=general-purpose, model=opus
189
+ Prompt: [4-part prompt, applies fixes]
190
+
191
+ ### Stage 4: TestRunner (Iteration 1)
192
+ Task: subagent_type=Bash, model=haiku
193
+ Prompt: Re-run 'just test' to verify fixes
194
+
195
+ ### Loop Check
196
+ If failures > 0 and iterations < 3:
197
+ Go to Stage 2 with remaining failures
198
+ ```
199
+
200
+ ## Success Criteria
201
+
202
+ - All tests pass
203
+ - OR: Remaining failures documented with justification
204
+ - Fixes don't introduce new failures
205
+ - Max 3 fix iterations
206
+
207
+ ## Failure Categories
208
+
209
+ | Category | Description | Typical Fix |
210
+ |----------|-------------|-------------|
211
+ | Environment | Port conflicts, missing deps | Dynamic allocation, setup scripts |
212
+ | Assertion | Wrong expected value | Update test or fix bug |
213
+ | Timeout | Test too slow or hangs | Increase timeout, optimize |
214
+ | Flaky | Intermittent failures | Fix race condition, add retry |
215
+ | Setup | beforeEach/afterEach issues | Fix setup/teardown |
216
+ | Mock | Mock not matching real | Update mock or use real |
217
+
218
+ ## Iteration Tracking
219
+
220
+ ```yaml
221
+ iterations:
222
+ - round: 1
223
+ failures_before: 4
224
+ failures_after: 1
225
+ fixed: ["proxy port", "config env"]
226
+ - round: 2
227
+ failures_before: 1
228
+ failures_after: 0
229
+ fixed: ["timeout handling"]
230
+ - round: 3
231
+ not_needed: true
232
+ ```
233
+
234
+ ## Related Pipelines
235
+
236
+ - **Fix Validation**: For fixing source code bugs
237
+ - **Test Audit**: For auditing test quality
238
+ - **Code Review**: For reviewing fixes