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.4 KiB
4.4 KiB
name, description, usage, argument-hint, examples, allowed-tools
| name | description | usage | argument-hint | examples | allowed-tools | |||
|---|---|---|---|---|---|---|---|---|
| bug-index | Bug analysis and fix suggestions using CLI tools | /cli:mode:bug-index [--tool <codex|gemini|qwen>] [--enhance] [--cd "path"] "bug description" | [--tool codex|gemini|qwen] [--enhance] [--cd path] bug description |
|
SlashCommand(*), Bash(*) |
CLI Mode: Bug Index (/cli:mode:bug-index)
Purpose
Systematic bug analysis with diagnostic template (~/.claude/prompt-templates/bug-fix.md).
Supported Tools: codex, gemini (default), qwen
Key Feature: --cd flag for directory-scoped analysis
Parameters
--tool <codex|gemini|qwen>- Tool selection (default: gemini)--enhance- Enhance bug description with/enhance-promptfirst--cd "path"- Target directory for focused analysis<bug-description>(Required) - Bug description or error message
Execution Flow
- Parse tool selection: Extract
--toolflag (default: gemini) - If
--enhanceflag present: Execute/enhance-prompt "[bug-description]"first - Parse bug description (original or enhanced)
- Detect target directory (from
--cdor auto-infer) - Build command for selected tool with bug-fix template
- Execute analysis (read-only, provides fix recommendations)
- Save to
.workflow/WFS-[id]/.chat/bug-index-[timestamp].md
Core Rules
- Analysis Only: This command analyzes bugs and suggests fixes - it does NOT modify code
- Enhance First (if flagged): Execute
/enhance-promptbefore analysis - Directory Context: Use
cdwhen--cdprovided or auto-detected - Template Required: Always use bug-fix template
- Session Output: Save analysis results and fix recommendations to session chat
Analysis Focus (via Template)
- Root cause investigation and diagnosis
- Code path tracing to locate issues
- Targeted minimal fix recommendations
- Impact assessment of proposed changes
Command Template
cd [directory] && ~/.claude/scripts/gemini-wrapper --all-files -p "
PURPOSE: [bug analysis goal]
TASK: Systematic bug analysis and fix recommendations
MODE: analysis
CONTEXT: @{CLAUDE.md,**/*CLAUDE.md} [entire codebase in directory]
EXPECTED: Root cause analysis, code path tracing, targeted fix suggestions
RULES: $(cat ~/.claude/prompt-templates/bug-fix.md) | Bug: [description]
"
Examples
Basic Bug Analysis:
cd . && ~/.claude/scripts/gemini-wrapper --all-files -p "
PURPOSE: Debug authentication null pointer error
TASK: Identify root cause and provide fix recommendations
MODE: analysis
CONTEXT: @{CLAUDE.md,**/*CLAUDE.md}
EXPECTED: Root cause, code path, minimal fix suggestion, impact assessment
RULES: $(cat ~/.claude/prompt-templates/bug-fix.md) | Bug: null pointer in login flow
"
Directory-Specific:
cd src/auth && ~/.claude/scripts/gemini-wrapper --all-files -p "
PURPOSE: Fix token validation failure
TASK: Analyze token validation bug in auth module
MODE: analysis
CONTEXT: @{CLAUDE.md,**/*CLAUDE.md}
EXPECTED: Validation logic analysis, fix recommendation with minimal changes
RULES: $(cat ~/.claude/prompt-templates/bug-fix.md) | Bug: token validation fails intermittently
"
Bug Investigation Workflow
# 1. Find bug-related files
rg "error_keyword" --files-with-matches
mcp__code-index__search_code_advanced(pattern="error|exception", file_pattern="*.ts")
# 2. Execute bug analysis with focused context (analysis only, no code changes)
/cli:mode:bug-index --cd "src/module" "specific error description"
Output Routing
Output Destination Logic:
- Active session exists AND bug is session-relevant:
- Save to
.workflow/WFS-[id]/.chat/bug-index-[timestamp].md
- Save to
- No active session OR quick debugging:
- Save to
.workflow/.scratchpad/bug-index-[description]-[timestamp].md
- Save to
Examples:
- During active session
WFS-payment-fix, analyzing payment bug →.chat/bug-index-20250105-143022.md - No session, quick null pointer investigation →
.scratchpad/bug-index-null-pointer-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/bug-fix.md - Always uses
--all-filesfor comprehensive codebase context