Skip to content

gil906/copilot-hive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

32 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Copilot Hive



Agents Pipeline Ideas/Day Monitoring Self-Healing Platform


"What if your entire engineering team was AI β€” and never slept?"

Copilot Hive is an open-source framework for running 13 specialized GitHub Copilot CLI agents as an autonomous development team. They research ideas, implement features, audit code, deploy changes, and fix failures β€” all without human intervention, 24/7.

Architecture Β· Agents Β· Pipeline Β· Self-Healing Β· Get Started


πŸ—οΈ Architecture

Architecture

Three layers work together:

Layer Agents Purpose
πŸ”¬ Research 6 read-only agents Generate 780+ structured ideas per day
⚑ Pipeline Developer ↔ Auditor Implement β†’ Deploy β†’ Verify β†’ Audit β†’ Loop
πŸ›‘οΈ Emergency Fixer + Kuma + SmartThings Monitor, self-heal, alert on failures

πŸ“Έ Copilot Hive UI

This repo's actual interface is the Copilot Hive Project Manager in dashboard.js β€” a dark-mode control panel for registering projects, checking agent status, launching runs, and reviewing setup logs.

🧭 Fleet Overview

Copilot Hive Project Manager UI β€” project cards, agent status, and live logs

From one screen you can wire up a repo, choose which agents should work on it, and watch the hive operate in real time.

πŸš€ Add Project Modal

The setup flow lets you register a local app or clone from GitHub, map health checks and containers, and choose exactly which Hive agents should be enabled for that project.

Copilot Hive add project modal with source selection, paths, health URL, and agent checkboxes

πŸ”Ž Project Detail, Agents, and Logs

Each project gets its own control surface with configuration, per-agent run buttons, competitor discovery, and a live setup log for troubleshooting.

Copilot Hive project detail page with configuration, agents, competitors, and setup log

🐝 The Hive β€” 13 Agents

πŸ”§ Code-Modifying Agents

These are the only agents that touch the codebase. They chain through the event-driven pipeline.

Agent What It Does Trigger
πŸ”§ Developer Reads ALL idea files, implements the best ones, pushes to GitHub Pipeline (continuous)
πŸ” Auditor Security audit, tests, bug fixes, code quality review Pipeline (after Developer)
πŸš‘ Emergency Fixer Reads Docker logs + HTTP diagnostics, fixes critical issues On failure (escalation)

πŸ”¬ Research Agents

Read-only β€” they analyze the codebase and competitors, then write structured idea documents. Never modify code.

Agent Focus Area Output Schedule
🎨 Website Designer Public site UX, animations, landing pages, mobile, conversions 10 ideas ⏱️ Every hour
πŸ–₯️ Portal Designer Dashboard, admin panel, charts, data viz, user settings 10 ideas ⏱️ Every hour
βš™οΈ API Architect API design, scanners, orchestration, performance, new tools 10 ideas ⏱️ Every hour
πŸ”₯ Radical Visionary Game-changers β€” competitor analysis, AI innovation, disruption 5 transformative ⏱️ Every 2h
βš–οΈ Lawyer Privacy policies, ToS, legal compliance, competitor legal 5 ideas ⏱️ Every 2h
πŸ“‹ Compliance SOC2, PCI-DSS, HIPAA, ISO 27001 readiness 5 ideas ⏱️ Every 2h

πŸ“Š Support

Agent What It Does Schedule
πŸ“§ Reporter Sends HTML email summaries of all agent activity Daily + Weekly
πŸš€ Deployer GitHub Actions β€” builds Docker images, deploys via SSH On git push

πŸ’‘ Idea Flow

Idea Flow

Research agents write structured markdown files to ideas/. The Developer reads all 6 files and picks the highest-impact ideas to implement:

ideas/web_design_latest.md    ─┐
ideas/portal_design_latest.md  β”‚
ideas/api_architect_latest.md  β”œβ”€β”€β–Ά  πŸ”§ Developer picks best ideas
ideas/radical_latest.md        β”‚     implements β†’ pushes β†’ deploys
ideas/lawyer_latest.md         β”‚
ideas/compliance_latest.md    β”€β”˜
Per Hour30 specialist ideas (10 web + 10 portal + 10 api)
Per 2 Hours+ 15 strategic ideas (5 radical + 5 lawyer + 5 compliance)
Per Day~780 total ideas feeding the Developer agent

