gemini-claude-loop
SKILL.md
Gemini-Claude Engineering Loop
Workflow Overview
Plan (Claude) → Validate (Gemini) → Implement (Claude) → Review (Gemini) → Fix → Re-validate → Done
| Role | Responsibility |
|---|---|
| Claude | Architecture, planning, code implementation (Edit/Write/Read) |
| Gemini | Validation, code review, quality assurance |
Environment Notice
Non-TTY environment: See gemini-cli SKILL for CLI fundamentals. Key rule: Always use
gemini -p "prompt"(headless mode required)
Phase 0: Pre-flight Check
- Create context directory:
mkdir -p .gemini-loop
Add .gemini-loop/ to your project's .gitignore to avoid committing session artifacts.
- Ask user via
AskUserQuestion:- Model preference (gemini-3-flash-preview (default), gemini-3.1-pro-preview (complex only))
- Role mode preference (Review-Only OR Review+Suggest)
Phase 1: Planning (Claude)
- Create detailed implementation plan
- Break down into clear steps
- Document assumptions and risks
- Save to
.gemini-loop/plan.md
Phase 2: Plan Validation (Gemini)
Ask user for role mode, then execute with timeout: 600000:
gemini -m gemini-3-flash-preview -p "Review this plan: $(cat .gemini-loop/plan.md) ..."
Full prompts by role mode: See commands.md
Save result: > .gemini-loop/phase2_validation.md
Phase 3: Feedback Loop
If issues found:
- Summarize Gemini feedback to user
- Ask via
AskUserQuestion: "Revise and re-validate, or proceed?" - If revise → Update plan → Repeat Phase 2
Phase 4: Implementation (Claude)
- Implement using Edit/Write/Read tools
- Execute step-by-step with error handling
- Save summary to
.gemini-loop/implementation.md
Phase 5: Code Review (Gemini)
Execute with timeout: 600000:
gemini -m gemini-3-flash-preview --include-directories ./src -p "Review: $(cat .gemini-loop/plan.md) $(cat .gemini-loop/implementation.md) ..."
Full prompts by role mode: See commands.md
Save result: > .gemini-loop/phase5_review.md
Claude response by severity:
- Critical → Fix immediately
- Architectural → Discuss with user
- Minor → Document and proceed
Phase 6: Iteration
- Apply fixes from
.gemini-loop/phase5_review.md - Significant changes → Re-validate with Gemini
- Loop until quality standards met
Session Management
- Each loop run uses the
.gemini-loop/directory for all context files - Overwrite context files on each new run (plan.md, phase2_validation.md, etc.)
- Append iteration history to
.gemini-loop/iterations.mdfor traceability - If resuming a previous session, read existing context files before proceeding
Context Files
.gemini-loop/
├── plan.md # Implementation plan
├── phase2_validation.md # Plan validation result
├── implementation.md # Implementation summary
├── phase5_review.md # Code review result
└── iterations.md # Iteration history
Error Handling
Full error reference: See gemini-cli SKILL for Gemini CLI error details.
Error Recovery Flow:
- Non-zero exit or empty output → Stop and report error message
- Summarize error via
AskUserQuestion - Common issues:
- Empty output → Ensure
-pflag is used (headless mode) - Authentication failure → Check
gemini auth status - Model unavailable → Fall back to
gemini-3-flash-preview
- Empty output → Ensure
Quick Reference
Always use timeout: 600000 (10 min) for all Gemini commands.
Best Practices
- Always use
gemini -pin Claude Code environment (non-TTY, headless mode) - Always create
.gemini-loop/directory at start - Always save outputs to context files for traceability
- Always validate plans before implementation
- Never skip review after changes
- Default to Review-Only role mode unless user requests suggestions
- Check model availability before first Gemini command
- Set 10-minute timeout for all Gemini commands (
timeout: 600000)
References
- Command patterns & prompts: See references/commands.md
- Gemini CLI fundamentals: See gemini-cli SKILL (models, options, error handling, timeout, JSON output)
Weekly Installs
1
Repository
creator-hian/cl…-pluginsGitHub Stars
7
First Seen
6 days ago
Security Audits
Installed on
zencoder1
amp1
cline1
openclaw1
opencode1
cursor1