mtk-doctor
Skill8 starsChanged 4 days agoMITView on GitHub
MTK install health check — core files, hooks, integrity, active config and environment, with JSON output, safe auto-repair and raw usage counts; use when MTK seems broken or misconfigured.
In this repository34 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- batch-fixSkill
- brainstormingSkill
- code-review-and-qualitySkill
- code-simplificationSkill
- context-engineeringSkill
- fixSkill
- handoffSkill
- implementSkill
- incremental-implementationSkill
- instructionsSkill
- lessonsSkill
- mtk-setupSkill
- mtkSkill
- planning-and-task-breakdownSkill
- pre-commit-reviewSkill
- prior-work-checkSkill
- promote-lessonSkill
- repo-healthSkill
- research-contextSkill
- security-and-hardeningSkill
- setup-auditSkill
- setup-bootstrapSkill
- setup-refreshSkill
- spec-drift-detectionSkill
- spec-driven-developmentSkill
- subagent-implementationSkill
- tech-stack-dotnetSkill
- tech-stack-pythonSkill
- tech-stack-typescriptSkill
- verification-before-completionSkill
- workflow-artifactsSkill
- writing-skillsSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
When the engineer asks "is the toolkit healthy?" or "is anything broken?"
- Distinctive: line 22
After upgrading MTK in a target repo (catch deprecated IDs and hook drift)
- Distinctive: line 33
Run the script: Default: human-readable output.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
MTK Doctor
Overview
mtk-doctor is the holistic health check for an MTK installation. Where validate-toolkit.sh checks structural integrity (manifest matches files, frontmatter shape), the doctor catches runtime rot: deprecated model IDs in agents, an oversized constitution, settings keys Claude Code ignores, missing gitignore entries, stale analytics, dangling hook registrations.
The script ships with the plugin, so run it from ${CLAUDE_PLUGIN_ROOT}. It diagnoses two trees: toolkit checks run against the plugin's own files, project checks (constitution, .claude/settings*.json, .gitignore, lessons, context baseline, environment) against the repo it was run for ($CLAUDE_PROJECT_DIR, else the current directory).
When To Use
- Periodically (e.g. before bumping the toolkit version)
- When the engineer asks "is the toolkit healthy?" or "is anything broken?"
- After upgrading MTK in a target repo (catch deprecated IDs and hook drift)
- In CI as
bash scripts/mtk-doctor.sh --strict --jsonfor dashboards - "What MTK config is active?" — the CONFIG section lists stack, linter packs, domains and agents
- "How are we using MTK?" —
--usage
When NOT To Use
- For structural validation in tight loops — use
validate-toolkit.sh(faster, focused).
Workflow
- Run the script. Default: human-readable output.
bash "${CLAUDE_PLUGIN_ROOT}/scripts/mtk-doctor.sh" - Apply safe fixes. Auto-fix gitignore additions, chmod issues, and the invalid
permissions.allowedToolskey:
Thebash "${CLAUDE_PLUGIN_ROOT}/scripts/mtk-doctor.sh" --fixallowedToolsmigration is the only FAIL--fixrepairs (a lossless key move). Every other FAIL is reported, not fixed. - CI mode. Strict + JSON:
Strict treats WARN as failure (exit 1). JSON output suits dashboards.bash "${CLAUDE_PLUGIN_ROOT}/scripts/mtk-doctor.sh" --strict --json - Usage numbers.
--usage(optionally with--json) skips the health checks and prints the raw.claude/analytics.jsoncounters withn_sessions, spec/plan/lesson counts, thelearnings.sh metricsdecision-origin totals withn_recommendationsand π, and the eval case count plus the newestevals/results/*/aggregate-result.json. There are no healthy ranges: report the numbers with their n and say a ratio over fewer than ~20 sessions or ~10 recommendations is noise.total_operationscounts only Edit/Write/Bash (the evidence ledger sees no Read/Grep/Glob). Read-only. - Triage failures. Each FAIL entry includes a
detailfield pointing at the fix path. Common cases:- "version mismatch" → bump both manifest.json and plugin.json (and marketplace.json) to the same value
- "deprecated model" → update agent frontmatter to a current model ID or alias; "previous-generation model pinned" (WARN) → the alias already follows the current generation
- "uses permissions.allowedTools" → Claude Code has no such key (valid:
permissions.allow/deny/ask), so the list was ignored;--fixrunsscripts/migrate-settings-permissions.shon.claude/settings.jsonand.claude/settings.local.json - "hook missing" → either add the hook script or remove its registration from settings.json
- "skill name mismatch" → rename the directory or update frontmatter
name:to match - "hook basename also wired globally" → confirm the collision is intended; two scripts sharing a filename both run and log indistinguishably
- "hook collision check skipped" → set
CLAUDE_PLUGIN_ROOTso the check can see MTK's hooks; it compared nothing, which is not the same as finding nothing - "formatter missing" → install the stack's formatter, or accept that edits go unformatted (the hook never blocks)
Categories Checked
- CORE — required toolkit files (manifest, plugin.json, README, AGENTS, validate-toolkit); the project's resolved constitution line budget
- COMPONENTS — version sync, skill counts, skill name/directory consistency, deprecated model detection (update
DEPRECATED_MODELSinscripts/mtk-doctor.shwhen Anthropic deprecates more models) - HOOKS — hooks registered in the project's settings.json exist and are executable, event names are documented Claude Code events, all MTK hooks use
set -euo pipefail - PERMISSIONS — the project's
.claude/settings.json/settings.local.jsoncarry nopermissions.allowedTools(FAIL;--fixmigrates it) - INTEGRITY — manifest paths exist, gitignore coverage, analytics freshness, validate-toolkit passes
- CONFIG — the active tech stack and its skill, linter packs with rule counts (core, stack, each
.claude/domainsentry), review agents with their model. WARN when a named stack has notech-stack-*skill or a listed domain has nohooks/linter-patterns/domain-*pack; both silently load nothing - CONTEXT — always-on context baseline (CLAUDE.md + a loaded AGENTS.md + alwaysApply refs, in tokens/bytes), MCP schema count from the project's own
.mcp.json,ENABLE_TOOL_SEARCHstate (report-only, never WARN/FAIL) - ENVIRONMENT — fit between the install and the machine, which structural checks cannot see: MTK hook basenames also wired in the user's global
settings.json, and whether the active stack's formatter binary is actually on PATH. WARN at most — an environment mismatch is never a broken install
Verification
- Output shows non-zero PASS in every category (no empty section)
- Summary line printed last
- Exit code 1 on any FAIL
--strictexits 1 on WARN--jsonoutput is valid JSON parseable byjq--usageprints counts with their n and no verdicts, and writes nothing--fixonly modifies gitignore, file permissions, and theallowedTools→allowkey move; never edits source files
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

