bulwark-verify
Generate runnable verification scripts for components. Orchestrates assertion-patterns and component-patterns to produce executable scripts.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate runnable verification scripts for components. Orchestrates assertion-patterns and component-patterns to produce executable scripts.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Validates Claude Code assets (skills, hooks, agents, commands, MCP servers, plugins) against official Anthropic standards. Fetches latest docs dynamically and produces structured validation reports.
Real output verification vs mock calls. Use when transforming T1-T4 violating tests to verify observable behavior.
Curated edge case test data for boundary testing, verification scripts, and test generation. Provides pre-curated reference data organized by data type with context-specific loading guidance.
Role-based brainstorming with dual modes: --scoped (sequential Task tool, 5 roles) and --exploratory (Agent Teams peer debate, 4 roles). Use for feasibility assessment and idea validation.
Structured multi-viewpoint research using 5 parallel Sonnet sub-agents. Use when deep research is needed on a complex topic before implementation planning.
Initialize Bulwark infrastructure in a project: language-aware Justfile (8 langs), bun + eval-framework toolchain, logs/ subdirectories, and optional hooks.
| name | bulwark-verify |
| description | Generate runnable verification scripts for components. Orchestrates assertion-patterns and component-patterns to produce executable scripts. |
| user-invocable | true |
| skills | ["assertion-patterns","component-patterns","bug-magnet-data"] |
| allowed-tools | ["AskUserQuestion","Bash","Glob","Grep","Read","Skill","Task","Write"] |
| version | 1.0.1 |
| author | Ashay Kubal @ Qball Inc. |
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.
Load this skill when:
/bulwark-verify [path]DO NOT use for:
just test)test-audit skill)/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 contextWARNING: 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:
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?"
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 |
Read the target file
Identify component type using indicators from component-patterns skill:
spawn/exec/execSync imports → Process Spawnerlisten()/createServer/express()/fastify() → HTTP Serverfs.readFile/parse functions → File Parserprocess.argv/yargs/commander/argparse → CLI Commandpg, mysql, mongoose, prisma) → Databasefetch/axios/got/requests calls → External APILoad dependent skills:
assertion-patterns skill contentcomponent-patterns skill contentLoad bug-magnet-data for the component type [REQUIRED]:
| Component Type | Context File |
|---|---|
| CLI Command | bug-magnet-data/context/cli-args.md |
| HTTP Server | bug-magnet-data/context/http-body.md |
| File Parser | bug-magnet-data/context/file-contents.md |
| Database | bug-magnet-data/context/db-query.md |
| Process Spawner | bug-magnet-data/context/process-spawn.md |
| External API | bug-magnet-data/context/http-body.md |
data/strings/boundaries.yaml, data/numbers/boundaries.yamlSelect applicable patterns:
assertion-patterns: Identify T1-T4 transformation patterns relevant to the componentcomponent-patterns: Select the matching component type templatebug-magnet-data: Extract concrete edge case values to include in generated scriptYou 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}.
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:
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:
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}
{detected_type}
{relevant_assertion_patterns}
{component_pattern_template}
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}
Write script to: tmp/verification/{component_name}-verify.{ext}
Extension mapping:
.test.js_test.py.rs (or .sh if cargo test not suitable).shWrite to: logs/bulwark-verify-{YYYYMMDD-HHMMSS}.yaml
---
## Output Formats
### Generated Script Location
tmp/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]
# 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|error
Write diagnostic output to: logs/diagnostics/bulwark-verify-{YYYYMMDD-HHMMSS}.yaml
When test-audit Step 7 invokes this skill:
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 rewrite
| 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:
node --test if no external deps neededpytest for better outputError: Target file not found: {path}
Please provide a valid path to the component you want to verify.
Warning: Could not detect project language. Using generic (bash) templates.
To specify: /bulwark-verify {path} --lang=node
Warning: Could not determine component type from code analysis.
Please specify: /bulwark-verify {path} --type=cli
Available types: cli, http, file-parser, process, database, api
Error: Failed to generate verification script.
Reason: {error_message}
Check logs/bulwark-verify-*.yaml for details.
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
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 failed
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
Before completing bulwark-verify execution, verify ALL items:
assertion-patterns skill content loadedcomponent-patterns skill content loadedbug-magnet-data context file loaded for component typetmp/verification/{component_name}-verify.{ext}logs/bulwark-verify-*.yamllogs/diagnostics/bulwark-verify-*.yaml--execute: Script executed, PASS/FAIL results reportedDo NOT return to user until all applicable checklist items are verified.
assertion-patterns (P2.1) - T1-T4 transformation patternscomponent-patterns (P2.2) - Component-type verification templatesbug-magnet-data (P4.2) - Curated edge case test data