meta-doctor
Most monitoring tells you something broke. A doctor opens the pull request that fixes it.
meta-doctor is a Claude Code plugin marketplace
that scaffolds autonomous "doctor" agents directly into your repository — scheduled
health auditors that run on a recurring schedule, open PRs for code-fixable findings,
file deduped tracker tickets for everything else, and post a digest after every run.
You describe your stack. The skill generates a production-ready audit-and-repair engine
in your codebase, in your language — not a black-box SaaS, not a vendored binary you
can't read.
Why this exists
Traditional observability stops at the alert. Someone still has to wake up, read the
stack trace, find the file, write the patch, open the PR, and babysit CI. A doctor does
that loop autonomously:
audit → classify → remediate (open PR) or file ticket → post digest
| Most monitoring | A doctor |
|---|
| Fires an alert and waits for a human | Opens a PR with a validated patch |
| Re-pages you for the same error every hour | Dedupes by stable signature — one issue, one work item |
| Goes quiet when the pipeline itself breaks | Always posts a digest, even if remediation fails |
| A dashboard you have to remember to check | Runs on a schedule and comes to you (Slack/Teams/Discord) |
| A closed product you configure | Source code in your repo, in your stack, that you own and extend |
What a generated doctor actually does
Every scheduled run walks the same loop, and each stage is built to be trustworthy:
- Audits via runbooks. Each runbook is a Markdown audit definition (scan error logs,
check data integrity, detect cost anomalies, …) executed through an agentic loop with
real data-plane tools — log queries, metrics, SQL, source-control reads.
- Emits structured findings, not noise. Healthy runs emit zero findings. A finding
is only raised for a confirmed, actionable problem — and every finding becomes a PR or a
ticket, never a "just FYI" that piles up.
- Repairs code automatically — and conservatively. Code-fixable findings flow into a
five-phase repair pipeline that localizes the bug (file → function → line), generates
N independent patch candidates, and ships a PR only when a majority of candidates
agree (self-consistency voting). This is the difference between "an LLM guessed a diff"
and "three independent attempts converged on the same fix."
- Files everything else as deduped tickets. Non-code findings (compliance, data drift,
cost) become tracker tickets, deduped against what's already open so you never get the
same ticket twice.
- Babysits its own PRs. A
repair-ci mode watches the doctor's open PRs, reads failing
CI logs, and pushes fix commits — with a durable, restart-proof attempt counter so it
never loops forever.
- Never goes dark. An error-isolation invariant guarantees the Slack/Teams/Discord
digest posts at the end of every run, surfacing any remediation error so a human can
step in. The expensive audit tokens are never wasted to a downstream failure.
Example: from log line to merged fix
A scan-logs run finds a TypeError firing 47 times in the last hour, traces it to a
real source frame, and emits:
{
"signature": "TypeError:scheduler/poller.ts:142",
"severity": "high",
"category": "code_bug",
"title": "Uncaught TypeError in poller during backfill window",
"description": "TypeError at poller.ts:142 when due_at falls inside a holiday exclusion window; the exception is swallowed and the send is silently dropped.",
"suggestedFix": { "type": "code", "fileHint": "services/scheduler/src/poller.ts", "functionHint": "processWindow" }
}
The orchestrator dedupes it (no open PR for that signature yet), routes it to the repair
pipeline, and you wake up to a PR titled "fix(scheduler): guard processWindow against
undefined tz in holiday window" — already green, because repair-ci fixed the one lint
error CI flagged overnight.
Install
In Claude Code, add this marketplace and install the plugin:
/plugin marketplace add michellemayes/meta-doctor
/plugin install meta-doctor@meta-doctor
Or from the CLI:
claude plugin marketplace add michellemayes/meta-doctor
claude plugin install meta-doctor@meta-doctor
What's included
This marketplace ships one plugin, meta-doctor, which provides two skills:
| Skill | What it does |
|---|
scaffold-doctor | Generates a complete scheduled doctor agent into your repo. Asks about your stack — language, LLM provider, scheduler, VCS, tracker, chat, data source — then generates the engine to match. Finishes only when typecheck and test both pass. |
add-doctor-runbook | Adds a new health check to an existing doctor and registers it. Extends audit coverage without re-scaffolding. |
Once installed, the skills activate automatically when your request matches them
(e.g. "scaffold a health-auditing agent for this repo" or "add a runbook that checks
for stuck queue jobs").
Built for your stack, not a default one
The scaffolder isn't a template dump — it generates against your choices:
| Dimension | Options |
|---|
| Language | TypeScript (default), Python, or describe your own |
| LLM provider | Amazon Bedrock (default) or Anthropic API direct |
| Scheduler | EventBridge + Lambda (default), GitHub Actions, cron/systemd, K8s CronJob |
| VCS | GitHub (default) or GitLab |
| Tracker | Linear (default), Jira, or GitHub Issues |
| Chat digest | Slack (default), Microsoft Teams, or Discord |
| Data source | Athena (default), generic SQL, Prometheus, or none |
Budgets (max PRs/tickets per run, patch-candidate count, repair attempts, token caps) are
all configurable and live in a single config.ts — no magic numbers buried in the engine.
Extending a doctor
Audit coverage is just Markdown. To add a check, run add-doctor-runbook and describe
what to audit, what signals it reads, and what a violation looks like versus expected
noise. The skill authors the runbook, assigns each finding a stable dedup signature, and
registers it in the runbook index and schedule. Add a check today; it runs on the next
scheduled cycle after redeploy.
Repository layout
.
├── .claude-plugin/
│ └── marketplace.json # Marketplace catalog
└── plugins/
└── meta-doctor/
├── .claude-plugin/
│ └── plugin.json # Plugin manifest
└── skills/
├── scaffold-doctor/ # Generates the doctor engine
│ ├── SKILL.md
│ ├── references/ # Architecture, repair pipeline, finding
│ │ └── … # contract, runbook authoring, swap table
│ └── assets/runbooks/ # scan-logs example runbook
└── add-doctor-runbook/ # Adds a runbook to an existing doctor
└── SKILL.md
The references/ directory is the heart of the scaffolder — a set of stack-neutral
contracts (module responsibilities, the five-phase repair pipeline, the finding schema,
self-consistency winner selection) that Claude implements in your chosen language.
Validate
claude plugin validate .
License
MIT — see LICENSE.