refactor: Streamline Gemini commands documentation and reduce duplication

- Simplify analyze.md, execute.md, bug-index.md, and plan.md command documentation
- Remove redundant content and focus on essential usage patterns
- Reduce total lines by 503 while maintaining core functionality
- Improve documentation clarity and reduce maintenance overhead

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-09-09 22:55:02 +08:00
parent e9cd438144
commit 47493a4db5
4 changed files with 283 additions and 526 deletions

View File

@@ -1,6 +1,5 @@
---
name: bug-index
description: Bug analysis and fix suggestions using specialized template
usage: /gemini:pre:bug-index "bug description"
argument-hint: "description of the bug or error you're experiencing"
@@ -12,102 +11,63 @@ allowed-tools: Bash(gemini:*)
model: sonnet
---
### 🐛 **Command Overview: `/gemini:pre:bug-index`**
# Bug Analysis Command (/gemini:pre:bug-index)
- **Type**: Template-based Gemini CLI Wrapper
- **Purpose**: Specialized bug analysis and fix suggestions using expert diagnostic template
- **Template**: Bug fix analysis template for systematic problem diagnosis
- **Core Tool**: `Bash(gemini:*)` - Executes Gemini CLI with bug-fix template
## Overview
Systematic bug analysis and fix suggestions using expert diagnostic template.
### 📥 **Parameters & Usage**
## Usage
- **`<bug description>` (Required)**: Description of the bug, error, or unexpected behavior
- **`--all-files` (Optional)**: Includes entire codebase for comprehensive analysis
- **`--save-session` (Optional)**: Saves the bug analysis to current workflow session
### 🔄 **Execution Workflow**
`Parse Bug Description` **->** `Load Bug-Fix Template` **->** `Assemble Context` **->** `Execute Gemini CLI` **->** `(Optional) Save Session`
### 📋 **Bug Analysis Focus**
The bug-fix template provides structured analysis covering:
- **Root Cause Analysis**: Systematic investigation of underlying issues
- **Code Path Tracing**: Following execution flow to identify failure points
- **Hypothesis Validation**: Testing theories about bug origins
- **Targeted Solutions**: Specific, minimal fixes rather than broad refactoring
- **Impact Assessment**: Understanding side effects of proposed fixes
### 📚 **Context Assembly**
Context includes:
1. **Bug-Fix Template**: @~/.claude/prompt-templates/bug-fix.md
2. **Project Guidelines**: @{CLAUDE.md,**/*CLAUDE.md}
3. **Relevant Files**: User-specified files or all files if `--all-files` used
### 📝 **Prompt Structure**
```
=== SYSTEM PROMPT ===
@~/.claude/prompt-templates/bug-fix.md
=== CONTEXT ===
@{CLAUDE.md,**/*CLAUDE.md}
@{target_files}
=== USER INPUT ===
[Bug description and any relevant details]
### Basic Bug Analysis
```bash
/gemini:pre:bug-index "authentication error during login"
```
### ⚙️ **Implementation**
```pseudo
FUNCTION execute_bug_fix_analysis(bug_description, flags):
// Load bug-fix template
template = load_file(@~/.claude/prompt-templates/bug-fix.md)
// Construct prompt with template
prompt = "=== SYSTEM PROMPT ===\n" + template + "\n\n"
prompt += "=== CONTEXT ===\n"
prompt += "@{CLAUDE.md,**/*CLAUDE.md}\n"
// Execute with appropriate context
IF flags contain "--all-files":
result = execute_tool("Bash(gemini:*)", "--all-files", "-p", prompt + bug_description)
ELSE:
prompt += "\n=== USER INPUT ===\n" + bug_description
result = execute_tool("Bash(gemini:*)", "-p", prompt)
// Save session if requested
IF flags contain "--save-session":
save_bug_analysis_session(bug_description, result)
RETURN result
END FUNCTION
### With All Files Context
```bash
/gemini:pre:bug-index "React state not updating" --all-files
```
### 💾 **Session Integration**
### Save to Workflow Session
```bash
/gemini:pre:bug-index "API timeout issues" --save-session
```
When `--save-session` is used:
- Saves to `.workflow/WFS-[topic]/.chat/` directory
- File named: `bug-index-YYYYMMDD-HHMMSS.md`
- Includes template used, bug description, analysis, and recommendations
## Command Execution
**Session Template:**
```markdown
# Bug Fix Analysis: [Timestamp]
**Template Used**: `~/.claude/prompt-templates/bug-fix.md`
## Bug Description
[Original bug description]
**Executes**:
```bash
gemini --all-files -p "$(cat ~/.claude/prompt-templates/bug-fix.md)
## Template Used
bug-fix.md - Expert diagnostic analysis template
Context: @{CLAUDE.md,**/*CLAUDE.md}
## Analysis Results
[Complete Gemini response with root cause analysis and fix suggestions]
Bug Description: [user_description]"
```
## Recommended Actions
- [Immediate fixes]
- [Prevention measures]
- [Testing recommendations]
```
## Analysis Focus
The bug-fix template provides:
- **Root Cause Analysis**: Systematic investigation
- **Code Path Tracing**: Following execution flow
- **Targeted Solutions**: Specific, minimal fixes
- **Impact Assessment**: Understanding side effects
## Options
| Option | Purpose |
|--------|---------|
| `--all-files` | Include entire codebase for analysis |
| `--save-session` | Save analysis to workflow session |
## Session Output
When `--save-session` used, saves to:
`.workflow/WFS-[topic]/.chat/bug-index-[timestamp].md`
**Includes:**
- Bug description
- Template used
- Analysis results
- Recommended actions

View File

@@ -1,117 +1,75 @@
---
name: plan
description: Project planning and architecture analysis using specialized template
usage: /gemini:chat:plan "planning topic"
usage: /gemini:pre:plan "planning topic"
argument-hint: "planning topic or architectural challenge to analyze"
examples:
- /gemini:chat:plan "design user dashboard feature architecture"
- /gemini:chat:plan "plan microservices migration strategy"
- /gemini:chat:plan "implement real-time notification system"
- /gemini:pre:plan "design user dashboard feature architecture"
- /gemini:pre:plan "plan microservices migration strategy"
- /gemini:pre:plan "implement real-time notification system"
allowed-tools: Bash(gemini:*)
model: sonnet
---
### 📋 **Command Overview: `/gemini:chat:plan`**
# Planning Analysis Command (/gemini:pre:plan)
- **Type**: Template-based Gemini CLI Wrapper
- **Purpose**: Comprehensive project planning and architecture analysis using expert planning template
- **Template**: Planning analysis template for systematic feature and system design
- **Core Tool**: `Bash(gemini:*)` - Executes Gemini CLI with planning template
## Overview
Comprehensive project planning and architecture analysis using expert planning template.
### 📥 **Parameters & Usage**
## Usage
- **`<planning topic>` (Required)**: Description of the feature, system, or architectural challenge to plan
- **`--all-files` (Optional)**: Includes entire codebase for comprehensive planning context
- **`--save-session` (Optional)**: Saves the planning analysis to current workflow session
### 🔄 **Execution Workflow**
`Parse Planning Topic` **->** `Load Planning Template` **->** `Assemble Context` **->** `Execute Gemini CLI` **->** `(Optional) Save Session`
### 📋 **Planning Analysis Focus**
The planning template provides structured analysis covering:
- **Requirements Analysis**: Understanding functional and non-functional requirements
- **Architecture Design**: System structure, components, and interactions
- **Implementation Strategy**: Step-by-step development approach
- **Risk Assessment**: Identifying potential challenges and mitigation strategies
- **Resource Planning**: Time, effort, and technology requirements
### 📚 **Context Assembly**
Context includes:
1. **Planning Template**: @~/.claude/prompt-templates/plan.md
2. **Project Guidelines**: @{CLAUDE.md,**/*CLAUDE.md}
3. **Relevant Files**: User-specified files or all files if `--all-files` used
### 📝 **Prompt Structure**
```
=== SYSTEM PROMPT ===
@~/.claude/prompt-templates/plan.md
=== CONTEXT ===
@{CLAUDE.md,**/*CLAUDE.md}
@{target_files}
=== USER INPUT ===
[Planning topic and any specific requirements or constraints]
### Basic Planning Analysis
```bash
/gemini:pre:plan "design authentication system"
```
### ⚙️ **Implementation**
```pseudo
FUNCTION execute_planning_analysis(planning_topic, flags):
// Load planning template
template = load_file(@~/.claude/prompt-templates/plan.md)
// Construct prompt with template
prompt = "=== SYSTEM PROMPT ===\n" + template + "\n\n"
prompt += "=== CONTEXT ===\n"
prompt += "@{CLAUDE.md,**/*CLAUDE.md}\n"
// Execute with appropriate context
IF flags contain "--all-files":
result = execute_tool("Bash(gemini:*)", "--all-files", "-p", prompt + planning_topic)
ELSE:
prompt += "\n=== USER INPUT ===\n" + planning_topic
result = execute_tool("Bash(gemini:*)", "-p", prompt)
// Save session if requested
IF flags contain "--save-session":
save_planning_session(planning_topic, result)
RETURN result
END FUNCTION
### With All Files Context
```bash
/gemini:pre:plan "microservices migration" --all-files
```
### 💾 **Session Integration**
### Save to Workflow Session
```bash
/gemini:pre:plan "real-time notifications" --save-session
```
When `--save-session` is used:
- Saves to `.workflow/WFS-[topic]/.chat/` directory
- File named: `plan-YYYYMMDD-HHMMSS.md`
- Includes template used, planning topic, analysis, and implementation roadmap
## Command Execution
**Session Template:**
```markdown
# Planning Analysis: [Timestamp]
**Template Used**: `~/.claude/prompt-templates/plan.md`
## Planning Topic
[Original planning topic description]
**Executes**:
```bash
gemini --all-files -p "$(cat ~/.claude/prompt-templates/plan.md)
## Template Used
plan.md - Expert planning and architecture analysis template
Context: @{CLAUDE.md,**/*CLAUDE.md}
## Analysis Results
[Complete Gemini response with requirements, architecture, and implementation plan]
Planning Topic: [user_description]"
```
## Implementation Roadmap
- [Phase 1: Foundation work]
- [Phase 2: Core implementation]
- [Phase 3: Integration and testing]
## Planning Focus
## Key Decisions
- [Architecture choices]
- [Technology selections]
- [Risk mitigation strategies]
```
The planning template provides:
- **Requirements Analysis**: Functional and non-functional requirements
- **Architecture Design**: System structure and interactions
- **Implementation Strategy**: Step-by-step development approach
- **Risk Assessment**: Challenges and mitigation strategies
- **Resource Planning**: Time, effort, and technology needs
## Options
| Option | Purpose |
|--------|---------|
| `--all-files` | Include entire codebase for context |
| `--save-session` | Save analysis to workflow session |
## Session Output
When `--save-session` used, saves to:
`.workflow/WFS-[topic]/.chat/plan-[timestamp].md`
**Includes:**
- Planning topic
- Template used
- Analysis results
- Implementation roadmap
- Key decisions