docs: Add .geminiignore configuration guidelines to improve Gemini CLI performance and context clarity

This commit is contained in:
catlog22
2025-09-12 15:49:38 +08:00
parent 1f6b73b4d9
commit 00ed337594
7 changed files with 148 additions and 95 deletions

View File

@@ -15,8 +15,9 @@ model: sonnet
## Overview
Comprehensive development planning and implementation strategy using expert planning templates with Codex CLI.
- **Directory Analysis Rule**: When user intends to analyze specific directory (cd XXX), use: `codex --cd XXX --full-auto exec "prompt"` or `cd XXX && codex --full-auto exec "@{**/*} prompt"`
- **Default Mode**: `--full-auto exec` autonomous development mode (RECOMMENDED for all tasks).
**Core Guidelines**: @~/.claude/workflows/codex-unified.md
⚠️ **Critical Difference**: Codex has **NO `--all-files` flag** - you MUST use `@` patterns to reference files.
@@ -26,22 +27,20 @@ Comprehensive development planning and implementation strategy using expert plan
```bash
/codex:mode:plan "design authentication system with implementation"
```
**Executes**: `codex exec "@{**/*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/planning/task-breakdown.txt)"`
**Executes**: `codex --full-auto exec "@{**/*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/planning/task-breakdown.txt) design authentication system with implementation"`
### Architecture Planning with Context
```bash
/codex:mode:plan "microservices migration strategy"
```
**Executes**: `codex exec "@{src/**/*,*.config.*,CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/planning/migration.txt)"`
**Executes**: `codex --full-auto exec "@{src/**/*,*.config.*,CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/planning/migration.txt) microservices migration strategy"`
### Feature Implementation Planning
```bash
/codex:mode:plan "real-time notifications with WebSocket integration"
```
**Executes**: `codex exec "@{**/*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/development/feature.txt)
Additional Planning Context:
$(cat ~/.claude/workflows/cli-templates/prompts/planning/task-breakdown.txt)"`
**Executes**: `codex --full-auto exec "@{**/*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/development/feature.txt) Additional Planning Context:$(cat ~/.claude/workflows/cli-templates/prompts/planning/task-breakdown.txt) real-time notifications with WebSocket integration"`
## Codex-Specific Planning Patterns

View File

