mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-11 02:33:51 +08:00
- **Intent Clarification**: Distinguished analysis (read-only) from execution (modifies code) commands - **Output Routing**: Added comprehensive output destination logic for all CLI commands - **Scratchpad Integration**: Introduced `.workflow/.scratchpad/` for non-session-specific outputs ## Analysis Commands (Read-Only) - `/cli:analyze`, `/cli:chat`, `/cli:mode:*`: Added "Core Behavior" emphasizing read-only nature - Added "MODE: analysis" in command templates - Examples clearly show recommendations vs. code changes ## Execution Commands (Modifies Code) - `/cli:execute`: Added ⚠️ warnings about code modification - `/cli:codex-execute`: Clarified multi-stage execution with detailed output structure - Both commands now have "Output Routing" sections ## Workflow Architecture Updates - Added `.workflow/.scratchpad/` directory definition - Output routing logic: session-relevant → `.chat/`, otherwise → `.scratchpad/` - File naming pattern: `[command-type]-[brief-description]-[timestamp].md` - Examples for both analysis and implementation commands ## Key Improvements - Prevents confusion between analysis and implementation operations - Solves output loss when no active session exists - Prevents unrelated analyses from cluttering session history - Provides centralized location for ad-hoc outputs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
4.4 KiB
4.4 KiB
name, description, usage, argument-hint, examples, allowed-tools
| name | description | usage | argument-hint | examples | allowed-tools | |||
|---|---|---|---|---|---|---|---|---|
| plan | Project planning and architecture analysis using CLI tools | /cli:mode:plan [--tool <codex|gemini|qwen>] [--enhance] [--cd "path"] "topic" | [--tool codex|gemini|qwen] [--enhance] [--cd path] topic |
|
SlashCommand(*), Bash(*) |
CLI Mode: Plan (/cli:mode:plan)
Purpose
Comprehensive planning and architecture analysis with strategic planning template (~/.claude/prompt-templates/plan.md).
Supported Tools: codex, gemini (default), qwen
Key Feature: --cd flag for directory-scoped planning
Parameters
--tool <codex|gemini|qwen>- Tool selection (default: gemini)--enhance- Enhance topic with/enhance-promptfirst--cd "path"- Target directory for focused planning<topic>(Required) - Planning topic or architectural question
Execution Flow
- Parse tool selection: Extract
--toolflag (default: gemini) - If
--enhanceflag present: Execute/enhance-prompt "[topic]"first - Parse topic (original or enhanced)
- Detect target directory (from
--cdor auto-infer) - Build command for selected tool with planning template
- Execute analysis (read-only, no code modification)
- Save to
.workflow/WFS-[id]/.chat/plan-[timestamp].md
Core Rules
- Analysis Only: This command provides planning recommendations and insights - it does NOT modify code
- Enhance First (if flagged): Execute
/enhance-promptbefore planning - Directory Context: Use
cdwhen--cdprovided or auto-detected - Template Required: Always use planning template
- Session Output: Save analysis results to session chat
Planning Capabilities (via Template)
- Strategic architecture insights and recommendations
- Implementation roadmaps and suggestions
- Key technical decisions analysis
- Risk assessment
- Resource planning
Command Template
cd [directory] && ~/.claude/scripts/gemini-wrapper --all-files -p "
PURPOSE: [planning goal from topic]
TASK: Comprehensive planning and architecture analysis
MODE: analysis
CONTEXT: @{CLAUDE.md,**/*CLAUDE.md} [entire codebase in directory]
EXPECTED: Strategic insights, implementation recommendations, key decisions
RULES: $(cat ~/.claude/prompt-templates/plan.md) | Focus on [topic area]
"
Examples
Basic Planning Analysis:
cd . && ~/.claude/scripts/gemini-wrapper --all-files -p "
PURPOSE: Design user dashboard architecture
TASK: Plan dashboard component structure and data flow
MODE: analysis
CONTEXT: @{CLAUDE.md,**/*CLAUDE.md}
EXPECTED: Architecture recommendations, component design, data flow diagram
RULES: $(cat ~/.claude/prompt-templates/plan.md) | Focus on scalability
"
Directory-Specific Planning:
cd src/api && ~/.claude/scripts/gemini-wrapper --all-files -p "
PURPOSE: Plan API refactoring strategy
TASK: Analyze current API structure and recommend improvements
MODE: analysis
CONTEXT: @{CLAUDE.md,**/*CLAUDE.md}
EXPECTED: Refactoring roadmap, breaking change analysis, migration plan
RULES: $(cat ~/.claude/prompt-templates/plan.md) | Maintain backward compatibility
"
Planning Workflow
# 1. Discover project structure
~/.claude/scripts/get_modules_by_depth.sh
mcp__code-index__find_files(pattern="*.ts")
# 2. Gather existing architecture info
rg "architecture|design" --files-with-matches
# 3. Execute planning analysis (analysis only, no code changes)
/cli:mode:plan "topic for strategic planning"
Output Routing
Output Destination Logic:
- Active session exists AND planning is session-relevant:
- Save to
.workflow/WFS-[id]/.chat/plan-[timestamp].md
- Save to
- No active session OR exploratory planning:
- Save to
.workflow/.scratchpad/plan-[description]-[timestamp].md
- Save to
Examples:
- During active session
WFS-dashboard, planning dashboard architecture →.chat/plan-20250105-143022.md - No session, exploring new feature idea →
.scratchpad/plan-feature-idea-20250105-143045.md
Notes
- Command templates and file patterns: see intelligent-tools-strategy.md (loaded in memory)
- Scratchpad directory details: see workflow-architecture.md
- Template path:
~/.claude/prompt-templates/plan.md - Always uses
--all-filesfor comprehensive project context