spec-to-code-compliance

Verifies smart contract code implements exactly what whitepapers and specifications document.

Updated Mar 22, 2026
One-click install
npx skills add https://github.com/TECH-HY/SKILLS --skill spec-to-code-compliance-tech-hy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spec-to-code-compliance
Source: https://github.com/TECH-HY/SKILLS/tree/main/skills/spec-to-code-compliance
Command: npx skills add https://github.com/TECH-HY/SKILLS --skill spec-to-code-compliance-tech-hy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Blockchain audits require proving that code matches its specification, but manually comparing whitepapers against smart contracts is error-prone and often misses subtle divergences like missing slippage checks or undocumented code paths. ## Core Features & Use Cases - Structured IR Extraction: Converts specifications and code into Spec-IR and Code-IR records with line-level citations and confidence scores. - Alignment & Divergence Analysis: Classifies every spec claim as full_match, partial_match, mismatch, or missing_in_code, with severity-rated findings and exploit scenarios. - Audit-Grade Reporting: Produces a 16-section compliance report with an alignment matrix, quantified economic impact, and remediation code examples. - Use Case: Given a DEX whitepaper and its Solidity router contract, the skill detects that the required 1% slippage protection is entirely missing, documents a sandwich attack scenario with quantified losses, and provides a fixed implementation. ## Quick Start Use the spec-compliance-checker agent to verify this codebase against the whitepaper and produce a full compliance report.

Frequently Asked Questions about spec-to-code-compliance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I verify smart contract code matches a whitepaper?

Provide both the specification documents and the codebase, then run the seven-phase compliance workflow. It extracts spec requirements into Spec-IR, analyzes code line-by-line into Code-IR, and produces an alignment matrix classifying each requirement as matched, mismatched, or missing.

What documentation formats can be checked against code?

The skill normalizes PDFs, Markdown, DOCX, HTML, plain text, Notion exports, and meeting transcripts into a unified spec corpus. It identifies documentation by semantic cues like invariants, formulas, and trust models, not just filenames.

When should I not use spec-to-code compliance checking?

Do not use it for codebases without corresponding specification documents, general vulnerability hunting, or writing documentation. It only verifies compliance between an existing spec and code, and is designed for blockchain projects with formal specifications.

How are divergences between spec and code classified?

Each misalignment is rated CRITICAL, HIGH, MEDIUM, or LOW based on exploitability. CRITICAL and HIGH findings include detailed attack scenarios with quantified economic impact, remediation code examples, testing requirements, and migration paths.

How does the skill avoid hallucinated audit findings?

Every claim must quote exact spec text or cite code line numbers, and ambiguous items are classified as AMBIGUOUS or UNDOCUMENTED rather than guessed. Confidence scores below 0.8 require explicit ambiguity documentation, and inference from prior protocol knowledge is prohibited.