Auto-run the relevant codebase doctor(s) after large edit sessions or before committing. Detects which subsystems were touched and runs the matching doctor or security doctor chain. Use when the agent has completed a significant edit (5+ files), before claiming work is done, or when the user says "run doctors", "health check", "doctor pass", or "check everything."
After a significant edit session, detect which subsystems were touched and run the relevant doctor(s) before reporting completion.
Run this skill when ANY of the following are true:
Check git diff --name-only (staged + unstaged) to determine which doctors to run:
| Files changed match | Run |
|---|---|
wiki/**, skills/**, config/** | npx tsx scripts/doctor.ts (wiki-doctor) |
*.tsx, *.jsx, components/**, app/**, pages/** | npx react-doctor@latest |
| Auth, admin, user input, URL handling, HTML sinks, secrets, API routes, server actions, webhooks, permissions, payments, multi-tenant, or sandbox files | skills/engineering/security-doctor-chain/SKILL.md |
**/*.test.*, **/tests/**, production code under test | Read .agents/skills/tests/SKILL.md, then run smallest honest test layer |
package.json, tsconfig.*, monorepo config | npx @sylphx/doctor (if monorepo) |
| Any frontend files | agent-browser vitals <url> (if dev server running) |
*.tf, infra/** | Project-specific infra doctor |
/tests skill)When the diff touches tests or the code they cover:
.agents/skills/tests/SKILL.md.invariant_* or design_* names that could appear in an architecture doc.Example targeted runs:
cd apps/website && pnpm exec vitest run tests/unit/clerk/user-handlers.test.ts
pnpm test website
pnpm typecheck website# 1. Detect what changed
git diff --name-only HEAD
# 2. Run matching doctors (examples)
npx tsx scripts/doctor.ts # wiki edits
npx react-doctor@latest # React edits
# security-sensitive edits: read skills/engineering/security-doctor-chain/SKILL.md
pnpm test <project> # smallest honest layer after reading tests skill
npx @sylphx/doctor # monorepo structure
agent-browser vitals http://localhost:3000 # frontend running
# 3. Report results
# If any doctor returns failures: fix before committing
# If warnings only: report to user, commit is OK
# If all pass: proceedWhen tests changed, also report:
security-doctor-chain before final no-sus-code-doctor..agents/skills/tests/SKILL.md — invariant naming, smallest honest layer, litmus testsskills/engineering/security-doctor-chain/SKILL.md — security/pre-ship doctor compositionwiki/concepts/doctor-pattern.md — the pattern definition and registrywiki/concepts/lint-enforced-agent-guardrails.md — enforcement hierarchyskills/productivity/wiki-doctor/SKILL.md — wiki-specific doctor