feat(map-plan): add already-implemented gate to planning#150
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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-planprompts 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.
|
|
||
| ### 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. |
|
|
||
| ## 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
map-plannow checks whether a requested feature (or part of it) is already implemented before planning it — avoiding re-planning work that already exists.What changed
Already Implementedsection: which requested behaviors/acceptance criteria already exist, each withfile:lineproof. Explicit instruction not to assume absence — search for an existing implementation first.Out of Scope > Already Implementedsubsection so decomposition plans only the remaining gap.Out of Scope > Already Implemented.plan-reference.md.Scope
Applied to both Claude (
.claude/skills/map-plan/) and Codex (.codex/skills/map-plan/) variants, synced tosrc/mapify_cli/templates/viamake sync-templates, and documented indocs/USAGE.mdanddocs/ARCHITECTURE.md.Test plan
make check— 1730 passed, 4 skippedmake lint— ruff / mypy / pyright clean (0 errors)test_skills.py,test_template_sync.pygreen;diff -qmatches)🤖 Generated with Claude Code