⚑ Event-Driven Pipeline

Pipeline State Machine

The Dispatcher (copilot-dispatcher.sh) runs every 60 seconds via cron and orchestrates the continuous Developer ↔ Auditor loop:

State What's Happening
πŸ’€ Idle Ready to launch next agent in the chain
πŸ”§ Running Agent is actively working (PID tracked, monitored)
⏳ Deploy Code pushed β€” waiting for GitHub Actions + Docker deploy + version verification
πŸ”§ Fixing Deploy failed β€” re-running the agent that broke it (2 retries before πŸš‘ escalation)

What a Cycle Looks Like

07:01  πŸ“‘ Dispatcher β†’ launches Developer
07:35  πŸ”§ Developer β†’ implements 3 features from idea files
07:36  πŸ”§ Developer β†’ stamps build-id, pushes to GitHub
07:37  πŸš€ GitHub Actions β†’ builds container, deploys via SSH
07:39  πŸ“‘ Dispatcher β†’ calls /api/version β†’ confirms NEW container is live βœ…
07:39  πŸ“‘ Dispatcher β†’ launches Auditor
08:05  πŸ” Auditor β†’ finds 2 security issues, fixes them
08:06  πŸ” Auditor β†’ stamps build-id, pushes to GitHub
08:08  πŸ“‘ Dispatcher β†’ version verified βœ… β†’ launches Developer
08:08  ♻️  New cycle begins...

πŸ”– Version Verification

"Did the deploy actually work?" β€” Copilot Hive doesn't just check if a container is running. It verifies the exact version matches.

1. Agent stamps a unique build ID before committing:

BUILD_ID="$(date +%s)-$(openssl rand -hex 4)"
echo "$BUILD_ID" > .build-id
git add -A && git commit && git push

2. App exposes it via API:

GET /api/version β†’ {"build_id": "1740234567-a1b2c3d4", "status": "running"}

3. Dispatcher verifies after deploy:

RUNNING=$(curl -s localhost:8080/api/version | jq -r '.build_id')
[ "$RUNNING" = "$EXPECTED" ] && echo "βœ… New container live" || echo "⏳ Still deploying..."

This prevents the next agent from working against stale code when a deploy fails silently.


πŸ›‘οΈ Smart Failure Coordination

When a deploy breaks, the system follows an intelligent escalation path β€” the agent that broke things gets first chance to fix it:

Failure Coordination

Key insight: The agent that pushed the bad code has the most context about what changed β€” it's the best candidate to fix it. Emergency Fixer is the last resort, armed with full diagnostics.


πŸ₯ Health Monitoring & Self-Healing

Uptime Kuma

Uptime Kuma monitors all services with dashboards and history:

Monitor Type Target Interval
Website HTTP port 80 60s
API Health HTTP /health 60s
API Version HTTP /api/version 60s
External HTTPS your domain 60s
Database TCP port 5432 60s
Web Container Docker container status 60s
API Container Docker container status 60s
DB Container Docker container status 60s

Alert threshold: 30 minutes β€” if a service is down for 30 consecutive checks, the webhook fires.

Webhook β†’ Emergency Fixer Flow

Uptime Kuma detects service DOWN for 30 min
         β”‚
         β”œβ”€β”€ Is an agent already working on it? β†’ Skip
         β”œβ”€β”€ Cooldown active (10 min)? β†’ Skip
         β”‚
         β”œβ”€β”€ Write .alert-context.json (monitor, error, pipeline state)
         └── Launch πŸš‘ Emergency Fixer with full context

πŸ“± SmartThings Notifications

Agents send push notifications to your phone via Samsung SmartThings:

Agent fails β†’ notify-smartthings.sh β†’ Toggle CopilotAlert switch
β†’ SmartThings Automation β†’ Push notification to phone πŸ“±

🚨 Urgent Idea System

Need something implemented right now? Submit an urgent idea to ideas/admin_ideas.json:

{ "title": "Add rate limiting", "urgent": true, "status": "pending" }

Every agent checks for urgent ideas at startup. The very next agent to run β€” whether it's the Website Designer, Lawyer, or Compliance Officer β€” temporarily becomes a developer, implements the idea, pushes it, then returns to its normal role.


πŸ”¬ Agent Prompts

