본문으로 건너뛰기
Skillpedia
테스트8.0k · #12706

spec-to-code-compliance

하는 일

코드가 명세나 백서에 적힌 대로 실제로 동작하는지 확인합니다. 구현이 공개 문서나 고객 문서와 맞는다는 것을 증명해야 하는 감사자와 엔지니어를 위한 것입니다.

사용하는 경우

  • ✓고객이나 감사자가 코드가 작성된 명세와 맞는다는 증명을 원할 때.
  • ✓프로토콜 문서와 구현이 있고, 둘이 어긋나는 곳을 찾고 싶을 때.
  • ✓설계 메모에 없는 코드의 동작 목록이 필요한 경우.

스킬 링크

https://github.com/trailofbits/skills/blob/main/plugins/spec-to-code-compliance/skills/spec-to-code-compliance/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/trailofbits/skills/blob/main/plugins/spec-to-code-compliance/skills/spec-to-code-compliance/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 프로토콜 명세와 제 코드를 비교해서, 코드가 따르지 않는 요구 사항을 찾아 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 문서와 코드를 나란히 읽고, 각 요구 사항을 나열한 다음, 코드가 충족하는지, 어기는지, 침묵하는지 확인합니다. 각 차이는 코드 버그 또는 문서 오류로 표시됩니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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 absent verdict 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.

  • partial is 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.
  • absent rests entirely on its searched record. Read it. Enforcement often lives somewhere the search did not go — a modifier, a base class, a caller that chec
자주 묻는 질문

문서가 필요한가요?

네. 이 스킬은 의도된 동작을 적은 글이 있는 코드를 위한 것입니다. 기준이 없으면 비교할 것이 없습니다.

모든 버그를 찾나요?

아니요. 코드와 문서가 어긋나는 경우만 찾습니다.

어떻게 시작하나요?

코드와 비교할 명세 파일을 스킬에 가리키면 됩니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
8.0k
순위
#12706
라이선스
CC-BY-SA-4.0
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