@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.
- package/.claude-plugin/plugin.json +43 -0
- package/agents/bulwark-fix-validator.md +633 -0
- package/agents/bulwark-implementer.md +391 -0
- package/agents/bulwark-issue-analyzer.md +308 -0
- package/agents/bulwark-standards-reviewer.md +221 -0
- package/agents/plan-creation-architect.md +323 -0
- package/agents/plan-creation-eng-lead.md +352 -0
- package/agents/plan-creation-po.md +300 -0
- package/agents/plan-creation-qa-critic.md +334 -0
- package/agents/product-ideation-competitive-analyzer.md +298 -0
- package/agents/product-ideation-idea-validator.md +268 -0
- package/agents/product-ideation-market-researcher.md +292 -0
- package/agents/product-ideation-pattern-documenter.md +308 -0
- package/agents/product-ideation-segment-analyzer.md +303 -0
- package/agents/product-ideation-strategist.md +259 -0
- package/agents/statusline-setup.md +97 -0
- package/hooks/hooks.json +59 -0
- package/package.json +45 -0
- package/scripts/hooks/cleanup-stale.sh +13 -0
- package/scripts/hooks/enforce-quality.sh +166 -0
- package/scripts/hooks/implementer-quality.sh +256 -0
- package/scripts/hooks/inject-protocol.sh +52 -0
- package/scripts/hooks/suggest-pipeline.sh +175 -0
- package/scripts/hooks/track-pipeline-start.sh +37 -0
- package/scripts/hooks/track-pipeline-stop.sh +52 -0
- package/scripts/init-rules.sh +35 -0
- package/scripts/init.sh +151 -0
- package/skills/anthropic-validator/SKILL.md +607 -0
- package/skills/anthropic-validator/references/agents-checklist.md +131 -0
- package/skills/anthropic-validator/references/commands-checklist.md +102 -0
- package/skills/anthropic-validator/references/hooks-checklist.md +151 -0
- package/skills/anthropic-validator/references/mcp-checklist.md +136 -0
- package/skills/anthropic-validator/references/plugins-checklist.md +148 -0
- package/skills/anthropic-validator/references/skills-checklist.md +85 -0
- package/skills/assertion-patterns/SKILL.md +296 -0
- package/skills/bug-magnet-data/SKILL.md +284 -0
- package/skills/bug-magnet-data/context/cli-args.md +91 -0
- package/skills/bug-magnet-data/context/db-query.md +104 -0
- package/skills/bug-magnet-data/context/file-contents.md +103 -0
- package/skills/bug-magnet-data/context/http-body.md +91 -0
- package/skills/bug-magnet-data/context/process-spawn.md +123 -0
- package/skills/bug-magnet-data/data/booleans/boundaries.yaml +143 -0
- package/skills/bug-magnet-data/data/collections/arrays.yaml +114 -0
- package/skills/bug-magnet-data/data/collections/objects.yaml +123 -0
- package/skills/bug-magnet-data/data/concurrency/race-conditions.yaml +118 -0
- package/skills/bug-magnet-data/data/concurrency/state-machines.yaml +115 -0
- package/skills/bug-magnet-data/data/dates/boundaries.yaml +137 -0
- package/skills/bug-magnet-data/data/dates/invalid.yaml +132 -0
- package/skills/bug-magnet-data/data/dates/timezone.yaml +118 -0
- package/skills/bug-magnet-data/data/encoding/charset.yaml +79 -0
- package/skills/bug-magnet-data/data/encoding/normalization.yaml +105 -0
- package/skills/bug-magnet-data/data/formats/email.yaml +154 -0
- package/skills/bug-magnet-data/data/formats/json.yaml +187 -0
- package/skills/bug-magnet-data/data/formats/url.yaml +165 -0
- package/skills/bug-magnet-data/data/language-specific/javascript.yaml +182 -0
- package/skills/bug-magnet-data/data/language-specific/python.yaml +174 -0
- package/skills/bug-magnet-data/data/language-specific/rust.yaml +148 -0
- package/skills/bug-magnet-data/data/numbers/boundaries.yaml +161 -0
- package/skills/bug-magnet-data/data/numbers/precision.yaml +89 -0
- package/skills/bug-magnet-data/data/numbers/special.yaml +69 -0
- package/skills/bug-magnet-data/data/strings/boundaries.yaml +109 -0
- package/skills/bug-magnet-data/data/strings/injection.yaml +208 -0
- package/skills/bug-magnet-data/data/strings/special-chars.yaml +190 -0
- package/skills/bug-magnet-data/data/strings/unicode.yaml +139 -0
- package/skills/bug-magnet-data/references/external-lists.md +115 -0
- package/skills/bulwark-brainstorm/SKILL.md +563 -0
- package/skills/bulwark-brainstorm/references/at-teammate-prompts.md +60 -0
- package/skills/bulwark-brainstorm/references/role-critical-analyst.md +78 -0
- package/skills/bulwark-brainstorm/references/role-development-lead.md +66 -0
- package/skills/bulwark-brainstorm/references/role-product-delivery-lead.md +79 -0
- package/skills/bulwark-brainstorm/references/role-product-manager.md +62 -0
- package/skills/bulwark-brainstorm/references/role-project-sme.md +59 -0
- package/skills/bulwark-brainstorm/references/role-technical-architect.md +66 -0
- package/skills/bulwark-research/SKILL.md +298 -0
- package/skills/bulwark-research/references/viewpoint-contrarian.md +63 -0
- package/skills/bulwark-research/references/viewpoint-direct-investigation.md +62 -0
- package/skills/bulwark-research/references/viewpoint-first-principles.md +65 -0
- package/skills/bulwark-research/references/viewpoint-practitioner.md +62 -0
- package/skills/bulwark-research/references/viewpoint-prior-art.md +66 -0
- package/skills/bulwark-scaffold/SKILL.md +330 -0
- package/skills/bulwark-statusline/SKILL.md +161 -0
- package/skills/bulwark-statusline/scripts/statusline.sh +144 -0
- package/skills/bulwark-verify/SKILL.md +519 -0
- package/skills/code-review/SKILL.md +428 -0
- package/skills/code-review/examples/anti-patterns/linting.ts +181 -0
- package/skills/code-review/examples/anti-patterns/security.ts +91 -0
- package/skills/code-review/examples/anti-patterns/standards.ts +195 -0
- package/skills/code-review/examples/anti-patterns/type-safety.ts +108 -0
- package/skills/code-review/examples/recommended/linting.ts +195 -0
- package/skills/code-review/examples/recommended/security.ts +154 -0
- package/skills/code-review/examples/recommended/standards.ts +231 -0
- package/skills/code-review/examples/recommended/type-safety.ts +181 -0
- package/skills/code-review/frameworks/angular.md +218 -0
- package/skills/code-review/frameworks/django.md +235 -0
- package/skills/code-review/frameworks/express.md +207 -0
- package/skills/code-review/frameworks/flask.md +298 -0
- package/skills/code-review/frameworks/generic.md +146 -0
- package/skills/code-review/frameworks/react.md +152 -0
- package/skills/code-review/frameworks/vue.md +244 -0
- package/skills/code-review/references/linting-patterns.md +221 -0
- package/skills/code-review/references/security-patterns.md +125 -0
- package/skills/code-review/references/standards-patterns.md +246 -0
- package/skills/code-review/references/type-safety-patterns.md +130 -0
- package/skills/component-patterns/SKILL.md +131 -0
- package/skills/component-patterns/references/pattern-cli-command.md +118 -0
- package/skills/component-patterns/references/pattern-database.md +166 -0
- package/skills/component-patterns/references/pattern-external-api.md +139 -0
- package/skills/component-patterns/references/pattern-file-parser.md +168 -0
- package/skills/component-patterns/references/pattern-http-server.md +162 -0
- package/skills/component-patterns/references/pattern-process-spawner.md +133 -0
- package/skills/continuous-feedback/SKILL.md +327 -0
- package/skills/continuous-feedback/references/collect-instructions.md +81 -0
- package/skills/continuous-feedback/references/specialize-code-review.md +82 -0
- package/skills/continuous-feedback/references/specialize-general.md +98 -0
- package/skills/continuous-feedback/references/specialize-test-audit.md +81 -0
- package/skills/create-skill/SKILL.md +359 -0
- package/skills/create-skill/references/agent-conventions.md +194 -0
- package/skills/create-skill/references/agent-template.md +195 -0
- package/skills/create-skill/references/content-guidance.md +291 -0
- package/skills/create-skill/references/decision-framework.md +124 -0
- package/skills/create-skill/references/template-pipeline.md +217 -0
- package/skills/create-skill/references/template-reference-heavy.md +111 -0
- package/skills/create-skill/references/template-research.md +210 -0
- package/skills/create-skill/references/template-script-driven.md +172 -0
- package/skills/create-skill/references/template-simple.md +80 -0
- package/skills/create-subagent/SKILL.md +353 -0
- package/skills/create-subagent/references/agent-conventions.md +268 -0
- package/skills/create-subagent/references/content-guidance.md +232 -0
- package/skills/create-subagent/references/decision-framework.md +134 -0
- package/skills/create-subagent/references/template-single-agent.md +192 -0
- package/skills/fix-bug/SKILL.md +241 -0
- package/skills/governance-protocol/SKILL.md +116 -0
- package/skills/init/SKILL.md +341 -0
- package/skills/issue-debugging/SKILL.md +385 -0
- package/skills/issue-debugging/references/anti-patterns.md +245 -0
- package/skills/issue-debugging/references/debug-report-schema.md +227 -0
- package/skills/mock-detection/SKILL.md +511 -0
- package/skills/mock-detection/references/false-positive-prevention.md +402 -0
- package/skills/mock-detection/references/stub-patterns.md +236 -0
- package/skills/pipeline-templates/SKILL.md +215 -0
- package/skills/pipeline-templates/references/code-change-workflow.md +277 -0
- package/skills/pipeline-templates/references/code-review.md +336 -0
- package/skills/pipeline-templates/references/fix-validation.md +421 -0
- package/skills/pipeline-templates/references/new-feature.md +335 -0
- package/skills/pipeline-templates/references/research-brainstorm.md +161 -0
- package/skills/pipeline-templates/references/research-planning.md +257 -0
- package/skills/pipeline-templates/references/test-audit.md +389 -0
- package/skills/pipeline-templates/references/test-execution-fix.md +238 -0
- package/skills/plan-creation/SKILL.md +497 -0
- package/skills/product-ideation/SKILL.md +372 -0
- package/skills/product-ideation/references/analysis-frameworks.md +161 -0
- package/skills/session-handoff/SKILL.md +139 -0
- package/skills/session-handoff/references/examples.md +223 -0
- package/skills/setup-lsp/SKILL.md +312 -0
- package/skills/setup-lsp/references/server-registry.md +85 -0
- package/skills/setup-lsp/references/troubleshooting.md +135 -0
- package/skills/subagent-output-templating/SKILL.md +415 -0
- package/skills/subagent-output-templating/references/examples.md +440 -0
- package/skills/subagent-prompting/SKILL.md +364 -0
- package/skills/subagent-prompting/references/examples.md +342 -0
- package/skills/test-audit/SKILL.md +531 -0
- package/skills/test-audit/references/known-limitations.md +41 -0
- package/skills/test-audit/references/priority-classification.md +30 -0
- package/skills/test-audit/references/prompts/deep-mode-detection.md +83 -0
- package/skills/test-audit/references/prompts/synthesis.md +57 -0
- package/skills/test-audit/references/rewrite-instructions.md +46 -0
- package/skills/test-audit/references/schemas/audit-output.yaml +100 -0
- package/skills/test-audit/references/schemas/diagnostic-output.yaml +49 -0
- package/skills/test-audit/scripts/data-flow-analyzer.ts +509 -0
- package/skills/test-audit/scripts/integration-mock-detector.ts +462 -0
- package/skills/test-audit/scripts/package.json +20 -0
- package/skills/test-audit/scripts/skip-detector.ts +211 -0
- package/skills/test-audit/scripts/verification-counter.ts +295 -0
- package/skills/test-classification/SKILL.md +310 -0
- package/skills/test-fixture-creation/SKILL.md +295 -0
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
# Sub-Agent Output Examples
|
|
2
|
+
|
|
3
|
+
Extended examples for different agent types and scenarios.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Code Auditor Output Example
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
# logs/bulwark-code-auditor-20260111-143022.yaml
|
|
11
|
+
|
|
12
|
+
metadata:
|
|
13
|
+
agent: bulwark-code-auditor
|
|
14
|
+
timestamp: 2026-01-11T14:30:22Z
|
|
15
|
+
model: sonnet
|
|
16
|
+
task_id: "security-audit-auth-module"
|
|
17
|
+
duration_ms: 8520
|
|
18
|
+
|
|
19
|
+
goal: "Identify security vulnerabilities in authentication module that could allow unauthorized access"
|
|
20
|
+
|
|
21
|
+
completion:
|
|
22
|
+
why:
|
|
23
|
+
problem: "Multiple security issues found in authentication flow"
|
|
24
|
+
root_cause: "Insufficient input validation and outdated hashing algorithm"
|
|
25
|
+
solution: "Fixed validation, upgraded to argon2, added rate limiting"
|
|
26
|
+
|
|
27
|
+
what:
|
|
28
|
+
- file: src/auth/login.ts
|
|
29
|
+
lines: "23-45"
|
|
30
|
+
change: "Added input sanitization for username and password fields"
|
|
31
|
+
- file: src/auth/password.ts
|
|
32
|
+
lines: "12-30"
|
|
33
|
+
change: "Replaced bcrypt with argon2id for password hashing"
|
|
34
|
+
- file: src/auth/middleware.ts
|
|
35
|
+
lines: "56-78"
|
|
36
|
+
change: "Added rate limiting (5 attempts per 15 minutes)"
|
|
37
|
+
- file: src/auth/login.test.ts
|
|
38
|
+
lines: "89-145"
|
|
39
|
+
change: "Added tests for SQL injection, rate limiting, and hash verification"
|
|
40
|
+
|
|
41
|
+
trade_offs:
|
|
42
|
+
gained:
|
|
43
|
+
- "Security: OWASP Top 10 injection prevention"
|
|
44
|
+
- "Security: Modern password hashing (argon2id)"
|
|
45
|
+
- "Security: Brute force protection via rate limiting"
|
|
46
|
+
cost:
|
|
47
|
+
- "Performance: Argon2 is ~3x slower than bcrypt (acceptable for auth)"
|
|
48
|
+
- "Complexity: Rate limiter requires Redis dependency"
|
|
49
|
+
- "Migration: Existing passwords need re-hashing on next login"
|
|
50
|
+
|
|
51
|
+
risks:
|
|
52
|
+
- risk: "Users with old bcrypt hashes must re-authenticate"
|
|
53
|
+
mitigation: "Dual-hash support during 90-day migration window"
|
|
54
|
+
severity: medium
|
|
55
|
+
- risk: "Rate limiter could block legitimate users on shared IPs"
|
|
56
|
+
mitigation: "Whitelist known corporate IP ranges"
|
|
57
|
+
severity: low
|
|
58
|
+
- risk: "Redis failure would disable rate limiting"
|
|
59
|
+
mitigation: "Fallback to in-memory rate limiting with shorter window"
|
|
60
|
+
severity: medium
|
|
61
|
+
|
|
62
|
+
next_steps:
|
|
63
|
+
- "Deploy Redis cluster in staging"
|
|
64
|
+
- "Run migration script for password re-hashing"
|
|
65
|
+
- "Monitor failed login rates for anomalies"
|
|
66
|
+
- "Schedule security review in 30 days"
|
|
67
|
+
|
|
68
|
+
summary: |
|
|
69
|
+
Found 3 security issues in auth module:
|
|
70
|
+
- Critical: SQL injection in login (fixed with parameterized queries)
|
|
71
|
+
- High: Weak bcrypt hashing (upgraded to argon2id)
|
|
72
|
+
- Medium: No brute force protection (added rate limiting)
|
|
73
|
+
|
|
74
|
+
All issues fixed with comprehensive tests. Requires Redis for rate limiting.
|
|
75
|
+
90-day migration window for password re-hashing.
|
|
76
|
+
Next: deploy to staging, monitor for 48h.
|
|
77
|
+
|
|
78
|
+
diagnostics:
|
|
79
|
+
model_requested: sonnet
|
|
80
|
+
model_actual: sonnet
|
|
81
|
+
context_type: forked
|
|
82
|
+
parent_vars_accessible: false
|
|
83
|
+
hooks_fired:
|
|
84
|
+
- Stop
|
|
85
|
+
execution_time_ms: 8520
|
|
86
|
+
completion_status: success
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Test Auditor Output Example
|
|
92
|
+
|
|
93
|
+
```yaml
|
|
94
|
+
# logs/bulwark-test-auditor-20260111-151245.yaml
|
|
95
|
+
|
|
96
|
+
metadata:
|
|
97
|
+
agent: bulwark-test-auditor
|
|
98
|
+
timestamp: 2026-01-11T15:12:45Z
|
|
99
|
+
model: sonnet
|
|
100
|
+
task_id: "test-audit-api-module"
|
|
101
|
+
duration_ms: 5340
|
|
102
|
+
|
|
103
|
+
goal: "Classify tests in api/ module and identify mock-heavy tests that should verify real behavior"
|
|
104
|
+
|
|
105
|
+
completion:
|
|
106
|
+
why:
|
|
107
|
+
problem: "Test suite has high coverage but low confidence due to excessive mocking"
|
|
108
|
+
root_cause: "Tests mock HTTP clients and database, verifying mocks not behavior"
|
|
109
|
+
solution: "Identified 12 tests for rewrite to use real integrations"
|
|
110
|
+
|
|
111
|
+
what:
|
|
112
|
+
- file: src/api/users.test.ts
|
|
113
|
+
lines: "all"
|
|
114
|
+
change: "FLAGGED: 8 tests mock axios, verify mock calls not responses"
|
|
115
|
+
- file: src/api/orders.test.ts
|
|
116
|
+
lines: "45-120"
|
|
117
|
+
change: "FLAGGED: 4 tests mock database, never verify actual data"
|
|
118
|
+
- file: src/api/health.test.ts
|
|
119
|
+
lines: "all"
|
|
120
|
+
change: "OK: Tests actual endpoint, verifies real response"
|
|
121
|
+
|
|
122
|
+
trade_offs:
|
|
123
|
+
gained:
|
|
124
|
+
- "Visibility: Clear inventory of mock-heavy tests"
|
|
125
|
+
- "Priority: Tests ranked by rewrite urgency"
|
|
126
|
+
cost:
|
|
127
|
+
- "Effort: 12 tests need significant rewrite"
|
|
128
|
+
- "Infrastructure: Real integration tests need test database"
|
|
129
|
+
|
|
130
|
+
risks:
|
|
131
|
+
- risk: "Rewriting tests may uncover hidden bugs"
|
|
132
|
+
mitigation: "Run old and new tests in parallel during transition"
|
|
133
|
+
severity: low
|
|
134
|
+
- risk: "Integration tests are slower"
|
|
135
|
+
mitigation: "Separate unit and integration test runs"
|
|
136
|
+
severity: low
|
|
137
|
+
|
|
138
|
+
next_steps:
|
|
139
|
+
- "Set up test database container"
|
|
140
|
+
- "Rewrite users.test.ts first (highest priority)"
|
|
141
|
+
- "Create verification scripts for API endpoints"
|
|
142
|
+
|
|
143
|
+
summary: |
|
|
144
|
+
Audited 15 test files in api/ module.
|
|
145
|
+
Classification: 3 real integration tests, 12 mock-heavy tests.
|
|
146
|
+
Priority rewrites: users.test.ts (8 tests), orders.test.ts (4 tests).
|
|
147
|
+
Recommendation: Set up test database, rewrite in priority order.
|
|
148
|
+
|
|
149
|
+
diagnostics:
|
|
150
|
+
model_requested: sonnet
|
|
151
|
+
model_actual: sonnet
|
|
152
|
+
context_type: forked
|
|
153
|
+
parent_vars_accessible: false
|
|
154
|
+
hooks_fired:
|
|
155
|
+
- Stop
|
|
156
|
+
execution_time_ms: 5340
|
|
157
|
+
completion_status: success
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Issue Debugger Output Example
|
|
163
|
+
|
|
164
|
+
```yaml
|
|
165
|
+
# logs/bulwark-issue-debugger-20260111-162030.yaml
|
|
166
|
+
|
|
167
|
+
metadata:
|
|
168
|
+
agent: bulwark-issue-debugger
|
|
169
|
+
timestamp: 2026-01-11T16:20:30Z
|
|
170
|
+
model: sonnet
|
|
171
|
+
task_id: "debug-issue-memory-leak"
|
|
172
|
+
duration_ms: 12450
|
|
173
|
+
|
|
174
|
+
goal: "Identify root cause of memory leak reported in production WebSocket server"
|
|
175
|
+
|
|
176
|
+
completion:
|
|
177
|
+
why:
|
|
178
|
+
problem: "Server memory grows 50MB/hour, requires daily restarts"
|
|
179
|
+
root_cause: "Event listeners not removed on WebSocket disconnect"
|
|
180
|
+
solution: "Added cleanup in disconnect handler, verified with memory profiling"
|
|
181
|
+
|
|
182
|
+
what:
|
|
183
|
+
- file: src/ws/connection.ts
|
|
184
|
+
lines: "67-89"
|
|
185
|
+
change: "Added removeAllListeners() in onDisconnect handler"
|
|
186
|
+
- file: src/ws/connection.test.ts
|
|
187
|
+
lines: "156-198"
|
|
188
|
+
change: "Added test that simulates 1000 connect/disconnect cycles"
|
|
189
|
+
- file: logs/debugging-memory-leak.md
|
|
190
|
+
lines: "all"
|
|
191
|
+
change: "Documented debugging journey with heap snapshots"
|
|
192
|
+
|
|
193
|
+
trade_offs:
|
|
194
|
+
gained:
|
|
195
|
+
- "Stability: Memory now stable over 72h test run"
|
|
196
|
+
- "Performance: No degradation from cleanup"
|
|
197
|
+
cost:
|
|
198
|
+
- "None identified"
|
|
199
|
+
|
|
200
|
+
risks:
|
|
201
|
+
- risk: "Other event sources may have similar leaks"
|
|
202
|
+
mitigation: "Added memory monitoring dashboard, alert at 80% threshold"
|
|
203
|
+
severity: low
|
|
204
|
+
|
|
205
|
+
next_steps:
|
|
206
|
+
- "Deploy to staging, run 72h soak test"
|
|
207
|
+
- "Add memory metrics to production monitoring"
|
|
208
|
+
- "Audit other WebSocket handlers for similar patterns"
|
|
209
|
+
|
|
210
|
+
summary: |
|
|
211
|
+
Root cause identified: event listeners not cleaned up on WebSocket disconnect.
|
|
212
|
+
Fixed in connection.ts:67-89, added regression test with 1000 cycle simulation.
|
|
213
|
+
Memory stable over 72h test run. Ready for staging deployment.
|
|
214
|
+
Next: 72h soak test in staging, then production rollout.
|
|
215
|
+
|
|
216
|
+
diagnostics:
|
|
217
|
+
model_requested: sonnet
|
|
218
|
+
model_actual: sonnet
|
|
219
|
+
context_type: forked
|
|
220
|
+
parent_vars_accessible: false
|
|
221
|
+
hooks_fired:
|
|
222
|
+
- Stop
|
|
223
|
+
execution_time_ms: 12450
|
|
224
|
+
completion_status: success
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## Implementer Output Example
|
|
230
|
+
|
|
231
|
+
```yaml
|
|
232
|
+
# logs/bulwark-implementer-20260111-173500.yaml
|
|
233
|
+
|
|
234
|
+
metadata:
|
|
235
|
+
agent: bulwark-implementer
|
|
236
|
+
timestamp: 2026-01-11T17:35:00Z
|
|
237
|
+
model: sonnet
|
|
238
|
+
task_id: "implement-password-reset"
|
|
239
|
+
duration_ms: 15780
|
|
240
|
+
|
|
241
|
+
goal: "Implement password reset flow with email verification following security best practices"
|
|
242
|
+
|
|
243
|
+
completion:
|
|
244
|
+
why:
|
|
245
|
+
problem: "Users cannot reset forgotten passwords"
|
|
246
|
+
root_cause: "Feature not implemented"
|
|
247
|
+
solution: "Full password reset flow with secure token generation and email"
|
|
248
|
+
|
|
249
|
+
what:
|
|
250
|
+
- file: src/auth/reset.ts
|
|
251
|
+
lines: "1-85"
|
|
252
|
+
change: "New file: password reset request and verification handlers"
|
|
253
|
+
- file: src/auth/reset.test.ts
|
|
254
|
+
lines: "1-120"
|
|
255
|
+
change: "New file: tests for token generation, expiry, and reset flow"
|
|
256
|
+
- file: src/email/templates/reset.html
|
|
257
|
+
lines: "1-45"
|
|
258
|
+
change: "New file: password reset email template"
|
|
259
|
+
- file: src/routes/auth.ts
|
|
260
|
+
lines: "34-42"
|
|
261
|
+
change: "Added POST /reset-request and POST /reset-verify routes"
|
|
262
|
+
- file: prisma/schema.prisma
|
|
263
|
+
lines: "45-52"
|
|
264
|
+
change: "Added PasswordResetToken model"
|
|
265
|
+
|
|
266
|
+
trade_offs:
|
|
267
|
+
gained:
|
|
268
|
+
- "Feature: Users can reset passwords via email"
|
|
269
|
+
- "Security: Tokens expire in 1 hour, single-use"
|
|
270
|
+
- "UX: Clear error messages for invalid/expired tokens"
|
|
271
|
+
cost:
|
|
272
|
+
- "Dependency: Requires email service (SendGrid configured)"
|
|
273
|
+
- "Database: New table for reset tokens"
|
|
274
|
+
|
|
275
|
+
risks:
|
|
276
|
+
- risk: "Email delivery delays could frustrate users"
|
|
277
|
+
mitigation: "Added 'check spam folder' messaging, retry button"
|
|
278
|
+
severity: low
|
|
279
|
+
- risk: "Token enumeration attack"
|
|
280
|
+
mitigation: "Consistent response time regardless of email existence"
|
|
281
|
+
severity: medium
|
|
282
|
+
|
|
283
|
+
next_steps:
|
|
284
|
+
- "Configure SendGrid API key in production"
|
|
285
|
+
- "Run database migration for PasswordResetToken"
|
|
286
|
+
- "Add rate limiting to reset-request endpoint"
|
|
287
|
+
- "QA: Test with multiple email providers"
|
|
288
|
+
|
|
289
|
+
summary: |
|
|
290
|
+
Implemented password reset flow: POST /reset-request and /reset-verify.
|
|
291
|
+
Created reset.ts handler, reset.test.ts (12 tests), email template.
|
|
292
|
+
Security: 1-hour token expiry, single-use, constant-time responses.
|
|
293
|
+
Requires: SendGrid config, database migration, rate limiting (TODO).
|
|
294
|
+
|
|
295
|
+
diagnostics:
|
|
296
|
+
model_requested: sonnet
|
|
297
|
+
model_actual: sonnet
|
|
298
|
+
context_type: forked
|
|
299
|
+
parent_vars_accessible: false
|
|
300
|
+
hooks_fired:
|
|
301
|
+
- Stop
|
|
302
|
+
execution_time_ms: 15780
|
|
303
|
+
completion_status: success
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## Error Output Example
|
|
309
|
+
|
|
310
|
+
When a sub-agent encounters an error, the output format remains consistent:
|
|
311
|
+
|
|
312
|
+
```yaml
|
|
313
|
+
# logs/bulwark-code-auditor-20260111-180000.yaml
|
|
314
|
+
|
|
315
|
+
metadata:
|
|
316
|
+
agent: bulwark-code-auditor
|
|
317
|
+
timestamp: 2026-01-11T18:00:00Z
|
|
318
|
+
model: sonnet
|
|
319
|
+
task_id: "audit-legacy-module"
|
|
320
|
+
duration_ms: 2340
|
|
321
|
+
|
|
322
|
+
goal: "Audit legacy payment module for security vulnerabilities"
|
|
323
|
+
|
|
324
|
+
completion:
|
|
325
|
+
why:
|
|
326
|
+
problem: "Unable to complete audit"
|
|
327
|
+
root_cause: "Target files not found at specified paths"
|
|
328
|
+
solution: "No action taken - requires path correction"
|
|
329
|
+
|
|
330
|
+
what: []
|
|
331
|
+
|
|
332
|
+
trade_offs:
|
|
333
|
+
gained: []
|
|
334
|
+
cost:
|
|
335
|
+
- "Time: 2.3 seconds spent before failure detection"
|
|
336
|
+
|
|
337
|
+
risks:
|
|
338
|
+
- risk: "Payment module may contain unaudited vulnerabilities"
|
|
339
|
+
mitigation: "Retry with correct file paths"
|
|
340
|
+
severity: high
|
|
341
|
+
|
|
342
|
+
next_steps:
|
|
343
|
+
- "Verify file paths: src/payments/ does not exist"
|
|
344
|
+
- "Check if module was renamed or moved"
|
|
345
|
+
- "Re-invoke with correct CONTEXT"
|
|
346
|
+
|
|
347
|
+
summary: |
|
|
348
|
+
ERROR: Audit could not complete. Target path src/payments/ not found.
|
|
349
|
+
0 files audited. Requires path correction and retry.
|
|
350
|
+
Action: Verify module location and re-invoke.
|
|
351
|
+
|
|
352
|
+
diagnostics:
|
|
353
|
+
model_requested: sonnet
|
|
354
|
+
model_actual: sonnet
|
|
355
|
+
context_type: forked
|
|
356
|
+
parent_vars_accessible: false
|
|
357
|
+
hooks_fired:
|
|
358
|
+
- Stop
|
|
359
|
+
execution_time_ms: 2340
|
|
360
|
+
completion_status: error
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
365
|
+
## Summary Token Examples
|
|
366
|
+
|
|
367
|
+
### ~100 Tokens (Simple)
|
|
368
|
+
|
|
369
|
+
```
|
|
370
|
+
Found 1 critical issue: hardcoded API key in config.ts:23.
|
|
371
|
+
Removed and replaced with environment variable.
|
|
372
|
+
No risks. Ready for deployment.
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
### ~200 Tokens (Moderate)
|
|
376
|
+
|
|
377
|
+
```
|
|
378
|
+
Audited 8 test files in auth/ module.
|
|
379
|
+
Classification: 2 real integration tests, 6 mock-heavy tests.
|
|
380
|
+
|
|
381
|
+
Priority rewrites needed:
|
|
382
|
+
1. login.test.ts - mocks entire auth flow
|
|
383
|
+
2. session.test.ts - never verifies actual session storage
|
|
384
|
+
|
|
385
|
+
Set up test database required before rewrites.
|
|
386
|
+
Estimated effort: 4-6 hours for full rewrite.
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### ~300 Tokens (Complex)
|
|
390
|
+
|
|
391
|
+
```
|
|
392
|
+
Security audit of payment module found 5 issues:
|
|
393
|
+
|
|
394
|
+
Critical (1):
|
|
395
|
+
- SQL injection in refund handler (fixed, parameterized queries added)
|
|
396
|
+
|
|
397
|
+
High (2):
|
|
398
|
+
- PCI data logged to console (fixed, scrubbed from logs)
|
|
399
|
+
- Missing CSRF protection on payment form (fixed, token added)
|
|
400
|
+
|
|
401
|
+
Medium (2):
|
|
402
|
+
- Outdated stripe-js dependency (upgraded to 3.x)
|
|
403
|
+
- Verbose error messages expose internals (sanitized)
|
|
404
|
+
|
|
405
|
+
All issues fixed with 15 new tests added.
|
|
406
|
+
Trade-off: Stripe upgrade requires testing with live sandbox.
|
|
407
|
+
Risk: Payment form changes may affect some older browsers.
|
|
408
|
+
Next: Full regression test in staging, then security team sign-off.
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
---
|
|
412
|
+
|
|
413
|
+
## Pipeline Chaining Example
|
|
414
|
+
|
|
415
|
+
When outputs feed into the next pipeline stage:
|
|
416
|
+
|
|
417
|
+
**Stage 1: Code Auditor**
|
|
418
|
+
```yaml
|
|
419
|
+
summary: |
|
|
420
|
+
Found 3 issues: 1 critical (SQL injection), 2 medium (logging, error handling).
|
|
421
|
+
Files affected: src/api/users.ts, src/api/orders.ts.
|
|
422
|
+
Recommend: IssueDebugger for critical fix, then TestAuditor for coverage.
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
**Stage 2: Issue Debugger** (reads Stage 1 summary)
|
|
426
|
+
```yaml
|
|
427
|
+
summary: |
|
|
428
|
+
Fixed SQL injection in users.ts:45-67 with parameterized queries.
|
|
429
|
+
Added regression test in users.test.ts.
|
|
430
|
+
Critical issue resolved. Medium issues still pending.
|
|
431
|
+
Recommend: CodeAuditor re-scan to verify fix.
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
**Stage 3: Code Auditor** (re-scan)
|
|
435
|
+
```yaml
|
|
436
|
+
summary: |
|
|
437
|
+
Re-audit of users.ts confirms SQL injection fixed.
|
|
438
|
+
2 medium issues remain in orders.ts.
|
|
439
|
+
Pipeline can continue or address medium issues.
|
|
440
|
+
```
|