add-doctor-runbook
Adds a new runbook to an existing doctor and registers it in the runbook index and mode config. Use when extending a doctor's audit coverage with a new check,…
Scaffolds a complete scheduled "doctor" agent directly into the user's repo. The doctor audits app health on a recurring schedule, routes code-fixable findings to an automated repair pipeline that opens pull requests, and files deduped tracker tickets for everything else. A
$ npx -y skills add michellemayes/meta-doctor --skill scaffold-doctor --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/scaffold-doctorContext preview
The summary Claude sees to decide when to auto-load this skill.
Scaffolds a complete scheduled "doctor" agent directly into the user's repo. The doctor audits app health on a recurring schedule, routes code-fixable findings to an automated repair pipeline that opens pull requests, and files deduped tracker tickets for everything else. A
name: scaffold-doctor description: > Scaffolds a complete scheduled "doctor" agent directly into the user's repo. The doctor audits app health on a recurring schedule, routes code-fixable findings to an automated repair pipeline that opens pull requests, and files deduped tracker tickets for everything else. A Slack (or equivalent) digest posts after every run, even if remediation fails. Use when a team wants to deploy an autonomous health-auditing agent alongside their application without copying a pre-built engine — the skill generates the engine in the user's chosen stack by following the bundled reference docs.
Generates a production-ready "doctor" agent inside the target repo by following the pattern described in [`references/architecture.md`](references/architecture.md). **Read that file first** — it defines the module table, data flow diagram, three run modes, and the error-isolation invariant that all generated code must preserve.
---
Ask questions **one at a time**, in the order listed below. Use multiple choice wherever possible. Stack questions come first because they determine which modules get generated and which swap-table rows apply.
---
Ask each sub-question on its own turn.
**1a. Language / runtime**
1) TypeScript (default) 2) Python 3) Other — describe
**1b. LLM provider**
1) Amazon Bedrock (default) 2) Anthropic API direct
**1c. Scheduler**
1) AWS EventBridge + Lambda (default) 2) GitHub Actions 3) POSIX cron / systemd timer 4) Kubernetes CronJob
**1d. VCS**
1) GitHub (default) 2) GitLab
**1e. Tracker**
1) Linear (default) 2) Jira 3) GitHub Issues
**1f. Chat**
1) Slack (default) 2) Microsoft Teams 3) Discord
For any non-default choice, note which swap-table row applies (see [`references/swap-table.md`](references/swap-table.md)) — generation will follow that row exactly.
---
> What is your application's name? (Used as the doctor's identity in the system > prompt, e.g. "Acme Doctor".)
Free text. Store as `PRODUCT_NAME`.
---
> What is the owner/name of the GitHub (or GitLab) repo the doctor will read > from and open PRs against? (e.g. `acme-corp/backend`)
Free text. Store as `REPO_SLUG`.
---
> Which log groups should the doctor scan? List ARNs or names, one per line. > Press enter twice when done. (Default: CloudWatch Logs; describe a different > source if applicable.)
Collect as `LOG_GROUPS[]`. Default lookback: 60 minutes.
---
> Which query tool should runbooks use?
1) AWS Athena (default) 2) Generic SQL (Postgres, MySQL, BigQuery…) — specify driver 3) Prometheus 4) None — runbooks use only log/metric/VCS tools
Store as `DATA_SOURCE`. For non-default choices, generation follows the matching swap-table row in [`references/swap-table.md`](references/swap-table.md).
---
> Primary model ID and AWS region (Bedrock) or plain model string (Anthropic > API)? > > Defaults: `us.anthropic.claude-sonnet-4-6`, `us-east-1`. Press enter to > accept.
Store as `MODEL_ID` and `AWS_REGION`. Fallback model defaults to `us.anthropic.claude-haiku-3-5` (Bedrock) or `claude-haiku-3-5` (Anthropic API).
---
Present defaults; user may override any or all.
| Parameter | Default | |---|---| | `maxPrsPerRun` | 3 | | `maxTicketsPerRun` | 5 | | `maxIterations` (per runbook) | 15 | | `maxTokensPerCall` | 4096 | | `patchCandidates` | 3 | | `maxRepairAttempts` (per CI PR) | 3 |
---
> The example runbook `scan-logs` will be registered as a **daily** runbook. > Do you have additional runbooks to schedule now? (You can add more later with > `add-doctor-runbook`.)
1) No, start with scan-logs only (default) 2) Yes — list names and daily/weekly for each
Collect `DAILY_RUNBOOKS[]` (starts with `["scan-logs"]`) and `WEEKLY_RUNBOOKS[]` (starts empty).
---
Once all answers are collected, generate the doctor engine by following the reference docs below. **Do not restate their content** — implement exactly what they specify.
Follow [`references/architecture.md`](references/architecture.md) — Module Responsibilities table and Default-Stack File Tree. Generate every listed module. For non-default stack choices, apply the relevant rows from [`references/swap-table.md`](references/swap-table.md) before generating.
Follow [`references/agentic-loop.md`](references/agentic-loop.md) completely.
**Port these two reference snippets verbatim** (translated to the target language/stack):
the fallback model before propagating.
text block when the same tool fires three times in a row.
The system prompt must follow the four-section structure in §8 exactly:
1. Identity block — `You are {PRODUCT_NAME} Doctor, an automated auditor for the {PRODUCT_NAME} platform.` 2. Core behavioral contract (static prose as specified). 3. Known gotchas (empty placeholder — keep the heading). 4. Runtime context block + runbook content appended at run time.
The runbook section must always be separated by `---` and the heading `## Skill to execute` — **do not rename this heading**; the control tools depend on it.
Follow [`references/repair-pipeline.md`](references/repair-pipeline.md) for the full five-phase flow and CI auto-repair loop.
**Port these reference snippets verbatim** (translated to the target language):
match-count semantics.
count≥2 t
Most monitoring tells you something broke. A doctor opens the pull request that fixes it.
Repo: michellemayes/meta-doctor
Adds a new runbook to an existing doctor and registers it in the runbook index and mode config. Use when extending a doctor's audit coverage with a new check,…