Skip to content

DUBSOpenHub/grid-medic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

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

Repository files navigation

πŸš‘ Grid-Medic

Your agents just ran a mission. Who's checking if they came back healthy?

Grid-Medic is a self-healing meta-agent that monitors, repairs, and continuously improves your AI agent fleet. It reads scan outputs, diagnoses failures, proposes minimal fixes, validates every change across multiple AI models, and auto-applies only what passes consensus.

Think of it as the immune system for your agents. They do the work. Grid-Medic keeps them healthy.


🌍 Works with any agent. Scans .agent.md prompt files for Copilot CLI, but the patterns apply to any AI agent framework. Zero dependencies beyond the Copilot CLI itself.

🏭 Built with Dark Factory β€” 6 AI agents, sealed-envelope testing, validated and shipped.

πŸ”¬ Pairs with Agent X-Ray β€” X-Ray scans your agents for weaknesses. Grid-Medic fixes what it finds.


Why This Tool?

Agents degrade. APIs change, scoring goes stale, edge cases pile up, new capabilities emerge that your agents don't leverage. Manually reviewing and updating 8+ agent prompt files is tedious and error-prone.

Grid-Medic automates the entire maintenance lifecycle:

  • Self-healing β€” detects and fixes API errors (403 misclassification, deprecated endpoints, malformed queries) without human intervention
  • Multi-model validation β€” every change is reviewed by 3 AI models before being applied. No cowboy commits to your agent prompts
  • Full auditability β€” every diagnosis, proposal, validation result, and applied change is logged with rationale
  • Fleet health tracking β€” quality scores per agent, trend lines over time, a dashboard showing which agents need attention

πŸš€ Quick Start

Grid-Medic runs as a Copilot CLI custom agent.

Install

# Copy the agent file to your Copilot agents directory
curl -fsSL https://raw.githubusercontent.com/DUBSOpenHub/grid-medic/main/grid-medic.agent.md \
  -o ~/.copilot/agents/grid-medic.agent.md

Restart your Copilot CLI session (/exit then copilot). Grid-Medic will appear in your agent list.

Run

Open Copilot CLI and say any of these:

grid-medic diagnose                    # Scan all agents for issues
grid-medic improve security-audit      # Focus on one agent
grid-medic review-log                  # See improvement history
grid-medic /path/to/scan-output        # Analyze sweep results

That's it. Point it at your agents and let it work.

πŸ”§ The 5-Phase Improvement Cycle

  πŸ“₯ Input          πŸ” Diagnose        πŸ’Š Prescribe       πŸ§ͺ Validate         βœ… Apply
  ─────────── ──▢ ─────────── ──▢ ─────────── ──▢ ─────────── ──▢ ───────────
  diagnose         Read agents        Generate          Send to 3 models     Auto-apply
  improve X        Detect issues      minimal fixes     (2/3 consensus)      + log everything
  scan output      Categorize         Exact old/new     Approve / Reject     Rollback if broken

Phase 1 β€” Diagnosis

Reads all agent files from ~/.copilot/agents/ and categorizes issues:

Category Icon What It Catches
API Fix πŸ”΄ API calls returning errors, deprecated endpoints, malformed commands
Logic Fix πŸ”΄ Missing fallback logic, edge cases that crash the agent
Scoring 🟑 Formulas that produce unintuitive or unfair results
Output 🟑 Missing evidence citations, broken formatting
Prompt Clarity 🟑 Ambiguous instructions causing inconsistent behavior
Performance 🟑 Redundant API calls, sequential ops that could be parallel
New Dimension 🟒 New data sources or analysis dimensions to add

Phase 2 β€” Prescription

For each issue, Grid-Medic generates a specific, minimal improvement with exact old/new text. No rewrites. Surgical edits only.

Phase 3 β€” Multi-Model Validation

Every proposed change gets sent to 3 AI models in parallel:

  πŸ’Š Proposed Change
      β”‚
      β”œβ”€β”€β–Ά Claude Sonnet    ──▢ βœ… 8/10
      β”œβ”€β”€β–Ά GPT Codex        ──▢ βœ… 7/10
      └──▢ Gemini Pro       ──▢ ❌ 4/10
                                    β”‚
                            2/3 = Apply with note
