mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-10 02:24:35 +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.0 KiB
4.0 KiB
name, description, usage, argument-hint, examples, allowed-tools
| name | description | usage | argument-hint | examples | allowed-tools | |||
|---|---|---|---|---|---|---|---|---|
| analyze | Quick codebase analysis using CLI tools (codex/gemini/qwen) | /cli:analyze [--tool <codex|gemini|qwen>] [--enhance] <analysis-target> | [--tool codex|gemini|qwen] [--enhance] analysis target |
|
SlashCommand(*), Bash(*), TodoWrite(*), Read(*), Glob(*) |
CLI Analyze Command (/cli:analyze)
Purpose
Quick codebase analysis using CLI tools. Analysis only - does NOT modify code.
Intent: Understand code patterns, architecture, and provide insights/recommendations Supported Tools: codex, gemini (default), qwen
Core Behavior
- Read-Only Analysis: This command ONLY analyzes code and provides insights
- No Code Modification: Results are recommendations and analysis reports
- Template-Based: Automatically selects appropriate analysis template
- Smart Pattern Detection: Infers relevant files based on analysis target
Parameters
--tool <codex|gemini|qwen>- Tool selection (default: gemini)--enhance- Use/enhance-promptfor context-aware enhancement<analysis-target>- Description of what to analyze
Execution Flow
- Parse tool selection (default: gemini)
- If
--enhance: Execute/enhance-promptfirst to expand user intent - Auto-detect analysis type from keywords → select template
- Build command with auto-detected file patterns and
MODE: analysis - Execute analysis (read-only, no code changes)
- Return analysis report with insights and recommendations
File Pattern Auto-Detection
Keywords trigger specific file patterns:
- "auth" →
@{**/*auth*,**/*user*} - "component" →
@{src/components/**/*,**/*.component.*} - "API" →
@{**/api/**/*,**/routes/**/*} - "test" →
@{**/*.test.*,**/*.spec.*} - "config" →
@{*.config.*,**/config/**/*} - Generic →
@{src/**/*}
For complex patterns, use rg or MCP tools to discover files first, then execute CLI with precise file references.
Command Template
cd . && ~/.claude/scripts/gemini-wrapper -p "
PURPOSE: [analysis goal from target]
TASK: [auto-detected analysis type]
MODE: analysis
CONTEXT: @{CLAUDE.md} [auto-detected file patterns]
EXPECTED: Insights, patterns, recommendations (NO code modification)
RULES: [auto-selected template] | Focus on [analysis aspect]
"
Examples
Basic Analysis:
/cli:analyze "authentication patterns"
# Executes: Gemini analysis with auth file patterns
# Returns: Pattern analysis, architecture insights, recommendations
Architecture Analysis:
/cli:analyze --tool qwen "component architecture"
# Executes: Qwen with component file patterns
# Returns: Architecture review, design patterns, improvement suggestions
Performance Analysis:
/cli:analyze --tool codex "performance bottlenecks"
# Executes: Codex deep analysis with performance focus
# Returns: Bottleneck identification, optimization recommendations
Enhanced Analysis:
/cli:analyze --enhance "fix auth issues"
# Step 1: Enhance prompt to expand context
# Step 2: Analysis with expanded context
# Returns: Root cause analysis, fix recommendations (NO automatic fixes)
Output Routing
Output Destination Logic:
- Active session exists AND analysis is session-relevant:
- Save to
.workflow/WFS-[id]/.chat/analyze-[timestamp].md
- Save to
- No active session OR one-off analysis:
- Save to
.workflow/.scratchpad/analyze-[description]-[timestamp].md
- Save to
Examples:
- During active session
WFS-auth-system, analyzing auth patterns →.chat/analyze-20250105-143022.md - No session, quick security check →
.scratchpad/analyze-security-20250105-143045.md
Notes
- Command templates, file patterns, and best practices: see intelligent-tools-strategy.md (loaded in memory)
- Scratchpad directory details: see workflow-architecture.md
- Scratchpad files can be promoted to workflow sessions if analysis proves valuable