spec-to-code-compliance
Verifies code implements exactly what documentation specifies for blockchain audits. Use when comparing code against whitepapers, finding gaps between specs and implementation, or performing compliance checks for protocol implementations.
Security Assessment
About spec-to-code-compliance
The Spec-to-Code Compliance skill is designed to rigorously verify that a codebase adheres precisely to its corresponding documentation, particularly in the context of blockchain projects. It addresses the common challenge of ensuring that implementations reflect specifications, such as whitepapers or design documents, without introducing unintended behavior or leaving parts of the specification unimplemented. By systematically comparing the code against documentation, this skill helps organizations maintain high integrity in protocol implementations, detect gaps, and prevent deviations that could lead to functional errors or security vulnerabilities.
This skill provides comprehensive capabilities for blockchain auditors and developers who need precise spec-to-code alignment. Key features include deterministic analysis, evidence-based verification, traceable reporting, and strict classification of ambiguities. It enforces global rules such as never inferring unspecified behavior, citing exact documentation and code references, providing confidence scores for all mappings, and separating extraction, alignment, classification, and reporting into distinct phases. The skill supports normalization of multiple input formats (PDF, Markdown, DOCX, HTML, TXT, Notion exports, and meeting transcripts) while preserving logical structure, formulas, tables, code snippets, and invariants.
Typical use cases involve auditing smart contracts against whitepapers, performing compliance checks for protocol implementations, and identifying undocumented or unimplemented behaviors. Target users include senior blockchain auditors, development teams working on protocol implementations, and security specialists conducting detailed compliance reviews. This skill is not intended for general code review, vulnerability hunting, or documentation writing, making it highly specialized for projects with formal specifications and blockchain-specific logic.
FAQ
When should I use the Spec-to-Code Compliance skill?
Use this skill when you need to verify that code implements exactly what is specified in documentation, audit smart contracts against whitepapers or design documents, find gaps between intended behavior and actual implementation, or perform compliance checks for blockchain protocols.
What types of documentation are compatible with this skill?
The skill works with any documentation that describes logic, flows, assumptions, or protocol rules, including PDFs, Markdown files, DOCX documents, HTML pages, TXT files, Notion exports, and meeting transcripts.
Can I use this skill for general code review or vulnerability testing?
No. This skill is focused solely on compliance verification between code and specifications. For general code review or vulnerability testing, a different skill or audit approach should be used.
Is prior knowledge of known protocols required?
No. The skill is designed to rely exclusively on the provided documentation and codebase. It does not use external knowledge or assumptions about protocols.
What outputs can I expect from the skill?
You will receive a deterministic, traceable, and evidence-based report with confidence scores for all mappings, classification of ambiguities, and identification of undocumented or unimplemented code paths.
Install spec-to-code-compliance
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
trailofbits/skills