Skip to content

This project enables multi-AI perspectives, consensus-based decision making, and specialized expertise for development tasks, code reviews, data analysis, and research.

License

Notifications You must be signed in to change notification settings

weorbitant/claude-code-agentic-research-orchestrator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– 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.

πŸ“‹ Overview

This project integrates two powerful agentic CLI tools:

  1. πŸ” Gemini CLI - Development guidance, code reviews, and best practices analysis
  2. πŸ“Š 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 flow

Get 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-tools

Subscription 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

  1. πŸ“₯ Install Tools
# Install Gemini CLI
npm install -g gemini-cli

# Install Copilot CLI
npm install -g @github/copilot
  1. πŸ” 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
  1. βœ… 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-tools

For 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 recommendations

Example 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 findings

2. 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 recommendations

3. 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

  1. πŸ” Code Review - Comprehensive code quality, security, and performance reviews
  2. βœ… Best Practices - Language and framework best practices audits
  3. πŸ’‘ Development Guidance - Architectural decisions and technical guidance

Located in: gemini-cli/context-templates/

Copilot CLI Templates

  1. πŸ“Š Data Analysis - Statistical analysis, trend detection, anomaly identification
  2. πŸ§ͺ 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
- Recommendations

Usage: 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

  1. πŸ“Š Use JSON Output: For Gemini CLI, use -o json for structured parsing
  2. πŸ€– Specify Models: For Copilot CLI, choose model based on task (Claude for analysis, GPT for creativity)
  3. πŸ”’ Tool Permissions: Use minimal permissions, expand as needed
  4. πŸ“ Context Management: Use @file syntax explicitly for precise context
  5. πŸ’° Cost Awareness: Monitor API usage, especially with auto-approval modes
  6. βœ… Validate Results: Cross-check AI recommendations, especially for critical decisions
  7. πŸ“ 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:

πŸ“š Documentation

πŸ’Ό 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 references

Example 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 report

Example 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:

  1. πŸ“ New Context Templates: Add templates for additional use cases
  2. βš™οΈ Custom Commands: Share useful Gemini commands in .gemini/commands/
  3. 🎭 Custom Agents: Share Copilot agent configurations
  4. πŸ”„ Integration Patterns: Document successful workflows
  5. πŸ› 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

Copilot CLI

Claude Code

πŸ“„ License

This project is part of the broader agents repository. See repository root for license information.

πŸ’¬ Support

For issues and questions:


Status: βœ… Infrastructure complete | πŸ§ͺ Testing phase complete | πŸš€ Ready for production Last Updated: 2025-11-20 Version: 1.0.0

About

This project enables multi-AI perspectives, consensus-based decision making, and specialized expertise for development tasks, code reviews, data analysis, and research.

Topics

Resources

License

Stars

Watchers

Forks