diff --git a/.claude/agents/action-planning-agent.md b/.claude/agents/action-planning-agent.md index 642d836f..4284df88 100644 --- a/.claude/agents/action-planning-agent.md +++ b/.claude/agents/action-planning-agent.md @@ -42,8 +42,8 @@ You are a pure execution agent specialized in creating actionable implementation ``` **Analysis CLI Usage Standards**: -- **Gemini CLI**: Use task-specific paths: `~/.claude/scripts/gemini-wrapper -p "$(.claude/scripts/read-task-paths.sh [task-json-file]) @{CLAUDE.md}" ` -- **Codex CLI**: Use task-specific paths: `codex --full-auto exec "$(.claude/scripts/read-task-paths.sh [task-json-file]) [prompt]"` +- **Gemini CLI**: Use task-specific paths: `bash(~/.claude/scripts/gemini-wrapper -p "$(.claude/scripts/read-task-paths.sh [task-json-file]) @{CLAUDE.md}")` +- **Codex CLI**: Use task-specific paths: `bash(codex --full-auto exec "$(.claude/scripts/read-task-paths.sh [task-json-file]) [prompt]")` - **Follow Guidelines**: @~/.claude/workflows/gemini-unified.md and @~/.claude/workflows/codex-unified.md ### Deep Analysis Execution diff --git a/.claude/agents/code-developer.md b/.claude/agents/code-developer.md index 16d06e7b..0c5352a3 100644 --- a/.claude/agents/code-developer.md +++ b/.claude/agents/code-developer.md @@ -56,8 +56,8 @@ ELIF context insufficient OR task has analysis marker: - **Purpose**: Enables autonomous development with intelligent file discovery and code generation **Analysis CLI Usage Standards**: -- **Gemini CLI**: Use task-specific paths from JSON: `~/.claude/scripts/gemini-wrapper -p "$(~/.claude/scripts/read-task-paths.sh [task-json-file]) [prompt]" ` -- **Codex CLI**: Use task-specific paths from JSON: `codex --full-auto exec "$(~/.claude/scripts/read-task-paths.sh [task-json-file]) [prompt]"` +- **Gemini CLI**: Use task-specific paths from JSON: `bash(~/.claude/scripts/gemini-wrapper -p "$(~/.claude/scripts/read-task-paths.sh [task-json-file]) [prompt]")` +- **Codex CLI**: Use task-specific paths from JSON: `bash(codex --full-auto exec "$(~/.claude/scripts/read-task-paths.sh [task-json-file]) [prompt]")` - **Follow Guidelines**: @~/.claude/workflows/gemini-unified.md and @~/.claude/workflows/codex-unified.md diff --git a/.claude/agents/code-review-test-agent.md b/.claude/agents/code-review-test-agent.md index 10a937a4..fe99a9e0 100644 --- a/.claude/agents/code-review-test-agent.md +++ b/.claude/agents/code-review-test-agent.md @@ -78,7 +78,7 @@ Use the targeted review context template: **Gemini CLI Command**: ```bash -~/.claude/scripts/gemini-wrapper -p "$(.claude/scripts/read-task-paths.sh [task-json-file]) @{CLAUDE.md} [review-analysis-prompt]" +bash(~/.claude/scripts/gemini-wrapper -p "$(.claude/scripts/read-task-paths.sh [task-json-file]) @{CLAUDE.md} [review-analysis-prompt]") ``` This executes a change-specific Gemini CLI command that identifies: @@ -96,7 +96,7 @@ Use the autonomous development context template: **Codex CLI Command**: ```bash -codex --full-auto exec "$(.claude/scripts/read-task-paths.sh [task-json-file]) [autonomous-review-prompt]" +bash(codex --full-auto exec "$(.claude/scripts/read-task-paths.sh [task-json-file]) [autonomous-review-prompt]") ``` This executes autonomous Codex CLI analysis that provides: diff --git a/.claude/agents/conceptual-planning-agent.md b/.claude/agents/conceptual-planning-agent.md index 81fec306..f48b41fb 100644 --- a/.claude/agents/conceptual-planning-agent.md +++ b/.claude/agents/conceptual-planning-agent.md @@ -53,7 +53,7 @@ def handle_analysis_markers(prompt): if "[GEMINI_CLI_REQUIRED]" in prompt: for dimension in dimensions: result = execute_gemini_cli( - command=f"~/.claude/scripts/gemini-wrapper -p \"$(.claude/scripts/read-task-paths.sh [task-json-file]) @{{CLAUDE.md}} {dimension}\"", + command=f"bash(~/.claude/scripts/gemini-wrapper -p \"$(.claude/scripts/read-task-paths.sh [task-json-file]) @{{CLAUDE.md}} {dimension}\")", dimension=dimension, role_context=role, topic=topic @@ -62,7 +62,7 @@ def handle_analysis_markers(prompt): elif "[CODEX_CLI_REQUIRED]" in prompt: result = execute_codex_cli( - command=f"codex --full-auto exec \"$(.claude/scripts/read-task-paths.sh [task-json-file]) {topic}\"", + command=f"bash(codex --full-auto exec \"$(.claude/scripts/read-task-paths.sh [task-json-file]) {topic}\")", autonomous_analysis=True, role_context=role, topic=topic diff --git a/.claude/workflows/codex-unified.md b/.claude/workflows/codex-unified.md index 27bcc6bb..f95ec55e 100644 --- a/.claude/workflows/codex-unified.md +++ b/.claude/workflows/codex-unified.md @@ -8,7 +8,7 @@ type: technical-guideline - **Purpose**: An AI-powered CLI tool for automated codebase analysis, intelligent code generation, and autonomous development workflows. - **Key Characteristic**: **No `--all-files` flag** - requires explicit `@` pattern references for file inclusion. -- **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"` +- **Directory Analysis Rule**: When user intends to analyze specific directory (cd XXX), use: `bash(codex --cd XXX --full-auto exec "prompt")` or `bash(cd XXX && codex --full-auto exec "@{**/*} prompt")` - **Default Mode**: `--full-auto exec` autonomous development mode (RECOMMENDED for all tasks). - **Primary Triggers**: - When user needs automated code generation or refactoring. @@ -22,16 +22,16 @@ type: technical-guideline ### ⭐ **CRITICAL: Default to `--full-auto` Mode** -> **🎯 Golden Rule**: Always start with `codex --full-auto exec "your task description"` for maximum autonomous capabilities. This is the recommended approach for 90% of development tasks. +> **🎯 Golden Rule**: Always start with `bash(codex --full-auto exec "your task description")` for maximum autonomous capabilities. This is the recommended approach for 90% of development tasks. -**Why `--full-auto` Should Be Your Default:** +**Why `bash(codex --full-auto)` Should Be Your Default:** - **🧠 Intelligent File Discovery**: Codex automatically identifies relevant files without manual `@` patterns - **🎯 Context-Aware Execution**: Understands project structure and dependencies autonomously - **⚡ Streamlined Workflow**: No need to specify file patterns - just describe what you want - **🚀 Maximum Automation**: Leverages full autonomous development capabilities - **📚 Smart Documentation**: Automatically includes relevant CLAUDE.md files and project context -**When to Use `codex --full-auto exec` with Explicit Patterns:** +**When to Use `bash(codex --full-auto exec)` with Explicit Patterns:** - ✅ When you need precise control over which files are included - ✅ When working with specific file patterns that require manual specification - ✅ When debugging issues with file discovery in `--full-auto` mode @@ -41,30 +41,30 @@ type: technical-guideline - **Basic Structure** (Priority Order): ```bash - codex --full-auto exec "autonomous development task" # DEFAULT & RECOMMENDED - codex --full-auto exec "prompt with @{patterns}" # For specific control needs + bash(codex --full-auto exec "autonomous development task") # DEFAULT & RECOMMENDED + bash(codex --full-auto exec "prompt with @{patterns}") # For specific control needs ``` - **Key Commands** (In Order of Preference): - - `codex --full-auto exec "..."` ⭐ **PRIMARY MODE** - Full autonomous development - - `codex --full-auto exec "..."` - Controlled execution when you need specific patterns - - `codex --cd /path --full-auto exec "..."` - Directory-specific autonomous development - - `codex --cd /path --full-auto exec "@{patterns} ..."` - Directory-specific execution with patterns + - `bash(codex --full-auto exec "...")` ⭐ **PRIMARY MODE** - Full autonomous development + - `bash(codex --full-auto exec "...")` - Controlled execution when you need specific patterns + - `bash(codex --cd /path --full-auto exec "...")` - Directory-specific autonomous development + - `bash(codex --cd /path --full-auto exec "@{patterns} ...")` - Directory-specific execution with patterns - **Template Usage** (Preferred Approaches): ```bash # RECOMMENDED: Full autonomous mode (let Codex handle file discovery) - codex --full-auto exec "Refactor authentication system using best practices" + bash(codex --full-auto exec "Refactor authentication system using best practices") # Alternative: Direct execution with explicit patterns - codex --full-auto exec "@{src/**/*} @{CLAUDE.md} Refactor authentication system" + bash(codex --full-auto exec "@{src/**/*} @{CLAUDE.md} Refactor authentication system") # Advanced: Template injection with autonomous mode - codex --full-auto exec "$(cat ~/.claude/workflows/cli-templates/prompts/development/feature.txt) + bash(codex --full-auto exec "$(cat ~/.claude/workflows/cli-templates/prompts/development/feature.txt) ## Task: Authentication System Refactoring - Apply modern security patterns - Improve code organization - - Add comprehensive tests" + - Add comprehensive tests") ``` ### 📂 File Pattern Rules - **CRITICAL FOR CODEX** @@ -111,62 +111,62 @@ type: technical-guideline - **Module-Specific Development** ```bash # RECOMMENDED: Full autonomous mode with directory context - codex --cd src/auth --full-auto exec "Refactor authentication module using latest patterns" + bash(codex --cd src/auth --full-auto exec "Refactor authentication module using latest patterns") # Alternative: Full autonomous mode with explicit task description - codex --full-auto exec "Refactor the authentication module in src/auth/ using latest security patterns" + bash(codex --full-auto exec "Refactor the authentication module in src/auth/ using latest security patterns") # Fallback: Explicit patterns when autonomous mode needs guidance - codex --full-auto exec "@{src/auth/**/*,CLAUDE.md} Refactor authentication module using latest patterns" + bash(codex --full-auto exec "@{src/auth/**/*,CLAUDE.md} Refactor authentication module using latest patterns") # Alternative: Directory-specific execution with explicit patterns - codex --cd src/auth --full-auto exec "@{**/*,../../CLAUDE.md} Refactor authentication module using latest patterns" + bash(codex --cd src/auth --full-auto exec "@{**/*,../../CLAUDE.md} Refactor authentication module using latest patterns") ``` - **Basic Development Task** ```bash # RECOMMENDED: Let Codex handle everything autonomously - codex --full-auto exec "Implement user authentication with JWT tokens" + bash(codex --full-auto exec "Implement user authentication with JWT tokens") # Alternative: Explicit file patterns if needed - codex --full-auto exec "@{src/**/*,*.json,CLAUDE.md} Implement user authentication with JWT" + bash(codex --full-auto exec "@{src/**/*,*.json,CLAUDE.md} Implement user authentication with JWT") ``` - **Template-Enhanced Development** ```bash # RECOMMENDED: Autonomous mode with template guidance - codex --full-auto exec "$(cat ~/.claude/workflows/cli-templates/prompts/development/feature.txt) + bash(codex --full-auto exec "$(cat ~/.claude/workflows/cli-templates/prompts/development/feature.txt) ## Task: User Authentication System - JWT token management - Role-based access control - - Password reset functionality" + - Password reset functionality") # Alternative: Explicit patterns with templates - codex --full-auto exec "@{src/**/*,CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/development/feature.txt)" + bash(codex --full-auto exec "@{src/**/*,CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/development/feature.txt)") ``` - **Full Auto Mode (PRIMARY RECOMMENDATION)** ```bash # OPTIMAL: Let Codex discover files and handle everything - codex --full-auto exec "Create a complete todo application with React and TypeScript" + bash(codex --full-auto exec "Create a complete todo application with React and TypeScript") # Alternative: Explicit patterns if you want to control file scope - codex --full-auto exec "@{**/*} Create a complete todo application with React and TypeScript" + bash(codex --full-auto exec "@{**/*} Create a complete todo application with React and TypeScript") ``` - **Debugging & Analysis** ```bash # RECOMMENDED: Autonomous debugging mode - codex --full-auto exec "$(cat ~/.claude/workflows/cli-templates/prompts/development/debugging.txt) + bash(codex --full-auto exec "$(cat ~/.claude/workflows/cli-templates/prompts/development/debugging.txt) ## Issue: Performance degradation in user dashboard - Identify bottlenecks in the codebase - Propose and implement optimizations - - Add performance monitoring" + - Add performance monitoring") # Alternative: Explicit patterns for controlled analysis - codex --full-auto exec "@{src/**/*,package.json,CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/development/debugging.txt)" + bash(codex --full-auto exec "@{src/**/*,package.json,CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/development/debugging.txt)") ``` ### ⭐ Best Practices & Rules @@ -180,10 +180,10 @@ type: technical-guideline - **Be selective**: Use specific patterns like `@{src/**/*.ts}` for targeted analysis **Default Automation Mode (CRITICAL GUIDANCE):** -- **`--full-auto exec` is the PRIMARY choice**: Use for 90% of all tasks - maximizes autonomous capabilities -- **`codex --full-auto exec` with explicit patterns only when necessary**: Reserve for cases where you need explicit file pattern control +- **`bash(codex --full-auto exec)` is the PRIMARY choice**: Use for 90% of all tasks - maximizes autonomous capabilities +- **`bash(codex --full-auto exec)` with explicit patterns only when necessary**: Reserve for cases where you need explicit file pattern control - **Trust the autonomous intelligence**: Codex excels at file discovery, context gathering, and architectural decisions -- **Start with `--full-auto exec` always**: If it doesn't meet needs, then consider explicit patterns with `exec` mode +- **Start with `bash(codex --full-auto exec)` always**: If it doesn't meet needs, then consider explicit patterns with `exec` mode #### 📋 CLAUDE.md Loading Rules @@ -231,38 +231,38 @@ type: technical-guideline **Pre-Development Analysis:** ```bash # RECOMMENDED: Autonomous pattern analysis -codex --full-auto exec "$(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt) +bash(codex --full-auto exec "$(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt) -Analyze the existing codebase patterns and conventions before implementing new features." +Analyze the existing codebase patterns and conventions before implementing new features.") # Alternative: Explicit patterns if needed -codex --full-auto exec "@{src/**/*,CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt)" +bash(codex --full-auto exec "@{src/**/*,CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt)") ``` **Feature Development:** ```bash # RECOMMENDED: Full autonomous feature development -codex --full-auto exec "$(cat ~/.claude/workflows/cli-templates/prompts/development/feature.txt) +bash(codex --full-auto exec "$(cat ~/.claude/workflows/cli-templates/prompts/development/feature.txt) ## Feature: Advanced Search Functionality - Full-text search capabilities - Filter and sort options - Performance optimization -- Integration with existing UI components" +- Integration with existing UI components") # Alternative: Explicit patterns when needed -codex --full-auto exec "@{**/*,CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/development/feature.txt)" +bash(codex --full-auto exec "@{**/*,CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/development/feature.txt)") ``` **Quality Assurance:** ```bash # RECOMMENDED: Autonomous testing and validation -codex --full-auto exec "$(cat ~/.claude/workflows/cli-templates/prompts/development/testing.txt) +bash(codex --full-auto exec "$(cat ~/.claude/workflows/cli-templates/prompts/development/testing.txt) -Generate comprehensive tests and perform validation for the entire codebase." +Generate comprehensive tests and perform validation for the entire codebase.") # Alternative: Specific test scope control -codex --full-auto exec "@{src/**/*,test/**/*,CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/development/testing.txt)" +bash(codex --full-auto exec "@{src/**/*,test/**/*,CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/development/testing.txt)") ``` ### 🎨 Advanced Usage Patterns @@ -270,25 +270,25 @@ codex --full-auto exec "@{src/**/*,test/**/*,CLAUDE.md} $(cat ~/.claude/workflow **Multi-Phase Development (Full Autonomous Workflow):** ```bash # Phase 1: Autonomous Analysis -codex --full-auto exec "Analyze current architecture for payment system integration" +bash(codex --full-auto exec "Analyze current architecture for payment system integration") # Phase 2: Autonomous Implementation (RECOMMENDED APPROACH) -codex --full-auto exec "Implement Stripe payment integration based on the analyzed architecture" +bash(codex --full-auto exec "Implement Stripe payment integration based on the analyzed architecture") # Phase 3: Autonomous Testing -codex --full-auto exec "Generate comprehensive tests for the payment system implementation" +bash(codex --full-auto exec "Generate comprehensive tests for the payment system implementation") # Alternative: Explicit control when needed -codex --full-auto exec "@{**/*,CLAUDE.md} Analyze current architecture for payment system integration" +bash(codex --full-auto exec "@{**/*,CLAUDE.md} Analyze current architecture for payment system integration") ``` **Cross-Project Learning:** ```bash # RECOMMENDED: Autonomous cross-project pattern learning -codex --full-auto exec "Implement feature X by learning patterns from ../other-project/ and applying them to the current codebase" +bash(codex --full-auto exec "Implement feature X by learning patterns from ../other-project/ and applying them to the current codebase") # Alternative: Explicit pattern specification -codex --full-auto exec "@{../other-project/src/**/*,src/**/*,CLAUDE.md} Implement feature X using patterns from other-project" +bash(codex --full-auto exec "@{../other-project/src/**/*,src/**/*,CLAUDE.md} Implement feature X using patterns from other-project") ``` -Remember: **Codex excels at autonomous development** - `--full-auto exec` mode should be your default choice. Trust its intelligence for file discovery, context gathering, and implementation decisions. Use explicit `@` patterns with `--full-auto exec` only when you need precise control over file scope. \ No newline at end of file +Remember: **Codex excels at autonomous development** - `bash(codex --full-auto exec)` mode should be your default choice. Trust its intelligence for file discovery, context gathering, and implementation decisions. Use explicit `@` patterns with `bash(codex --full-auto exec)` only when you need precise control over file scope. \ No newline at end of file diff --git a/.claude/workflows/gemini-unified.md b/.claude/workflows/gemini-unified.md index 034395ce..5c877f95 100644 --- a/.claude/workflows/gemini-unified.md +++ b/.claude/workflows/gemini-unified.md @@ -17,7 +17,11 @@ type: technical-guideline - Architectural analysis and pattern detection. - Identification of coding standards and conventions. -### 🎯 Intelligent Wrapper: `gemini-wrapper` +## ⭐ **RECOMMENDED: Use `gemini-wrapper` as Primary Method** + +> **🎯 Core Recommendation**: Always use `gemini-wrapper` instead of direct `gemini` commands. This intelligent wrapper handles token limits, approval modes, and error management automatically. + +### 🎯 Intelligent Wrapper: `gemini-wrapper` (PRIMARY METHOD) - **Purpose**: Smart wrapper that automatically manages `--all-files` flag and approval modes based on project analysis - **Location**: `~/.claude/scripts/gemini-wrapper` (auto-installed) @@ -33,6 +37,21 @@ type: technical-guideline - **Benefits**: Prevents token limits, optimizes approval workflow, provides error tracking - **Setup**: Script auto-installs to `~/.claude/scripts/` location +**⚡ Quick Start Examples:** +```bash +# RECOMMENDED: Let wrapper handle everything automatically +bash(~/.claude/scripts/gemini-wrapper -p "Analyze authentication patterns") + +# Analysis task - wrapper auto-detects and uses --approval-mode default +bash(~/.claude/scripts/gemini-wrapper -p "Review code quality and conventions") + +# Development task - wrapper auto-detects and uses --approval-mode yolo +bash(~/.claude/scripts/gemini-wrapper -p "Implement user dashboard feature") + +# Directory-specific analysis +bash(cd src/auth && ~/.claude/scripts/gemini-wrapper -p "Analyze module patterns") +``` + ### ⚙️ Command Syntax & Arguments - **Basic Structure**: @@ -50,19 +69,19 @@ type: technical-guideline - **Template Usage**: ```bash # Without template (manual prompt) - gemini --all-files -p "@{src/**/*} @{CLAUDE.md} Analyze code patterns and conventions" + bash(gemini --all-files -p "@{src/**/*} @{CLAUDE.md} Analyze code patterns and conventions") # With template (recommended) - gemini --all-files -p "@{src/**/*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt)" + bash(gemini --all-files -p "@{src/**/*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt)") # Multi-template composition - gemini --all-files -p "@{src/**/*} @{CLAUDE.md} $(cat <<'EOF' + bash(gemini --all-files -p "@{src/**/*} @{CLAUDE.md} $(cat <<'EOF' $(cat ~/.claude/workflows/cli-templates/prompts/analysis/architecture.txt) Additional Security Focus: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/security.txt) EOF - )" + )") ``` @@ -105,54 +124,54 @@ type: technical-guideline ### 📦 Standard Command Structures -These are recommended command templates for common scenarios. +> **⚠️ IMPORTANT**: Use `gemini-wrapper` for 90% of all tasks. Only use direct `gemini` commands when you need explicit manual control. -#### 🎯 Using Intelligent Wrapper (Recommended) +#### 🎯 Using Intelligent Wrapper (PRIMARY CHOICE - 90% of tasks) - **Automatic Token & Approval Management** ```bash # Analysis task - auto adds --approval-mode default - ~/.claude/scripts/gemini-wrapper -p "Analyze authentication module patterns and implementation" + bash(~/.claude/scripts/gemini-wrapper -p "Analyze authentication module patterns and implementation") # Execution task - auto adds --approval-mode yolo - ~/.claude/scripts/gemini-wrapper -p "Implement user login feature with JWT tokens" + bash(~/.claude/scripts/gemini-wrapper -p "Implement user login feature with JWT tokens") # Navigate to specific directory with wrapper - cd src/auth && ~/.claude/scripts/gemini-wrapper -p "Review authentication patterns" + bash(cd src/auth && ~/.claude/scripts/gemini-wrapper -p "Review authentication patterns") # Override token threshold if needed - GEMINI_TOKEN_LIMIT=500000 ~/.claude/scripts/gemini-wrapper -p "Custom threshold analysis" + bash(GEMINI_TOKEN_LIMIT=500000 ~/.claude/scripts/gemini-wrapper -p "Custom threshold analysis") # Multi-directory support with wrapper - ~/.claude/scripts/gemini-wrapper --include-directories /path/to/other/project -p "Cross-project analysis" + bash(~/.claude/scripts/gemini-wrapper --include-directories /path/to/other/project -p "Cross-project analysis") ``` - **Module-Specific Analysis (Quick Module Analysis)** ```bash # Navigate to module directory for focused analysis - cd src/auth && ~/.claude/scripts/gemini-wrapper -p "Analyze authentication module patterns and implementation" + bash(cd src/auth && ~/.claude/scripts/gemini-wrapper -p "Analyze authentication module patterns and implementation") # Or specify module from root directory - cd backend/services && ~/.claude/scripts/gemini-wrapper -p "Review service architecture and dependencies" + bash(cd backend/services && ~/.claude/scripts/gemini-wrapper -p "Review service architecture and dependencies") # Template-enhanced module analysis with wrapper - cd frontend/components && ~/.claude/scripts/gemini-wrapper -p "$(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt)" + bash(cd frontend/components && ~/.claude/scripts/gemini-wrapper -p "$(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt)") ``` -#### 📝 Direct Gemini Usage (Manual Control) +#### 📝 Direct Gemini Usage (Manual Control - Use Only When Needed) - **Manual Token Management** ```bash # Direct gemini usage when you want explicit control - gemini --all-files -p "Analyze authentication module patterns and implementation" + bash(gemini --all-files -p "Analyze authentication module patterns and implementation") # Fallback when wrapper suggests pattern usage - gemini -p "@{src/auth/**/*} @{CLAUDE.md} Analyze authentication patterns" + bash(gemini -p "@{src/auth/**/*} @{CLAUDE.md} Analyze authentication patterns") ``` - **Basic Structure (Manual Prompt)** ```bash - gemini --all-files -p "@{target_patterns} @{CLAUDE.md,**/*CLAUDE.md} + bash(gemini --all-files -p "@{target_patterns} @{CLAUDE.md,**/*CLAUDE.md} Context: [Analysis type] targeting @{target_patterns} Guidelines: Include CLAUDE.md standards @@ -163,13 +182,13 @@ These are recommended command templates for common scenarios. ## Output: - File:line references - - Code examples" + - Code examples") ``` - **Template-Enhanced (Recommended)** ```bash # Using a predefined template for consistent, high-quality analysis - gemini --all-files -p "@{target_patterns} @{CLAUDE.md,**/*CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/[category]/[template].txt) + bash(gemini --all-files -p "@{target_patterns} @{CLAUDE.md,**/*CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/[category]/[template].txt) ## Analysis: 1. [Point 1] @@ -177,13 +196,12 @@ These are recommended command templates for common scenarios. ## Output: - File:line references - - Code examples" - " + - Code examples") ``` - **Multi-Template Composition** ```bash - gemini --all-files -p "@{src/**/*} @{CLAUDE.md} + bash(gemini --all-files -p "@{src/**/*} @{CLAUDE.md} $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt) Additional Security Focus: @@ -195,8 +213,7 @@ These are recommended command templates for common scenarios. ## Output: - File:line references - - Code examples" - " + - Code examples") ``` - **Token Limit Fallback** @@ -204,13 +221,13 @@ These are recommended command templates for common scenarios. # If --all-files exceeds token limits, immediately retry with targeted patterns: # Original command that failed: - gemini --all-files -p "Analyze authentication patterns" + bash(gemini --all-files -p "Analyze authentication patterns") # Fallback with specific patterns: - gemini -p "@{src/auth/**/*} @{src/middleware/**/*} @{CLAUDE.md} Analyze authentication patterns" + bash(gemini -p "@{src/auth/**/*} @{src/middleware/**/*} @{CLAUDE.md} Analyze authentication patterns") # Or focus on specific file types: - gemini -p "@{**/*.ts} @{**/*.js} @{CLAUDE.md} Analyze authentication patterns" + bash(gemini -p "@{**/*.ts} @{**/*.js} @{CLAUDE.md} Analyze authentication patterns") ``` ### ⭐ Best Practices & Rules