Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gil906/copilot-hive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Copilot Hive



Agents Pipeline Ideas/Day Monitoring Self-Healing


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

Copilot Hive is an open-source framework for running 11 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

🐝 The Hive β€” 11 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 an eleven-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

πŸš€ Getting Started

Prerequisites

  • GitHub Copilot CLI (copilot command)
  • Docker + Docker Compose
  • A Dockerized application with a health endpoint
  • Git credentials configured (~/.git-credentials)

Quick Setup

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

# 2. Configure
cp .env.example .env         # Add your tokens
# Edit scripts: set PROJECT_DIR to your app's source code path

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

# 4. Install crontab
crontab crontab.example

# 5. Optional: Start monitoring
docker-compose -f monitoring.yml up -d

Customization

What How
Add research agents Copy any copilot-designer-*.sh, change the prompt focus
Change idea counts Edit "EXACTLY 10 ideas" in prompts
Adjust schedules Modify crontab entries
Change escalation Edit MAX_FIX_RETRIES in dispatcher
Add notifications Swap SmartThings for Slack/Discord/Telegram

πŸ“ 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