Skip to content

feat: unified /plan command with gap analysis, design review, and plan-aware /implement#176

Merged
dean0x merged 9 commits intomainfrom
feat/108-unified-plan-command
Apr 8, 2026
Merged

feat: unified /plan command with gap analysis, design review, and plan-aware /implement#176
dean0x merged 9 commits intomainfrom
feat/108-unified-plan-command

Conversation

@dean0x
Copy link
Copy Markdown
Owner

@dean0x dean0x commented Apr 7, 2026

Summary

Closes #108 — Track 4: Unified Plan Command

  • New /plan command with gap analysis and design review — identifies specification gaps, generates actionable design artifacts, and validates architecture before implementation
  • New designer agent (Opus-tier) for architecture evaluation and design document generation
  • New skills: gap-analysis (specification completeness checking) and design-review (architecture anti-pattern detection)
  • /implement now accepts plan documents — can be invoked with a design artifact, GitHub issue, or task description
  • /specify deprecated — replaced by /plan which covers specification + design in a unified flow
  • plan:orch orchestration skill updated for ambient mode integration (PLAN intent → ORCHESTRATED depth)

Key changes (26 files, +2129/-483)

Area Changes
New plugin devflow-plan with plan.md, plan-teams.md, designer.md agent, plugin.json
New agent shared/agents/designer.md — Opus-tier architecture analysis
New skills gap-analysis/SKILL.md + references, design-review/SKILL.md + references
/implement Simplified to accept plan docs, issues, or descriptions; reduced from ~350 to ~200 lines
/specify Deprecated with pointer to /plan
Orchestration plan:orch expanded with full pipeline (Skimmer → Explore → Designer → Synthesizer → Plan → Designer)
CLI devflow-plan registered in plugins.ts, test updated
Docs CLAUDE.md, README.md, marketplace.json updated

Test plan

  • npm run build passes — all 71 skills distributed across plugins
  • npm test passes — 611/611 tests
  • node dist/cli.js init --plugin=plan installs the new plugin
  • /plan command loads and runs gap analysis + design review pipeline
  • /implement accepts a plan document path and proceeds with implementation
  • /specify shows deprecation notice pointing to /plan
  • Ambient mode routes PLAN intent to plan:orch correctly

Dean Sharon and others added 4 commits April 7, 2026 16:24
…view

Implements Phases A, B, and C of the unified /plan command:

Phase A - Foundation:
- Add gap-analysis skill with 6 focus areas (completeness, architecture,
  security, performance, consistency, dependencies) and check-layers reference
- Add design-review skill with 6 anti-pattern rules (N+1, god functions,
  missing parallelism, error handling gaps, missing caching, poor decomposition)
  and anti-patterns reference with before/after examples
- Add designer agent (opus model, mode-driven: gap-analysis + design-review)
- Add design mode to synthesizer (deduplication, confidence boost, blocking/
  should-address/informational categorization)
- Add fetch-issues-batch operation to git agent for multi-issue planning

Phase B - Plugin:
- Create devflow-plan plugin with /plan and /plan-teams commands
- 17-phase pipeline in 7 blocks: requirements discovery, gap analysis,
  scope approval, implementation design, design review, plan approval, output
- Produces machine-readable design artifacts at .docs/design/
- Register in plugins.ts (after devflow-specify) and marketplace.json
- Add designer agent + gap-analysis, design-review skills to devflow-ambient

Phase C - Ambient integration:
- Rewrite plan:orch with 8-phase pipeline including gap analysis lite (2
  designers), synthesizer design mode, and inline design review in Phase 6
- Update router SKILL.md: add design-review to PLAN rows (GUIDED + ORCHESTRATED)
…nd deprecate /specify

- Remove exploration/planning phases (2-6) from /implement and /implement-teams;
  both now start directly at implementation using plan document, issue, or task description
