$npx -y skills add michellemayes/meta-doctor --skill scaffold-doctorScaffolds 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
| 1 | # scaffold-doctor |
| 2 | |
| 3 | Generates a production-ready "doctor" agent inside the target repo by following |
| 4 | the pattern described in [`references/architecture.md`](references/architecture.md). |
| 5 | **Read that file first** — it defines the module table, data flow diagram, |
| 6 | three run modes, and the error-isolation invariant that all generated code must |
| 7 | preserve. |
| 8 | |
| 9 | --- |
| 10 | |
| 11 | ## Interactive Flow |
| 12 | |
| 13 | Ask questions **one at a time**, in the order listed below. Use multiple choice |
| 14 | wherever possible. Stack questions come first because they determine which |
| 15 | modules get generated and which swap-table rows apply. |
| 16 | |
| 17 | --- |
| 18 | |
| 19 | ### Q1 — Stack |
| 20 | |
| 21 | Ask each sub-question on its own turn. |
| 22 | |
| 23 | **1a. Language / runtime** |
| 24 | ``` |
| 25 | 1) TypeScript (default) |
| 26 | 2) Python |
| 27 | 3) Other — describe |
| 28 | ``` |
| 29 | |
| 30 | **1b. LLM provider** |
| 31 | ``` |
| 32 | 1) Amazon Bedrock (default) |
| 33 | 2) Anthropic API direct |
| 34 | ``` |
| 35 | |
| 36 | **1c. Scheduler** |
| 37 | ``` |
| 38 | 1) AWS EventBridge + Lambda (default) |
| 39 | 2) GitHub Actions |
| 40 | 3) POSIX cron / systemd timer |
| 41 | 4) Kubernetes CronJob |
| 42 | ``` |
| 43 | |
| 44 | **1d. VCS** |
| 45 | ``` |
| 46 | 1) GitHub (default) |
| 47 | 2) GitLab |
| 48 | ``` |
| 49 | |
| 50 | **1e. Tracker** |
| 51 | ``` |
| 52 | 1) Linear (default) |
| 53 | 2) Jira |
| 54 | 3) GitHub Issues |
| 55 | ``` |
| 56 | |
| 57 | **1f. Chat** |
| 58 | ``` |
| 59 | 1) Slack (default) |
| 60 | 2) Microsoft Teams |
| 61 | 3) Discord |
| 62 | ``` |
| 63 | |
| 64 | For any non-default choice, note which swap-table row applies (see |
| 65 | [`references/swap-table.md`](references/swap-table.md)) — generation will |
| 66 | follow that row exactly. |
| 67 | |
| 68 | --- |
| 69 | |
| 70 | ### Q2 — Product name |
| 71 | |
| 72 | > What is your application's name? (Used as the doctor's identity in the system |
| 73 | > prompt, e.g. "Acme Doctor".) |
| 74 | |
| 75 | Free text. Store as `PRODUCT_NAME`. |
| 76 | |
| 77 | --- |
| 78 | |
| 79 | ### Q3 — Target repo |
| 80 | |
| 81 | > What is the owner/name of the GitHub (or GitLab) repo the doctor will read |
| 82 | > from and open PRs against? (e.g. `acme-corp/backend`) |
| 83 | |
| 84 | Free text. Store as `REPO_SLUG`. |
| 85 | |
| 86 | --- |
| 87 | |
| 88 | ### Q4 — Log source |
| 89 | |
| 90 | > Which log groups should the doctor scan? List ARNs or names, one per line. |
| 91 | > Press enter twice when done. (Default: CloudWatch Logs; describe a different |
| 92 | > source if applicable.) |
| 93 | |
| 94 | Collect as `LOG_GROUPS[]`. Default lookback: 60 minutes. |
| 95 | |
| 96 | --- |
| 97 | |
| 98 | ### Q5 — Data source for audits |
| 99 | |
| 100 | > Which query tool should runbooks use? |
| 101 | ``` |
| 102 | 1) AWS Athena (default) |
| 103 | 2) Generic SQL (Postgres, MySQL, BigQuery…) — specify driver |
| 104 | 3) Prometheus |
| 105 | 4) None — runbooks use only log/metric/VCS tools |
| 106 | ``` |
| 107 | |
| 108 | Store as `DATA_SOURCE`. For non-default choices, generation follows the |
| 109 | matching swap-table row in [`references/swap-table.md`](references/swap-table.md). |
| 110 | |
| 111 | --- |
| 112 | |
| 113 | ### Q6 — Model and region |
| 114 | |
| 115 | > Primary model ID and AWS region (Bedrock) or plain model string (Anthropic |
| 116 | > API)? |
| 117 | > |
| 118 | > Defaults: `us.anthropic.claude-sonnet-4-6`, `us-east-1`. Press enter to |
| 119 | > accept. |
| 120 | |
| 121 | Store as `MODEL_ID` and `AWS_REGION`. Fallback model defaults to |
| 122 | `us.anthropic.claude-haiku-3-5` (Bedrock) or `claude-haiku-3-5` (Anthropic API). |
| 123 | |
| 124 | --- |
| 125 | |
| 126 | ### Q7 — Budgets |
| 127 | |
| 128 | Present defaults; user may override any or all. |
| 129 | |
| 130 | | Parameter | Default | |
| 131 | |---|---| |
| 132 | | `maxPrsPerRun` | 3 | |
| 133 | | `maxTicketsPerRun` | 5 | |
| 134 | | `maxIterations` (per runbook) | 15 | |
| 135 | | `maxTokensPerCall` | 4096 | |
| 136 | | `patchCandidates` | 3 | |
| 137 | | `maxRepairAttempts` (per CI PR) | 3 | |
| 138 | |
| 139 | --- |
| 140 | |
| 141 | ### Q8 — Runbook schedule assignment |
| 142 | |
| 143 | > The example runbook `scan-logs` will be registered as a **daily** runbook. |
| 144 | > Do you have additional runbooks to schedule now? (You can add more later with |
| 145 | > `add-doctor-runbook`.) |
| 146 | ``` |
| 147 | 1) No, start with scan-logs only (default) |
| 148 | 2) Yes — list names and daily/weekly for each |
| 149 | ``` |
| 150 | |
| 151 | Collect `DAILY_RUNBOOKS[]` (starts with `["scan-logs"]`) and |
| 152 | `WEEKLY_RUNBOOKS[]` (starts empty). |
| 153 | |
| 154 | --- |
| 155 | |
| 156 | ## Generation Directive |
| 157 | |
| 158 | Once all answers are collected, generate the doctor engine by following the |
| 159 | reference docs below. **Do not restate their content** — implement exactly |
| 160 | what they specify. |
| 161 | |
| 162 | ### Module list and file tree |
| 163 | |
| 164 | Follow [`references/architecture.md`](references/architecture.md) — Module |
| 165 | Responsibilities table and Default-Stack File Tree. Generate every listed |
| 166 | module. For non-default stack choices, apply the relevant rows from |
| 167 | [`references/swap-table.md`](references/swap-table.md) before generating. |
| 168 | |
| 169 | ### `run-skill` and `prompts/system` |
| 170 | |
| 171 | Follow [`references/agentic-loop.md`](references/agentic-loop.md) completely. |
| 172 | |
| 173 | **Port these two reference snippets verbatim** (translated to the target |
| 174 | language/stack): |
| 175 | |
| 176 | - **Model fallback** (§5): the `createMessage` wrapper that retries once on |
| 177 | the fallback model before propagating. |
| 178 | - **Anti-loop guard** (§4): the `lastCalls` tail-check that injects a nudge |
| 179 | text block when th |