@@ -17,6 +17,10 @@ model: sonnet
## Overview
Automatically analyzes user input to select the most appropriate template and execute Gemini CLI with optimal context.
**Directory Analysis Rule**: Intelligent detection of directory context intent - automatically navigate to target directory when analysis scope is directory-specific.
**--cd Parameter Rule**: When `--cd` parameter is provided, always execute `cd [path] && gemini --all-files -p "prompt"` to ensure analysis occurs in the specified directory context.
**Process**: List Templates → Analyze Input → Select Template → Execute with Context
## Usage
@@ -34,6 +38,9 @@ Automatically analyzes user input to select the most appropriate template and ex
# Architecture/design keywords → selects plan.md
/gemini:mode:auto "implement real-time chat system architecture"
# With directory context
/gemini:mode:auto "authentication issues" --cd "src/auth"
```
## Template Selection Logic
@@ -118,24 +125,19 @@ END FUNCTION
### Step 3: Execute with Dynamically Selected Template
```bash
# Dynamic execution with selected template
# Basic execution with selected template
gemini --all-files -p "$(cat ~/.claude/prompt-templates/[selected_template])
Context: @{CLAUDE.md,**/*CLAUDE.md}
User Input: [user_input]"
# With --cd parameter
cd [specified_directory] && gemini --all-files -p "$(cat ~/.claude/prompt-templates/[selected_template])
User Input: [user_input]"
```
**Template selection is completely dynamic** - any new templates added to the directory will be automatically discovered and available for selection based on their YAML frontmatter.
## Options
| Option | Purpose |
|--------|---------|
| `--list-templates` | Show available templates and exit |
| `--template <name>` | Force specific template (overrides auto-selection) |
| `--debug` | Show template selection reasoning |
| `--save-session` | Save results to workflow session |
### Manual Template Override
```bash
@@ -174,7 +176,7 @@ User Input: [user_input]"
## Session Integration
When `--save-session` used, saves to:
saves to:
`.workflow/WFS-[topic]/.chat/auto-[template]-[timestamp].md`
**Session includes:**

View File

@@ -16,18 +16,23 @@ model: sonnet
## Overview
Systematic bug analysis and fix suggestions using expert diagnostic template.
**Directory Analysis Rule**: Intelligent detection of directory context intent - automatically navigate to target directory when analysis scope is directory-specific.
**--cd Parameter Rule**: When `--cd` parameter is provided, always execute `cd [path] && gemini --all-files -p "prompt"` to ensure analysis occurs in the specified directory context.
## Usage
### Basic Bug Analysis
```bash
/gemini:mode:bug-index "authentication error during login"
/gemini:mode:bug-index "authentication null pointer error"
```
### With All Files Context
### Bug Analysis with Directory Context
```bash
/gemini:mode:bug-index "React state not updating" --all-files
/gemini:mode:bug-index "authentication error" --cd "src/auth"
```
### Save to Workflow Session
```bash
/gemini:mode:bug-index "API timeout issues" --save-session
@@ -39,9 +44,13 @@ Systematic bug analysis and fix suggestions using expert diagnostic template.
**Executes**:
```bash
# Basic usage
gemini --all-files -p "$(cat ~/.claude/prompt-templates/bug-fix.md)
Context: @{CLAUDE.md,**/*CLAUDE.md}
Bug Description: [user_description]"
# With --cd parameter
cd [specified_directory] && gemini --all-files -p "$(cat ~/.claude/prompt-templates/bug-fix.md)
Bug Description: [user_description]"
```
@@ -54,16 +63,10 @@ The bug-fix template provides:
- **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:
saves to:
`.workflow/WFS-[topic]/.chat/bug-index-[timestamp].md`
**Includes:**

View File

@@ -1,6 +1,6 @@
---
name: plan
description: Project planning and architecture analysis using specialized template
description: Project planning and architecture analysis using Gemini CLI with specialized template
usage: /gemini:mode:plan "planning topic"
argument-hint: "planning topic or architectural challenge to analyze"
examples:
@@ -14,57 +14,44 @@ model: sonnet
# Planning Analysis Command (/gemini:mode:plan)
## Overview
Comprehensive project planning and architecture analysis using expert planning template.
**This command uses Gemini CLI for comprehensive project planning and architecture analysis.** It leverages Gemini CLI's powerful codebase analysis capabilities combined with expert planning templates to provide strategic insights and implementation roadmaps.
### Key Features
- **Gemini CLI Integration**: Utilizes Gemini CLI's deep codebase analysis for informed planning decisions
**--cd Parameter Rule**: When `--cd` parameter is provided, always execute `cd [path] && gemini --all-files -p "prompt"` to ensure analysis occurs in the specified directory context.
## Usage
### Basic Planning Analysis
### Basic Usage
```bash
/gemini:mode:plan "design authentication system"
```
### With All Files Context
### Directory-Specific Analysis
```bash
/gemini:mode:plan "microservices migration" --all-files
```
### Save to Workflow Session
```bash
/gemini:mode:plan "real-time notifications" --save-session
/gemini:mode:plan "design authentication system" --cd "src/auth"
```
## Command Execution
**Template Used**: `~/.claude/prompt-templates/plan.md`
**Smart Directory Detection**: Auto-detects relevant directories based on topic keywords
**Executes**:
```bash
# Project-wide analysis
gemini --all-files -p "$(cat ~/.claude/prompt-templates/plan.md)
Planning Topic: [user_description]"
Context: @{CLAUDE.md,**/*CLAUDE.md}
# Directory-specific analysis
cd [directory] && gemini --all-files -p "$(cat ~/.claude/prompt-templates/plan.md)
Planning Topic: [user_description]"
```
## Planning Focus
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:
saves to:
`.workflow/WFS-[topic]/.chat/plan-[timestamp].md`
**Includes:**