Skip to content

sb-dev/openquant / .agents/skills/spec-to-code-compliance

spec-to-code-compliance

Verified

Check implementation code against its specification, protocol, whitepaper, or design document. Trace each requirement to evidence, report contradictions and missing or partial enforcement, and find undocumented behavior.

FileKindSize
SKILL.mdskill md7.0 KB
upstream/.claude-plugin/plugin.jsonconfig370 B
upstream/README.mdmarkdown4.1 KB
upstream/agents/spec-compliance-checker.mdmarkdown5.7 KB
upstream/evals/.gitignoreother9 B
upstream/evals/documents-contradict/case.yamlconfig2.0 KB
upstream/evals/documents-contradict/fixture/README.mdmarkdown821 B
upstream/evals/documents-contradict/fixture/SPEC.mdmarkdown1.5 KB
upstream/evals/documents-contradict/fixture/Vault.solother2.8 KB
upstream/evals/documents-contradict/graders/reports-the-contradiction.mdmarkdown1.4 KB
upstream/evals/name-is-not-evidence/case.yamlconfig2.2 KB
upstream/evals/name-is-not-evidence/fixture/SPEC.mdmarkdown1.5 KB
upstream/evals/name-is-not-evidence/fixture/Vault.solother2.8 KB
upstream/evals/name-is-not-evidence/graders/senior-branch-unenforced.mdmarkdown1.5 KB
upstream/evals/name-is-not-evidence/graders/verdict-per-requirement.mdmarkdown1.0 KB
upstream/evals/routes-not-inline/case.yamlconfig2.9 KB
upstream/evals/routes-not-inline/fixture/SPEC.mdmarkdown1.5 KB
upstream/evals/routes-not-inline/fixture/Vault.solother2.8 KB
upstream/evals/routes-not-inline/graders/dispatches-the-workflow.mdmarkdown109 B
upstream/evals/routes-not-inline/graders/invokes-the-skill.mdmarkdown90 B
upstream/skills/spec-to-code-compliance/SKILL.upstream.mdmarkdown7.4 KB
upstream/skills/spec-to-code-compliance/agents/openai.yamlconfig252 B
upstream/skills/spec-to-code-compliance/assets/trail-of-bits-mark.svgother3.0 KB
upstream/skills/spec-to-code-compliance/resources/ANALYSIS_FORMAT.mdmarkdown2.8 KB
upstream/skills/spec-to-code-compliance/resources/DIVERGENCE_RUBRIC.mdmarkdown3.3 KB
upstream/skills/spec-to-code-compliance/resources/DOMAIN_NOTES.mdmarkdown5.7 KB
upstream/skills/spec-to-code-compliance/resources/WORKED_EXAMPLE.mdmarkdown4.1 KB
upstream/workflows/spec-compliance.jsscript28.4 KB

upstream/skills/spec-to-code-compliance/resources/ANALYSIS_FORMAT.md

View on GitHub
# Analysis Format

The output format for a per-requirement analysis. The agent defines what to check; this defines how to write it
down. One document per requirement.

## Structure

Sections in this order, separated by `---`:

```markdown
## REQ-04 — <the requirement in a few words>

> "<the requirement quoted verbatim>"
> — SPEC.md §3.2

**Verdict:** partial · confidence: high

**What this demands of an implementation:** the property that has to hold, restated concretely enough to look
for. Name the quantities and where they come from.

**Where enforcement lives:**

​```solidity
// Vault.sol:L80-L85
<the code>
​```
- What it checks, and against what.
- Which paths reach it, and which do not.

**Paths walked:**
- `redeem` → `_collateralPreserved`: Standard tier reaches the comparison at L84. ✓
- `redeem` → `_collateralPreserved`: Senior tier returns `true` at L82 without comparing. ✗ — the gap.

**Searched:**
- `locked` → 4 hits: L24 declaration, L57 write, L84 comparison, L98 transfer in `reassign`
- `tier` → 3 hits, none in a bounds check other than L81
- modifiers on `redeem` → `notPaused` only; no collateral check
- callers of `redeem` → none in scope; it is an entrypoint

**How the verdict was reached:** why this verdict and not the adjacent one. For `partial`, why it is not
`contradicted`; for `absent`, why the searches above are exhaustive rather than merely unsuccessful.

**Open questions:**
- unclear; need to inspect X
```

## Conventions

Cite code as `File.ext:L45` or `L89-L135`. Quote the document verbatim and cite its section — a paraphrase
silently substitutes your reading for the requirement.

The **Searched** section is what makes an `absent` verdict worth anything. Record the pattern and its result,
including the searches that found something irrelevant. `0 hits` and `6 hits, all in tests` are both evidence;
"I looked and found nothing" is not.

Spend words where the code earns them. A requirement enforced in one line takes one line to confirm. Branches,
call chains, and the paths where enforcement goes missing are where the depth belongs. There is no minimum
number of anything, and padding a section to fill this template produces text that looks like analysis and
isn't.

Leave a section out only when it is genuinely empty, and say so: "No enforcement found anywhere." A missing
section could mean "none" or "never checked", and the reader cannot tell which.

## Before you finish

Every claim either cites a line or sits in Open Questions. Every path through each function called was walked,
not only the one that returns successfully.

Cut the hedges. "Probably", "seems to", and "should be" each become a claim with a line number or an open
question.

Finishing with open questions is a complete analysis. Finishing with open questions you never wrote down is not.
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall