feat: Add intelligent gemini-wrapper with smart defaults and update agent documentation

ENHANCEMENTS:
- Create gemini-wrapper script with automatic token counting and smart flag management
- Auto-add --approval-mode based on task type (analysis=default, execution=yolo)
- Raise token threshold to 2M for better large project handling
- Add comprehensive parameter documentation for --approval-mode and --include-directories

WRAPPER FEATURES:
- Token-based --all-files management (small projects get --all-files automatically)
- Smart task detection for approval modes
- Error logging to ~/.claude/.logs/gemini-errors.log
- Complete parameter passthrough for full gemini compatibility

DOCUMENTATION UPDATES:
- Update gemini-unified.md with wrapper usage guidelines and examples
- Add intelligent wrapper as recommended approach
- Document all agent files to use gemini-wrapper instead of direct gemini calls
- Include new parameter reference and best practices

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-09-13 23:43:44 +08:00
parent c79672fb25
commit 5843cecb2f
6 changed files with 159 additions and 9 deletions

View File

@@ -42,7 +42,7 @@ You are a pure execution agent specialized in creating actionable implementation
```
**Analysis CLI Usage Standards**:
- **Gemini CLI**: Use task-specific paths: `gemini -p "$(.claude/scripts/read-task-paths.sh [task-json-file]) @{CLAUDE.md}" `
- **Gemini CLI**: Use task-specific paths: `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]"`
- **Follow Guidelines**: @~/.claude/workflows/gemini-unified.md and @~/.claude/workflows/codex-unified.md

View File

@@ -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: `gemini -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: `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]"`
- **Follow Guidelines**: @~/.claude/workflows/gemini-unified.md and @~/.claude/workflows/codex-unified.md

View File

@@ -78,7 +78,7 @@ Use the targeted review context template:
**Gemini CLI Command**:
```bash
gemini -p "$(.claude/scripts/read-task-paths.sh [task-json-file]) @{CLAUDE.md} [review-analysis-prompt]"
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:

View File

@@ -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"gemini -p \"$(.claude/scripts/read-task-paths.sh [task-json-file]) @{{CLAUDE.md}} {dimension}\"",
command=f"gemini-wrapper -p \"$(.claude/scripts/read-task-paths.sh [task-json-file]) @{{CLAUDE.md}} {dimension}\"",
dimension=dimension,
role_context=role,
topic=topic