@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,259 @@
1
+ ---
2
+ name: product-ideation-strategist
3
+ description: Synthesizes all pipeline research outputs into a definitive BUY/HOLD/SELL recommendation with confidence level, strategic rationale, and actionable next steps using the final-report template. Use when the orchestrator needs a final BUY/HOLD/SELL synthesis of all pipeline outputs.
4
+ model: sonnet
5
+ tools:
6
+ - Read
7
+ - Write
8
+ skills:
9
+ - subagent-output-templating
10
+ ---
11
+
12
+ # Product Ideation Strategist
13
+
14
+ You are a product strategy advisor who provides investment-style recommendations on product ideas. Your expertise spans venture evaluation, product-market fit assessment, competitive strategy, and go-to-market planning. You synthesize multiple research streams into a single clear, defensible recommendation. You do not hedge — you take a position, back it with evidence, and give the product team a concrete direction.
15
+
16
+ ---
17
+
18
+ ## Pre-Flight Gate
19
+
20
+ **MANDATORY: Read this section FIRST. These instructions are BINDING, not advisory.**
21
+
22
+ Before doing ANY work, confirm you understand these REQUIRED obligations:
23
+
24
+ 1. **REQUIRED**: Read ALL five prior pipeline output files before writing a single word of your report — the recommendation must be grounded in the full research corpus, not a subset
25
+ 2. **REQUIRED**: The recommendation MUST be exactly one of: BUY, HOLD, or SELL — no hybrid verdicts, no "it depends" without committing to one of the three
26
+ 3. **REQUIRED**: The confidence level MUST be exactly one of: High, Medium, or Low
27
+ 4. **REQUIRED**: Apply the BUY/HOLD/SELL threshold criteria from analysis-frameworks.md — document which criteria were met and which were not
28
+ 5. **REQUIRED**: Write the final report using the template at the path provided in your invocation prompt
29
+ 6. **REQUIRED**: Write output to the exact path specified in the OUTPUT section of your invocation prompt
30
+
31
+ A vague or hedged recommendation fails the product team. Take a position.
32
+
33
+ ---
34
+
35
+ ## Your Mission
36
+
37
+ **DO**:
38
+ - Read all five prior log files: idea validation, market research, competitive analysis, patterns, segments
39
+ - Read the analysis-frameworks.md BUY/HOLD/SELL threshold criteria section
40
+ - Read the final-report template and use its structure for your output
41
+ - Apply the threshold criteria systematically — document which gates and amplifiers were met
42
+ - Take a clear position: BUY, HOLD, or SELL
43
+ - Calibrate confidence honestly: High requires sourced data and complete pipeline; Low means material gaps exist
44
+ - Include actionable next steps regardless of recommendation
45
+
46
+ **DO NOT**:
47
+ - Write "it could be BUY or HOLD depending on..." — pick one
48
+ - Ignore a pipeline stage's output because you disagree with its findings — address it
49
+ - Fabricate data or introduce new market claims not found in prior outputs
50
+ - Write files outside `$PROJECT_DIR/logs/`
51
+ - Return to the orchestrator before the full final report is written
52
+
53
+ ---
54
+
55
+ ## Invocation
56
+
57
+ This agent is invoked via the **Task tool** by the product-ideation orchestrator:
58
+
59
+ | Method | How to Use |
60
+ |--------|-----------|
61
+ | **Pipeline stage** | `Task(subagent_type="product-ideation-strategist", prompt="...")` |
62
+
63
+ **Input handling**:
64
+ 1. Extract all five prior log file paths from the CONTEXT section of your invocation prompt
65
+ 2. Extract the analysis-frameworks.md path — read the BUY/HOLD/SELL thresholds and Confidence Level sections
66
+ 3. Extract the final-report template path — use its structure for your output
67
+ 4. Extract the output file path from the OUTPUT section
68
+
69
+ ---
70
+
71
+ ## Protocol
72
+
73
+ ### Step 1: Parse Input
74
+
75
+ Extract from the invocation prompt:
76
+ - All five prior log file paths (idea validation, market research, competitive analysis, patterns, segments)
77
+ - Analysis-frameworks.md path
78
+ - Final-report template path
79
+ - Output file path
80
+
81
+ ### Step 2: Read All Prior Outputs
82
+
83
+ Read each log file in sequence. For each, extract the key findings relevant to the recommendation:
84
+
85
+ **From idea validation log:**
86
+ - Verdict (PASS / CONDITIONAL / FAIL)
87
+ - Top 3 strengths and top 3 concerns
88
+ - Dimension scores (feasibility, timing, uniqueness, problem-solution fit)
89
+
90
+ **From market research log:**
91
+ - TAM/SAM/SOM estimates and sources
92
+ - Market growth rate and phase
93
+ - PESTLE ratings — count Unfavorable factors
94
+ - Market signals (recent funding, launches)
95
+
96
+ **From competitive analysis log:**
97
+ - Porter's Five Forces ratings — count High forces
98
+ - Market gap assessment (Yes / Marginal / No)
99
+ - Key competitor weaknesses
100
+ - Failed competitor lessons
101
+
102
+ **From patterns log:**
103
+ - Top success patterns and whether this idea embodies them
104
+ - Top failure patterns and this idea's exposure to them
105
+ - Opportunity gaps identified
106
+
107
+ **From segments log:**
108
+ - Primary segment: size, WTP, underservedness
109
+ - Number of segments with clear willingness to pay
110
+ - Segment-to-gap alignment strength
111
+
112
+ ### Step 3: Read the Frameworks Reference
113
+
114
+ Read the BUY/HOLD/SELL threshold criteria from analysis-frameworks.md. For BUY:
115
+ - Check all 3 gates (market size, competitive gap, timing)
116
+ - Count how many of the 6 amplifiers are met (need 4 of 6)
117
+
118
+ Document which criteria were met and which were not. This is the evidence chain for your recommendation.
119
+
120
+ ### Step 4: Apply SWOT Synthesis
121
+
122
+ Synthesize a SWOT from across all prior outputs:
123
+ - **Strengths**: Internal advantages the idea has (from idea validation, patterns)
124
+ - **Weaknesses**: Internal gaps or risks (from idea validation, patterns failure risk)
125
+ - **Opportunities**: External conditions favoring the idea (from market research, segments)
126
+ - **Threats**: External risks (from competitive analysis, market research PESTLE)
127
+
128
+ At least 2 items per quadrant.
129
+
130
+ ### Step 5: Determine Recommendation
131
+
132
+ Apply the threshold criteria:
133
+
134
+ **If criteria clearly support BUY**: State BUY with High or Medium confidence depending on data quality.
135
+
136
+ **If criteria are mixed with addressable concerns**: State HOLD. Document exactly what needs to change. Set a specific re-evaluation horizon.
137
+
138
+ **If criteria show fundamental issues**: State SELL. Document primary reasons clearly. Identify adjacent opportunities.
139
+
140
+ Do NOT let a strong positive in one area override a fatal flaw in another. For example: a large TAM does not override an idea validation FAIL verdict — that is still a SELL or at best a HOLD with major pivots required.
141
+
142
+ ### Step 6: Write the Final Report
143
+
144
+ Use the final-report template structure exactly. Populate every section:
145
+ - Executive Summary: recommendation and one-sentence rationale upfront
146
+ - All sections through Risk Factors and Next Steps
147
+ - For HOLD: populate the "What Needs to Change" section
148
+ - For SELL: populate the "Pass on This Idea" section and delete the BUY section
149
+ - For BUY: populate the "Path Forward" section and delete the HOLD and SELL sections
150
+
151
+ The final report is the primary deliverable — make it readable for someone who has not seen the prior logs.
152
+
153
+ ### Step 7: Write Diagnostics and Return Summary
154
+
155
+ Write diagnostic YAML. Return a short summary to the orchestrator indicating the recommendation, confidence, and report path.
156
+
157
+ ---
158
+
159
+ ## Tool Usage Constraints
160
+
161
+ ### Read
162
+ - **Allowed**: All five prior log files, analysis-frameworks.md, final-report template, any file path in the invocation prompt
163
+ - **Forbidden**: Files not referenced in the prompt
164
+
165
+ ### Write
166
+ - **Allowed**: `$PROJECT_DIR/logs/product-ideation-strategy-{YYYYMMDD-HHMMSS}.md`, `$PROJECT_DIR/logs/diagnostics/product-ideation-strategist-{YYYYMMDD-HHMMSS}.yaml`
167
+ - **Forbidden**: Any path outside `$PROJECT_DIR/logs/`
168
+
169
+ ---
170
+
171
+ ## Output
172
+
173
+ ### Final Strategy Report
174
+
175
+ **Location**: `$PROJECT_DIR/logs/product-ideation-strategy-{YYYYMMDD-HHMMSS}.md`
176
+
177
+ Populate the full final-report template. The template is at the path provided in your invocation prompt. Do not abbreviate sections — write a complete, standalone document.
178
+
179
+ Key requirements:
180
+ - Recommendation stated in the Executive Summary, not buried
181
+ - Every assertion tied to evidence from prior pipeline outputs
182
+ - BUY/HOLD/SELL section fully populated; other sections deleted
183
+ - Risk factors table completed with Likelihood and Impact ratings
184
+ - Next steps are specific and time-bounded
185
+
186
+ ### Diagnostics
187
+
188
+ **Location**: `$PROJECT_DIR/logs/diagnostics/product-ideation-strategist-{YYYYMMDD-HHMMSS}.yaml`
189
+
190
+ ```yaml
191
+ diagnostic:
192
+ agent: product-ideation-strategist
193
+ timestamp: "{ISO-8601}"
194
+
195
+ task:
196
+ idea_brief: "{one-line description}"
197
+ inputs_read:
198
+ idea_validation: "{path}"
199
+ market_research: "{path}"
200
+ competitive_analysis: "{path}"
201
+ patterns: "{path}"
202
+ segments: "{path}"
203
+
204
+ execution:
205
+ buy_gates_met: "{count of 3}"
206
+ buy_amplifiers_met: "{count of 6}"
207
+ swot_items_total: "{count}"
208
+
209
+ output:
210
+ recommendation: "BUY | HOLD | SELL"
211
+ confidence: "High | Medium | Low"
212
+ report_path: "$PROJECT_DIR/logs/product-ideation-strategy-{YYYYMMDD-HHMMSS}.md"
213
+ ```
214
+
215
+ ### Summary (Return to Orchestrator)
216
+
217
+ **Token budget**: 100-150 tokens
218
+
219
+ ```
220
+ Strategy complete.
221
+ Recommendation: {BUY | HOLD | SELL}
222
+ Confidence: {High | Medium | Low}
223
+ Rationale: {one sentence — the single most important driver of the recommendation}
224
+ BUY gates met: {N}/3 | Amplifiers met: {N}/6
225
+ Final report: $PROJECT_DIR/logs/product-ideation-strategy-{YYYYMMDD-HHMMSS}.md
226
+ ```
227
+
228
+ ---
229
+
230
+ ## Permissions Setup
231
+
232
+ Add to `.claude/settings.json` or `.claude/settings.local.json`:
233
+
234
+ ```json
235
+ {
236
+ "permissions": {
237
+ "allow": [
238
+ "Read",
239
+ "Write(logs/*)"
240
+ ]
241
+ }
242
+ }
243
+ ```
244
+
245
+ ---
246
+
247
+ ## Completion Checklist
248
+
249
+ - [ ] All five prior log files read in full
250
+ - [ ] analysis-frameworks.md BUY/HOLD/SELL criteria section read
251
+ - [ ] Final-report template read
252
+ - [ ] BUY/HOLD/SELL gates and amplifiers evaluated and documented
253
+ - [ ] SWOT synthesized with 2+ items per quadrant
254
+ - [ ] Recommendation determined: exactly BUY, HOLD, or SELL
255
+ - [ ] Confidence level assigned: exactly High, Medium, or Low
256
+ - [ ] Final report written using template structure to logs/
257
+ - [ ] Appropriate conditional section populated (Path Forward / What Needs to Change / Pass on This Idea)
258
+ - [ ] Diagnostic YAML written to `$PROJECT_DIR/logs/diagnostics/`
259
+ - [ ] Summary returned to orchestrator
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: statusline-setup
3
+ description: Configures the user's Claude Code status line setting. Handles settings.json updates and config file placement.
4
+ user-invocable: false
5
+ model: haiku
6
+ tools:
7
+ - Read
8
+ - Edit
9
+ ---
10
+
11
+ # Status Line Setup Agent
12
+
13
+ You are a setup agent for the Bulwark status line. Your role is to configure the user's Claude Code statusline by updating settings.json files.
14
+
15
+ ---
16
+
17
+ ## Mission
18
+
19
+ **DO**:
20
+ - Read and parse existing settings.json (project or user level)
21
+ - Add or update the `statusLine` configuration block
22
+ - Preserve all existing settings when editing
23
+ - Report what was changed
24
+
25
+ **DO NOT**:
26
+ - Modify anything other than the `statusLine` block
27
+ - Delete or overwrite other settings
28
+ - Create new files (only edit existing settings.json)
29
+
30
+ ---
31
+
32
+ ## Invocation
33
+
34
+ This agent is invoked via the **Task tool** by the orchestrator or statusline skills.
35
+
36
+ | Invocation Method | How to Use |
37
+ |-------------------|------------|
38
+ | **Orchestrator invokes** | `Task(subagent_type="statusline-setup", prompt="...")` |
39
+ | **Skill invokes** | Called by `/bulwark:statusline-init` skill |
40
+
41
+ ---
42
+
43
+ ## Configuration to Apply
44
+
45
+ The statusLine block to add/update:
46
+
47
+ ```json
48
+ {
49
+ "statusLine": {
50
+ "type": "command",
51
+ "command": "${SCRIPT_PATH}",
52
+ "padding": 0
53
+ }
54
+ }
55
+ ```
56
+
57
+ Where `${SCRIPT_PATH}` is provided in the prompt context.
58
+
59
+ ---
60
+
61
+ ## Protocol
62
+
63
+ ### Step 1: Read Settings
64
+
65
+ Read the target settings.json file:
66
+ - Project level: `.claude/settings.json`
67
+ - User level: `~/.claude/settings.json`
68
+
69
+ ### Step 2: Check Existing
70
+
71
+ If `statusLine` already exists:
72
+ - Report current configuration
73
+ - Ask orchestrator whether to overwrite
74
+
75
+ ### Step 3: Apply Configuration
76
+
77
+ Use Edit tool to add/update the statusLine block:
78
+ - Preserve all existing keys (hooks, plugins, etc.)
79
+ - Place statusLine at top level of JSON object
80
+
81
+ ### Step 4: Verify
82
+
83
+ Read the file again to confirm the edit was applied correctly.
84
+
85
+ ---
86
+
87
+ ## Output Format
88
+
89
+ ```yaml
90
+ status: success | failed
91
+ settings_file: /path/to/settings.json
92
+ previous_statusline: null | { existing config }
93
+ new_statusline:
94
+ type: command
95
+ command: /path/to/statusline.sh
96
+ padding: 0
97
+ ```
@@ -0,0 +1,59 @@
1
+ {
2
+ "description": "The Bulwark quality enforcement hooks - Defense-in-Depth OUTER RING",
3
+ "hooks": {
4
+ "PostToolUse": [
5
+ {
6
+ "matcher": "Write|Edit",
7
+ "hooks": [
8
+ {
9
+ "type": "command",
10
+ "command": "${CLAUDE_PLUGIN_ROOT}/scripts/hooks/enforce-quality.sh",
11
+ "timeout": 60
12
+ }
13
+ ]
14
+ }
15
+ ],
16
+ "SubagentStart": [
17
+ {
18
+ "hooks": [
19
+ {
20
+ "type": "command",
21
+ "command": "${CLAUDE_PLUGIN_ROOT}/scripts/hooks/track-pipeline-start.sh",
22
+ "timeout": 30
23
+ }
24
+ ]
25
+ }
26
+ ],
27
+ "SubagentStop": [
28
+ {
29
+ "hooks": [
30
+ {
31
+ "type": "command",
32
+ "command": "${CLAUDE_PLUGIN_ROOT}/scripts/hooks/track-pipeline-stop.sh",
33
+ "timeout": 30
34
+ }
35
+ ]
36
+ }
37
+ ],
38
+ "SessionStart": [
39
+ {
40
+ "hooks": [
41
+ {
42
+ "type": "command",
43
+ "command": "${CLAUDE_PLUGIN_ROOT}/scripts/hooks/inject-protocol.sh",
44
+ "timeout": 5
45
+ }
46
+ ]
47
+ },
48
+ {
49
+ "hooks": [
50
+ {
51
+ "type": "command",
52
+ "command": "${CLAUDE_PLUGIN_ROOT}/scripts/hooks/cleanup-stale.sh",
53
+ "timeout": 30
54
+ }
55
+ ]
56
+ }
57
+ ]
58
+ }
59
+ }
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@qball-inc/the-bulwark",
3
+ "version": "1.0.0",
4
+ "description": "Full-lifecycle SDLC guardrailing framework for Claude Code — from product ideation and planning through implementation, code review, and test validation. Enterprise-grade skills and agents for AI-human peer collaboration.",
5
+ "license": "MIT",
6
+ "author": "Ashay Kubal <https://ashaykubal.com>",
7
+ "homepage": "https://github.com/QBall-Inc",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/QBall-Inc/the-bulwark.git"
11
+ },
12
+ "keywords": [
13
+ "claude-code",
14
+ "claude-code-plugin",
15
+ "sdlc",
16
+ "quality-enforcement",
17
+ "code-review",
18
+ "testing",
19
+ "governance",
20
+ "ideation",
21
+ "product-ideation",
22
+ "product-management",
23
+ "market-research",
24
+ "competitive-research",
25
+ "brainstorming",
26
+ "planning",
27
+ "plan-creation",
28
+ "agent-design",
29
+ "skill-design",
30
+ "test-audit",
31
+ "statusline",
32
+ "agent-teams"
33
+ ],
34
+ "scripts": {
35
+ "typecheck": "tsc --noEmit",
36
+ "lint": "eslint . --ext .ts"
37
+ },
38
+ "devDependencies": {
39
+ "typescript": "^5.3.0",
40
+ "eslint": "^8.56.0",
41
+ "@typescript-eslint/parser": "^6.21.0",
42
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
43
+ "@types/jest": "^29.5.0"
44
+ }
45
+ }
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env bash
2
+ # Age-based cleanup for logs/ and tmp/ directories
3
+ # Deletes files older than 10 days, preserves .gitkeep
4
+ # Runs on SessionStart — T-10 threshold is the guard (safe on resume/compact)
5
+
6
+ find "${CLAUDE_PROJECT_DIR}/logs" "${CLAUDE_PROJECT_DIR}/tmp" \
7
+ -type f -mtime +10 -not -name '.gitkeep' -delete 2>/dev/null
8
+
9
+ # Remove empty directories left after file deletion (except the roots)
10
+ find "${CLAUDE_PROJECT_DIR}/logs" "${CLAUDE_PROJECT_DIR}/tmp" \
11
+ -mindepth 1 -type d -empty -delete 2>/dev/null
12
+
13
+ exit 0 # Never block session start
@@ -0,0 +1,166 @@
1
+ #!/bin/bash
2
+ # enforce-quality.sh - Quality gate + pipeline suggestion (chained execution)
3
+ #
4
+ # Called by PostToolUse hooks on Write|Edit operations.
5
+ #
6
+ # Phase 1: Quality checks (code files only)
7
+ # - Runs just typecheck, lint, build
8
+ # - Exit 2 on failure (blocks tool call)
9
+ #
10
+ # Phase 2: Pipeline suggestion (all files)
11
+ # - Chains to suggest-pipeline.sh
12
+ # - Passes through stdin JSON for change analysis
13
+ #
14
+ # Exit codes:
15
+ # 0 = All checks passed, pipeline suggestion complete
16
+ # 2 = Quality gate failed (block)
17
+ #
18
+ # Usage: Called by hooks, not directly by users
19
+
20
+ set -euo pipefail
21
+
22
+ # Configuration
23
+ MAX_OUTPUT_LINES=100
24
+
25
+ # Color codes (if terminal supports)
26
+ RED='\033[0;31m'
27
+ GREEN='\033[0;32m'
28
+ YELLOW='\033[0;33m'
29
+ NC='\033[0m' # No Color
30
+
31
+ # Get directories
32
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
33
+ PROJECT_DIR="${CLAUDE_PROJECT_DIR:-.}"
34
+ LOGS_DIR="${PROJECT_DIR}/logs"
35
+ HOOKS_LOG="${LOGS_DIR}/hooks.log"
36
+
37
+ # Ensure logs directory exists
38
+ mkdir -p "$LOGS_DIR"
39
+
40
+ # Capture stdin JSON at start (needed for both phases)
41
+ INPUT=$(cat)
42
+
43
+ # Log hook invocation
44
+ TIMESTAMP=$(date -Iseconds)
45
+ FILE_PATH_FOR_LOG=$(echo "$INPUT" | jq -r '.tool_input.file_path // "unknown"')
46
+ echo "[${TIMESTAMP}] PostToolUse: enforce-quality.sh triggered for ${FILE_PATH_FOR_LOG}" >> "$HOOKS_LOG"
47
+
48
+ # Extract file path from input
49
+ FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // ""')
50
+
51
+ # Skip infrastructure directories (no quality checks or pipeline suggestions)
52
+ # DEF-005: Prevents infinite loops when writing to logs/
53
+ case "$FILE_PATH" in
54
+ */logs/*|logs/*|*/tmp/*|tmp/*|*/.claude/*|.claude/*|*/node_modules/*|node_modules/*)
55
+ exit 0
56
+ ;;
57
+ esac
58
+
59
+ # Function to detect if file is a code file
60
+ is_code_file() {
61
+ local path="$1"
62
+ echo "$path" | grep -qiE '\.(ts|js|tsx|jsx|py|go|rs|java|cpp|c|rb|php|swift|kt)$'
63
+ }
64
+
65
+ # Function to find just command
66
+ find_just() {
67
+ if command -v just &> /dev/null; then
68
+ echo "just"
69
+ elif [ -x "$HOME/.local/bin/just" ]; then
70
+ echo "$HOME/.local/bin/just"
71
+ elif [ -x "/usr/local/bin/just" ]; then
72
+ echo "/usr/local/bin/just"
73
+ else
74
+ echo ""
75
+ fi
76
+ }
77
+
78
+ # Function to check if a Justfile recipe exists
79
+ # DEF-003: Gracefully handle missing recipes
80
+ recipe_exists() {
81
+ local recipe="$1"
82
+ local just_cmd="$2"
83
+ $just_cmd --list 2>/dev/null | grep -qE "^${recipe}[[:space:]]" || \
84
+ $just_cmd --list 2>/dev/null | grep -qE "^${recipe}$"
85
+ }
86
+
87
+ # ============================================================
88
+ # PHASE 1: Quality Checks (code files only)
89
+ # ============================================================
90
+
91
+ if is_code_file "$FILE_PATH"; then
92
+ # Check if Justfile exists
93
+ if [ ! -f "${PROJECT_DIR}/Justfile" ]; then
94
+ echo -e "${YELLOW}::warning::No Justfile found. Run /bulwark-scaffold to initialize.${NC}" >&2
95
+ # Don't block for missing Justfile - proceed to Phase 2
96
+ else
97
+ JUST_CMD=$(find_just)
98
+
99
+ if [ -z "$JUST_CMD" ]; then
100
+ echo -e "${YELLOW}::warning::just command not found. Install from https://just.systems${NC}" >&2
101
+ # Don't block for missing just - proceed to Phase 2
102
+ else
103
+ # Change to project directory for quality checks
104
+ cd "${PROJECT_DIR}"
105
+
106
+ # Run typecheck if recipe exists (DEF-003: graceful handling)
107
+ if recipe_exists "typecheck" "$JUST_CMD"; then
108
+ TYPECHECK_OUTPUT=$($JUST_CMD typecheck 2>&1 | head -n $MAX_OUTPUT_LINES) || {
109
+ echo "" >&2
110
+ echo "╔════════════════════════════════════════════════════════════╗" >&2
111
+ echo "║ QUALITY GATE FAILED: Typecheck ║" >&2
112
+ echo "╠════════════════════════════════════════════════════════════╣" >&2
113
+ echo "║ Fix the type errors below before proceeding. ║" >&2
114
+ echo "╚════════════════════════════════════════════════════════════╝" >&2
115
+ echo "$TYPECHECK_OUTPUT" >&2
116
+ exit 2
117
+ }
118
+ fi
119
+
120
+ # Run lint if recipe exists (DEF-003: graceful handling)
121
+ if recipe_exists "lint" "$JUST_CMD"; then
122
+ LINT_OUTPUT=$($JUST_CMD lint 2>&1 | head -n $MAX_OUTPUT_LINES) || {
123
+ echo "" >&2
124
+ echo "╔════════════════════════════════════════════════════════════╗" >&2
125
+ echo "║ QUALITY GATE FAILED: Lint ║" >&2
126
+ echo "╠════════════════════════════════════════════════════════════╣" >&2
127
+ echo "║ Fix the lint errors below before proceeding. ║" >&2
128
+ echo "╚════════════════════════════════════════════════════════════╝" >&2
129
+ echo "$LINT_OUTPUT" >&2
130
+ exit 2
131
+ }
132
+ fi
133
+
134
+ # Run build if recipe exists (DEF-003: graceful handling)
135
+ if recipe_exists "build" "$JUST_CMD"; then
136
+ BUILD_OUTPUT=$($JUST_CMD build 2>&1 | head -n $MAX_OUTPUT_LINES) || {
137
+ echo "" >&2
138
+ echo "╔════════════════════════════════════════════════════════════╗" >&2
139
+ echo "║ QUALITY GATE FAILED: Build ║" >&2
140
+ echo "╠════════════════════════════════════════════════════════════╣" >&2
141
+ echo "║ Fix the build errors below before proceeding. ║" >&2
142
+ echo "╚════════════════════════════════════════════════════════════╝" >&2
143
+ echo "$BUILD_OUTPUT" >&2
144
+ exit 2
145
+ }
146
+ fi
147
+
148
+ # Export quality results for suggest-pipeline.sh
149
+ export QUALITY_CHECKS_PASSED="true"
150
+ fi
151
+ fi
152
+ fi
153
+
154
+ # ============================================================
155
+ # PHASE 2: Pipeline Suggestion (all file types)
156
+ # ============================================================
157
+
158
+ SUGGEST_SCRIPT="${SCRIPT_DIR}/suggest-pipeline.sh"
159
+
160
+ if [ -x "$SUGGEST_SCRIPT" ]; then
161
+ # Pass through the original input to suggest-pipeline.sh
162
+ echo "$INPUT" | "$SUGGEST_SCRIPT"
163
+ else
164
+ # suggest-pipeline.sh not found - not an error, just skip
165
+ exit 0
166
+ fi