mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-12 02:37:45 +08:00
- 更新所有69个命令文件的description字段,基于实际功能重新生成详细描述 - 重新生成5个索引文件(all-commands, by-category, by-use-case, essential-commands, command-relationships) - 移动analyze_commands.py到scripts/目录并完善功能 - 移除临时备份文件 命令描述改进示例: - workflow:plan: 增加了工具和代理的详细说明(Gemini, action-planning-agent) - cli:execute: 说明了YOLO权限和多种执行模式 - memory:update-related: 详细说明了批处理策略和工具回退链 索引文件改进: - usage_scenario从2种扩展到10种(更精细分类) - command-relationships覆盖所有69个命令 - 区分built-in(内置调用)和sequential(用户顺序执行)关系 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
131 lines
3.6 KiB
Markdown
131 lines
3.6 KiB
Markdown
---
|
|
name: bug-diagnosis
|
|
description: Read-only bug root cause analysis using Gemini/Qwen/Codex with systematic diagnosis template for fix suggestions
|
|
argument-hint: "[--agent] [--tool codex|gemini|qwen] [--enhance] [--cd path] bug description"
|
|
allowed-tools: SlashCommand(*), Bash(*), Task(*)
|
|
---
|
|
|
|
# CLI Mode: Bug Diagnosis (/cli:mode:bug-diagnosis)
|
|
|
|
## Purpose
|
|
|
|
Systematic bug diagnosis with root cause analysis template (`~/.claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt`).
|
|
|
|
**Tool Selection**:
|
|
- **gemini** (default) - Best for bug diagnosis
|
|
- **qwen** - Fallback when Gemini unavailable
|
|
- **codex** - Alternative for complex bug analysis
|
|
|
|
## Parameters
|
|
|
|
- `--tool <gemini|qwen|codex>` - Tool selection (default: gemini)
|
|
- `--agent` - Use cli-execution-agent for automated context discovery
|
|
- `--enhance` - Enhance bug description with `/enhance-prompt`
|
|
- `--cd "path"` - Target directory for focused diagnosis
|
|
- `<bug-description>` (Required) - Bug description or error details
|
|
|
|
## Tool Usage
|
|
|
|
**Gemini** (Primary):
|
|
```bash
|
|
# Uses gemini by default, or specify explicitly
|
|
--tool gemini
|
|
```
|
|
|
|
**Qwen** (Fallback):
|
|
```bash
|
|
--tool qwen
|
|
```
|
|
|
|
**Codex** (Alternative):
|
|
```bash
|
|
--tool codex
|
|
```
|
|
|
|
## Execution Flow
|
|
|
|
### Standard Mode
|
|
1. Parse tool selection (default: gemini)
|
|
2. Optional: enhance with `/enhance-prompt`
|
|
3. Detect directory from `--cd` or auto-infer
|
|
4. Build command with template
|
|
5. Execute diagnosis (read-only)
|
|
6. Save to `.workflow/WFS-[id]/.chat/`
|
|
|
|
### Agent Mode (`--agent`)
|
|
|
|
Delegates to agent for intelligent diagnosis:
|
|
|
|
```javascript
|
|
Task(
|
|
subagent_type="cli-execution-agent",
|
|
description="Bug root cause diagnosis",
|
|
prompt=`
|
|
Task: ${bug_description}
|
|
Mode: bug-diagnosis
|
|
Tool: ${tool_flag || 'auto-select'} // gemini|qwen|codex
|
|
Directory: ${cd_path || 'auto-detect'}
|
|
Template: ~/.claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt
|
|
|
|
Agent responsibilities:
|
|
1. Context Discovery:
|
|
- Locate error traces and logs
|
|
- Find related code sections
|
|
- Identify data flow paths
|
|
|
|
2. CLI Command Generation:
|
|
- Build Gemini/Qwen/Codex command
|
|
- Include diagnostic context
|
|
- Apply ~/.claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt template
|
|
|
|
3. Execution & Output:
|
|
- Execute root cause analysis
|
|
- Generate fix suggestions
|
|
- Save to .workflow/.chat/
|
|
`
|
|
)
|
|
```
|
|
|
|
## Core Rules
|
|
|
|
- **Read-only**: Diagnoses bugs, does NOT modify code
|
|
- **Template**: Uses `~/.claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt` for root cause analysis
|
|
- **Output**: Saves to `.workflow/WFS-[id]/.chat/`
|
|
|
|
## CLI Command Templates
|
|
|
|
**Gemini/Qwen** (default, diagnosis only):
|
|
```bash
|
|
cd [dir] && gemini -p "
|
|
PURPOSE: [goal]
|
|
TASK: Root cause analysis
|
|
MODE: analysis
|
|
CONTEXT: @**/*
|
|
EXPECTED: Diagnosis, fix plan
|
|
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt)
|
|
"
|
|
# Qwen: Replace 'gemini' with 'qwen'
|
|
```
|
|
|
|
**Codex** (diagnosis + potential fixes):
|
|
```bash
|
|
codex -C [dir] --full-auto exec "
|
|
PURPOSE: [goal]
|
|
TASK: Bug diagnosis
|
|
MODE: analysis
|
|
CONTEXT: @**/*
|
|
EXPECTED: Diagnosis, fix suggestions
|
|
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt)
|
|
" -m gpt-5 --skip-git-repo-check -s danger-full-access
|
|
```
|
|
|
|
## Output
|
|
|
|
- **With session**: `.workflow/WFS-[id]/.chat/bug-diagnosis-[timestamp].md`
|
|
- **No session**: `.workflow/.scratchpad/bug-diagnosis-[desc]-[timestamp].md`
|
|
|
|
## Notes
|
|
|
|
- Template: `~/.claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt`
|
|
- See `intelligent-tools-strategy.md` for detailed tool usage
|