Documentation Correctness Verification
Verify factual claims in the documentation against implementation source: $ARGUMENTS
Parse the arguments to determine scope.
Accepted inputs:
- A single page path (e.g.,
docs/spec/evm/dual-gas-model.md) — verify claims on that page.
- A directory (e.g.,
docs/spec/evm/) — verify all pages in that directory.
- A claim family (e.g.,
gas, system-contracts, upgrades, agent-files) — verify all claims of that type across all pages.
all — verify every page listed in docs/spec/SUMMARY.md and docs/mega-evme/SUMMARY.md, plus all agent files (AGENTS.md, CLAUDE.md, docs/spec/AGENTS.md, bin/mega-evme/AGENTS.md, REVIEW.md, .claude/skills/*/SKILL.md).
Default (no arguments): verify all pages.
Claim Families
Every verifiable claim in the docs falls into one of these families.
| Family |
What to verify |
Key source locations |
| Gas |
Gas costs, limits, compute gas caps, storage gas bases, detention caps, refund rules, multipliers |
crates/mega-evm/src/constants.rs, crates/mega-evm/src/evm/instructions.rs, crates/mega-evm/src/external/gas.rs |
| System Contracts |
Addresses, Solidity interfaces, execution semantics, deployment specs, interception behavior |
crates/system-contracts/contracts/, crates/mega-evm/src/system/, address constants in constants.rs |
| Resource Limits |
Per-transaction limits (compute gas, data size, KV updates, state growth), per-frame limits, forwarding rules |
crates/mega-evm/src/constants.rs, crates/mega-evm/src/limit/ |
| Detention |
Gas detention caps, volatile data categories, detention trigger conditions |
crates/mega-evm/src/constants.rs, crates/mega-evm/src/access/, crates/mega-evm/src/evm/host.rs |
| Upgrades |
Spec progression, per-upgrade behavioral deltas, activation order, backward compatibility |
crates/mega-evm/src/evm/spec.rs, crates/mega-evm/src/block/hardfork.rs |
| Precompiles |
Precompile addresses, behavior, gas costs |
crates/mega-evm/src/evm/precompiles.rs |
| CLI Commands |
Command names, flags, subcommands, default values in mega-evme docs |
bin/mega-evme/src/cmd.rs, bin/mega-evme/src/run/, bin/mega-evme/src/tx/, bin/mega-evme/src/replay/, bin/mega-evme/src/common/ |
| Agent Files |
Spec progression lists, system contract tables, source layout descriptions, code path references, unstable spec markers in AGENTS.md, CLAUDE.md, docs/spec/AGENTS.md, bin/mega-evme/AGENTS.md, REVIEW.md, and .claude/skills/*/SKILL.md |
Same sources as the claim's primary family (spec progression → spec.rs, system contracts → constants.rs + crates/system-contracts/, source layout → actual directory structure, mega-evme structure → bin/mega-evme/src/) |
Agent File Verification
Agent instruction files (AGENTS.md, CLAUDE.md, docs/spec/AGENTS.md, bin/mega-evme/AGENTS.md, REVIEW.md, .claude/skills/*/SKILL.md) contain code-related claims that can go stale.
Treat them as additional pages to audit.
Key claims to verify:
- Spec progression list in
AGENTS.md: Does it match the actual MegaSpecId enum in spec.rs?
- Unstable spec marker in
AGENTS.md: Is the marked unstable spec still the latest?
- System Contracts table in
AGENTS.md: Do the contracts, addresses, and purposes match the source?
- Core Source Layout in
AGENTS.md: Do the listed modules and descriptions match the actual directory structure?
- Code-to-doc mapping tables in skill files: Are all doc pages and code paths still valid?
- Hardfork-to-spec mapping in
AGENTS.md: Does it match hardfork.rs?
- Test organization in
AGENTS.md: Does it match actual test directory structure?
- mega-evme STRUCTURE in
bin/mega-evme/AGENTS.md: Do the listed modules match the actual bin/mega-evme/src/ directory layout?
Workflow
Phase 1: Claim Extraction
Read the target page(s) and extract every verifiable claim.
A claim is any statement that can be checked against source code:
- Numeric values: gas costs, limits, caps, multipliers, addresses, bucket sizes.
- Behavioral rules: "X always/never happens", "Y reverts when Z", "A is charged before B".
- Interface definitions: function signatures, event signatures, error selectors, parameter names.
- Relationships: "Spec X introduced feature Y", "Contract Z is available since Rex2".
- Security claims: Attack vectors, invariants, and risk consequences stated in Security Considerations sections.
For each claim, record:
- The exact text from the doc.
- The page path and section.
- The claim family.
Phase 2: Source Resolution
For each claim, locate the authoritative source:
- Match the claim family to the source locations in the table above.
- Find the specific source: search for the constant name, function signature, address, or behavioral code path.
- For constants: grep for the constant name or numeric value in
crates/mega-evm/src/constants.rs and related files.
- For interfaces: read the Solidity contract source in
crates/system-contracts/contracts/.
- For upgrade claims: check
spec.rs and hardfork.rs for the spec gate.
- For behavioral rules: trace the code path that implements the rule.
Budget: Do not spend more than ~5 targeted file reads per claim.
If the source cannot be found after 5 reads, mark the claim as Ambiguous.
Phase 3: Verification
For each claim, compare the doc text against the source and assign a disposition:
| Disposition |
Meaning |
| Verified |
Doc matches source exactly. Record: file path and line number. |
| Incorrect |
Doc contradicts source. Record: what the doc says, what the source says, and the source location. |
| Stale |
Doc was correct for a previous spec but is outdated. Record: which spec introduced the change. |
| Ambiguous |
Source is unclear or claim cannot be verified. Record: what was searched and why. |
| Version-dependent |
Claim is correct for some specs but not others, and the doc doesn't specify which. |
Phase 4: Report
## Correctness
**Scope**: {what was verified}
**Claims checked**: {count}
### Summary
| Disposition | Count |
|-------------|-------|
| Verified | N |
| Incorrect | N |
| Stale | N |
| Ambiguous | N |
| Version-dependent | N |
### Findings (Incorrect / Stale / Ambiguous / Version-dependent only)
#### C-001: {short description}
- **Severity**: Blocker | Major | Minor
- **Disposition**: {disposition}
- **Claim family**: {family}
- **Page**: {path}
- **Section**: {heading}
- **Doc says**: "{exact text from doc}"
- **Source says**: "{what the source actually shows}"
- **Source location**: `{file}:{line}`
- **Suggested correction**: {concrete edit to the doc text}
#### C-002: ...
### Verified Claims
<details>
<summary>N claims verified</summary>
| # | Page | Claim | Source | Line |
|---|------|-------|--------|------|
| 1 | {path} | {claim summary} | `{file}` | {line} |
</details>
Severity definitions:
- Blocker: Incorrect numeric values (gas costs, limits, addresses), wrong spec attribution, wrong interface signature — would cause implementation bugs.
- Major: Stale values from a previous spec, missing version qualification, misleading behavioral description.
- Minor: Ambiguous claim that could be misread, minor wording imprecision that doesn't change meaning.
Rules
- Verify against actual source code, not against other documentation pages.
- If a claim references a specific spec (e.g., "Rex3 introduced X"), verify it was indeed that spec, not an earlier or later one.
- Do NOT fix the issues yourself unless the user explicitly asks. This skill produces a report, not edits.
- When verifying gas constants, check both the constant definition AND its usage context (per-transaction? per-opcode? per-block?).
- When verifying Security Considerations claims, confirm that the stated invariant is real — check that the code actually enforces it.
- Every numeric value MUST be verified against
crates/mega-evm/src/constants.rs or the relevant source file. Do not trust other documentation pages as a source of truth.
1---2name: doc-correctness3description: Verifies documentation claims in docs/ against implementation source code in this repository. Use when cross-checking doc accuracy, auditing constants and addresses, verifying spec correctness, or validating behavioral rules against source.4---56# Documentation Correctness Verification78Verify factual claims in the documentation against implementation source: $ARGUMENTS910Parse the arguments to determine scope.11Accepted inputs:1213- A single page path (e.g., `docs/spec/evm/dual-gas-model.md`) — verify claims on that page.14- A directory (e.g., `docs/spec/evm/`) — verify all pages in that directory.15- A claim family (e.g., `gas`, `system-contracts`, `upgrades`, `agent-files`) — verify all claims of that type across all pages.16- `all` — verify every page listed in `docs/spec/SUMMARY.md` and `docs/mega-evme/SUMMARY.md`, plus all agent files (`AGENTS.md`, `CLAUDE.md`, `docs/spec/AGENTS.md`, `bin/mega-evme/AGENTS.md`, `REVIEW.md`, `.claude/skills/*/SKILL.md`).1718Default (no arguments): verify all pages.1920## Claim Families2122Every verifiable claim in the docs falls into one of these families.2324| Family | What to verify | Key source locations |25|--------|---------------|---------------------|26| Gas | Gas costs, limits, compute gas caps, storage gas bases, detention caps, refund rules, multipliers | `crates/mega-evm/src/constants.rs`, `crates/mega-evm/src/evm/instructions.rs`, `crates/mega-evm/src/external/gas.rs` |27| System Contracts | Addresses, Solidity interfaces, execution semantics, deployment specs, interception behavior | `crates/system-contracts/contracts/`, `crates/mega-evm/src/system/`, address constants in `constants.rs` |28| Resource Limits | Per-transaction limits (compute gas, data size, KV updates, state growth), per-frame limits, forwarding rules | `crates/mega-evm/src/constants.rs`, `crates/mega-evm/src/limit/` |29| Detention | Gas detention caps, volatile data categories, detention trigger conditions | `crates/mega-evm/src/constants.rs`, `crates/mega-evm/src/access/`, `crates/mega-evm/src/evm/host.rs` |30| Upgrades | Spec progression, per-upgrade behavioral deltas, activation order, backward compatibility | `crates/mega-evm/src/evm/spec.rs`, `crates/mega-evm/src/block/hardfork.rs` |31| Precompiles | Precompile addresses, behavior, gas costs | `crates/mega-evm/src/evm/precompiles.rs` |32| CLI Commands | Command names, flags, subcommands, default values in mega-evme docs | `bin/mega-evme/src/cmd.rs`, `bin/mega-evme/src/run/`, `bin/mega-evme/src/tx/`, `bin/mega-evme/src/replay/`, `bin/mega-evme/src/common/` |33| Agent Files | Spec progression lists, system contract tables, source layout descriptions, code path references, unstable spec markers in `AGENTS.md`, `CLAUDE.md`, `docs/spec/AGENTS.md`, `bin/mega-evme/AGENTS.md`, `REVIEW.md`, and `.claude/skills/*/SKILL.md` | Same sources as the claim's primary family (spec progression → `spec.rs`, system contracts → `constants.rs` + `crates/system-contracts/`, source layout → actual directory structure, mega-evme structure → `bin/mega-evme/src/`) |3435### Agent File Verification3637Agent instruction files (`AGENTS.md`, `CLAUDE.md`, `docs/spec/AGENTS.md`, `bin/mega-evme/AGENTS.md`, `REVIEW.md`, `.claude/skills/*/SKILL.md`) contain code-related claims that can go stale.38Treat them as additional pages to audit.39Key claims to verify:4041- **Spec progression list** in `AGENTS.md`: Does it match the actual `MegaSpecId` enum in `spec.rs`?42- **Unstable spec marker** in `AGENTS.md`: Is the marked unstable spec still the latest?43- **System Contracts table** in `AGENTS.md`: Do the contracts, addresses, and purposes match the source?44- **Core Source Layout** in `AGENTS.md`: Do the listed modules and descriptions match the actual directory structure?45- **Code-to-doc mapping tables** in skill files: Are all doc pages and code paths still valid?46- **Hardfork-to-spec mapping** in `AGENTS.md`: Does it match `hardfork.rs`?47- **Test organization** in `AGENTS.md`: Does it match actual test directory structure?48- **mega-evme STRUCTURE** in `bin/mega-evme/AGENTS.md`: Do the listed modules match the actual `bin/mega-evme/src/` directory layout?4950## Workflow5152### Phase 1: Claim Extraction5354Read the target page(s) and extract every verifiable claim.55A claim is any statement that can be checked against source code:5657- **Numeric values**: gas costs, limits, caps, multipliers, addresses, bucket sizes.58- **Behavioral rules**: "X always/never happens", "Y reverts when Z", "A is charged before B".59- **Interface definitions**: function signatures, event signatures, error selectors, parameter names.60- **Relationships**: "Spec X introduced feature Y", "Contract Z is available since Rex2".61- **Security claims**: Attack vectors, invariants, and risk consequences stated in Security Considerations sections.6263For each claim, record:6465- The exact text from the doc.66- The page path and section.67- The claim family.6869### Phase 2: Source Resolution7071For each claim, locate the authoritative source:72731. **Match the claim family** to the source locations in the table above.742. **Find the specific source**: search for the constant name, function signature, address, or behavioral code path.75 - For constants: grep for the constant name or numeric value in `crates/mega-evm/src/constants.rs` and related files.76 - For interfaces: read the Solidity contract source in `crates/system-contracts/contracts/`.77 - For upgrade claims: check `spec.rs` and `hardfork.rs` for the spec gate.78 - For behavioral rules: trace the code path that implements the rule.7980**Budget**: Do not spend more than ~5 targeted file reads per claim.81If the source cannot be found after 5 reads, mark the claim as Ambiguous.8283### Phase 3: Verification8485For each claim, compare the doc text against the source and assign a disposition:8687| Disposition | Meaning |88|-------------|---------|89| **Verified** | Doc matches source exactly. Record: file path and line number. |90| **Incorrect** | Doc contradicts source. Record: what the doc says, what the source says, and the source location. |91| **Stale** | Doc was correct for a previous spec but is outdated. Record: which spec introduced the change. |92| **Ambiguous** | Source is unclear or claim cannot be verified. Record: what was searched and why. |93| **Version-dependent** | Claim is correct for some specs but not others, and the doc doesn't specify which. |9495### Phase 4: Report9697```markdown98## Correctness99100**Scope**: {what was verified}101**Claims checked**: {count}102103### Summary104105| Disposition | Count |106|-------------|-------|107| Verified | N |108| Incorrect | N |109| Stale | N |110| Ambiguous | N |111| Version-dependent | N |112113### Findings (Incorrect / Stale / Ambiguous / Version-dependent only)114115#### C-001: {short description}116117- **Severity**: Blocker | Major | Minor118- **Disposition**: {disposition}119- **Claim family**: {family}120- **Page**: {path}121- **Section**: {heading}122- **Doc says**: "{exact text from doc}"123- **Source says**: "{what the source actually shows}"124- **Source location**: `{file}:{line}`125- **Suggested correction**: {concrete edit to the doc text}126127#### C-002: ...128129### Verified Claims130131<details>132<summary>N claims verified</summary>133134| # | Page | Claim | Source | Line |135|---|------|-------|--------|------|136| 1 | {path} | {claim summary} | `{file}` | {line} |137138</details>139```140141**Severity definitions**:142143- **Blocker**: Incorrect numeric values (gas costs, limits, addresses), wrong spec attribution, wrong interface signature — would cause implementation bugs.144- **Major**: Stale values from a previous spec, missing version qualification, misleading behavioral description.145- **Minor**: Ambiguous claim that could be misread, minor wording imprecision that doesn't change meaning.146147## Rules148149- Verify against actual source code, not against other documentation pages.150- If a claim references a specific spec (e.g., "Rex3 introduced X"), verify it was indeed that spec, not an earlier or later one.151- Do NOT fix the issues yourself unless the user explicitly asks. This skill produces a report, not edits.152- When verifying gas constants, check both the constant definition AND its usage context (per-transaction? per-opcode? per-block?).153- When verifying Security Considerations claims, confirm that the stated invariant is real — check that the code actually enforces it.154- Every numeric value MUST be verified against `crates/mega-evm/src/constants.rs` or the relevant source file. Do not trust other documentation pages as a source of truth.