PR Documentation Impact Check
Analyze the current PR diff to determine whether documentation under docs/ needs updating.
Context
This skill runs in CI on pull requests that modify source code under crates/mega-evm/src/, crates/system-contracts/, or bin/mega-evme/src/.
It checks whether the code changes affect documented behavior and whether the PR already includes corresponding doc updates.
The documentation in docs/ is the formal MegaETH specification.
Read docs/spec/AGENTS.md for the writing rules and conventions.
Code-to-Doc Mapping
Use this mapping to identify which doc pages are potentially affected by code changes.
| Code path |
What changes here |
Affected doc pages |
crates/mega-evm/src/constants.rs |
Gas limits, resource limits, detention caps, multipliers |
docs/spec/evm/dual-gas-model.md, docs/spec/evm/resource-limits.md, docs/spec/evm/gas-detention.md, docs/spec/evm/gas-forwarding.md, docs/spec/evm/contract-limits.md |
crates/mega-evm/src/evm/spec.rs |
Spec definitions, spec progression |
docs/spec/hardfork-spec.md, docs/spec/upgrades/overview.md, docs/spec/evm/overview.md |
crates/mega-evm/src/evm/instructions.rs |
Opcode behavior, compute gas wrapping, gas detention enforcement |
docs/spec/evm/dual-gas-model.md, docs/spec/evm/gas-detention.md |
crates/mega-evm/src/evm/host.rs |
Host hooks, volatile data access tracking |
docs/spec/evm/gas-detention.md |
crates/mega-evm/src/evm/precompiles.rs |
Precompile behavior |
docs/spec/evm/precompiles.md |
crates/mega-evm/src/block/ |
Block execution, hardfork mapping, executor |
docs/spec/hardfork-spec.md, docs/spec/evm/overview.md |
crates/mega-evm/src/limit/ |
Resource limit tracking (compute gas, data size, KV updates, state growth) |
docs/spec/evm/resource-limits.md, docs/spec/evm/resource-accounting.md |
crates/mega-evm/src/limit/storage_call_stipend.rs |
Storage gas stipend lifecycle |
docs/spec/evm/gas-forwarding.md |
crates/mega-evm/src/access/ |
Block env access tracking, volatile data detection |
docs/spec/evm/gas-detention.md |
crates/mega-evm/src/system/ |
System contract integration, call interception |
docs/spec/system-contracts/*.md |
crates/mega-evm/src/external/ |
SALT environment, oracle environment, dynamic gas cost |
docs/spec/evm/dual-gas-model.md, docs/spec/system-contracts/oracle.md |
crates/system-contracts/contracts/ |
Solidity system contract sources |
docs/spec/system-contracts/*.md |
bin/mega-evme/src/cmd.rs |
CLI command dispatch, top-level commands |
docs/mega-evme/overview.md |
bin/mega-evme/src/run/ |
Bytecode execution command |
docs/mega-evme/commands/run.md |
bin/mega-evme/src/tx/ |
Transaction execution command |
docs/mega-evme/commands/tx.md |
bin/mega-evme/src/replay/ |
Historical transaction replay |
docs/mega-evme/commands/replay.md |
bin/mega-evme/src/common/ |
Shared CLI args, state loading, tracing, tx parsing |
docs/mega-evme/configuration/*.md, docs/mega-evme/tracing/*.md |
Agent and Skill Files
Code changes can also make agent instruction files stale.
These files contain code paths, constant names, system contract tables, and spec references that must stay in sync with the implementation.
| Code path |
Affected agent files |
crates/mega-evm/src/evm/spec.rs |
AGENTS.md (spec progression list, unstable spec marker), CLAUDE.md (same content) |
crates/mega-evm/src/block/hardfork.rs |
AGENTS.md (hardfork-to-spec mapping) |
crates/mega-evm/src/ (new/renamed modules) |
AGENTS.md (Core Source Layout section) |
crates/system-contracts/contracts/ (new contract) |
AGENTS.md (System Contracts table) |
crates/mega-evm/src/constants.rs |
AGENTS.md (Key Concepts sections referencing constant names) |
crates/mega-evm/src/system/ |
AGENTS.md (System Contracts section), .claude/skills/doc-impact-check/SKILL.md and .claude/skills/doc-freshness/SKILL.md (code-to-doc mapping tables) |
crates/mega-evm/src/limit/ (new tracker) |
AGENTS.md (Multidimensional Resource Limits section) |
bin/mega-evme/src/ (new/renamed modules) |
bin/mega-evme/AGENTS.md (STRUCTURE section) |
docs/ (new pages added to SUMMARY.md) |
.claude/skills/doc-impact-check/SKILL.md and .claude/skills/doc-freshness/SKILL.md (code-to-doc mapping tables need new entries) |
Workflow
Phase 1: Read the Diff
gh pr diff $PR_NUMBER
Identify all changed files and classify each as:
- Behavioral code change: Modifies EVM semantics, gas costs, resource limits, system contract logic, spec definitions.
- Test-only change: Only adds/modifies tests. No doc impact.
- Refactoring: Restructures code without changing behavior. No doc impact.
- Doc change: Already modifies files under
docs/. Note which pages are updated.
Focus on behavioral code changes only.
Phase 2: Map Changes to Doc Pages
For each behavioral code change:
- Use the code-to-doc mapping table above to identify potentially affected pages.
- Also check the agent file mapping table — code changes may affect
AGENTS.md, CLAUDE.md, or skill files.
- Read the affected source code to understand what changed (new constant value? new spec gate? new opcode behavior?).
- Read the potentially affected doc and agent files to check if the current content matches the new behavior.
Phase 3: Check for Existing Doc Updates
Check if the PR already includes changes to the affected doc pages:
- If the PR updates the relevant doc pages, verify the updates are consistent with the code changes.
- If the PR does NOT update the relevant doc pages, flag them.
Phase 4: Report
Post a single PR comment with findings.
If doc or agent file updates are needed:
## Documentation Impact
This PR modifies EVM behavior that is documented in `docs/` or referenced in agent files. The following files may need updating:
### Spec Documentation
| Doc page | Reason |
|----------|--------|
| `docs/spec/evm/dual-gas-model.md` | {what changed and why the page is affected} |
| `docs/spec/evm/resource-limits.md` | {what changed and why the page is affected} |
{If the PR introduces a new spec}: A new upgrade page under `docs/spec/upgrades/` is also needed.
### Agent / Skill Files
| File | Reason |
|------|--------|
| `AGENTS.md` | {e.g., spec progression list needs new spec, system contract table needs new entry} |
These updates can be included in this PR or in a follow-up.
If no doc updates are needed:
Do NOT post a comment.
Only comment when there is an actionable finding.
If the PR already includes correct doc updates:
Do NOT post a comment.
The PR review job handles general review.
Rules
- Only flag genuine behavioral changes that affect documented behavior.
Do NOT flag refactorings, test additions, or internal restructuring.
- Be specific about what in the docs needs updating.
"This page may need updating" is not actionable.
"
COMPUTE_GAS_LIMIT changed from 1,000,000,000 to 2,000,000,000 — update the Constants table in docs/spec/evm/resource-limits.md" is actionable.
- Respect the spec's backward compatibility rule: if the change introduces a new spec, note that a new upgrade page is needed under
docs/spec/upgrades/.
- Do NOT edit documentation yourself. This skill produces a comment, not edits.
- Do NOT duplicate the work of the
pr-review job. Focus exclusively on doc impact.
- If uncertain whether a change is behavioral, err on the side of flagging it — a false positive is better than a missed doc gap.
1---2name: doc-impact-check3description: Analyzes a PR diff to determine if documentation under docs/ needs updating. Use when a PR modifies EVM behavior, gas constants, system contracts, opcode semantics, resource limits, or spec definitions in mega-evm source code.4---56# PR Documentation Impact Check78Analyze the current PR diff to determine whether documentation under `docs/` needs updating.910## Context1112This skill runs in CI on pull requests that modify source code under `crates/mega-evm/src/`, `crates/system-contracts/`, or `bin/mega-evme/src/`.13It checks whether the code changes affect documented behavior and whether the PR already includes corresponding doc updates.1415The documentation in `docs/` is the formal MegaETH specification.16Read `docs/spec/AGENTS.md` for the writing rules and conventions.1718## Code-to-Doc Mapping1920Use this mapping to identify which doc pages are potentially affected by code changes.2122| Code path | What changes here | Affected doc pages |23|-----------|-------------------|--------------------|24| `crates/mega-evm/src/constants.rs` | Gas limits, resource limits, detention caps, multipliers | `docs/spec/evm/dual-gas-model.md`, `docs/spec/evm/resource-limits.md`, `docs/spec/evm/gas-detention.md`, `docs/spec/evm/gas-forwarding.md`, `docs/spec/evm/contract-limits.md` |25| `crates/mega-evm/src/evm/spec.rs` | Spec definitions, spec progression | `docs/spec/hardfork-spec.md`, `docs/spec/upgrades/overview.md`, `docs/spec/evm/overview.md` |26| `crates/mega-evm/src/evm/instructions.rs` | Opcode behavior, compute gas wrapping, gas detention enforcement | `docs/spec/evm/dual-gas-model.md`, `docs/spec/evm/gas-detention.md` |27| `crates/mega-evm/src/evm/host.rs` | Host hooks, volatile data access tracking | `docs/spec/evm/gas-detention.md` |28| `crates/mega-evm/src/evm/precompiles.rs` | Precompile behavior | `docs/spec/evm/precompiles.md` |29| `crates/mega-evm/src/block/` | Block execution, hardfork mapping, executor | `docs/spec/hardfork-spec.md`, `docs/spec/evm/overview.md` |30| `crates/mega-evm/src/limit/` | Resource limit tracking (compute gas, data size, KV updates, state growth) | `docs/spec/evm/resource-limits.md`, `docs/spec/evm/resource-accounting.md` |31| `crates/mega-evm/src/limit/storage_call_stipend.rs` | Storage gas stipend lifecycle | `docs/spec/evm/gas-forwarding.md` |32| `crates/mega-evm/src/access/` | Block env access tracking, volatile data detection | `docs/spec/evm/gas-detention.md` |33| `crates/mega-evm/src/system/` | System contract integration, call interception | `docs/spec/system-contracts/*.md` |34| `crates/mega-evm/src/external/` | SALT environment, oracle environment, dynamic gas cost | `docs/spec/evm/dual-gas-model.md`, `docs/spec/system-contracts/oracle.md` |35| `crates/system-contracts/contracts/` | Solidity system contract sources | `docs/spec/system-contracts/*.md` |36| `bin/mega-evme/src/cmd.rs` | CLI command dispatch, top-level commands | `docs/mega-evme/overview.md` |37| `bin/mega-evme/src/run/` | Bytecode execution command | `docs/mega-evme/commands/run.md` |38| `bin/mega-evme/src/tx/` | Transaction execution command | `docs/mega-evme/commands/tx.md` |39| `bin/mega-evme/src/replay/` | Historical transaction replay | `docs/mega-evme/commands/replay.md` |40| `bin/mega-evme/src/common/` | Shared CLI args, state loading, tracing, tx parsing | `docs/mega-evme/configuration/*.md`, `docs/mega-evme/tracing/*.md` |4142### Agent and Skill Files4344Code changes can also make agent instruction files stale.45These files contain code paths, constant names, system contract tables, and spec references that must stay in sync with the implementation.4647| Code path | Affected agent files |48|-----------|---------------------|49| `crates/mega-evm/src/evm/spec.rs` | `AGENTS.md` (spec progression list, unstable spec marker), `CLAUDE.md` (same content) |50| `crates/mega-evm/src/block/hardfork.rs` | `AGENTS.md` (hardfork-to-spec mapping) |51| `crates/mega-evm/src/` (new/renamed modules) | `AGENTS.md` (Core Source Layout section) |52| `crates/system-contracts/contracts/` (new contract) | `AGENTS.md` (System Contracts table) |53| `crates/mega-evm/src/constants.rs` | `AGENTS.md` (Key Concepts sections referencing constant names) |54| `crates/mega-evm/src/system/` | `AGENTS.md` (System Contracts section), `.claude/skills/doc-impact-check/SKILL.md` and `.claude/skills/doc-freshness/SKILL.md` (code-to-doc mapping tables) |55| `crates/mega-evm/src/limit/` (new tracker) | `AGENTS.md` (Multidimensional Resource Limits section) |56| `bin/mega-evme/src/` (new/renamed modules) | `bin/mega-evme/AGENTS.md` (STRUCTURE section) |57| `docs/` (new pages added to SUMMARY.md) | `.claude/skills/doc-impact-check/SKILL.md` and `.claude/skills/doc-freshness/SKILL.md` (code-to-doc mapping tables need new entries) |5859## Workflow6061### Phase 1: Read the Diff6263```bash64gh pr diff $PR_NUMBER65```6667Identify all changed files and classify each as:68- **Behavioral code change**: Modifies EVM semantics, gas costs, resource limits, system contract logic, spec definitions.69- **Test-only change**: Only adds/modifies tests. No doc impact.70- **Refactoring**: Restructures code without changing behavior. No doc impact.71- **Doc change**: Already modifies files under `docs/`. Note which pages are updated.7273Focus on behavioral code changes only.7475### Phase 2: Map Changes to Doc Pages7677For each behavioral code change:78791. Use the code-to-doc mapping table above to identify potentially affected pages.802. Also check the agent file mapping table — code changes may affect `AGENTS.md`, `CLAUDE.md`, or skill files.813. Read the affected source code to understand *what* changed (new constant value? new spec gate? new opcode behavior?).824. Read the potentially affected doc and agent files to check if the current content matches the new behavior.8384### Phase 3: Check for Existing Doc Updates8586Check if the PR already includes changes to the affected doc pages:87- If the PR updates the relevant doc pages, verify the updates are consistent with the code changes.88- If the PR does NOT update the relevant doc pages, flag them.8990### Phase 4: Report9192Post a single PR comment with findings.9394**If doc or agent file updates are needed:**9596```markdown97## Documentation Impact9899This PR modifies EVM behavior that is documented in `docs/` or referenced in agent files. The following files may need updating:100101### Spec Documentation102103| Doc page | Reason |104|----------|--------|105| `docs/spec/evm/dual-gas-model.md` | {what changed and why the page is affected} |106| `docs/spec/evm/resource-limits.md` | {what changed and why the page is affected} |107108{If the PR introduces a new spec}: A new upgrade page under `docs/spec/upgrades/` is also needed.109110### Agent / Skill Files111112| File | Reason |113|------|--------|114| `AGENTS.md` | {e.g., spec progression list needs new spec, system contract table needs new entry} |115116These updates can be included in this PR or in a follow-up.117```118119**If no doc updates are needed:**120121Do NOT post a comment.122Only comment when there is an actionable finding.123124**If the PR already includes correct doc updates:**125126Do NOT post a comment.127The PR review job handles general review.128129## Rules130131- Only flag genuine behavioral changes that affect documented behavior.132 Do NOT flag refactorings, test additions, or internal restructuring.133- Be specific about *what* in the docs needs updating.134 "This page may need updating" is not actionable.135 "`COMPUTE_GAS_LIMIT` changed from 1,000,000,000 to 2,000,000,000 — update the Constants table in `docs/spec/evm/resource-limits.md`" is actionable.136- Respect the spec's backward compatibility rule: if the change introduces a new spec, note that a new upgrade page is needed under `docs/spec/upgrades/`.137- Do NOT edit documentation yourself. This skill produces a comment, not edits.138- Do NOT duplicate the work of the `pr-review` job. Focus exclusively on doc impact.139- If uncertain whether a change is behavioral, err on the side of flagging it — a false positive is better than a missed doc gap.