Files
Claude-Code-Workflow/.claude/commands/cli/analyze.md
catlog22 467963eee2 docs: refactor CLI command docs to eliminate redundancy
Streamlined 7 CLI command documentation files by removing duplicate
content that's already comprehensively covered in intelligent-tools-strategy.md
(loaded in memory). Established single source of truth (SSOT) pattern.

Changes:
- Removed duplicate command templates (→ strategy lines 51-118)
- Removed file pattern reference lists (→ strategy lines 324-329)
- Removed complex pattern discovery steps (→ strategy lines 331-355)
- Removed MODE field definitions (→ strategy lines 128-143)
- Removed tool feature descriptions (→ strategy lines 283-322)

Files streamlined:
- analyze.md: 117→61 lines (48% reduction)
- chat.md: 118→62 lines (47% reduction)
- execute.md: 180→100 lines (44% reduction)
- codex-execute.md: 481→473 lines (2% - preserved unique content)
- mode/bug-index.md: 144→75 lines (48% reduction)
- mode/code-analysis.md: 188→76 lines (60% reduction)
- mode/plan.md: 100→76 lines (24% reduction)

Total reduction: 681 lines removed across all files

Each doc now contains only:
- Unique purpose and parameters
- Command-specific execution flow
- Practical examples
- Brief reference to intelligent-tools-strategy.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-05 10:35:27 +08:00

2.2 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
/cli:analyze "authentication patterns"
/cli:analyze --tool qwen "API security"
/cli:analyze --tool codex --enhance "performance bottlenecks"
SlashCommand(*), Bash(*), TodoWrite(*), Read(*), Glob(*)

CLI Analyze Command (/cli:analyze)

Purpose

Quick codebase analysis using CLI tools. Automatically detects analysis type and selects appropriate template.

Supported Tools: codex, gemini (default), qwen

Parameters

  • --tool <codex|gemini|qwen> - Tool selection (default: gemini)
  • --enhance - Use /enhance-prompt for context-aware enhancement
  • <analysis-target> - Description of what to analyze

Execution Flow

  1. Parse tool selection (default: gemini)
  2. If --enhance: Execute /enhance-prompt first to expand user intent
  3. Auto-detect analysis type from keywords → select template
  4. Build command with auto-detected file patterns
  5. Execute and return results

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.

Examples

/cli:analyze "authentication patterns"              # Auto: gemini + auth patterns
/cli:analyze --tool qwen "component architecture"   # Qwen architecture analysis
/cli:analyze --tool codex "performance bottlenecks" # Codex deep analysis
/cli:analyze --enhance "fix auth issues"            # Enhanced prompt → analysis

Notes

  • Command templates, file patterns, and best practices: see intelligent-tools-strategy.md (loaded in memory)
  • Active workflow session: results saved to .workflow/WFS-[id]/.chat/
  • No session: results returned directly