@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,295 @@
1
+ ---
2
+ name: test-fixture-creation
3
+ description: Guidelines for creating unbiased test fixtures that integrate with project infrastructure. Use when creating fixtures for manual testing, setting up E2E test scenarios, or building code samples with deliberate issues for LLM review. Ensures fixtures work with hook automation and pass Phase 1 checks.
4
+ user-invocable: false
5
+ ---
6
+
7
+ # Test Fixture Creation
8
+
9
+ Guidelines for creating test fixtures that work with Bulwark's hook-based automation and avoid bias that could compromise testing.
10
+
11
+ ---
12
+
13
+ ## When to Use This Skill
14
+
15
+ **Load this skill when:**
16
+ - Creating fixtures for manual testing of skills or agents
17
+ - Setting up E2E test scenarios that require hook automation
18
+ - Building code samples with deliberate issues for LLM review
19
+
20
+ **DO NOT use for:**
21
+ - Unit test fixtures (those can be isolated in tests/fixtures/)
22
+ - Mock data for automated tests
23
+ - Documentation examples
24
+
25
+ ---
26
+
27
+ ## Core Principles
28
+
29
+ ### 1. No Bias in Fixtures
30
+
31
+ **CRITICAL**: Fixtures must not contain any indicators that they are test fixtures.
32
+
33
+ | Forbidden | Why | Alternative |
34
+ |-----------|-----|-------------|
35
+ | `test-*.ts`, `*-fixture.ts` | Filename reveals intent | `user-service.ts`, `data-processor.ts` |
36
+ | `// This is a test file` | Comment reveals intent | No explanatory comments |
37
+ | `// Intentional bug here` | Points to the issue | Let LLM discover it |
38
+ | `fixture/`, `test-data/` | Directory name reveals intent | `scripts/components/`, `lib/` |
39
+ | `FIXME`, `TODO: test` | Markers reveal intent | Remove all markers |
40
+
41
+ **Why this matters**: When Claude knows code is a test fixture, it may:
42
+ - Skip hook automation ("this is just a test")
43
+ - Ignore pipeline suggestions
44
+ - Produce different results than real code review
45
+
46
+ ### 2. Project Infrastructure Integration
47
+
48
+ Fixtures must be placed within project infrastructure to enable hook automation.
49
+
50
+ **Required for hooks to fire:**
51
+ - Code must be in directories covered by `tsconfig.json` include paths
52
+ - Project must have working `just typecheck` and `just lint` recipes
53
+ - Fixtures must pass Phase 1 checks
54
+
55
+ **Placement Strategy:**
56
+ ```
57
+ PROJECT_ROOT/
58
+ ├── scripts/
59
+ │ ├── components/ ← Place fixtures here
60
+ │ │ ├── user-service.ts
61
+ │ │ ├── data-processor.ts
62
+ │ │ └── workflow-handler.ts
63
+ │ └── lib/ ← Supporting stubs
64
+ │ ├── database.ts
65
+ │ └── logger.ts
66
+ ```
67
+
68
+ ### 3. Fixtures Must Pass Phase 1
69
+
70
+ Fixtures should compile and lint successfully so that Phase 2 (LLM review) can run.
71
+
72
+ **Phase 1 Requirements:**
73
+ - `just typecheck` passes (no TypeScript errors)
74
+ - `just lint` passes (no lint errors)
75
+ - All imports resolve
76
+
77
+ **Common Issues:**
78
+ | Problem | Solution |
79
+ |---------|----------|
80
+ | Missing Node.js types | Avoid `fs`, `events`, `Buffer` - use pure TS |
81
+ | Import resolution | Create stub files in `scripts/lib/` |
82
+ | Type errors | Use `as unknown as T` for intentional unsafe casts |
83
+
84
+ ### 4. Deliberate Issues for Phase 2
85
+
86
+ Fixtures should contain issues that TypeScript allows but are bad practice:
87
+
88
+ **Security Issues (user-service.ts):**
89
+ - SQL injection via string interpolation
90
+ - Hardcoded API keys and secrets
91
+ - Path traversal vulnerabilities
92
+ - Insecure token generation
93
+
94
+ **Type Safety Issues (data-processor.ts):**
95
+ - Excessive `any` in properties and parameters
96
+ - Unsafe type assertions (`as unknown as T`, `as any`)
97
+ - Missing return types
98
+
99
+ **Linting Issues (workflow-handler.ts):**
100
+ - Single-letter function names (`p`, `x`, `z`)
101
+ - Generic variable names (`s`, `d`, `c`, `i`, `r`)
102
+ - Deep nesting (8+ levels)
103
+ - High cyclomatic complexity
104
+
105
+ **Coding Standards Issues (config-manager.ts):**
106
+ - Multiple responsibilities in one file
107
+ - Global mutable state
108
+ - Implicit side effects (auto-initialization)
109
+ - Mixed concerns in functions
110
+
111
+ ---
112
+
113
+ ## Fixture Creation Workflow
114
+
115
+ ### Step 1: Plan Fixture Structure
116
+
117
+ ```
118
+ 1. Identify skill/agent sections to test
119
+ 2. Map each section to a fixture file
120
+ 3. Plan deliberate issues for each file
121
+ 4. Identify supporting stubs needed
122
+ ```
123
+
124
+ ### Step 2: Create Supporting Infrastructure
125
+
126
+ ```typescript
127
+ // scripts/lib/database.ts - Stub for database imports
128
+ export interface QueryResult {
129
+ rows: Record<string, unknown>[];
130
+ }
131
+
132
+ export const db = {
133
+ async query(sql: string): Promise<QueryResult> {
134
+ return { rows: [] };
135
+ }
136
+ };
137
+ ```
138
+
139
+ ### Step 3: Create Fixture Files
140
+
141
+ ```typescript
142
+ // scripts/components/user-service.ts
143
+ // NO comments explaining this is a test!
144
+ // File looks like production code
145
+
146
+ import { db } from '../lib/database';
147
+
148
+ const API_KEY = 'sk_live_...'; // Hardcoded secret
149
+
150
+ export async function getUserByEmail(email: string) {
151
+ const query = `SELECT * FROM users WHERE email = '${email}'`; // SQL injection
152
+ // ... rest of realistic code
153
+ }
154
+ ```
155
+
156
+ ### Step 4: Verify Phase 1 Passes
157
+
158
+ ```bash
159
+ # Must pass before creating test cases
160
+ just typecheck
161
+ just lint
162
+ ```
163
+
164
+ ### Step 5: Create Test Protocol
165
+
166
+ Use conversational, non-developer prompts:
167
+
168
+ ```markdown
169
+ **Prompt** (conversational):
170
+ I just joined the team and was asked to review the user authentication module
171
+ before we go live. Can you take a look at scripts/components/user-service.ts
172
+ and let me know if there's anything concerning?
173
+ ```
174
+
175
+ **NOT:**
176
+ ```markdown
177
+ **Prompt** (too technical):
178
+ Run code-review on the SQL injection vulnerability in getUserByEmail().
179
+ ```
180
+
181
+ ### Step 6: Add Cleanup Steps
182
+
183
+ ```markdown
184
+ ## Cleanup Steps
185
+
186
+ ### CLEANUP-P4-001: Remove Component Fixtures
187
+ rm -rf scripts/components/
188
+ rm -rf scripts/lib/database.ts
189
+ rm -rf scripts/lib/logger.ts
190
+ ```
191
+
192
+ ---
193
+
194
+ ## Prompt Writing Guidelines
195
+
196
+ ### Realistic User Language
197
+
198
+ Users don't speak in technical jargon. Prompts should reflect real conversations.
199
+
200
+ | Bad (Technical) | Good (Realistic) |
201
+ |-----------------|------------------|
202
+ | "Review the SQL injection in line 14" | "The login seems slow and I'm worried about security" |
203
+ | "Check for any usage" | "Sometimes we get weird undefined errors" |
204
+ | "Analyze cyclomatic complexity" | "I can barely understand what this code does" |
205
+ | "Validate SRP compliance" | "This file seems to do a lot of different things" |
206
+
207
+ ### Symptom-Based Prompts
208
+
209
+ Describe symptoms, not root causes:
210
+
211
+ ```
212
+ "After I select a date range on the app, the app hangs. Could you please
213
+ debug, fix and validate the issue after loading the appropriate skills
214
+ and pipeline agents?"
215
+ ```
216
+
217
+ **NOT:**
218
+ ```
219
+ "timerangecalc() is giving an out of bound error"
220
+ ```
221
+
222
+ ---
223
+
224
+ ## Cleanup Protocol
225
+
226
+ **MANDATORY**: All fixtures must be cleaned up after testing.
227
+
228
+ ### Cleanup Checklist
229
+
230
+ 1. [ ] Remove fixture files (`scripts/components/*.ts`)
231
+ 2. [ ] Remove supporting stubs (`scripts/lib/database.ts`, etc.)
232
+ 3. [ ] Remove empty directories
233
+ 4. [ ] Clear diagnostic logs (optional)
234
+ 5. [ ] Verify `just typecheck` passes after cleanup
235
+ 6. [ ] Check `git status` for orphaned artifacts
236
+
237
+ ### Cleanup Commands
238
+
239
+ ```bash
240
+ # Remove fixtures
241
+ rm -rf scripts/components/
242
+ rm -f scripts/lib/database.ts scripts/lib/logger.ts
243
+
244
+ # Verify clean state
245
+ just typecheck
246
+ git status
247
+ ```
248
+
249
+ ---
250
+
251
+ ## Diagnostic Output
252
+
253
+ After creating fixtures, document the mapping:
254
+
255
+ ```yaml
256
+ diagnostic:
257
+ skill: test-fixture-creation
258
+ timestamp: 2026-01-31T12:00:00Z
259
+ fixtures_created:
260
+ - file: scripts/components/user-service.ts
261
+ section: Security
262
+ issues: [sql_injection, hardcoded_secrets, path_traversal]
263
+ - file: scripts/components/data-processor.ts
264
+ section: Type Safety
265
+ issues: [excessive_any, unsafe_assertions]
266
+ - file: scripts/components/workflow-handler.ts
267
+ section: Linting
268
+ issues: [poor_naming, deep_nesting, high_complexity]
269
+ - file: scripts/components/config-manager.ts
270
+ section: Coding Standards
271
+ issues: [multiple_responsibilities, global_state, side_effects]
272
+ supporting_stubs:
273
+ - scripts/lib/database.ts
274
+ - scripts/lib/logger.ts
275
+ phase1_validation:
276
+ typecheck: passed
277
+ lint: passed
278
+ ```
279
+
280
+ ---
281
+
282
+ ## Learnings Log
283
+
284
+ ### Session 32 (2026-01-31)
285
+
286
+ 1. **Fixtures in project infrastructure**: Test fixtures need to be in project directories (not tests/fixtures/) so hooks fire correctly
287
+ 2. **No @types/node**: Pure TypeScript fixtures avoid dependency on @types/node
288
+ 3. **Stub imports**: Create minimal stubs for imports to make fixtures compile
289
+ 4. **Realistic prompts**: Non-developer language produces more realistic test results
290
+ 5. **Cleanup discipline**: Always add cleanup steps to test protocols
291
+ 6. **ESLint config required**: Without `.eslintrc.json`, `just lint` skips TypeScript - Phase 1 incomplete
292
+ 7. **Package.json for deps**: Need `package.json` with typescript, eslint, @typescript-eslint/* for real Phase 1 checks
293
+ 8. **Warnings vs Errors**: ESLint warnings (intentional `any`, unused vars) don't block Phase 1; only errors block
294
+ 9. **Separate fixture locations**: Use `scripts/components/` for direct invocation, `scripts/services/` for pipeline integration
295
+ 10. **Pipeline vs Direct tests**: Direct invocation uses `--section` flag (deterministic); pipeline tests LLM judgment (stochastic)