with one click
plan-export
// Export a detailed phased implementation plan for a GitHub issue to a file, reading all applicable rules from .cursor/rules before planning
// Export a detailed phased implementation plan for a GitHub issue to a file, reading all applicable rules from .cursor/rules before planning
Use this skill whenever you are about to run any write `gh` CLI command — `gh pr edit`, `gh pr create`, `gh issue edit`, `gh issue create`, `gh pr comment`, `gh issue comment`, `gh pr close`, `gh pr merge`, `gh release create`, or similar. High-level `gh` commands sometimes fail with "missing required scopes" auth errors even though the underlying GitHub REST API works fine with the same token. This skill makes you automatically fall back to `gh api` instead of stopping to ask the user to re-authenticate. Always invoke before running any mutating `gh` command.
Expert review of an implementation plan against a GitHub issue/enhancement description (provided as a local file or a GitHub issue URL) and the current repository codebase. Use when asked to critique a plan for correctness, completeness, codebase alignment, risks, and test/rollout readiness (do not implement).
Use to implement a structured implementation plan (e.g. temp/impl_plans/issue-*.md) phase by phase. Trigger when the user asks to implement, execute, realize, or "do" an implementation-plan file. Orchestrates a phase-developer subagent and a plan-correspondence-verifier subagent for each phase, commits each verified phase, then walks the Final Checklist. Invoke explicitly — it makes commits and spawns many subagents.
TRIGGER CONDITIONS - invoke this skill when ANY of these apply: User-triggered (explicit request): - User mentions "specification", "SPEC", "SPEC.md", "spec requirements" - User asks to "verify with spec", "confirm with specification", "check requirements" - User requests "authoritative requirements" or "source of truth" Agent self-triggered (during reasoning): - Before implementing any feature or making code changes - When verifying technical requirements or constraints - When making architectural or design decisions - When you need unbiased guidance not influenced by current implementation - When encountering conflicting information and need ground truth PURPOSE: Consults SPEC.md through an isolated subagent that ONLY reads the specification, never implementation code. This ensures guidance is based on authoritative requirements, not potentially incorrect existing code.
Describe very high level changes required to implement discussed functionality (functionality, test, docs)
Generate a structured bug report for GitHub issues based on conversation context about bugs, errors, or broken functionality
| name | plan-export |
| description | Export a detailed phased implementation plan for a GitHub issue to a file, reading all applicable rules from .cursor/rules before planning |
| argument-hint | ["issue-number (optional)"] |
| disable-model-invocation | true |
This skill composes a detailed, phased implementation plan for a GitHub issue. The issue number can be passed as $1 or discovered from the conversation context (e.g., after a /gh-issue-publish invocation). The plan is designed for a junior developer with minimal knowledge of MCP, Blockscout, and other 3rd-party components but strong Python experience.
Before invoking this skill, the agent must already understand the scope of the changes through prior conversation. The skill assumes:
Before proceeding, resolve the GitHub issue number to use throughout the plan:
$1 is provided and non-empty, use it directly as the issue number.https://github.com/.../issues/<number> — extract the number from the URL. This is typically present after a preceding /gh-issue-publish invocation (which outputs the URL).#<number> or issue <number>.Once resolved, use this number as $1 for all subsequent steps.
Read .cursor/AGENTS.md to determine which rules from .cursor/rules/ apply to the discussed changes. That file contains the authoritative mapping of when each rule should be applied.
MANDATORY: Read each applicable rule file using the Read tool before composing the plan. Do not skip this step or guess rule contents.
For each rule file:
Create a detailed Markdown document at .ai/impl_plans/issue-$1.md with the following structure.
Slice markers — required. Wrap every section in paired, namespaced HTML-comment markers so the plan can be sliced deterministically by scripts/slice_impl_plan.py (headings alone are unreliable — plans embed code blocks and exact documentation that legitimately contain #/## as content). Rules:
slug="preamble".slug="phase-<n>", where <n> is the phase's sequential number (1, 2, 3 … contiguous, matching the ## Phase <n> heading). Number only the phases you actually emit. Put title="<short phase name>" on the begin marker.slug="final-checklist".begin has a matching end with the same slug; never nest them. No real content may live outside a region (blank lines and --- rules between regions are fine). A title must not contain a double-quote.The structure, with markers in place:
<!-- impl-plan:begin slug="preamble" -->
# Implementation Plan for Issue #$1
**GitHub Issue:** https://github.com/blockscout/mcp-server/issues/$1
## Overview
[Brief summary of what needs to be implemented - 2-3 sentences]
## Applicable Guidelines
[List the rule files that were read and applied to this plan, with brief notes on key requirements from each]
---
## Definition of Done — Test Integrity (non-negotiable)
[Mandatory. In your own words — explain the *why*, don't just recite rules — state that the work is done only when its tests genuinely pass for the right reason, for unit and integration tests alike. The wording is yours, but the section must get these points across: each failure is diagnosed (regression vs. legitimately changed expectation) and its root cause fixed, never worked around (no skip/xfail, deletion, loosened assertions, or bypassed hooks); a test is updated only when intended behavior changed; a test that couldn't run, timed out, or hung is a defect to diagnose, not a pass (for integration tests, point at the timeout-protected runner from rule 200); and no phase is "done" while any test is failing, disabled to avoid a failure, or unverified.]
<!-- impl-plan:end slug="preamble" -->
---
<!-- impl-plan:begin slug="phase-1" title="[Phase Name - Functional Changes]" -->
## Phase 1: [Phase Name - Functional Changes]
### Objective
[What this phase accomplishes]
### Files to Modify/Create
- `path/to/file.py`: [Brief description of changes]
- ...
### Implementation Details
[Explain WHAT needs to be changed and WHY. Focus on project-specific context the developer needs to understand:]
- What existing patterns/helpers to reuse and where to find them
- What project conventions apply (naming, structure, error handling approach)
- How this change fits into the existing architecture
- Any non-obvious dependencies or side effects
**Do NOT include code snippets.** The developer knows Python - explain the project-specific aspects they need to understand.
### Unit Tests
- **File:** `tests/tools/category/test_feature.py`
- **Purpose:** [What functionality this test validates]
- **Scenarios to cover:**
- [List scenarios: success cases, error handling, edge cases]
- **Reference:** [Point to similar existing test file as a pattern example]
### Verification
1. Run unit tests for modified functionality:
```bash
pytest tests/tools/category/test_feature.py -v
Run linting and formatting checks:
ruff check path/to/modified/files/
ruff format --check path/to/modified/files/
Fix any linting or formatting issues before proceeding to the next phase.
[Same structure as Phase 1, including its own unit tests]
Verify the implementation works correctly with real network calls.
tests/integration/category/test_feature_real.pyRun integration tests for the new test file:
pytest -m integration tests/integration/category/test_feature_real.py -v
Run linting and formatting checks:
ruff check tests/integration/category/test_feature_real.py
ruff format --check tests/integration/category/test_feature_real.py
Fix any linting or formatting issues before proceeding to the next phase.
Only include this phase if documentation changes are required. If no documentation updates are needed, omit this phase entirely.
For each documentation file that requires changes, provide exact text content to add or modify (documentation requires precise wording):
[Exact section and content to add/modify, if applicable]
[Exact section and content to add/modify, if applicable]
[Exact section and content to add/modify, if applicable]
[Exact section and content to add/modify, if applicable]
[Exact section and content to add/modify, if applicable]
[Exact lines to add, if applicable]
Review all documentation files for accuracy and completeness.
pytest tests/tools/pytest -m integration tests/integration/ruff check .ruff format --check .
### 4. Content Guidelines
**MUST INCLUDE:**
- Reference to the GitHub issue (with full URL)
- List of applicable guidelines that were read and applied
- Phases that allow incremental verification
- Explanations of WHAT to change and WHY (project-specific context)
- References to existing code as pattern examples (file paths, not snippets)
- Complete documentation text (documentation requires precise wording)
- Specific test scenarios with clear descriptions
- Verification steps for each phase (including tests, linting, and formatting checks)
- A mandatory "Definition of Done — Test Integrity" section, placed after "Applicable Guidelines" and before the first phase, covering both unit and integration tests
**MUST NOT INCLUDE:**
- Code snippets for functional changes or tests (developer knows Python)
- Time estimates
- Assumptions about developer's MCP/Blockscout knowledge
- References to "see documentation" without providing the content
- Vague instructions like "update as appropriate"
**PHASE ORGANIZATION:**
1. Only include phases that have actual work to do - omit empty phases
2. **Keep phases small and focused**: Each phase should have a single, clear objective that can be completed, tested, and reviewed as an independent unit. Prefer multiple small phases over fewer large ones.
3. Organize phases so each can be independently verified with its own tests
4. Start with core functionality, then tests, then documentation (if needed)
5. Each phase should build on the previous one
**Phase Size Rationale**: Since each phase's code goes through review, smaller phases are easier to review thoroughly. Catching issues early (e.g., in a model definition phase) prevents building faulty logic on top of flawed foundations.
**Examples of Good Phase Breakdown**:
- ❌ **Too Large**: Phase 1: Create model + handler + all unit tests
- ✅ **Better**: Phase 1: Create model + model unit tests, Phase 2: Create handler + handler unit tests
- ❌ **Too Large**: Phase 1: Refactor 5 modules + add new feature + update tests
- ✅ **Better**: Phase 1: Refactor module A + tests, Phase 2: Refactor module B + tests, Phase 3: Add new feature + tests
**DEPENDENCY ORDERING:**
1. **Between Phases**: Changes in a subsequent phase must build on top of changes from previous phases. Never reference functionality that will be created in a later phase.
2. **Within a Phase**: In the "Implementation Details" section, describe dependencies before things that use them:
- If a handler uses a data model, describe the model first, then the handler
- If code imports a helper function, describe the helper first, then the code using it
- If a test requires a fixture, describe the fixture first, then the test
3. **Files Listing Order**: In "Files to Create/Modify" sections, list files in dependency order (dependencies first)
### 5. Write the Plan File
Save the plan to:
```text
.ai/impl_plans/issue-$1.md
Before handing back, prove the plan you just wrote can actually be sliced. Run the validator in inspect mode (it writes nothing):
/.dockerenv exists): python scripts/slice_impl_plan.py .ai/impl_plans/issue-$1.md --inspectuv run python scripts/slice_impl_plan.py .ai/impl_plans/issue-$1.md --inspectRead the exit code:
--inspect until it exits 0. Never hand back a plan that fails this check: a plan that cannot be sliced cannot be implemented by implement-plan.After writing the plan file:
Output format:
Created implementation plan at [.ai/impl_plans/issue-$1.md](.ai/impl_plans/issue-$1.md)
The plan includes {N} phases:
1. [Phase 1 name]
2. [Phase 2 name]
...
Applicable guidelines that were incorporated:
- [List of rule files read]
Awaiting your instructions to proceed.
<!-- impl-plan:begin slug="…" --> … <!-- impl-plan:end slug="…" --> markers (see step 3) and confirm the plan passes the step-6 --inspect self-check before handing backtools/address/get_address_info.py")