@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,607 @@
1
+ ---
2
+ name: anthropic-validator
3
+ description: Validates Claude Code assets (skills, hooks, agents, commands, MCP servers, plugins) against official Anthropic standards. Fetches latest docs dynamically and produces structured validation reports.
4
+ user-invocable: true
5
+ ---
6
+
7
+ # Anthropic Validator
8
+
9
+ Validates Claude Code assets against official Anthropic standards using dynamic documentation fetching and critical analysis.
10
+
11
+ ---
12
+
13
+ ## Overview
14
+
15
+ ### The Problem
16
+
17
+ Claude Code evolves rapidly. Static checklists become outdated. Assets created months ago may violate current standards, and new features may not be reflected in embedded validation rules.
18
+
19
+ ### The Solution
20
+
21
+ This skill provides **dynamic validation** by:
22
+
23
+ 1. **Fetching latest standards** from official Claude Code documentation
24
+ 2. **Critically analyzing** assets against those standards
25
+ 3. **Producing actionable reports** with specific violations and remediation
26
+
27
+ ### Design Pattern: Main Context Orchestration
28
+
29
+ This skill uses **Main Context Orchestration** - you (Claude) follow the instructions below to orchestrate sub-agents sequentially. This is required because sub-agents cannot spawn other sub-agents.
30
+
31
+ ```
32
+ ┌─────────────────────────────────────────────────────────────┐
33
+ │ MAIN CONTEXT (You) │
34
+ │ │
35
+ │ 1. Load this skill (anthropic-validator) │
36
+ │ 2. Follow section instructions for asset type │
37
+ │ 3. Spawn claude-code-guide → fetch latest standards │
38
+ │ 4. Read output (direct response) │
39
+ │ 5. Spawn bulwark-standards-reviewer → analyze asset │
40
+ │ 6. Read validation report from logs/validations/ │
41
+ │ 7. Present summary to user │
42
+ │ │
43
+ └─────────────────────────────────────────────────────────────┘
44
+ ```
45
+
46
+ ### Invocation
47
+
48
+ ```bash
49
+ # Single asset validation
50
+ /anthropic-validator skills/my-skill/SKILL.md
51
+
52
+ # Batch validation (directory)
53
+ /anthropic-validator skills/
54
+
55
+ # Context inference (validates current file in context)
56
+ /anthropic-validator
57
+ ```
58
+
59
+ ---
60
+
61
+ ## Validation Workflow
62
+
63
+ ### Step 0: Resolve Target Asset
64
+
65
+ **IMPORTANT**: When this skill is invoked, first resolve what to validate:
66
+
67
+ ```
68
+ IF $ARGUMENTS is provided (e.g., /anthropic-validator path/to/file):
69
+ target_path = $1
70
+
71
+ IF target_path ends with "/" OR is a directory:
72
+ mode = "batch"
73
+ → Skip to "Batch Validation" section below
74
+ ELSE:
75
+ mode = "single"
76
+ → Continue with Step 1 for single-file validation
77
+
78
+ ELSE (no arguments, context inference):
79
+ Look for Claude Code assets in recent conversation context
80
+ IF found: validate that asset (single mode)
81
+ ELSE: Ask user what to validate
82
+ ```
83
+
84
+ **Argument Reference:**
85
+ - `$ARGUMENTS` - Full argument string passed to skill
86
+ - `$1` - First positional argument (the path)
87
+
88
+ **Workflow Routing:**
89
+ - Single file → Continue with Steps 1-4 below
90
+ - Directory (batch) → Jump to "Batch Validation" section
91
+
92
+ ### Step 1: Determine Asset Type
93
+
94
+ For the resolved `target_path`, match against these patterns:
95
+
96
+ | Path Pattern | Asset Type |
97
+ |--------------|------------|
98
+ | `skills/*/SKILL.md` | Skill |
99
+ | `hooks/hooks.json` or `*.hooks.json` | Hooks |
100
+ | `agents/*.md` or `.claude/agents/*.md` | Agent |
101
+ | `commands/*.md` | Command |
102
+ | `mcp/` or `*-mcp-server*` | MCP Server |
103
+ | `.claude-plugin/plugin.json` | Plugin |
104
+
105
+ ### Step 2: Fetch Latest Standards
106
+
107
+ Spawn `claude-code-guide` agent with the appropriate documentation URL:
108
+
109
+ ```
110
+ GOAL: Fetch current standards for {asset_type} from official Claude Code docs
111
+
112
+ CONSTRAINTS:
113
+ - Only use official Anthropic documentation
114
+ - Report what IS supported vs what is NOT
115
+ - Include any recent changes or deprecations
116
+
117
+ CONTEXT:
118
+ - Documentation URL: {see section below for URL}
119
+ - Capability being validated: {asset_type}
120
+
121
+ OUTPUT:
122
+ - Current supported fields/features
123
+ - Required vs optional elements
124
+ - Common pitfalls or mistakes
125
+ - Any version-specific notes
126
+ ```
127
+
128
+ ### Step 2.5: Gather Supporting Files (Skills Only)
129
+
130
+ For skills, check for supporting subdirectories and files:
131
+
132
+ ```
133
+ IF asset_type == "skill":
134
+ 1. Check for references/ subdirectory
135
+ - List all files if present
136
+ - Note: references/ is OPTIONAL (not all skills have it)
137
+
138
+ 2. Check for other common subdirectories
139
+ - examples/, scripts/, templates/, data/
140
+ - List files if present
141
+
142
+ 3. Scan SKILL.md for file references
143
+ - Look for patterns: `references/*.md`, `examples/*`, etc.
144
+ - Verify referenced files exist
145
+
146
+ 4. Build supporting_files inventory:
147
+ supporting_files = {
148
+ references: [list of files or "none"],
149
+ examples: [list of files or "none"],
150
+ scripts: [list of files or "none"],
151
+ referenced_but_missing: [any files mentioned but not found]
152
+ }
153
+ ```
154
+
155
+ ### Step 3: Critical Analysis
156
+
157
+ Spawn `bulwark-standards-reviewer` agent (Task tool with `subagent_type: bulwark-standards-reviewer`):
158
+
159
+ ```
160
+ GOAL: Critically analyze {asset_path} against fetched standards
161
+
162
+ CONSTRAINTS:
163
+ - Be thorough - check every requirement
164
+ - Rate findings by severity (Critical/High/Medium/Low)
165
+ - Provide specific remediation for each finding
166
+ - Do NOT modify the asset, only report
167
+ - Only flag missing references/ if the skill explicitly references files that don't exist
168
+ - Validate tools/fields against DOCUMENTATION, not by attempting to use them
169
+ (The reviewer may not have access to all tools - don't conflate "I can't use this" with "this is invalid")
170
+
171
+ CONTEXT:
172
+ - Asset to validate: {asset_content}
173
+ - Current standards: {fetched_standards from Step 2}
174
+ - Asset type: {asset_type}
175
+ - Supporting files inventory: {supporting_files from Step 2.5, if skill}
176
+ - Referenced files verified: {yes/no with details}
177
+ - Known conventions (DO NOT flag as high/critical — classify as informational):
178
+ The following patterns are intentional conventions backed by empirical testing.
179
+ LLM agents reliably ignore behavioral-register instructions ("You always verify...")
180
+ but comply with imperative-register instructions ("You MUST verify..."). These
181
+ patterns have been validated across Opus and Sonnet models. Treat as informational
182
+ only — note the divergence from pure Anthropic style but do NOT elevate severity:
183
+ * Pre-Flight Gate sections with MUST/MUST NOT binding language
184
+ * Imperative Protocol sections (step-by-step operational instructions)
185
+ * Permissions Setup sections documenting settings.json configuration
186
+ * Completion Checklists with checkbox items
187
+ * DO/DO NOT mission sections
188
+ * Tool Usage Constraints with Allowed/Forbidden per tool
189
+
190
+ OUTPUT:
191
+ Write structured YAML to logs/validations/{asset-name}-{timestamp}.yaml
192
+ ```
193
+
194
+ ### Step 4: Present Results
195
+
196
+ Summarize findings to user in human-readable format (see Output Format section).
197
+
198
+ ---
199
+
200
+ ## Skills Validation
201
+
202
+ ### Official Documentation
203
+
204
+ https://docs.anthropic.com/en/docs/claude-code/skills
205
+
206
+ ### Validation Workflow
207
+
208
+ 1. Read the skill's `SKILL.md` file
209
+ 2. **Check for supporting subdirectories**:
210
+ - `references/` - list files if present (OPTIONAL - not all skills need this)
211
+ - `examples/`, `scripts/`, `templates/`, `data/` - list if present
212
+ 3. **Verify referenced files** - scan SKILL.md for file mentions (`references/*.md`, etc.) and confirm they exist
213
+ 4. Spawn `claude-code-guide` with prompt:
214
+ ```
215
+ Fetch current standards for Claude Code skills from https://docs.anthropic.com/en/docs/claude-code/skills
216
+ Focus on: frontmatter fields, SKILL.md structure, user-invocable, agent field, context field
217
+ ```
218
+ 5. Spawn `bulwark-standards-reviewer` with:
219
+ - Skill content
220
+ - Fetched standards
221
+ - **Supporting files inventory** (list of files in references/, examples/, etc.)
222
+ - **Referenced files verification** (which mentioned files exist/missing)
223
+ 6. Write report to `logs/validations/`
224
+
225
+ **Important**: A missing `references/` folder is NOT a violation unless the skill explicitly references files that don't exist. Many skills are self-contained and don't need supporting files.
226
+
227
+ ### Key Validation Points
228
+
229
+ | Field | Requirement |
230
+ |-------|-------------|
231
+ | `name` | Required, matches directory name |
232
+ | `description` | Required, concise explanation |
233
+ | `user-invocable` | Boolean, controls `/` menu visibility |
234
+ | `agent` | Optional: `haiku`, `sonnet`, or `opus` for model selection |
235
+ | `context` | Optional: `fork` for isolated execution |
236
+ | `skills` | Optional: array of skills to load |
237
+ | `tools` | Optional: array of allowed tools |
238
+
239
+ ### Fallback Checklist
240
+
241
+ If doc fetch fails, use: `references/skills-checklist.md`
242
+
243
+ ---
244
+
245
+ ## Hooks Validation
246
+
247
+ ### Official Documentation
248
+
249
+ https://docs.anthropic.com/en/docs/claude-code/hooks
250
+
251
+ ### Validation Workflow
252
+
253
+ 1. Read the hooks configuration file
254
+ 2. Spawn `claude-code-guide` with prompt:
255
+ ```
256
+ Fetch current standards for Claude Code hooks from https://docs.anthropic.com/en/docs/claude-code/hooks
257
+ Focus on: hook types, matcher patterns, once field, command format, environment variables
258
+ ```
259
+ 3. Spawn `bulwark-standards-reviewer` with hooks content and fetched standards
260
+ 4. Write report to `logs/validations/`
261
+
262
+ ### Key Validation Points
263
+
264
+ | Field | Requirement |
265
+ |-------|-------------|
266
+ | Hook types | `PreToolUse`, `PostToolUse`, `SubagentStart`, `SubagentStop`, `Notification` |
267
+ | `matcher` | Regex pattern for tool/subagent matching |
268
+ | `command` | Shell command to execute |
269
+ | `once` | Boolean, `true` for run-once hooks (e.g., SessionStart) |
270
+ | `timeout` | Optional, milliseconds |
271
+
272
+ ### Environment Variables
273
+
274
+ | Variable | Available In |
275
+ |----------|--------------|
276
+ | `$CLAUDE_TOOL_NAME` | PreToolUse, PostToolUse |
277
+ | `$CLAUDE_TOOL_INPUT` | PreToolUse, PostToolUse |
278
+ | `$CLAUDE_TOOL_OUTPUT` | PostToolUse |
279
+ | `$CLAUDE_SUBAGENT_TYPE` | SubagentStart, SubagentStop |
280
+ | `$CLAUDE_SUBAGENT_PROMPT` | SubagentStart |
281
+
282
+ ### Fallback Checklist
283
+
284
+ If doc fetch fails, use: `references/hooks-checklist.md`
285
+
286
+ ---
287
+
288
+ ## Agents Validation
289
+
290
+ ### Official Documentation
291
+
292
+ https://docs.anthropic.com/en/docs/claude-code/sub-agents
293
+
294
+ ### Validation Workflow
295
+
296
+ 1. Read the agent markdown file
297
+ 2. Spawn `claude-code-guide` with prompt:
298
+ ```
299
+ Fetch current standards for Claude Code custom sub-agents from https://docs.anthropic.com/en/docs/claude-code/sub-agents
300
+ Focus on: agent definition format, frontmatter fields, model selection, tools array, lookup priority
301
+ ```
302
+ 3. Spawn `bulwark-standards-reviewer` with agent content and fetched standards
303
+ 4. Write report to `logs/validations/`
304
+
305
+ ### Key Validation Points
306
+
307
+ | Field | Requirement |
308
+ |-------|-------------|
309
+ | `name` | Required, matches filename |
310
+ | `description` | Required, explains agent purpose |
311
+ | `model` | Optional: `haiku`, `sonnet`, `opus` |
312
+ | `tools` | Optional: array of allowed tools |
313
+ | `skills` | Optional: array of skills to load |
314
+ | File location | `.claude/agents/`, `~/.claude/agents/`, or plugin `agents/` |
315
+
316
+ ### Agent Lookup Priority
317
+
318
+ 1. CLI flag (`--agent`)
319
+ 2. `.claude/agents/` (project)
320
+ 3. `~/.claude/agents/` (user)
321
+ 4. Plugin `agents/` directory
322
+ 5. Built-in agents
323
+
324
+ ### Fallback Checklist
325
+
326
+ If doc fetch fails, use: `references/agents-checklist.md`
327
+
328
+ ---
329
+
330
+ ## Commands Validation
331
+
332
+ ### Official Documentation
333
+
334
+ https://docs.anthropic.com/en/docs/claude-code/skills (commands merged with skills in v2.1.3)
335
+
336
+ ### Validation Workflow
337
+
338
+ 1. Read the command file
339
+ 2. Spawn `claude-code-guide` with prompt:
340
+ ```
341
+ Fetch current standards for Claude Code commands/skills from https://docs.anthropic.com/en/docs/claude-code/skills
342
+ Focus on: command invocation, argument passing ($ARGUMENTS, $1, $2), user-invocable field
343
+ Note: Commands and skills merged in v2.1.3
344
+ ```
345
+ 3. Spawn `bulwark-standards-reviewer` with command content and fetched standards
346
+ 4. Write report to `logs/validations/`
347
+
348
+ ### Key Validation Points
349
+
350
+ | Aspect | Requirement |
351
+ |--------|-------------|
352
+ | Invocation | `/skill-name arg1 arg2` |
353
+ | Arguments | `$ARGUMENTS` (all), `$1`/`$2` (positional) |
354
+ | Environment | `${ENV_VAR}` for environment variables |
355
+ | Visibility | `user-invocable: true` for `/` menu |
356
+
357
+ ### Fallback Checklist
358
+
359
+ If doc fetch fails, use: `references/commands-checklist.md`
360
+
361
+ ---
362
+
363
+ ## MCP Validation
364
+
365
+ ### Official Documentation
366
+
367
+ https://docs.anthropic.com/en/docs/claude-code/mcp
368
+
369
+ ### Validation Workflow
370
+
371
+ 1. Read MCP server configuration
372
+ 2. Spawn `claude-code-guide` with prompt:
373
+ ```
374
+ Fetch current standards for Claude Code MCP servers from https://docs.anthropic.com/en/docs/claude-code/mcp
375
+ Focus on: server configuration, tool definitions, transport types, security considerations
376
+ ```
377
+ 3. Spawn `bulwark-standards-reviewer` with MCP content and fetched standards
378
+ 4. Write report to `logs/validations/`
379
+
380
+ ### Key Validation Points
381
+
382
+ | Aspect | Requirement |
383
+ |--------|-------------|
384
+ | Configuration | Valid JSON in `.claude/mcp.json` |
385
+ | Transport | `stdio`, `http`, or `sse` |
386
+ | Tools | Properly defined tool schemas |
387
+ | Security | No exposed secrets, proper permissions |
388
+
389
+ ### Fallback Checklist
390
+
391
+ If doc fetch fails, use: `references/mcp-checklist.md`
392
+
393
+ ---
394
+
395
+ ## Plugins Validation
396
+
397
+ ### Official Documentation
398
+
399
+ https://docs.anthropic.com/en/docs/claude-code/plugins
400
+
401
+ ### Validation Workflow
402
+
403
+ 1. Read plugin manifest and structure
404
+ 2. Spawn `claude-code-guide` with prompt:
405
+ ```
406
+ Fetch current standards for Claude Code plugins from https://docs.anthropic.com/en/docs/claude-code/plugins
407
+ Focus on: plugin.json manifest, directory structure, registration, flat skills directory
408
+ ```
409
+ 3. Spawn `bulwark-standards-reviewer` with plugin content and fetched standards
410
+ 4. Write report to `logs/validations/`
411
+
412
+ ### Key Validation Points
413
+
414
+ | Aspect | Requirement |
415
+ |--------|-------------|
416
+ | Manifest | `.claude-plugin/plugin.json` |
417
+ | Structure | Flat directories at root (`skills/`, `agents/`, `hooks/`) |
418
+ | Registration | All components listed in manifest |
419
+ | Naming | Plugin name matches directory |
420
+
421
+ ### Directory Structure
422
+
423
+ ```
424
+ plugin-name/
425
+ ├── .claude-plugin/
426
+ │ └── plugin.json # ONLY manifest here
427
+ ├── agents/ # At root, NOT in .claude-plugin/
428
+ ├── skills/ # At root, NOT in .claude-plugin/
429
+ └── hooks/ # At root, NOT in .claude-plugin/
430
+ ```
431
+
432
+ ### Fallback Checklist
433
+
434
+ If doc fetch fails, use: `references/plugins-checklist.md`
435
+
436
+ ---
437
+
438
+ ## Batch Validation
439
+
440
+ When validating a directory:
441
+
442
+ 1. **Glob** all matching files based on asset type patterns
443
+ 2. **For each asset INDIVIDUALLY**:
444
+ - Run the FULL single-asset validation workflow (Steps 1-4)
445
+ - Spawn `bulwark-standards-reviewer` with ONLY that one asset
446
+ - Write individual report to `logs/validations/`
447
+ - **DO NOT** combine multiple assets into one reviewer context
448
+ 3. **After all assets validated**, aggregate results into summary report
449
+
450
+ **CRITICAL**: Do NOT frontload all assets into a single reviewer context. This causes shallow analysis due to context overload. Each asset must be validated with full depth individually, then results aggregated.
451
+
452
+ ### Batch Output
453
+
454
+ ```
455
+ logs/validations/
456
+ ├── batch-summary-{timestamp}.yaml # Aggregate summary
457
+ ├── skill-one-{timestamp}.yaml # Individual reports
458
+ ├── skill-two-{timestamp}.yaml
459
+ └── ...
460
+ ```
461
+
462
+ ### Batch Summary Format
463
+
464
+ ```yaml
465
+ batch_validation:
466
+ metadata:
467
+ directory: "{path}"
468
+ timestamp: "{ISO-8601}"
469
+ total_assets: 5
470
+
471
+ results:
472
+ passed: 3
473
+ failed: 2
474
+
475
+ failures:
476
+ - asset: "skills/broken-skill/SKILL.md"
477
+ critical_count: 1
478
+ report: "logs/validations/broken-skill-{timestamp}.yaml"
479
+ ```
480
+
481
+ ---
482
+
483
+ ## Output Format
484
+
485
+ ### YAML Report (logs/validations/)
486
+
487
+ ```yaml
488
+ validation_report:
489
+ metadata:
490
+ asset: "{file_path}"
491
+ asset_type: skill | hook | agent | command | mcp | plugin
492
+ timestamp: "{ISO-8601}"
493
+ validator: "bulwark-standards-reviewer"
494
+ standards_source: fetched | fallback
495
+
496
+ findings:
497
+ - severity: critical | high | medium | low
498
+ rule: "{standard being checked}"
499
+ violation: "{what is wrong}"
500
+ location: "{line or field}"
501
+ remediation: "{how to fix}"
502
+
503
+ summary:
504
+ total_findings: 0
505
+ critical: 0
506
+ high: 0
507
+ medium: 0
508
+ low: 0
509
+ verdict: pass | fail
510
+ notes: "{any additional context}"
511
+ ```
512
+
513
+ ### Human-Readable Summary
514
+
515
+ ```
516
+ Validation: skills/my-skill/SKILL.md
517
+ Standards: Fetched from official docs (2026-01-17)
518
+ Verdict: FAIL (2 critical, 1 high)
519
+
520
+ Critical:
521
+ - Missing required 'description' field in frontmatter
522
+ - SKILL.md exceeds 500 line limit (612 lines)
523
+
524
+ High:
525
+ - 'agent' field uses unsupported value 'gpt-4'
526
+
527
+ Full report: logs/validations/my-skill-2026-01-17T10-30-00.yaml
528
+ ```
529
+
530
+ ### Severity Definitions
531
+
532
+ | Severity | Definition | Examples |
533
+ |----------|------------|----------|
534
+ | **Critical** | Blocks functionality, violates required standards | Missing required frontmatter, wrong file location |
535
+ | **High** | Significant issue, should fix before release | Deprecated field, exceeds limits |
536
+ | **Medium** | Quality improvement, recommended | Missing optional fields |
537
+ | **Low** | Style/naming suggestions | Naming conventions |
538
+
539
+ ### Verdict Logic
540
+
541
+ ```
542
+ if any_critical_findings:
543
+ verdict = "FAIL"
544
+ else:
545
+ verdict = "PASS"
546
+ # Always list ALL findings regardless of verdict
547
+ ```
548
+
549
+ ---
550
+
551
+ ## Fallback Behavior
552
+
553
+ When `claude-code-guide` fetch fails:
554
+
555
+ 1. **Log warning**: "Could not fetch latest standards, using embedded checklist"
556
+ 2. **Set** `standards_source: fallback` in report
557
+ 3. **Use** embedded checklist from `references/`
558
+ 4. **Continue** validation
559
+ 5. **Include note** in summary: "Validated against potentially outdated standards"
560
+
561
+ ---
562
+
563
+ ## Diagnostic Output
564
+
565
+ All validation runs write diagnostic data to:
566
+
567
+ ```
568
+ logs/diagnostics/anthropic-validator-{timestamp}.yaml
569
+ ```
570
+
571
+ ### Diagnostic Schema
572
+
573
+ ```yaml
574
+ diagnostic:
575
+ skill: anthropic-validator
576
+ timestamp: "{ISO-8601}"
577
+
578
+ invocation:
579
+ asset_path: "{input}"
580
+ asset_type: "{detected type}"
581
+ batch_mode: true | false
582
+
583
+ execution:
584
+ standards_fetch:
585
+ agent: claude-code-guide
586
+ success: true | false
587
+ fallback_used: true | false
588
+ analysis:
589
+ agent: bulwark-standards-reviewer
590
+ findings_count: 0
591
+
592
+ output:
593
+ report_path: "logs/validations/{name}.yaml"
594
+ verdict: pass | fail
595
+ ```
596
+
597
+ ---
598
+
599
+ ## Related Skills
600
+
601
+ - `subagent-prompting` (P0.1) - 4-part template for agent invocation
602
+ - `subagent-output-templating` (P0.2) - Output format for logs
603
+
604
+ ## Related Agents
605
+
606
+ - `bulwark-standards-reviewer` - Critical analysis agent (invoked by this skill)
607
+ - `claude-code-guide` - Built-in agent for documentation fetching