Skip to content

feat(map-plan): add already-implemented gate to planning#150

Merged
azalio merged 2 commits into
mainfrom
caprock-gulch
May 29, 2026
Merged

feat(map-plan): add already-implemented gate to planning#150
azalio merged 2 commits into
mainfrom
caprock-gulch

Conversation

@azalio
Copy link
Copy Markdown
Owner

@azalio azalio commented May 29, 2026

Summary

map-plan now checks whether a requested feature (or part of it) is already implemented before planning it — avoiding re-planning work that already exists.

What changed

  • Discovery (Step 0) now requires the research-agent to report an Already Implemented section: which requested behaviors/acceptance criteria already exist, each with file:line proof. Explicit instruction not to assume absence — search for an existing implementation first.
  • New Step 0.5 — Already-Implemented Gate with three outcomes:
    • Whole feature already implemented → off-ramp: report evidence, state no plan is needed, STOP (no spec/blueprint written).
    • Partially implemented → already-done parts move into the spec's Out of Scope > Already Implemented subsection so decomposition plans only the remaining gap.
    • Not implemented → continue normally.
    • When unsure, treat as partial and surface in interview / Open Questions — never silently re-plan existing code.
  • Decomposer instructed not to create subtasks for behavior under Out of Scope > Already Implemented.
  • Updated Success Criteria / checkpoint checklist, spec template, and off-ramp examples in plan-reference.md.

Scope

Applied to both Claude (.claude/skills/map-plan/) and Codex (.codex/skills/map-plan/) variants, synced to src/mapify_cli/templates/ via make sync-templates, and documented in docs/USAGE.md and docs/ARCHITECTURE.md.

Test plan

  • make check — 1730 passed, 4 skipped
  • make lint — ruff / mypy / pyright clean (0 errors)
  • Template sync verified (test_skills.py, test_template_sync.py green; diff -q matches)

🤖 Generated with Claude Code

ARCHITECT phase now reconciles the request against existing code before
writing a spec. Discovery reports which requested behaviors already exist
(with file:line proof); a new Step 0.5 gate off-ramps a fully-implemented
request (no plan written) and moves partial duplicates into the spec's
"Out of Scope > Already Implemented" subsection so decomposition plans only
the remaining gap. The decomposer is instructed not to create subtasks for
already-implemented behavior.

Applied to both Claude and Codex map-plan skills, synced to templates, and
documented in USAGE.md / ARCHITECTURE.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 29, 2026 11:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an already-implemented detection/off-ramp to /map-plan, so planning can avoid duplicating work that already exists in the target codebase.

Changes:

  • Updates Claude and Codex map-plan prompts to require discovery evidence for already-implemented behavior and add Step 0.5 gating.
  • Updates spec/decomposer guidance so partially implemented behavior is placed under Out of Scope > Already Implemented.
  • Documents the new gate in usage and architecture docs.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
.claude/skills/map-plan/SKILL.md Adds Step 0.5 and decomposer/success criteria guidance.
.claude/skills/map-plan/plan-reference.md Adds spec template subsection and off-ramp examples.
.codex/skills/map-plan/SKILL.md Adds Codex discovery/gate/spec/decomposer/checkpoint guidance.
src/mapify_cli/templates/skills/map-plan/SKILL.md Synced Claude template update.
src/mapify_cli/templates/skills/map-plan/plan-reference.md Synced Claude reference template update.
src/mapify_cli/templates/codex/skills/map-plan/SKILL.md Synced Codex template update.
docs/USAGE.md Documents user-facing gate behavior.
docs/ARCHITECTURE.md Documents the gate as a planning guardrail.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .claude/skills/map-plan/SKILL.md Outdated

### Step 0.5: Already-Implemented Gate (MANDATORY when discovery ran)

Before interviewing or writing the spec, reconcile the request against the discovery `Already Implemented` section. Do not plan work the codebase already does. This gate runs whenever Step 0 produced findings; if discovery was intentionally skipped (greenfield or fully-provided spec), state that the gate was skipped and why.

### Step 0.5: Already-Implemented Gate (MANDATORY when discovery ran)

Before interviewing or writing the spec, reconcile the request against the discovery `Already Implemented` section. Do not plan work the codebase already does. This gate runs whenever Step 0 produced findings; if discovery was intentionally skipped (greenfield or fully-provided spec), state that the gate was skipped and why.
Comment thread .codex/skills/map-plan/SKILL.md Outdated

## Step 0.5: Already-Implemented Gate (MANDATORY when discovery ran)

Reconcile the request against the discovery `Already Implemented` section BEFORE interview/spec. Do not plan work the codebase already does. If discovery was skipped (greenfield or fully-provided spec), state the gate was skipped and why.

## Step 0.5: Already-Implemented Gate (MANDATORY when discovery ran)

Reconcile the request against the discovery `Already Implemented` section BEFORE interview/spec. Do not plan work the codebase already does. If discovery was skipped (greenfield or fully-provided spec), state the gate was skipped and why.
…lemented section

Addresses Copilot review on PR #150: Step 0 reused findings_<branch>.md
unconditionally, so a findings file written before this format (no
"Already Implemented" section) would let the mandatory Step 0.5 gate run
without the evidence it requires. Reuse is now conditional on the section
being present; otherwise discovery re-runs. Applied to both Claude and
Codex variants and synced to templates.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@azalio azalio merged commit 2721cd3 into main May 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants