weorbitant/claude-code-agentic-research-orchestrator
This project enables multi-AI perspectives, consensus-based decision making, and specialized expertise for development tasks, code reviews, data analysis, and research.
๐ค Research Agentic CLI Integration
A comprehensive integration framework for using Gemini CLI and GitHub Copilot CLI as collaborative agents with Claude Code. This project enables multi-AI perspectives, consensus-based decision making, and specialized expertise for development tasks, code reviews, data analysis, and research.
- ๐ค Research Agentic CLI Integration
- ๐ Overview
โ ๏ธ Important: Before You Begin- โจ Features
- ๐ Quick Start
- ๐ Project Structure
- ๐ป Usage
- ๐ญ Agent Descriptions
- ๐ Context Templates
- ๐ง Advanced Usage
- ๐ก Best Practices
- ๐ง Troubleshooting
- ๐ Documentation
- ๐ผ Examples
- ๐ค Contributing
- ๐ Future Enhancements
- ๐ Resources
- ๐ License
- ๐ฌ Support
๐ Overview
This project integrates two powerful agentic CLI tools:
- ๐ Gemini CLI - Development guidance, code reviews, and best practices analysis
- ๐ GitHub Copilot CLI - Data analysis, experiment design, and GitHub workflow automation
These tools work alongside Claude Code to provide:
- ๐ฏ Multiple AI perspectives on complex decisions
- ๐ง Specialized expertise for different domains
- ๐ค Consensus-building for high-confidence recommendations
- ๐ Automated workflows and research assistance
โ ๏ธ Important: Before You Begin
โก Critical Prerequisites:
Before using any agents in this project, you MUST complete the following steps:
๐ 1. Install CLI Tools
Both Gemini CLI and Copilot CLI must be installed globally on your system:
# Install Gemini CLI
npm install -g gemini-cli
# Install Copilot CLI
npm install -g @github/copilot
# Verify installations
gemini --version
copilot --version๐ 2. Complete Authentication Flow
Each tool requires authentication before use:
Gemini CLI Authentication
# Option 1: Using API Key (Free Tier / Personal Use)
export GOOGLE_API_KEY="your-api-key-here"
# Option 2: Using PRO Subscription
gemini
# Inside Gemini prompt, authenticate:
/auth
# Follow the authentication flowGet your API key: Google AI Studio
Copilot CLI Authentication
# Login with GitHub account (requires active Copilot subscription)
copilot auth login
# Verify authentication
copilot -p "Test authentication" --allow-all-toolsSubscription required: GitHub Copilot
โ 3. Verify Setup
Test both tools before using the agents:
# Test Gemini CLI
gemini "Hello, can you confirm you're working?"
# Test Copilot CLI
copilot -p "Hello, can you confirm you're working?" --allow-all-tools๐จ If either test fails, DO NOT proceed with agent usage. Complete the installation and authentication steps first.
โจ Features
- ๐ฏ Multi-Agent Coordination: Research orchestrator that coordinates Gemini and Copilot agents
- ๐ง Specialized Agents: Focused expertise in code review, data analysis, experiment design
- ๐ Reusable Templates: 50+ context templates for common tasks
- ๐ Comprehensive Documentation: Setup guides, usage examples, best practices
- ๐ Flexible Integration: Works seamlessly with Claude Code's Bash and Task tools
- ๐ค Multi-Model Support: Leverage Claude Sonnet 4.5, GPT-5, or Gemini 2.5 Pro based on task requirements
๐ Quick Start
๐ฆ Prerequisites
- โ Node.js 22.x or higher
- โ npm 10.x or higher
- โ Claude Code environment
- ๐ Google API key or Vertex AI credentials (for Gemini CLI)
- ๐ณ GitHub Copilot subscription (for Copilot CLI)
โ๏ธ Installation
- ๐ฅ Install Tools
# Install Gemini CLI
npm install -g gemini-cli
# Install Copilot CLI
npm install -g @github/copilot- ๐ Authenticate
# Gemini CLI - Set API key
export GOOGLE_API_KEY="your-api-key-here"
# or use your PRO subscription credentials
gemini
# inside Gemini prompt, follow instructions to authenticate
/auth
# Copilot CLI - Login with GitHub
copilot auth login- โ Verify Installation
# Test Gemini CLI
gemini "Hello, can you confirm you're working?"
# Test Copilot CLI
copilot -p "Hello, can you confirm you're working?" --allow-all-toolsFor detailed setup instructions, see:
๐ Project Structure
research-agentic-cli-integration/
โโโ agents/ # ๐ญ Agent definition files
โ โโโ gemini-integration.md # ๐ Gemini CLI integration agent
โ โโโ copilot-integration.md # ๐ Copilot CLI integration agent
โ โโโ research-orchestrator.md # ๐ฏ Multi-agent orchestration
โโโ gemini-cli/ # ๐ Gemini CLI resources
โ โโโ context-templates/ # ๐ Reusable prompt templates
โ โ โโโ code-review-context.md
โ โ โโโ best-practices-context.md
โ โ โโโ development-guidance-context.md
โ โโโ SETUP.md # โ๏ธ Installation & configuration guide
โโโ copilot-cli/ # ๐ Copilot CLI resources
โ โโโ context-templates/ # ๐ Reusable prompt templates
โ โ โโโ data-analysis-context.md
โ โ โโโ experiment-design-context.md
โ โโโ SETUP.md # โ๏ธ Installation & configuration guide
โโโ todos/ # ๐ Task tracking and improvements
โโโ IDEA.md # ๐ก Project vision and concept
โโโ PLAN.md # ๐
Implementation milestones
โโโ README.md # ๐ This file
๐ป Usage
Using Individual Agents
๐ Gemini CLI - Code Review
# From Claude Code, using Bash tool
# โ ๏ธ IMPORTANT: Always include --include-directories flag
nvm use 22 && gemini --include-directories /work/agents -o json "Review @src/auth/login.ts for security vulnerabilities"๐ Copilot CLI - Data Analysis
# From Claude Code, using Bash tool
nvm use 22 && copilot --model claude-sonnet-4.5 -p "Analyze user engagement trends in @data/metrics.csv" --allow-tool 'read'๐ฏ Using the Research Orchestrator
The research orchestrator coordinates both agents for comprehensive analysis:
# Claude Code invokes orchestrator agent
# Orchestrator determines which tool(s) to use
# Results are consolidated into unified recommendationsExample scenarios:
- ๐ Code + Data Analysis: Gemini reviews code quality, Copilot analyzes performance logs
- ๐๏ธ Architecture Decisions: Both agents provide perspectives, Claude synthesizes consensus
- ๐งช Experiment Design + Validation: Copilot designs experiment, Gemini validates technical feasibility
Common Workflows
1. Comprehensive Code Review
# Step 1: Gemini reviews code quality (note --include-directories flag)
nvm use 22 && gemini --include-directories $(pwd) -o json "Review @src/auth/*.ts for security and best practices" > gemini-review.json
# Step 2: Claude Code parses results and presents findings2. Data-Driven Decision Making
# Step 1: Copilot analyzes data
nvm use 22 && copilot --model claude-sonnet-4.5 -p "Analyze performance metrics in @data/api-logs.csv. Identify optimization opportunities." --allow-tool 'read' > analysis.txt
# Step 2: Gemini reviews code for optimization (include workspace directory)
nvm use 22 && gemini --include-directories $(pwd) -o json "Review @src/api/*.ts for performance bottlenecks identified in analysis.txt" > gemini-perf.json
# Step 3: Claude Code consolidates and prioritizes recommendations3. Multi-Model Consensus
# Get perspectives from different models on same question
nvm use 22 && copilot --model claude-sonnet-4.5 -p "Should we use microservices or monolith? @docs/requirements.md" --allow-all-tools > claude-perspective.txt
nvm use 22 && copilot --model gpt-5 -p "Should we use microservices or monolith? @docs/requirements.md" --allow-all-tools > gpt-perspective.txt
nvm use 22 && gemini --include-directories $(pwd) "Should we use microservices or monolith? @docs/requirements.md" > gemini-perspective.txt
# Claude Code compares all three perspectives and builds consensus๐ญ Agent Descriptions
๐ Gemini Integration Agent
Purpose: Development guidance, code reviews, best practices analysis
Best For:
- ๐ Security audits
- โ Code quality reviews
- ๐ Best practices validation
- ๐๏ธ Architectural decisions
- ๐ก Development guidance
Invocation Example:
nvm use 22 && gemini --include-directories $(pwd) -o json "Audit @src/auth/ for OWASP Top 10 vulnerabilities"See agents/gemini-integration.md for full documentation.
๐ Copilot Integration Agent
Purpose: Data analysis, experiment design, GitHub automation
Best For:
- ๐ Statistical analysis
- ๐งช Experiment design and A/B testing
- ๐ GitHub repository operations
- ๐ค Multi-model perspectives
- ๐ Data visualization recommendations
Invocation Example:
nvm use 22 && copilot --model claude-sonnet-4.5 -p "Analyze @data/sales.csv for trends and seasonality" --allow-tool 'read'See agents/copilot-integration.md for full documentation.
๐ฏ Research Orchestrator Agent
Purpose: Coordinate multiple agents for comprehensive analysis
Best For:
- ๐ญ Complex decisions requiring multiple perspectives
- ๐๏ธ High-stakes architectural choices
- ๐ Comprehensive project analysis
- ๐ค Consensus-building workflows
Features:
- ๐ฏ Task routing (determines which agent(s) to invoke)
- โก Parallel or sequential invocation
- ๐ฆ Output consolidation
- ๐ค Consensus analysis (agreement vs divergent perspectives)
See agents/research-orchestrator.md for full documentation.
๐ Context Templates
Reusable prompt templates for common tasks:
Gemini CLI Templates
- ๐ Code Review - Comprehensive code quality, security, and performance reviews
- โ Best Practices - Language and framework best practices audits
- ๐ก Development Guidance - Architectural decisions and technical guidance
Located in: gemini-cli/context-templates/
Copilot CLI Templates
- ๐ Data Analysis - Statistical analysis, trend detection, anomaly identification
- ๐งช Experiment Design - A/B testing, experimental methodology, sample size calculation
Located in: copilot-cli/context-templates/
Each template includes:
- ๐ Template structure
- ๐ก 10+ detailed examples
- ๐ Usage patterns
- โ Best practices
- ๐ Notes and tips
๐ง Advanced Usage
Custom Gemini Commands
Create reusable commands in .gemini/commands/:
# .gemini/commands/security-audit.toml
[command]
name = "security-audit"
description = "Security audit of codebase"
prompt = """
Perform security audit of @src/ for OWASP Top 10:
1. Injection vulnerabilities
2. Authentication flaws
3. Sensitive data exposure
4. XXE
5. Broken access control
...
Output: JSON with severity levels
"""
output_format = "json"Usage: gemini security-audit
Custom Copilot Agents
Create specialized agents in AGENTS.md:
## data-scientist
You are a data scientist specializing in statistical analysis.
### Focus
- Statistical significance testing
- Confidence intervals
- P-values
- Visualization recommendations
### Output
- Summary statistics
- Statistical tests
- RecommendationsUsage: copilot --agent data-scientist -p "Analyze @data/experiment.csv"
MCP Server Integration
Extend capabilities with Model Context Protocol servers:
// ~/.copilot/mcp-config.json
{
"mcpServers": {
"database": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"POSTGRES_CONNECTION_STRING": "postgresql://..."
}
}
}
}๐ก Best Practices
- ๐ Use JSON Output: For Gemini CLI, use
-o jsonfor structured parsing - ๐ค Specify Models: For Copilot CLI, choose model based on task (Claude for analysis, GPT for creativity)
- ๐ Tool Permissions: Use minimal permissions, expand as needed
- ๐ Context Management: Use
@filesyntax explicitly for precise context - ๐ฐ Cost Awareness: Monitor API usage, especially with auto-approval modes
- โ Validate Results: Cross-check AI recommendations, especially for critical decisions
- ๐ Document Interactions: Track agent invocations and outcomes in
todos/
๐ง Troubleshooting
Gemini CLI Issues
"API key not found"
export GOOGLE_API_KEY="your-key"
echo $GOOGLE_API_KEY # Verify it's set"Context too large"
- Use specific file references with
@file - Leverage
.geminiignore - Break analysis into smaller chunks
Copilot CLI Issues
"Not authenticated"
copilot auth login"Tool blocked by permissions"
copilot --allow-tool 'read' -p "Your prompt"
# Or for all tools:
copilot --allow-all-tools -p "Your prompt"See setup guides for comprehensive troubleshooting:
- ๐ Gemini CLI Setup
- ๐ Copilot CLI Setup
๐ Documentation
- ๐ก IDEA.md - Project vision and concept
- ๐ PLAN.md - Implementation milestones and timeline
- โ๏ธ Gemini CLI Setup - Installation and configuration
- โ๏ธ Copilot CLI Setup - Installation and configuration
- ๐ญ Agent Definitions - Detailed agent documentation
- ๐ Context Templates - Reusable prompts
- โ TESTING-RESULTS.md - Validation results and findings
๐ผ Examples
Example 1: Security Audit Workflow
# 1. Gemini performs security audit (include workspace directory)
nvm use 22 && gemini --include-directories $(pwd) -o json "Audit @src/auth/ @src/api/ for security vulnerabilities. Focus on OWASP Top 10. Output JSON." > security-audit.json
# 2. Claude Code parses and categorizes findings
# 3. Presents prioritized list with file:line referencesExample 2: A/B Test Analysis
# 1. Copilot designs experiment
nvm use 22 && copilot --model gpt-5 -p "Design A/B test for new checkout flow. Current conversion: 3.5%, Target: 5%, Duration: 2 weeks. Include sample size calc." --allow-all-tools > experiment-design.txt
# 2. Gemini validates technical implementation (include workspace)
nvm use 22 && gemini --include-directories $(pwd) "Review experiment design in experiment-design.txt. Assess technical feasibility for NestJS app in @src/checkout/. Flag risks." > feasibility.txt
# 3. Copilot analyzes test results (after test runs)
nvm use 22 && copilot --model claude-sonnet-4.5 -p "Analyze A/B test results @data/ab-test.csv. Calculate statistical significance, confidence intervals, recommendation." --allow-tool 'read' > results-analysis.txt
# 4. Claude Code consolidates into comprehensive reportExample 3: Architecture Decision
# Parallel invocation for multiple perspectives
nvm use 22 && gemini --include-directories $(pwd) "Analyze @src/ and recommend architecture: microservices vs modular monolith vs serverless. Context: 5-dev team, 50k users, growth to 200k in 12mo." > gemini-arch.txt &
nvm use 22 && copilot --model claude-sonnet-4.5 -p "Recommend architecture for growing NestJS app: microservices vs modular monolith. Team: 5 devs, Users: 50k->200k. Research industry trends." --allow-all-tools > copilot-arch.txt &
nvm use 22 && copilot --model gpt-5 -p "Suggest creative hybrid architecture approaches between microservices and monolith for 5-dev team with growth trajectory." --allow-all-tools > gpt-arch.txt &
wait
# Claude Code compares all three perspectives and synthesizes recommendation๐ค Contributing
This is a research project for integrating agentic CLI tools with Claude Code. Contributions welcome:
- ๐ New Context Templates: Add templates for additional use cases
- โ๏ธ Custom Commands: Share useful Gemini commands in
.gemini/commands/ - ๐ญ Custom Agents: Share Copilot agent configurations
- ๐ Integration Patterns: Document successful workflows
- ๐ Bug Reports: Report issues in
todos/
๐ Future Enhancements
Short-term
- ๐ Additional domain-specific context templates
- โ๏ธ Custom commands library for common tasks
- ๐ CI/CD integration patterns
- ๐ฐ Cost tracking and optimization
Medium-term
- ๐ค Automated agent selection based on task classification
- ๐ณ๏ธ Multi-agent voting system
- ๐ Performance analytics dashboard
- ๐พ Caching strategies for cost optimization
Long-term
- ๐ง ML-based task routing
- ๐ฅ Team collaboration features
- ๐ Integration with additional agentic tools
- ๐ข Enterprise deployment guides
See PLAN.md for detailed roadmap.
๐ Resources
Gemini CLI
- ๐ Documentation: https://github.com/google-gemini/gemini-cli
- ๐ API Docs: https://ai.google.dev/docs
- โ๏ธ Vertex AI: https://cloud.google.com/vertex-ai/docs
Copilot CLI
- ๐ Documentation: https://github.com/features/copilot/cli
- ๐ GitHub Copilot: https://docs.github.com/en/copilot
- ๐ MCP Protocol: https://modelcontextprotocol.io
Claude Code
- ๐ Documentation: https://claude.com/claude-code
- ๐ ๏ธ Agent SDK: https://github.com/anthropics/claude-agent-sdk
๐ License
This project is part of the broader agents repository. See repository root for license information.
๐ฌ Support
For issues and questions:
- ๐ Internal: Document in
todos/directory - ๐ Gemini CLI: https://github.com/google-gemini/gemini-cli/issues
- ๐ Copilot CLI: https://github.com/cli/cli/issues
- ๐ค Claude Code: https://github.com/anthropics/claude-code/issues
Status: โ
Infrastructure complete | ๐งช Testing phase complete | ๐ Ready for production
Last Updated: 2025-11-20
Version: 1.0.0