Align issue-plan codebase analysis with feature-dev's pre-implementation phases
Summary
The issue-plan command currently performs a lightweight codebase exploration (Step 3) before drafting a plan. The feature-dev plugin follows a more rigorous pre-implementation workflow: Discovery, Codebase Exploration (with code-explorer agents), Clarifying Questions, and Architecture Design (with code-architect agents). The issue-plan command should mirror these phases to ensure proper due diligence, deeper code exploration, and architecture consideration before producing an implementation plan.
Current Behavior
issue-plan Step 3 launches 2-3 generic exploration agents (similar features, architecture, integration points), reads identified files, and moves directly to plan drafting. It lacks:
- A dedicated clarifying questions phase with a hard stop before planning
- Architecture design exploration using code-architect agents to evaluate multiple approaches
- Structured presentation of codebase findings before asking questions
Proposed Behavior
Replace issue-plan Step 3 ("Explore the Codebase") and Step 4 ("Analyze and Plan") with phases that mirror feature-dev's pre-implementation workflow:
- Codebase Exploration (mirrors feature-dev Phase 2): Launch 2-3 code-explorer agents targeting different aspects. Read all identified files. Present a comprehensive summary of findings and patterns.
- Clarifying Questions (mirrors feature-dev Phase 3): Review codebase findings against the issue requirements. Identify all underspecified aspects (edge cases, integration points, scope boundaries, design preferences). Present questions to user and wait for answers before proceeding.
- Architecture Design (mirrors feature-dev Phase 4): Launch 2-3 code-architect agents exploring different approaches (minimal changes, clean architecture, pragmatic balance). Present approaches with trade-offs and a recommendation. Ask user which approach to base the plan on.
- Plan Drafting (existing Step 4 logic): Draft the staged implementation plan informed by the chosen architecture approach.
The contributing guide lookup (current Step 3a) should be preserved and run before the exploration phase, as it provides context for the agents.
Acceptance Criteria
issue-planmirrors feature-dev Phases 2-4 (stopping before implementation)- Code-explorer agents are used for codebase exploration with the same prompt patterns as feature-dev
- A dedicated clarifying questions step exists with a hard stop (user must answer before proceeding)
- Code-architect agents evaluate multiple implementation approaches before plan drafting
- The user selects a preferred architecture approach before the plan is drafted
- Contributing guide lookup (current Step 3a) is preserved
- Existing Step 5 (Post and Branch) behavior is unchanged
- Guardrails section remains intact (no code changes, no plan mode)
Technical Notes
- The feature-dev plugin lives at
feature-dev/commands/feature-dev.mdand usescode-explorerandcode-architectagents from itsagents/directory issue-plancannot directly invoke feature-dev agents since it's a separate plugin; it should use the Task tool withsubagent_type: Explore(as it does today) but adopt feature-dev's prompt patterns and phased structure- The current exploration agents in Step 3b already use the Task tool pattern; the change is primarily structural (adding phases) and adding architecture exploration
- Keep
allowed-toolsunchanged:Bash, Read, Grep, Glob, Task, AskUserQuestion
Implementation Plan: Align issue-plan with feature-dev's pre-implementation phases
Overview
Restructure commands/issue-plan.md Steps 3-4 to mirror feature-dev's Phases 2-4 (Codebase Exploration, Clarifying Questions, Architecture Design), adding deeper code analysis and explicit user decision points before plan drafting.
Stage 1: Restructure issue-plan.md with feature-dev-aligned phases
File modified: commands/issue-plan.md
Changes
Preserved (no changes):
- YAML frontmatter (description, argument-hint, allowed-tools, model)
- Guardrails section
- Step 1: Parse Input
- Step 2: Read the Issue
- Step 3a: Contributing guide lookup (relocated to run before new Phase 1)
- Step 5: Post and Branch (renumbered but content unchanged)
Replaced — current Step 3b (generic exploration) and Step 4 (analyze and plan) become four new phases:
New Step 3: Codebase Exploration (mirrors feature-dev Phase 2)
- Launches 2-3
feature-dev:code-exploreragents in parallel via the Task tool withsubagent_type: "feature-dev:code-explorer" - Each agent targets a different aspect with feature-dev prompt patterns (e.g., "Find features similar to X and trace through their implementation comprehensively", "Map the architecture and abstractions for X area")
- Each agent returns a list of 5-10 key files
- After agents complete, read all identified files to build deep understanding
- Present a comprehensive summary of findings and patterns discovered
New Step 4: Clarifying Questions (mirrors feature-dev Phase 3)
- Marked as CRITICAL -- must not be skipped
- Reviews codebase findings from Step 3 against the issue requirements
- Identifies underspecified aspects: edge cases, error handling, integration points, scope boundaries, design preferences, backward compatibility, performance needs
- Presents all questions to the user in a clear, organized list
- Hard stop: waits for user answers before proceeding
- If user says "whatever you think is best", provide recommendation and get explicit confirmation
New Step 5: Architecture Design (mirrors feature-dev Phase 4)
- Launches 2-3
feature-dev:code-architectagents in parallel via the Task tool withsubagent_type: "feature-dev:code-architect", each with a different focus:- Minimal changes: smallest change, maximum reuse
- Clean architecture: maintainability, elegant abstractions
- Pragmatic balance: speed + quality
- Reviews all approaches and forms opinion on best fit
- Presents to user: brief summary of each approach, trade-offs comparison, recommendation with reasoning, concrete implementation differences
- Uses
AskUserQuestionto ask user which approach they prefer - Hard stop: no plan drafting until user selects an approach
New Step 6: Plan Drafting (existing Step 4 plan-drafting logic, now informed by chosen architecture)
- Drafts staged implementation plan based on the user's chosen architecture approach
- Retains existing planning requirements: project-layer coverage, test coverage planning, session scoping constraints
- Each stage scoped to a single Claude Code CLI session
Renumbered Step 7: Post and Branch (existing Step 5, content unchanged)
Testing
This project has no testable runtime code (plugin command definitions are markdown files). Validation is manual: invoke /mach10:issue-plan on an issue and verify the new phase flow executes correctly end-to-end.
This comment will guide staged implementation via /mach10:issue-implement.
Stage 1 Progress: Restructure issue-plan.md
Commit: d67bc90
Changes
commands/issue-plan.md -- restructured from 5 steps to 7 steps:
- Step 3 (Codebase Exploration): Now uses
feature-dev:code-exploreragents with comprehensive trace-through prompts (mirrors feature-dev Phase 2). Contributing guide lookup (3a) preserved as substep. - Step 4 (Clarifying Questions): New dedicated step with CRITICAL hard-stop marker. Questions presented as free-text. Includes AskUserQuestion confirmation for "whatever you think is best" fallback.
- Step 5 (Architecture Design): New step launching 2-3
feature-dev:code-architectagents with three architectural lenses (minimal changes, clean architecture, pragmatic balance). AskUserQuestion for approach selection with Modify escape path. - Step 6 (Plan Drafting): Extracted plan-drafting logic from old step 4, now informed by chosen architecture. Planning requirements section preserved verbatim.
- Step 7 (Post and Branch): Old step 5 content preserved, renumbered.
CLAUDE.md -- updated plan marker sync note from "Step 5" to "Step 7".
Design decisions
- Code-architect agents produce real implementation architectures (not abstract plan blueprints) to force the planning agent to confront practical implementation realities before drafting stages.
- Architecture selection uses AskUserQuestion as a forced choice (no cancel escape) since an approach must be chosen to proceed with planning.
- Clarifying questions use free-text interaction (answers are open-ended) per CLAUDE.md conventions.