- Add plan document input parsing to Phase 1 Setup: reads .docs/design/*.md, extracts
  frontmatter (execution-strategy, context-risk, issue) and body sections
- Renumber remaining phases 1-10 with combined Report+Record Decisions as Phase 10
- Update architecture ASCII trees and phase cross-references throughout
- Update docs-framework SKILL.md: add .docs/design/ directory and Designer persistence rule
- Update CLAUDE.md: 18 plugins, 12 agents, 41 skills, add /plan to command roster,
  update /implement description to reflect streamlined pipeline
- Update README.md: add /plan to commands table, update /implement description,
  update plugin/skill counts, mark /specify as deprecated
- Add deprecation notice to /specify and /specify-teams pointing to /plan
- Add designer.md to .gitignore for build-generated agent copies

Co-Authored-By: Claude <noreply@anthropic.com>
- Synthesizer agent: add missing 'design' mode to Input section mode list
- CLAUDE.md: update Agent Teams count from 5 to 6 (includes /plan)
- CLAUDE.md: add designer to Opus analysis agents in Model Strategy
- plan-teams.md: add missing multi-issue naming convention to Phase 15
@dean0x
Copy link
Copy Markdown
Owner Author

dean0x commented Apr 7, 2026

Code Review Summary: feat/108-unified-plan-command

Review findings from 9 specialized reviewers (security, architecture, consistency, regression, performance, testing, complexity, typescript, documentation).


BLOCKING ISSUES (5 items, ≥80% confidence)

1. Stale agents in devflow-implement (95% confidence)

Files: src/cli/plugins.ts:71 + plugins/devflow-implement/.claude-plugin/plugin.json:20-21

The /implement command removed exploration/planning phases but still declares skimmer and synthesizer agents. Remove from both locations:

// src/cli/plugins.ts - Line 71
agents: ['git', 'coder', 'simplifier', 'scrutinizer', 'evaluator', 'tester', 'validator'],
// plugins/devflow-implement/.claude-plugin/plugin.json - Lines 20-21
"agents": [
  "git",
  "coder",
  "simplifier",
  "scrutinizer",
  "evaluator",
  "tester",
  "validator"
],

Impact: Dead weight in install footprint, violates clean separation principle.


2. Missing worktree-support in devflow-plan (90% confidence)

Files: src/cli/plugins.ts:65 + plugins/devflow-plan/.claude-plugin/plugin.json:24-29

Designer agent requires worktree-support skill. Add it to both locations:

// src/cli/plugins.ts - Line 65
skills: ['agent-teams', 'gap-analysis', 'design-review', 'patterns', 'knowledge-persistence', 'worktree-support'],
// plugins/devflow-plan/.claude-plugin/plugin.json
"skills": [
  "agent-teams",
  "gap-analysis",
  "design-review",
  "patterns",
  "knowledge-persistence",
  "worktree-support"
],

Every other plugin using Git agent (implement, code-review, resolve, debug, self-review, ambient) declares it.


3. Stale description in devflow-implement (92% confidence)

File: plugins/devflow-implement/.claude-plugin/plugin.json:3

- "description": "Complete task implementation workflow - orchestrates exploration, planning, coding, validation, and PR creation",
+ "description": "Complete task implementation workflow - accepts plan documents, issues, or task descriptions",

This matches the corrected description in src/cli/plugins.ts and marketplace.json.


4. Description drift across sources (92% confidence)

Files: .claude-plugin/marketplace.json:36 + plugins/devflow-implement/README.md:3 + CLAUDE.md:21

Update all references to remove "exploration, planning" and align with the new implement responsibility.


5. Path traversal in /implement plan document handling (82% confidence)

File: plugins/devflow-implement/commands/implement.md:51-56

The command reads plan documents without validating the path. A user could pass /etc/passwd or ../../.env and the agent would read it.

Fix: Add explicit path validation before reading:

**Plan Document Handling** (when $ARGUMENTS is a path ending in `.md`):
0. **Validate the path is relative and within project root** (reject absolute paths, `..`, symbolic links)
1. Verify the file exists under `.docs/design/` or project working directory
2. Verify frontmatter contains `type: design-artifact` and `version: 1`
3. Verify `execution-strategy` is one of: SINGLE_CODER, SEQUENTIAL_CODERS, PARALLEL_CODERS
4. Verify `context-risk` is one of: LOW, MEDIUM, HIGH, CRITICAL

SHOULD-FIX ISSUES (60-79% confidence)

  • CLAUDE.md missing /specify deprecation (85% confidence) — Specify commands have deprecation notices but CLAUDE.md still lists it as active. Add deprecation note and move below /plan.
  • Stale CLAUDE.md description for devflow-plan (82% confidence) — "Unified design planning with gap analysis" is missing "and design review".
  • Lack of lightweight orientation when /implement has no plan (82% confidence) — Previous behavior explored codebase. Consider adding Skimmer spawn when no plan document provided, or document this as deliberate.

RATE LIMIT & TECHNICAL NOTES

  • Rate limiting: fetch-issues-batch uses sequential GitHub API calls. Consider batching where possible.
  • Synthesizer design mode: New "design" mode has no disk persistence (output is ephemeral). Design artifact captures summary, so current approach is acceptable.

Recommendation: CHANGES_REQUESTED

Fix the 5 blocking issues (manifests, path validation, descriptions) before merge. Should-fix items can be deferred to follow-up if time-critical.


Generated by Claude Code review agent — /comment-pr operation

Dean Sharon added 5 commits April 8, 2026 00:56
Addresses review issues 1,2,3,5,7,11-15,20 from code review.
Removes devflow-specify plugin entirely, updates manifests,
docs, tests, and launch materials.
Fold pruning comment into JSDoc block for consistency.
Add devflow-plan hint and fix devflow-implement hint in init picker.
Remove 'specify' from COMMAND_REFS in skill-references test.
Add /plan section to docs/commands.md and update /implement workflow
to reflect removal of exploration/planning phases.
Consolidates three redundant phase boundaries in the /plan pipeline:
- Phases 2+3 → Phase 2 "Orient + Load Knowledge" (Skimmer + knowledge read
  run concurrently in one phase instead of sequentially across two)
- Phases 15+16+17 → Phase 14 "Output" (store, issue, report as one phase)
- Blocks 5+6 → Block 5 "Design Review + Approval" (design review and Gate 2
  share one block header)

Gate table updated (Gate 1: 8→7, Gate 2: 14→13). All cross-references,
architecture diagrams, and error handling updated across plan.md,
plan-teams.md, README.md, and docs/commands.md. No functionality removed.
- file-organization.md: 39→41 skills, 11→12 agents, add designer to shared agents list
- skills-architecture.md: add gap-analysis and design-review to Tier 2, add /plan to agent-teams Used By
- agent-design.md: add Designer to Worker examples, mention designer in shared agents note
- contributing.md: 39→41 skills, 11→12 agents
- plugins.ts: add devflow-specify→devflow-plan to LEGACY_PLUGIN_NAMES for upgrade migration
@dean0x dean0x merged commit 19994be into main Apr 8, 2026
4 checks passed
@dean0x dean0x deleted the feat/108-unified-plan-command branch April 8, 2026 08:34
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.

feat: add /gap-analysis and /plan commands with /implement plan detection

1 participant