Consensus Action
3/3 Approve Auto-apply immediately
2/3 Approve Apply with "majority approved" note
1/3 Approve Log as proposed, don't apply
0/3 Approve Reject and log reason

Phase 4 β€” Application

Approved changes are applied to agent files with automatic rollback if anything breaks. YAML frontmatter is validated after every edit.

Phase 5 β€” Logging

Everything is logged to ~/.copilot/grid-medic-log.md and tracked in SQL for cross-session trend analysis.

πŸ“Š Sample Output

πŸš‘ Grid-Medic Report
══════════════════════════════════════════════════════════

πŸ“‹ DIAGNOSIS
  Agents scanned:     8
  πŸ”΄ Errors:          1
  🟑 Inefficiencies:  2
  🟒 Enhancements:    1

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

πŸ’Š IMPROVEMENTS

  [πŸ”΄] security-audit: Fix code-scanning 403 response handling
    Validation: {Sonnet: βœ… 9/10} {Codex: βœ… 8/10} {Gemini: βœ… 9/10} β†’ APPLIED βœ…

  [🟑] msft-impact: Add path: filter to org:microsoft code search
    Validation: {Sonnet: βœ… 8/10} {Codex: βœ… 7/10} {Gemini: βœ… 8/10} β†’ APPLIED βœ…

  [🟑] octoscanner: Add retry logic for stats/commit_activity 202
    Validation: {Sonnet: βœ… 9/10} {Codex: βœ… 8/10} {Gemini: βœ… 7/10} β†’ APPLIED βœ…

  [🟒] compliance-inspector: Add SPDX license list version check
    Validation: {Sonnet: βœ… 6/10} {Codex: ❌ 4/10} {Gemini: βœ… 5/10} β†’ PROPOSED

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

πŸ“Š AGENT HEALTH DASHBOARD
  Agent                  Quality  Issues  Trend
  ──────────────────────────────────────────────
  repo-detective         9/10     0       β†’ Stable
  security-audit         8/10     0       ↑ Fixed (was 6/10)
  contact-info           9/10     0       β†’ Stable
  social-presence        8/10     0       β†’ Stable
  msft-impact            8/10     0       ↑ Fixed (was 6/10)
  compliance-inspector   8/10     1       β†’ Stable
  full-sweep             8/10     0       β†’ Stable
  octoscanner            8/10     0       ↑ Fixed (was 7/10)

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

πŸ“ˆ CUMULATIVE STATS
  Total improvements applied:  3
  Total improvements proposed: 1
  Fleet quality average:       8.3/10

πŸš‘ Grid-Medic signing off.

πŸ›‘οΈ Safety Rules

  • Never break a working agent. If uncertain, propose but don't apply.
  • Validate everything. No change is applied without multi-model consensus (β‰₯ 2/3).
  • Log everything. Every diagnosis, proposal, validation, and application is recorded.
  • Minimal changes. Surgical edits only. Never rewrite an entire agent file.
  • Preserve personality. Agent codenames, emojis, and voice are sacred.
  • Evidence-based. Improvements must be justified by observed failures.
  • Rollback on failure. If a change breaks the file, immediately revert.
  • If no issues are found, say so and sign off. Don't invent problems.

πŸ”¬ Works Great With

Tool How They Work Together
Agent X-Ray X-Ray scans for weaknesses. Grid-Medic fixes them.
Groundhog Day Groundhog backs up your skills. Grid-Medic keeps agents healthy.
Dark Factory Dark Factory builds agents. Grid-Medic maintains them post-deploy.

License

MIT


πŸ™ Created with πŸ’œ by @DUBSOpenHub with the GitHub Copilot CLI.

Let's build! πŸš€βœ¨

About

πŸš‘ Self-healing meta-agent that monitors, repairs, and continuously improves your AI agent fleet

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors