GitHunt
WE

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.

๐Ÿ“‹ 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

weorbitant/claude-code-agentic-research-orchestrator | GitHunt