πŸ”₯ Radical Visionary β€” the most ambitious agent
YOUR MISSION: You are the VISIONARY β€” the most important research agent.
Unlike the 3 specialist agents who focus on incremental improvements,
YOUR job is to find the BIG IDEAS β€” the ones that make the platform
10x better overnight.

You provide exactly 5 ideas per run β€” each must be TRANSFORMATIVE:
  πŸ”₯ Ideas that create massive visual impact β€” jaw-dropping dashboards
  πŸ”₯ Ideas that leapfrog competitors β€” features nobody else has
  πŸ”₯ Ideas that dramatically improve performance β€” 10x faster
  πŸ”₯ Ideas that bring cutting-edge AI/ML in ways competitors haven't

QUALITY BAR: Each idea should be worth MORE than all 10 ideas
from any specialist agent combined. Think disruption, not polish.
πŸ”§ Developer β€” reads all ideas, implements the best
You are the DEVELOPER agent. Part of a thirteen-agent autonomous team.

Read the following idea files and implement the best improvements:
  - ideas/web_design_latest.md   (Website Designer β€” 10 ideas)
  - ideas/portal_design_latest.md (Portal Designer β€” 10 ideas)
  - ideas/api_architect_latest.md (API Architect β€” 10 ideas)
  - ideas/radical_latest.md      (Radical Visionary β€” 5 game-changers)
  - ideas/lawyer_latest.md       (Lawyer β€” legal ideas)
  - ideas/compliance_latest.md   (Compliance β€” certification ideas)

Pick the highest-impact ideas and implement them. Use --yolo mode.
After implementation, stamp .build-id and push to GitHub.
πŸ”¬ Research agents β€” read-only enforcement
# Research agents use --deny-tool to prevent code modifications:
copilot --deny-tool "bash(git push*)" \
        --deny-tool "bash(git commit*)" \
        --deny-tool "bash(git add*)" \
        --add-dir "/opt/yourproject:ro"  # Read-only access

⏰ Schedule

# PIPELINE β€” every minute
* * * * *  copilot-dispatcher.sh

# SPECIALISTS β€” every hour (10 ideas each)
0  * * * *  copilot-designer-web.sh
5  * * * *  copilot-designer-portal.sh
10 * * * *  copilot-architect-api.sh

# VISIONARY + SUPPORT β€” every 2 hours
15 0,2,4,6,8,10,12,14,16,18,20,22 * * *  copilot-radical.sh
20 0,2,4,6,8,10,12,14,16,18,20,22 * * *  copilot-lawyer.sh
25 0,2,4,6,8,10,12,14,16,18,20,22 * * *  copilot-compliance.sh

# REPORTER
0 18 * * *    copilot-reporter.sh daily
0 18 * * 0    copilot-reporter.sh weekly

πŸ–₯️ Supported Platforms

Platform Status Install Method Scheduling
🐧 Linux (Ubuntu, Debian, etc.) βœ… Full support Native or Docker cron
🍎 macOS (Intel & Apple Silicon) βœ… Full support Native or Docker Desktop launchd
πŸͺŸ WSL 2 (Windows) βœ… Full support Native (in WSL) or Docker Desktop cron
🐳 Docker Desktop βœ… Full support docker compose up -d Built-in
πŸ“ Raspberry Pi (ARM64) βœ… Full support Native cron

Windows native is not supported β€” use WSL 2 or Docker Desktop instead.

All shell scripts use the built-in platform-detect.sh library for cross-platform compatibility:

  • File locking: flock on Linux/WSL, mkdir-based atomic lock on macOS
  • Hex encoding: xxd β†’ od β†’ hexdump fallback chain
  • File stats: OS-aware stat flags
  • Docker socket: Auto-detects Docker Desktop, Colima, Podman
  • Scheduling: Installer auto-picks cron (Linux/WSL) or launchd (macOS)

πŸš€ Getting Started

One-Line Install

curl -fsSL https://raw.githubusercontent.com/gil906/copilot-hive/main/install.sh | bash

The interactive installer will:

  1. βœ… Check prerequisites (git, curl, python3, docker, Copilot CLI)
  2. πŸ“ Clone the repo to /opt/copilot-hive (or your preferred location)
  3. βš™οΈ Walk you through project configuration (paths, containers, URLs)
  4. πŸ“ Generate your config.sh with all settings
  5. ⏰ Install the crontab with all agent schedules
  6. πŸš€ You're ready β€” the hive starts working!

