Skip to main content
skill CX Codex

spec-to-code-compliance — Claude Code skill: what it does & setup

Compares an implementation against technical whitepapers or protocol specifications to flag missing logic, deviations, and unrecorded behavior.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add trailofbits/skills --skill spec-to-code-compliance -a claude-code
Open on GitHub

What spec-to-code-compliance does

The skill evaluates codebases against authoritative texts like whitepapers, RFCs, or formal specifications. Trying to audit dozens of conditions inside a single prompt causes hallucinated confirmations when the context window fills up. To prevent this, the workflow extracts individual requirements and dispatches dedicated subagents to trace the complete caller and callee chains.

Every reported divergence undergoes review by separate verification agents. One subagent re-checks the code paths while another re-examines the specification text, dropping invalid findings before they reach the summary. The final output is stored in spec-compliance/REPORT.md, with per-requirement logs placed in spec-compliance/requirements/. Verdicts classify findings into statuses such as implemented, partial, contradicted, stronger-than-spec, and absent.

Running this check on undocumented code is useless. Without a reference text to establish intended behavior, the agent cannot tell an intentional architectural decision from a defect.

What it helps with

  • match codebase behavior against whitepapers and protocol specifications
  • detect partial requirement enforcement across unexercised code branches
  • catalog undocumented assumptions and constraints present in source files
  • audit smart contracts or services against published standards

Example prompts for the agent

  • /spec-to-code-compliance:spec-compliance ./contracts
  • Inspect a single requirement with spec-to-code-compliance:spec-compliance-checker

How to install spec-to-code-compliance

1Skills CLI (Vercel)

npx skills add trailofbits/skills --skill spec-to-code-compliance -a claude-code

2Manually: put the files in place

~/.claude/skills/spec-to-code-compliance/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/spec-to-code-compliance/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about spec-to-code-compliance

How to install spec-to-code-compliance in Claude Code?

Run npx skills add trailofbits/skills --skill spec-to-code-compliance -a claude-code. The skill file will be created at ~/.claude/skills/spec-to-code-compliance/SKILL.md.

What does spec-to-code-compliance do?

It identifies discrepancies between source code and its governing documentation. The tool splits documents into specific clauses, evaluates code paths using isolated subagents, and generates markdown audit reports.

Why does the skill assign each requirement to a separate subagent?

Evaluating an enforcement rule requires inspecting both callers and callees. Handling dozens of rules in one context leads to superficial checks based on function names rather than thorough code tracing.

Similar skills

All skills for Testing and QA →

From the same set77

agentic-actions-auditor Inspects GitHub Actions workflows for prompt injection risks and insecure AI agent setups. Catches attacker inputs leaking into prompts via event contexts or environment variables. CX Codex +1 6,700installs gh-cli A skill that redirects GitHub requests from curl and fetch to authenticated gh CLI for repositories, pull requests, and issues. Use it for private repos and higher API limits. CX Codex +1 6,600installs variant-analysis Finds related occurrences of an already identified defect across a repository. Use it after a vulnerability or logic issue turns up and similar code needs checking. CX Codex +1 6,400installs sarif-parsing Processes existing SARIF reports from CodeQL, Semgrep, and other scanners. Use it to filter findings, remove duplicates, or prepare results for CI/CD. CX Codex +1 5,900installs audit-prep-assistant Prepares codebases for external security reviews using Trail of Bits' checklist. It helps run static analysis, boost test coverage, and generate system documentation. CX Codex +1 5,700installs entry-point-analyzer Finds externally callable smart contract functions that change state and classifies their access level. Use it before an audit to map the attack surface. CX Codex +1 5,700installs semgrep-rule-creator A skill that walks you through creating custom Semgrep rules to detect security vulnerabilities and code patterns in your projects. Use it when you need static analysis tailored to your codebase. CX Codex +1 5,800installs solana-vulnerability-scanner Detects 6 critical vulnerabilities across native Rust and Anchor programs on Solana. Helps identify flaws in account validation, PDA derivation, and CPI logic. CX Codex +1 5,600installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor