bulwark-verify
Skill8 starsChanged 5 months agoMITView on GitHub
Generate runnable verification scripts for components. Orchestrates assertion-patterns and component-patterns to produce executable scripts.
- Deletes or force-pushes
In this repository29 other files it gives its agents.
- anthropic-validatorSkill
- assertion-patternsSkill
- bug-magnet-dataSkill
- bulwark-brainstormSkill
- bulwark-researchSkill
- bulwark-scaffoldSkill
- bulwark-statuslineSkill
- code-reviewSkill
- component-patternsSkill
- continuous-feedbackSkill
- create-skillSkill
- create-subagentSkill
- fix-bugSkill
- governance-protocolSkill
- initSkill
- issue-debuggingSkill
- mock-detectionSkill
- pipeline-templatesSkill
- plan-creationSkill
- plan-to-tasksSkill
- product-ideationSkill
- session-handoffSkill
- setup-lspSkill
- spec-drift-checkSkill
- subagent-output-templatingSkill
- subagent-promptingSkill
- test-auditSkill
- test-classificationSkill
- test-fixture-creationSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. About 0 are common, 20 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈20
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 34
test-audit Step 7 needs verification scripts
- Very specific: line 40
Test auditing (use test-audit skill)
- Distinctive: line 63
When this skill is loaded, execute these steps exactly as written:
- Distinctive: line 79
Check for project manifest files in order (search from target file's directory up to project root):
- Distinctive: line 105
Read the context file matching the component type:
- Distinctive: line 114
Read the "Applicable Categories" section from the context file
- Distinctive: line 126
You MUST spawn a Sonnet sub-agent for script generation: Do NOT generate the script yourself.
- Distinctive: line 140
After the sub-agent returns, validate the generated script syntax:
- Distinctive: line 149
Read the error message
- Distinctive: line 152
Only then proceed to Step 6
- Very specific: line 173
If --execute flag was provided:
- Distinctive: line 174
Run the generated script using Bash
- Distinctive: line 183
Use this 4-part prompt when spawning the Sonnet sub-agent:
- Distinctive: line 268
If generating a README for the verification script, name it per-component to avoid overwrites:
- Very specific: line 357
Write diagnostic output to: logs/diagnostics/bulwark-verify-{YYYYMMDD-HHMMSS}.yaml
- Distinctive: line 363
When test-audit Step 7 invokes this skill:
- Distinctive: line 365
test-audit provides the test file path and violation info
- Distinctive: line 368
If verification passes, test-audit proceeds with the rewrite
- Distinctive: line 393
When generating scripts, prefer the simplest runner:
- Distinctive: line 469
Test 1: Health endpoint...
- Distinctive: line 470
Test 2: API response... PASS (valid JSON) Test 3: 404 handling...
- Distinctive: line 471
Test 3: 404 handling... PASS (HTTP 404) === All tests passed ===
- Distinctive: line 501
Before completing bulwark-verify execution, verify ALL items:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Bulwark Verify
Purpose
Generate runnable verification scripts that test real component behavior without mocks. This skill orchestrates assertion-patterns (P2.1) and component-patterns (P2.2) to produce executable scripts for any component type.
When to Use
Load this skill when:
- User requests
/bulwark-verify [path] - test-audit Step 7 needs verification scripts
- Generating standalone verification for a component
DO NOT use for:
- Running existing tests (use
just test) - Writing unit tests (implement directly)
- Test auditing (use
test-auditskill)
Usage
/bulwark-verify [path] [--execute]Examples:
/bulwark-verify src/cli.ts- Generate verification script for CLI/bulwark-verify src/server.ts --execute- Generate and run/bulwark-verify- Infer from recent context
MANDATORY EXECUTION STEPS
WARNING: These steps are BINDING instructions, not suggestions. You MUST execute each step in order. Do NOT substitute your judgment for these instructions. Do NOT skip sub-agent spawning. Do NOT modify the execution flow.
When this skill is loaded, execute these steps exactly as written:
Step 1: Resolve Target
IF $ARGUMENTS provided:
target = first non-flag argument
execute_flag = "--execute" in $ARGUMENTS
ELSE:
Look for component files in recent conversation context
IF found: target = that path
ELSE: Ask user: "Which component should I generate a verification script for?"Step 2: Detect Project Language
Check for project manifest files in order (search from target file's directory up to project root):
| Check | Language | Test Runner |
package.json exists | Node | jest/vitest/node |
pyproject.toml OR setup.py exists | Python | pytest/python |
Cargo.toml exists | Rust | cargo test |
| None of the above | Generic | bash |
Step 3: Analyze Component
- Read the target file
- Identify component type using indicators from
component-patternsskill:- Has
spawn/exec/execSyncimports → Process Spawner - Has
listen()/createServer/express()/fastify()→ HTTP Server - Has
fs.readFile/parsefunctions → File Parser - Has
process.argv/yargs/commander/argparse→ CLI Command - Has database imports (
pg,mysql,mongoose,prisma) → Database - Has
fetch/axios/got/requestscalls → External API
- Has
- Load dependent skills:
- Load
assertion-patternsskill content - Load
component-patternsskill content
- Load
- Load bug-magnet-data for the component type [REQUIRED]:
- Read the context file matching the component type:
Component Type Context File CLI Command bug-magnet-data/context/cli-args.mdHTTP Server bug-magnet-data/context/http-body.mdFile Parser bug-magnet-data/context/file-contents.mdDatabase bug-magnet-data/context/db-query.mdProcess Spawner bug-magnet-data/context/process-spawn.mdExternal API bug-magnet-data/context/http-body.md - Read the "Applicable Categories" section from the context file
- Load T0 + T1 data files listed in the context file:
- T0 (Always):
data/strings/boundaries.yaml,data/numbers/boundaries.yaml - T1 (Common): Based on context file recommendations
- T0 (Always):
- Read the context file matching the component type:
- Select applicable patterns:
- From
assertion-patterns: Identify T1-T4 transformation patterns relevant to the component - From
component-patterns: Select the matching component type template - From
bug-magnet-data: Extract concrete edge case values to include in generated script
- From
Step 4: Generate Script [SPAWN-REQUIRED]
You MUST spawn a Sonnet sub-agent for script generation. Do NOT generate the script yourself.
Task(
description="Generate verification script for {component_name}",
subagent_type="general-purpose",
prompt=<constructed_4part_prompt_from_template_below>
)The sub-agent writes the script to tmp/verification/{component_name}-verify.{ext}.
Step 5: Validate Generated Script [REQUIRED]
After the sub-agent returns, validate the generated script syntax:
| Language | Validation Command | Success |
| Node | node --check {script_path} | Exit 0 |
| Python | python -m py_compile {script_path} | Exit 0 |
| Bash | bash -n {script_path} | Exit 0 |
If validation fails:
- Read the error message
- Fix the syntax issue in the generated script
- Re-validate until successful
- Only then proceed to Step 6
Step 6: Report Results
Present summary to user:
## Verification Script Generated
**Component:** {component_path}
**Type:** {component_type}
**Language:** {language}
**Script location:** tmp/verification/{name}-verify.{ext}
**To run manually:**{runner_command}
If --execute flag was provided:
- Run the generated script using Bash
- Capture output
- Report PASS/FAIL counts
- Show any failures with details
Generation Prompt Template
Use this 4-part prompt when spawning the Sonnet sub-agent:
## GOAL
Generate an executable verification script for `{component_path}` that tests real
component behavior without mocks. The script must verify observable output and
report clear PASS/FAIL for each test.
## CONSTRAINTS
- Language: {detected_language}
- Test runner: {runner} (e.g., jest, pytest, bash)
- Component type: {detected_type}
- MUST be directly executable: `{runner_command}`
- MUST use assertion patterns from assertion-patterns skill (real output, not mock calls)
- MUST follow component pattern from component-patterns skill ({component_type} verification)
- MUST include edge cases from bug-magnet-data (boundaries, special values, injection patterns)
- Include setup and teardown if component requires it
- Report clear PASS/FAIL for each verification
- Handle cleanup on both success and failure (use trap for bash, afterAll for jest, fixtures for pytest)
- Exit with code 0 on all pass, code 1 on any failure
- EXCLUDE destructive patterns marked `safe_for_automation: false` (add as commented-out manual tests)
## CONTEXT
### Component Code
```{language}
{component_content}Component Type
{detected_type}
Applicable Assertion Patterns (from assertion-patterns)
{relevant_assertion_patterns}
Applicable Component Pattern (from component-patterns)
{component_pattern_template}
Edge Cases (from bug-magnet-data) [REQUIRED]
Include these edge cases in verification tests:
T0 (Always include): {t0_edge_cases_from_bug_magnet_data}
T1 (Include if component handles input): {t1_edge_cases_from_bug_magnet_data}
Destructive patterns (manual-only - add as comments): {destructive_patterns_if_any}
OUTPUT
Write script to: tmp/verification/{component_name}-verify.{ext}
Extension mapping:
- Node →
.test.js - Python →
_test.py - Rust →
.rs(or.shif cargo test not suitable) - Generic →
.sh
Script Structure
- Setup (create temp files, start services, initialize test DB)
- Execute component under test
- Verify observable output (not mock calls)
- Report PASS/FAIL clearly for each test
- Cleanup (kill processes, remove temp files)
- Exit with appropriate code (0 = all pass, 1 = any fail)
Report your actions to the log file
Write to: logs/bulwark-verify-{YYYYMMDD-HHMMSS}.yaml
---
## Output Formats
### Generated Script Locationtmp/verification/{component-name}-verify.{ext}
### README Files (Per-Component)
If generating a README for the verification script, name it per-component to avoid overwrites:tmp/verification/{component-name}-README.md
**NOT:** `tmp/verification/README.md` (would be overwritten by subsequent runs)
### Cleanup Behavior
Generated scripts **persist in `tmp/verification/`** for inspection and debugging:
- Scripts are NOT automatically deleted after execution
- `tmp/` is in `.gitignore` - scripts won't be committed
- Manual cleanup: `rm -rf tmp/verification/*`
This allows:
- Post-run inspection of generated scripts
- Iterative refinement of verification approach
- Debugging when tests fail
### Log Schema
```yaml
# Top-level — required for Stop-hook per-file pipeline-recursion suppression.
# List every .sh verification script generated for this run (Bulwark verify
# scripts live under tmp/verification/ but are SCRIPT-bucket files for
# coverage purposes). Paths relative to ${CLAUDE_PROJECT_DIR}. Empty list
# `[]` if no script was emitted. Missing field disables suppression.
reviewed_files:
- tmp/verification/{component-name}-verify.sh
metadata:
skill: bulwark-verify
timestamp: {ISO-8601}
model: sonnet
generation:
target: {component_path}
language: node|python|rust|generic
component_type: cli|http|file-parser|process|database|api
script_path: tmp/verification/{name}-verify.{ext}
patterns_used:
assertion: [T1_transformation, T2_transformation]
component: "{component_type} verification"
execution: # Only if --execute
ran: true
runner: {runner_command}
exit_code: 0|1
duration_ms: 1234
results:
pass: 3
fail: 0
output: |
=== Verification: {component} ===
Test 1: Basic functionality... PASS
Test 2: Error handling... PASS
Test 3: Edge cases... PASS
=== All tests passed ===
summary: |
Generated verification script for {component} ({type}).
Script: tmp/verification/{name}-verify.{ext}
Run with: {runner_command}
[Execution: 3 passed, 0 failed]Diagnostic Schema
# Top-level — mirror the same list emitted in the run log (Stop hook contract).
reviewed_files:
- tmp/verification/{component-name}-verify.sh
skill: bulwark-verify
timestamp: {ISO-8601}
diagnostics:
model_requested: sonnet
model_actual: sonnet
context_type: main
language_detected: node|python|rust|generic
component_type: cli|http|file-parser|process|database|api
patterns_loaded:
- assertion-patterns
- component-patterns
script_generated: true
script_path: tmp/verification/{name}-verify.{ext}
execution_requested: true|false
execution_result: pass|fail|skipped
completion_status: success|errorWrite diagnostic output to: logs/diagnostics/bulwark-verify-{YYYYMMDD-HHMMSS}.yaml
Integration with test-audit
When test-audit Step 7 invokes this skill:
- test-audit provides the test file path and violation info
- This skill generates a verification script as intermediate artifact
- The script validates the rewrite approach before modifying the test
- If verification passes, test-audit proceeds with the rewrite
Flow:
test-audit Step 7
→ Load assertion-patterns
→ Load component-patterns
→ Generate verification script (tmp/verification/)
→ Run verification script
→ If pass: Apply rewrite to test file
→ If fail: Report issue, do not rewriteRunner Commands by Language
| Language | Default Runner | Command |
| Node | node (built-in test) | node --test tmp/verification/{name}-verify.test.js |
| Node (Jest) | jest | npx jest tmp/verification/{name}-verify.test.js |
| Python | pytest | pytest tmp/verification/{name}_test.py -v |
| Rust | cargo | cargo test --test {name} |
| Generic | bash | bash tmp/verification/{name}-verify.sh |
When generating scripts, prefer the simplest runner:
- For Node: Use built-in
node --testif no external deps needed - For Python: Use
pytestfor better output - For Generic: Always use bash
Error Handling
Target file not found
Error: Target file not found: {path}
Please provide a valid path to the component you want to verify.Language detection failed
Warning: Could not detect project language. Using generic (bash) templates.
To specify: /bulwark-verify {path} --lang=nodeComponent type detection failed
Warning: Could not determine component type from code analysis.
Please specify: /bulwark-verify {path} --type=cli
Available types: cli, http, file-parser, process, database, apiScript generation failed
Error: Failed to generate verification script.
Reason: {error_message}
Check logs/bulwark-verify-*.yaml for details.Examples
Example 1: CLI Component
User: /bulwark-verify src/cli.ts
Output:
## Verification Script Generated
**Component:** src/cli.ts
**Type:** CLI Command
**Language:** Node
**Script location:** tmp/verification/cli-verify.test.js
**To run manually:**node --test tmp/verification/cli-verify.test.js
Example 2: HTTP Server with Execution
User: /bulwark-verify src/server.ts --execute
Output:
## Verification Script Generated
**Component:** src/server.ts
**Type:** HTTP Server
**Language:** Node
**Script location:** tmp/verification/server-verify.test.js
**Execution Results:**=== HTTP Server Verification: server === Test 1: Health endpoint... PASS (HTTP 200) Test 2: API response... PASS (valid JSON) Test 3: 404 handling... PASS (HTTP 404) === All tests passed ===
**Summary:** 3 passed, 0 failedExample 3: Python Parser
User: /bulwark-verify src/parser.py
Output:
## Verification Script Generated
**Component:** src/parser.py
**Type:** File Parser
**Language:** Python
**Script location:** tmp/verification/parser_test.py
**To run manually:**pytest tmp/verification/parser_test.py -v
Completion Checklist
Before completing bulwark-verify execution, verify ALL items:
Component Analysis (Step 3)
- Target file read successfully
- Component type identified (CLI, HTTP Server, File Parser, Database, Process Spawner, External API)
- Project language detected (Node, Python, Rust, Generic)
assertion-patternsskill content loadedcomponent-patternsskill content loadedbug-magnet-datacontext file loaded for component type- T0 + T1 edge cases loaded from bug-magnet-data
Script Generation (Step 4)
- Sonnet sub-agent spawned (NOT generated by orchestrator)
- Prompt includes component code, assertion patterns, component patterns
- Prompt includes edge cases from bug-magnet-data (T0 + T1 values)
- Script written to
tmp/verification/{component_name}-verify.{ext}
Validation (Step 5)
- Syntax validation command executed (node --check, python -m py_compile, bash -n)
- Validation passed (or errors fixed and re-validated)
Edge Case Coverage
- T0 boundary values included (empty string, zero, null)
- T1 edge cases included if applicable (injection, unicode)
- Destructive patterns excluded or marked as manual-only comments
Output
- Summary presented to user with script location and run command
- Log written to
logs/bulwark-verify-*.yaml - Diagnostics written to
logs/diagnostics/bulwark-verify-*.yaml - If
--execute: Script executed, PASS/FAIL results reported
Do NOT return to user until all applicable checklist items are verified.
Related Skills
assertion-patterns(P2.1) - T1-T4 transformation patternscomponent-patterns(P2.2) - Component-type verification templatesbug-magnet-data(P4.2) - Curated edge case test data
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