Manual Install

# 1. Clone
git clone https://github.com/gil906/copilot-hive.git /opt/copilot-hive
cd /opt/copilot-hive

# 2. Run installer
bash install.sh

# β€” or configure manually β€”

# 3. Edit config
cp .env.example .env               # Add your tokens
nano config.sh                      # Set PROJECT_DIR, GH_REPO, container names

# 4. Add version endpoint to your app
# GET /api/version β†’ {"build_id": "...", "status": "running"}

# 5. Install crontab
crontab crontab.example

# 6. Optional: Start health webhook
python3 health-webhook.py &

Docker Install

git clone https://github.com/gil906/copilot-hive.git /opt/copilot-hive
cd /opt/copilot-hive

# Edit config
cp .env.example .env
nano config.sh                      # Set your project paths

# Start the hive
docker compose up -d

npm Install (prompts & CLI only)

npm install -g @gil906/copilot-hive

copilot-hive list                    # List all agent prompts
copilot-hive show developer          # View Developer agent prompt
copilot-hive init ./my-hive          # Scaffold agent scripts

Test Before Going Live

# Dry-run mode β€” agents work but don't push to GitHub
./copilot-improve.sh --dry-run
./copilot-audit.sh --dry-run

# Pause all agents
touch /opt/copilot-hive/.agents-paused

# Resume
rm /opt/copilot-hive/.agents-paused

Prerequisites

  • GitHub Copilot CLI β€” copilot command
  • Docker + Docker Compose
  • Git with credentials configured (~/.git-credentials)
  • A Dockerized application with a /api/version health endpoint
  • Python 3 + Node.js (for webhook and CLI)

Customization

What How
Change project settings Edit config.sh (single file)
Add research agents Copy any copilot-designer-*.sh, change the prompt focus
Change idea counts Edit "EXACTLY 10 ideas" in prompts/*.md
Adjust schedules Edit crontab entries (crontab -e)
Change escalation Set MAX_FIX_RETRIES in config.sh
Add notifications Swap SmartThings for Slack/Discord/Telegram
Edit prompts Modify files in prompts/ directory (loaded at runtime)
Test safely Use --dry-run flag on any pipeline agent

πŸ“ Files

Full file reference
File Purpose
copilot-dispatcher.sh πŸ“‘ Pipeline orchestrator (runs every 1 min)
copilot-improve.sh πŸ”§ Developer agent
copilot-audit.sh πŸ” Auditor agent
copilot-emergencyfixer.sh πŸš‘ Emergency fixer with diagnostics
copilot-designer-web.sh 🎨 Website Designer (10 ideas/hour)
copilot-designer-portal.sh πŸ–₯️ Portal Designer (10 ideas/hour)
copilot-architect-api.sh βš™οΈ API Architect (10 ideas/hour)
copilot-radical.sh πŸ”₯ Radical Visionary (5 game-changers/2h)
copilot-lawyer.sh βš–οΈ Lawyer agent
copilot-compliance.sh πŸ“‹ Compliance agent
copilot-reporter.sh πŸ“§ Email reporter
copilot-deployer.sh πŸš€ Deployment helper
copilot-gitguardian.sh πŸ” Secret scanner
copilot-regressiontest.sh πŸ§ͺ Regression tester
health-webhook.py πŸ₯ Uptime Kuma β†’ Emergency Fixer bridge
notify-smartthings.sh πŸ“± Push notification sender

🀝 Contributing

Contributions welcome! Some ideas for extending the hive:

  • πŸ†• New agent types (Performance, Accessibility, i18n, SEO)
  • οΏ½οΏ½ Web dashboard for agent status and idea management
  • πŸ”Œ Slack/Discord/Telegram notification integrations
  • 🐳 Docker Compose for the entire hive infrastructure
  • πŸ“ˆ Prometheus/Grafana metrics for agent analytics

πŸ“„ License

MIT License β€” see LICENSE


Built with GitHub Copilot πŸ€–

🐝 The hive never sleeps.

About

🐝 Autonomous AI Agent Swarm β€” 11 GitHub Copilot agents that research, develop, audit, and deploy improvements to production apps 24/7. Self-healing, version-verified, event-driven pipeline. 780+ ideas/day.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors