@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,194 @@
1
+ # Agent Conventions
2
+
3
+ Conventions for generating Claude Code agent files alongside pipeline skills. The Stage 2 generator sub-agent references this when a pipeline skill needs dedicated sub-agent files in `.claude/agents/`.
4
+
5
+ This file is replicated from `create-subagent/references/agent-conventions.md` for self-containment. If the source evolves, `continuous-feedback` will flag the drift.
6
+
7
+ ---
8
+
9
+ ## System-Prompt Register
10
+
11
+ Agent bodies in `.claude/agents/` are system prompts. They define WHO the agent IS, not WHAT to DO.
12
+
13
+ ### The Critical Distinction
14
+
15
+ **System-prompt register (CORRECT for agents):**
16
+
17
+ The body reads as identity, expertise, and behavioral guidelines.
18
+
19
+ ```markdown
20
+ # Security Reviewer
21
+
22
+ You are a code security reviewer specializing in web application vulnerabilities. Your expertise covers OWASP top 10, injection attacks, authentication flaws, and cryptographic misuse.
23
+
24
+ ## Your Mission
25
+
26
+ Analyze code changes for security vulnerabilities. You prioritize:
27
+ 1. Input validation and sanitization
28
+ 2. Authentication and authorization boundaries
29
+ 3. Data exposure and information leakage
30
+ 4. Dependency vulnerabilities
31
+
32
+ ## How You Work
33
+
34
+ When reviewing code, you:
35
+ 1. Read all changed files completely
36
+ 2. Trace data flow from user input to output
37
+ 3. Classify each finding by CVSS severity
38
+ 4. Report findings in structured format with remediation guidance
39
+ ```
40
+
41
+ **Task-instruction register (WRONG for agents):**
42
+
43
+ The body reads as step-by-step execution instructions.
44
+
45
+ ```markdown
46
+ # Security Review Steps
47
+
48
+ ## Steps
49
+ 1. Read the files provided in the prompt
50
+ 2. Look for security issues
51
+ 3. Check for SQL injection
52
+ 4. Check for XSS
53
+ 5. Write a report to logs/security-review.md
54
+
55
+ ## Output
56
+ Write findings to logs/security-review.md
57
+ ```
58
+
59
+ ### Why This Matters
60
+
61
+ - Agents run as forked contexts — the body IS the system prompt
62
+ - System prompts establish identity, which produces consistent behavior across invocations
63
+ - Task instructions belong in the invoking prompt (GOAL/CONSTRAINTS/CONTEXT/OUTPUT), not the agent definition
64
+ - Identity-based agents adapt to different tasks while maintaining consistent quality
65
+
66
+ ### Register Checklist
67
+
68
+ When generating an agent body, verify:
69
+
70
+ - [ ] Opens with "You are a..." or equivalent identity statement
71
+ - [ ] Describes expertise and specialization areas
72
+ - [ ] Explains behavioral patterns ("When you encounter X, you...")
73
+ - [ ] Uses present tense, not imperative ("You analyze..." not "Analyze...")
74
+ - [ ] Protocol section describes HOW the agent works, not WHAT to do for a specific task
75
+ - [ ] Output section describes format conventions, not specific file paths for one invocation
76
+
77
+ ---
78
+
79
+ ## Frontmatter Structure
80
+
81
+ ### Required Fields
82
+
83
+ ```yaml
84
+ ---
85
+ name: {agent-name}
86
+ description: {single-line description with "Use when..." trigger}
87
+ model: {haiku|sonnet|opus}
88
+ tools:
89
+ - {tool-1}
90
+ - {tool-N}
91
+ ---
92
+ ```
93
+
94
+ ### Optional Fields
95
+
96
+ ```yaml
97
+ skills:
98
+ - {skill-dependency-1}
99
+ - {skill-dependency-N}
100
+ ```
101
+
102
+ ### Model Selection Guidance
103
+
104
+ | Use Case | Model | Rationale |
105
+ |----------|-------|-----------|
106
+ | Quick lookups, simple classification | haiku | Fast, low-cost |
107
+ | Analysis, review, research, generation | sonnet | Balanced capability and speed |
108
+ | Complex implementation, architecture, novel problems | opus | Highest quality reasoning |
109
+
110
+ **Default to Sonnet** unless the task clearly requires Haiku's speed or Opus's depth.
111
+
112
+ ### Tool Selection
113
+
114
+ Only include tools the agent actually needs. Common patterns:
115
+
116
+ | Agent Type | Typical Tools |
117
+ |------------|--------------|
118
+ | Read-only reviewer | Read, Glob, Grep, Write (for reports only) |
119
+ | Code writer | Read, Grep, Glob, Write, Edit, Bash |
120
+ | Research agent | Read, Glob, Grep, WebFetch, WebSearch |
121
+
122
+ ---
123
+
124
+ ## Permissions Setup
125
+
126
+ Tool permissions for agents cannot be enforced automatically (GitHub feature request #10093, closed NOT_PLANNED Jan 2026). Generated agents must include manual permission setup documentation.
127
+
128
+ ### Required Documentation
129
+
130
+ Every generated agent must include a section like:
131
+
132
+ ```markdown
133
+ ## Permissions Setup
134
+
135
+ This agent requires the following permissions to be configured in your project settings:
136
+
137
+ ### Tool Permissions
138
+
139
+ Add to `.claude/settings.json` or `.claude/settings.local.json`:
140
+
141
+ \`\`\`json
142
+ {
143
+ "permissions": {
144
+ "allow": [
145
+ "Read",
146
+ "Glob",
147
+ "Grep",
148
+ "Write($PROJECT_DIR/logs/*)"
149
+ ]
150
+ }
151
+ }
152
+ \`\`\`
153
+ ```
154
+
155
+ ---
156
+
157
+ ## Output Conventions
158
+
159
+ ### Diagnostic Output
160
+
161
+ Agents that produce diagnostic output should follow this pattern:
162
+
163
+ ```yaml
164
+ diagnostic:
165
+ agent: {agent-name}
166
+ timestamp: "{ISO-8601}"
167
+
168
+ task:
169
+ description: "{what was requested}"
170
+ input: "{input provided}"
171
+
172
+ execution:
173
+ steps_completed: 0
174
+ findings: 0
175
+ errors: 0
176
+
177
+ output:
178
+ report_path: "{path to main output}"
179
+ verdict: "{pass/fail/complete/partial}"
180
+ ```
181
+
182
+ ### Log Output (SA2)
183
+
184
+ All agent output goes to `$PROJECT_DIR/logs/`. The agent definition should specify:
185
+
186
+ ```markdown
187
+ ## Output
188
+
189
+ Write all output to `$PROJECT_DIR/logs/` directory (`$PROJECT_DIR` is the project root where `.claude/` lives):
190
+ - Main report: `$PROJECT_DIR/logs/{agent-name}-{timestamp}.{ext}`
191
+ - Diagnostics: `$PROJECT_DIR/logs/diagnostics/{agent-name}-{timestamp}.yaml`
192
+ ```
193
+
194
+ **IMPORTANT**: `$PROJECT_DIR` ensures paths resolve to the project root, not the skill directory or CWD. Without this prefix, agents may write output into `.claude/skills/` or other incorrect locations.
@@ -0,0 +1,195 @@
1
+ # Agent Template: Single-Purpose Sub-Agent
2
+
3
+ Template for generating `.claude/agents/*.md` files when create-skill produces a pipeline skill. Each pipeline stage that uses a dedicated sub-agent gets its own agent file following this structure.
4
+
5
+ This file is replicated from `create-subagent/references/template-single-agent.md` for self-containment. If the source evolves, `continuous-feedback` will flag the drift.
6
+
7
+ ---
8
+
9
+ ## File Output
10
+
11
+ ```
12
+ .claude/agents/{agent-name}.md
13
+ ```
14
+
15
+ Single file per sub-agent — no supporting directories needed.
16
+
17
+ ## Generated Agent Structure
18
+
19
+ ```markdown
20
+ ---
21
+ name: {agent-name}
22
+ description: {single-line, role-based, trigger-specific}
23
+ model: {haiku|sonnet|opus}
24
+ tools:
25
+ - {tool-1}
26
+ - {tool-N}
27
+ skills:
28
+ - subagent-output-templating
29
+ ---
30
+
31
+ # {Agent Title}
32
+
33
+ You are a {role description}. Your expertise covers {domain areas}.
34
+
35
+ ---
36
+
37
+ ## Pre-Flight Gate
38
+
39
+ **MANDATORY: Read this section FIRST. These instructions are BINDING, not advisory.**
40
+
41
+ Before doing ANY work, confirm you understand these REQUIRED obligations:
42
+
43
+ 1. **REQUIRED**: {obligation 1}
44
+ 2. **REQUIRED**: {obligation 2}
45
+ 3. **REQUIRED**: Write output to the exact paths specified in Output section
46
+
47
+ Failure to follow these obligations produces non-compliant output.
48
+
49
+ ---
50
+
51
+ ## Your Mission
52
+
53
+ **DO**:
54
+ - {concrete action 1}
55
+ - {concrete action 2}
56
+ - {concrete action 3}
57
+ - Follow existing patterns and conventions in the target codebase
58
+
59
+ **DO NOT**:
60
+ - {specific prohibition 1}
61
+ - {specific prohibition 2}
62
+ - Write files outside the scope of the task
63
+
64
+ ---
65
+
66
+ ## Invocation
67
+
68
+ This agent is invoked via the **Task tool**:
69
+
70
+ | Method | How to Use |
71
+ |--------|-----------|
72
+ | **Direct** | `Task(subagent_type="{agent-name}", prompt="...")` |
73
+ | **Pipeline stage** | Referenced by orchestrator skills |
74
+
75
+ **Input handling**:
76
+ 1. Read task details from the prompt
77
+ 2. Parse input for required fields
78
+ 3. Validate inputs exist before proceeding
79
+
80
+ ---
81
+
82
+ ## Protocol
83
+
84
+ ### Step 1: Parse Input
85
+
86
+ {What to extract from the invoking prompt.}
87
+
88
+ ### Step 2: Read Context
89
+
90
+ {What files/data to read before doing work.}
91
+
92
+ ### Step 3: Execute
93
+
94
+ {Core work the agent performs. Describe behavioral approach, not mechanical steps.}
95
+
96
+ ### Step 4: Write Output
97
+
98
+ 1. Write main report to `$PROJECT_DIR/logs/{agent-name}-{timestamp}.{ext}`
99
+ 2. Write diagnostics to `$PROJECT_DIR/logs/diagnostics/{agent-name}-{timestamp}.yaml`
100
+
101
+ ### Step 5: Return Summary
102
+
103
+ Return a summary to the invoker (100-300 tokens). Include:
104
+ - What was done
105
+ - Key findings or results
106
+ - Report path
107
+
108
+ ---
109
+
110
+ ## Tool Usage Constraints
111
+
112
+ ### {Tool 1}
113
+ - **Allowed**: {specific allowed uses}
114
+ - **Forbidden**: {specific forbidden uses}
115
+
116
+ ---
117
+
118
+ ## Output
119
+
120
+ ### Main Report
121
+
122
+ **Location**: `$PROJECT_DIR/logs/{agent-name}-{timestamp}.{ext}`
123
+
124
+ {Report format specification.}
125
+
126
+ ### Diagnostics
127
+
128
+ **Location**: `$PROJECT_DIR/logs/diagnostics/{agent-name}-{timestamp}.yaml`
129
+
130
+ \`\`\`yaml
131
+ diagnostic:
132
+ agent: {agent-name}
133
+ timestamp: "{ISO-8601}"
134
+
135
+ task:
136
+ description: "{what was requested}"
137
+ input: "{input provided}"
138
+
139
+ execution:
140
+ steps_completed: 0
141
+ findings: 0
142
+ errors: 0
143
+
144
+ output:
145
+ report_path: "$PROJECT_DIR/logs/{agent-name}-{timestamp}.{ext}"
146
+ verdict: "{pass/fail/complete/partial}"
147
+ \`\`\`
148
+
149
+ ### Summary (Return to Invoker)
150
+
151
+ **Token budget**: 100-300 tokens
152
+
153
+ ---
154
+
155
+ ## Permissions Setup
156
+
157
+ This agent requires the following configuration:
158
+
159
+ ### Tool Permissions
160
+
161
+ Add to `.claude/settings.json` or `.claude/settings.local.json`:
162
+
163
+ \`\`\`json
164
+ {
165
+ "permissions": {
166
+ "allow": [
167
+ "{tool-1}",
168
+ "{tool-N}"
169
+ ]
170
+ }
171
+ }
172
+ \`\`\`
173
+
174
+ ---
175
+
176
+ ## Completion Checklist
177
+
178
+ - [ ] All steps executed
179
+ - [ ] Main report written to `$PROJECT_DIR/logs/`
180
+ - [ ] Diagnostic YAML written
181
+ - [ ] Summary returned to invoker
182
+ ```
183
+
184
+ ## Guidance for Generator
185
+
186
+ - Write in system-prompt register (WHO the agent IS, not WHAT to do)
187
+ - Open with identity statement: "You are a..."
188
+ - Include Pre-Flight Gate with MUST/MUST NOT (binding language, DEF-P4-005)
189
+ - Include DO/DO NOT mission section
190
+ - Include tool usage constraints for every tool listed in frontmatter
191
+ - Include Permissions Setup section (tool permissions unsolved per #10093)
192
+ - Include diagnostic output section with YAML schema
193
+ - Single-purpose agents are typically 150-250 lines
194
+ - Default model: Sonnet (unless task needs Haiku speed or Opus depth)
195
+ - For pipeline sub-agents: the agent's identity should reflect its stage role (e.g., "You are a security reviewer" not "You are Stage 2")
@@ -0,0 +1,291 @@
1
+ # Content Guidance
2
+
3
+ Instruction writing patterns, description rules, and common pitfalls for generating high-quality skills. The Stage 2 generator sub-agent references this to produce skills that activate reliably and instruct clearly.
4
+
5
+ ---
6
+
7
+ ## Description Field Rules
8
+
9
+ The YAML frontmatter `description` field controls skill discovery and activation. Getting it wrong means the skill never triggers.
10
+
11
+ ### Format Rules
12
+
13
+ 1. **Single line only.** Multi-line descriptions silently break skill discovery (GitHub #9817/#4700).
14
+ 2. **Maximum ~200 characters.** Longer descriptions get truncated in the `/` menu.
15
+ 3. **Start with an action verb.** "Generates...", "Audits...", "Validates..."
16
+
17
+ ### "When to Use" Framing
18
+
19
+ The description must tell Claude WHEN to load the skill, not just what it does.
20
+
21
+ **Good — trigger-specific:**
22
+ ```yaml
23
+ description: Generates Claude Code skills from requirements using adaptive interview, complexity classification, and iterative validation. Use when creating new skills, scaffolding skill structure, or generating skills with sub-agent orchestration.
24
+ ```
25
+
26
+ **Bad — vague:**
27
+ ```yaml
28
+ description: A tool for creating skills.
29
+ ```
30
+
31
+ **Bad — too broad:**
32
+ ```yaml
33
+ description: Helps with skill development and management across projects.
34
+ ```
35
+
36
+ ### Pattern
37
+
38
+ ```
39
+ {Action verb} {what it does} {using what method}. Use when {trigger condition 1}, {trigger condition 2}, or {trigger condition 3}.
40
+ ```
41
+
42
+ The trigger conditions are the most important part. They determine whether Claude loads the skill when the user asks for something.
43
+
44
+ ---
45
+
46
+ ## Instruction Writing Patterns
47
+
48
+ How to write skill instructions that Claude actually follows.
49
+
50
+ ### Binding Language (DEF-P4-005)
51
+
52
+ Without explicit binding language, Claude treats skill instructions as suggestions and skips steps it deems unnecessary.
53
+
54
+ **Pattern: Pre-Flight Gate**
55
+
56
+ Place a blocking gate before the main workflow. This forces acknowledgment before execution.
57
+
58
+ ```markdown
59
+ ## Pre-Flight Gate (BLOCKING)
60
+
61
+ **STOP. Before ANY analysis, you MUST acknowledge what this skill requires.**
62
+
63
+ ### What You MUST Do
64
+ 1. [Step 1]
65
+ 2. [Step 2]
66
+
67
+ ### What You MUST NOT Do
68
+ - Do NOT skip [specific step]
69
+ - Do NOT perform [agent's work] yourself
70
+ ```
71
+
72
+ **Pattern: MANDATORY sections**
73
+
74
+ Mark critical steps explicitly:
75
+
76
+ ```markdown
77
+ ### Stage 2: Generate (MANDATORY)
78
+
79
+ You MUST spawn a Sonnet sub-agent for generation. Do NOT generate the output yourself.
80
+ ```
81
+
82
+ **Pattern: Anti-thought traps**
83
+
84
+ Address the specific rationalization Claude uses to skip steps:
85
+
86
+ ```markdown
87
+ If you find yourself thinking "I can do this faster without a sub-agent" — STOP.
88
+ That thought pattern violates SC1-SC2. The pipeline exists for bias avoidance.
89
+ ```
90
+
91
+ ### Good vs Bad Instructions
92
+
93
+ **Good — specific, actionable, ordered:**
94
+ ```markdown
95
+ ## Stage 1: Classify
96
+
97
+ 1. Read the interview answers from Stage 0
98
+ 2. Apply Decision A (Context Mode) using the decision tree in references/decision-framework.md
99
+ 3. Apply Decision B (Sub-Agent Pattern)
100
+ 4. Apply Decision C (Supporting Files)
101
+ 5. Map the three decisions to a template using the Decision → Template Mapping table
102
+ 6. Present classification to user via AskUserQuestion for confirmation
103
+ ```
104
+
105
+ **Bad — vague, hand-wavy:**
106
+ ```markdown
107
+ ## Classification
108
+
109
+ Analyze the user's requirements and determine the best approach for the skill.
110
+ Consider factors like complexity, context needs, and file structure.
111
+ ```
112
+
113
+ **Bad — too many options without guidance:**
114
+ ```markdown
115
+ ## Generation
116
+
117
+ You can either:
118
+ - Generate the skill directly
119
+ - Use a sub-agent
120
+ - Ask the user to provide more details
121
+ - Skip generation if the skill seems too complex
122
+
123
+ Choose the best approach based on the situation.
124
+ ```
125
+
126
+ ### Instruction Density
127
+
128
+ - Each stage should have 3-8 concrete steps
129
+ - Steps should be imperative: "Read X", "Write Y", "Spawn Z"
130
+ - Avoid conditional trees deeper than 2 levels (use a reference table instead)
131
+
132
+ ---
133
+
134
+ ## Common Pitfalls
135
+
136
+ Issues discovered through production usage of Bulwark skills.
137
+
138
+ ### Pitfall 1: Multi-Line YAML Description
139
+
140
+ ```yaml
141
+ # BROKEN — skill won't appear in / menu
142
+ description: >
143
+ This skill does many things
144
+ across multiple lines.
145
+
146
+ # CORRECT — single line
147
+ description: This skill does many things across multiple lines.
148
+ ```
149
+
150
+ **Impact**: Silent failure. Skill exists on disk but never activates.
151
+
152
+ ### Pitfall 2: Fork + Guidelines = No-Op
153
+
154
+ A skill with `context: fork` that contains only guidelines (no tool calls, no sub-agents) runs in an isolated context, reads the guidelines, and returns without doing anything useful. The forked context has no access to the user's conversation or files being discussed.
155
+
156
+ ```yaml
157
+ # BROKEN — fork with only guidelines, no actionable work
158
+ context: fork
159
+ ---
160
+ ## Guidelines
161
+ - Write clean code
162
+ - Follow best practices
163
+ ```
164
+
165
+ **Resolution**: Use inline (no fork) for guideline/knowledge skills. Fork is for skills that perform independent multi-step work.
166
+
167
+ ### Pitfall 3: Over-Elaborate Output Specifications
168
+
169
+ Specifying every field, section, and format in exhaustive detail causes the generator to focus on format compliance rather than content quality.
170
+
171
+ **Better approach**: Provide a template file in `templates/` and reference it. Let the skill focus on WHAT to produce, not HOW to format every line.
172
+
173
+ ### Pitfall 4: Missing Activation Triggers
174
+
175
+ A skill without clear trigger patterns in its description and "When to Use" section will never be loaded by Claude, regardless of how good its instructions are.
176
+
177
+ **Minimum viable activation**:
178
+ 1. Description field with trigger verbs
179
+ 2. "When to Use" section with trigger pattern table
180
+ 3. "DO NOT use for" section to prevent false activations
181
+
182
+ ### Pitfall 5: Sub-Agent Work Done by Orchestrator
183
+
184
+ When a skill specifies "spawn a sub-agent for X", Claude may skip spawning and do the work itself. This defeats bias separation and pipeline observability.
185
+
186
+ **Prevention**: Use the binding language patterns (Pre-Flight Gate, MUST/MUST NOT, anti-thought traps).
187
+
188
+ ### Pitfall 6: Undocumented Dependencies
189
+
190
+ Skills that silently depend on other skills, scripts, or project structure break when used outside the original project.
191
+
192
+ **Prevention**: Declare all dependencies in a Dependencies table:
193
+
194
+ ```markdown
195
+ ## Dependencies
196
+
197
+ | Category | Files | Requirement | When to Load |
198
+ |----------|-------|-------------|--------------|
199
+ | **Prompting** | `subagent-prompting` skill | REQUIRED | Before spawning any sub-agent |
200
+ | **Templates** | `templates/output.md` | REQUIRED | Include in sub-agent prompt |
201
+ ```
202
+
203
+ ---
204
+
205
+ ## Activation Tuning
206
+
207
+ How to improve the chance Claude loads your skill when the user needs it.
208
+
209
+ ### Trigger Verb Coverage
210
+
211
+ Include multiple trigger verbs in the description to catch different phrasings:
212
+
213
+ ```yaml
214
+ # Covers: "create", "scaffold", "generate", "build"
215
+ description: Generates Claude Code skills from requirements... Use when creating new skills, scaffolding skill structure, or generating skills...
216
+ ```
217
+
218
+ ### "When to Use" Table
219
+
220
+ The table format is more reliable than prose for activation:
221
+
222
+ ```markdown
223
+ | Trigger Pattern | Example User Request |
224
+ |-----------------|---------------------|
225
+ | Skill creation | "Create a new skill", "Make a skill for X" |
226
+ | Scaffolding | "Scaffold a skill", "Set up a new skill" |
227
+ | Generation | "Generate a skill that does X" |
228
+ ```
229
+
230
+ ### "DO NOT Use For" Section
231
+
232
+ Negative triggers prevent false activations that waste tokens:
233
+
234
+ ```markdown
235
+ **DO NOT use for:**
236
+ - Editing existing skills (edit directly)
237
+ - Debugging skill issues (use issue-debugging)
238
+ ```
239
+
240
+ ---
241
+
242
+ ## Output Path Conventions
243
+
244
+ Generated skills MUST use `$PROJECT_DIR` as the prefix for all output paths. `$PROJECT_DIR` is the project root directory (where `.claude/` lives). Without this prefix, paths resolve relative to CWD — which during skill execution is often the skill directory itself (e.g., `.claude/skills/{skill-name}/`), causing output to be written into the skill directory.
245
+
246
+ ### Three Output Categories
247
+
248
+ | Category | Path Convention | What Goes Here |
249
+ |----------|----------------|----------------|
250
+ | **Intermediate output** | `$PROJECT_DIR/logs/{skill-name}/` | Sub-agent reports, stage outputs, working files that feed the next stage |
251
+ | **Diagnostics** | `$PROJECT_DIR/logs/diagnostics/{skill-name}-{timestamp}.yaml` | Pipeline execution metadata, timing, error counts |
252
+ | **Deliverables** | `$PROJECT_DIR/artifacts/{skill-name}/{slug}/` | Synthesis documents, final reports, generated code — anything the user consumes directly |
253
+
254
+ ### Rules
255
+
256
+ 1. **Always prefix with `$PROJECT_DIR/`** — never use bare `logs/` or `artifacts/`
257
+ 2. **Synthesis is a deliverable, not a log** — write to `artifacts/`, not `logs/`
258
+ 3. **Sub-agent output is intermediate** — write to `logs/`, the next stage reads from there
259
+ 4. **Diagnostics are always in `logs/diagnostics/`** — never in `artifacts/`
260
+ 5. **Never write output into the skill directory** (`.claude/skills/{name}/`) or CWD
261
+
262
+ ### Example Paths
263
+
264
+ ```
265
+ $PROJECT_DIR/logs/market-research/analyst.md # intermediate (sub-agent output)
266
+ $PROJECT_DIR/logs/market-research/competitor.md # intermediate (sub-agent output)
267
+ $PROJECT_DIR/logs/diagnostics/market-research-20260222.yaml # diagnostic
268
+ $PROJECT_DIR/artifacts/market-research/q1-analysis/synthesis.md # deliverable
269
+ ```
270
+
271
+ ---
272
+
273
+ ## Generate-and-Customize Contract
274
+
275
+ All generated skills are scaffolds, not production-ready output. This must be communicated explicitly.
276
+
277
+ ### Required Disclaimer
278
+
279
+ Every generated skill should include this understanding in the post-generation summary:
280
+
281
+ ```
282
+ This is a scaffold — a starting point for your skill. You should:
283
+ 1. Review and customize the generated instructions
284
+ 2. Test activation by asking Claude to invoke it
285
+ 3. Iterate on trigger patterns until activation is reliable
286
+ 4. Add domain-specific content to reference files
287
+ ```
288
+
289
+ ### Why This Matters
290
+
291
+ Research convergence across Rails generators, Yeoman, Create React App, and AI-era generators: output is always a starting point. Making this explicit prevents user disappointment and sets correct expectations.