spec-to-code-compliance
Ce qu’il fait
Ce skill vérifie si le code fait réellement ce que dit sa spécification ou son livre blanc. Il s'adresse aux auditeurs et ingénieurs qui doivent prouver qu'une implémentation correspond à un document publié ou fourni par un client.
Quand l’utiliser
- ✓Quand un client ou un auditeur veut une preuve que le code correspond à une spécification écrite.
- ✓Quand vous avez un document de protocole et une implémentation et voulez trouver les écarts entre les deux.
- ✓Quand vous avez besoin d'une liste de comportements non documentés dans le code que la note de conception ne mentionne pas.
Lien du skill
https://github.com/trailofbits/skills/blob/main/plugins/spec-to-code-compliance/skills/spec-to-code-compliance/SKILL.mdCopiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.
Comment l’utiliser
Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.
Message prêt à coller
Pour Claude Code, Codex ou Cursor : lancez-la dans le dossier du projet et le skill est installé.
Téléchargez le SKILL.md et placez-le dans le dossier de skills de votre agent.
Exemple de demande à votre IA
“Je veux comparer cette spécification de protocole avec mon code et trouver les exigences que le code ne respecte pas.”
5 nouveaux skills par semaine. 1 minute de lecture.
Comment ça marche
L'agent lit le document et le code côte à côte, liste chaque exigence et vérifie si le code la respecte, la contredit ou n'en parle pas. Chaque écart est marqué comme un bug de code ou une erreur de documentation.
Contenu technique (SKILL.md original)
Texte original de l’auteur, en anglais, directement depuis GitHub.
Spec-to-Code Compliance
Two artifacts disagree, and the job is to find where. The documentation says what the system does; the code decides what it actually does. Every gap between them is either a bug or a documentation fix, and which one it is is the finding.
When to Use
You have both documentation describing intended behavior and the code that should implement it. A whitepaper against a protocol, a design note against a service, a README's stated guarantees against the functions behind them.
Most useful when the document is authoritative — something a client wrote, published, or is audited against — because then a divergence is a defect rather than stale prose.
When NOT to Use
Not for code with no documentation of intended behavior. There is nothing to check against, and a requirement
inferred from the code is checked against itself. Build the system model first with audit-context-building.
Not for finding bugs in general. This finds one class: where the code and the document disagree. A bug both artifacts are silent about is out of scope, and a bug the document endorses is a finding against the document.
Not for writing or improving documentation, though it produces the list of what needs fixing.
Do not check requirements in this context
Run /spec-to-code-compliance:spec-compliance <path>. The slash command takes a path; to name the
specification directly or widen the fan-out, ask for the run with those values — "run spec-compliance on
./contracts against SPEC.md, checking 20 requirements" — and they reach the script as {path, spec, limit}.
Typing the object literally after the slash command does not work; it arrives as a string and becomes the path.
It finds the documents, splits them into individually checkable requirements, gives each requirement its own
agent to hunt the code with, has independent agents try to refute every divergence before it is reported, and
writes spec-compliance/REPORT.md plus one file per requirement under spec-compliance/requirements/. Only
compact records come back here.
For a single requirement, dispatch the spec-to-code-compliance:spec-compliance-checker agent at it.
This is not a preference about where output lands. The check does not fit in one context window if it is done honestly: judging one requirement means reading the enforcement, its callees, and its callers, and doing that for thirty requirements means holding thirty call chains at once. Attempted inline, the first few get a real check and the rest get a plausible one — and the transcript looks the same either way, because a verdict resting on a promising function name reads exactly like one resting on having read the function. Per requirement, in its own context, is what makes that difference visible.
Two properties come from the script rather than from instructions, and cannot be had here:
- A refutation the finding's author did not perform. Claude favors findings it produced when asked to check them. The workflow sends each divergence to agents that did not produce it — one reading the code again, one re-reading the document — and drops what either knocks down.
- Records that cannot be prose. A subagent bound to a return schema has to name the lines it read and the
searches it ran. An
absentverdict arrives with the patterns tried and their results attached, which is the only thing separating a real absence from a search that stopped early.
Measured on the routes-not-inline eval: with this plugin installed the work is dispatched every run, without
it never — Δ +1.00. Deleting this section while leaving the workflow in place changes nothing, because the
workflow is a real command that gets found and dispatched on its own. Read that as the mechanism carrying the
behavior rather than this text: the section is here so a human knows what runs and why, not because the routing
depends on it.
What comes back, and how to read it
Every requirement gets one of six verdicts: implemented, partial, contradicted, stronger-than-spec,
absent, or undecidable. The interesting ones are the middle four.
partialis usually the most serious thing in the report. The requirement holds on the paths anyone would test and fails on one nobody did, which is how it survived long enough to be found.absentrests entirely on itssearchedrecord. Read it. Enforcement often lives somewhere the search did not go — a modifier, a base class, a caller that chec
Questions fréquentes
Faut-il un document ?
Oui. Le skill s'adresse au code qui a une description écrite du comportement attendu. Un code sans description n'a rien à vérifier.
Trouve-t-il tous les bugs ?
Non. Il trouve seulement les cas où le code et le document ne concordent pas.
Comment le lancer ?
Indiquez au skill le fichier de spécification à comparer avec le code.
Détails
Description originale de l’auteur
Check code against the documentation that specifies it - which requirements hold, which the code contradicts, which are absent, and what the code does that no document mentions. Use when comparing an implementation against a whitepaper, protocol spec, or design document.
repo: trailofbits/skills
Popularité
- Étoiles GitHub
- 8.0k
- Position au classement
- #12706
- Licence
- CC-BY-SA-4.0
- Mis à jour
- 02/11/2026
Commentaires
- …
Autres skills de ce dépôt
audit-context-building
8.0kAide votre agent à comprendre un code inconnu avant une revue de sécurité, en cartographiant ce que chaque fonction suppose, garantit et utilise.
algorand-vulnerability-scanner
8.0kAide votre agent à scanner des contrats Algorand (TEAL, PyTeal) pour 11 failles courantes, comme la réaffectation de clé ou les frais non contrôlés.
audit-prep-assistant
8.0kAide votre agent à préparer votre code pour une revue de sécurité externe, avec analyse statique, couverture de tests, nettoyage du code mort et documentation claire.
cairo-vulnerability-scanner
8.0kAide votre agent à scanner les contrats Cairo sur StarkNet pour 6 problèmes graves, comme les dépassements arithmétiques et le rejeu de signature.
Skills similaires
test-driven-development
311kApprend à votre agent à écrire d'abord un test qui échoue, à le voir échouer, puis à écrire le code minimal qui le fait réussir, avant de construire toute fonctionnalité ou correction.
verification-before-completion
311kApprend à votre agent à lancer de véritables contrôles et à lire leurs résultats avant d'affirmer qu'une tâche, une correction ou une compilation est terminée ou réussie.
migrate-to-shoehorn
310kRemplace les conversions de type risquées dans vos fichiers de test par la bibliothèque shoehorn, afin que les tests utilisent des données partielles et passent les contrôles de types.