code-doctor
Skill2 starsChanged 4 months agoMITView on GitHub
Review any codebase for committed credentials, unresolved merge conflicts, oversized files, and TODO debt — in any language, including ones with no dedicated tooling. Use when the user wants a repo checked, audited, triaged, or cleaned up and it is not primarily Python or TypeScript: Go, Rust, Ruby, Java, Kotlin, C#, PHP, Swift, Elixir, or a mixed/polyglot tree. Needs no parser, no build, and no install — it reads text and git, so it works on a fresh clone. Separates defects it can prove from unverified leads, and never recommends a fix on heuristic evidence. Triggers on "review this repo", "what's wrong with this codebase", "any secrets committed", "audit this project". For Python use python-code-doctor, for TypeScript use typescript-code-doctor, for Django use django-code-doctor — this skill defers to them and says so. For architecture and understanding rather than defects, use code-visualization.
- Reads credentials
2 other projects use a version of this.
Adopted by
Most recently taken up by
- julweber/ai_agent_skillstheir own version, first seen Mar 20, 2026
- Kubementat/ai_agent_skillstheir own version, first seen Mar 20, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- julweber/ai_agent_skills★ 2same name
- Kubementat/ai_agent_skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository16 other files it gives its agents.
- brutal-reviewSkill
- code-deleterSkill
- code-overviewSkill
- code-visualizationSkill
- django-code-doctorSkill
- fix-issueSkill
- fix-prSkill
- legal-surveySkill
- literature-surveySkill
- pr-visualizationSkill
- python-code-doctorSkill
- rust-code-doctorSkill
- science-investigationSkill
- theory-buildingSkill
- typescript-code-doctorSkill
- update-docsSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
If the user wants to understand a codebase, hand off.
- Distinctive: line 30
Behavior is sacred: Never change what the code does.
- Distinctive: line 38
Every record is one of two kinds, and the difference is enforced in the schema:
- Distinctive: line 44
Never present a candidate as a defect, and never act on one without checking it first.
- Distinctive: line 67
Check before reviewing by hand.
- Very specific: line 99
All detectors share one interface: --format text|json, --ignore type1,type2, 🔴/🟡/🟢 severities.
- Distinctive: line 106
Establish what the repo is: Read the manifest and the entry points.
- Very specific: line 117
Never run one without knowing what it does.
- Distinctive: line 153
Keep every report, then union them:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Code Doctor
A critical reviewer for any codebase. Its job is to find quality problems and bugs, and it works without a parser, a build, an install, or knowing what language it is looking at.
Today it ships two detectors: repository hygiene (merge markers, oversized
files, TODO debt, a committed .env) and committed secrets (key material,
recognisable cloud credentials). Everything else in the family's design —
duplication, dead-code leads, churn hotspots, a project-toolchain runner — is
landing in later plans and is not part of this skill yet.
What this skill is, and is not
It measures quality and bugs. code-visualization explains architecture.
If the user wants to understand a codebase, hand off. This skill emits findings,
never maps or diagrams.
Reviewer mindset (read this first)
Approach the code as too complex until proven otherwise. The default question is not "is this OK?" but "why isn't this simpler?" Two hard limits keep the criticism honest:
- Behavior is sacred. Never change what the code does. If it isn't tested, pin current behavior with a characterization test before refactoring.
- Never assert more than the evidence supports. This skill has no parser. Most of what it observes is heuristic, and saying so is what makes the rest worth reading.
Findings and candidates
Every record is one of two kinds, and the difference is enforced in the schema:
- A finding asserts a defect. It carries a concrete fix.
- A candidate reports a lead needing verification. It carries the specific ways a healthy codebase produces the same observation, and no fix.
Never present a candidate as a defect, and never act on one without checking it first. Recommending an edit on heuristic evidence is how a tool like this talks someone into deleting live code.
Degrade audibly, too: a detector whose evidence can be incomplete (a file it
could not read, git being unavailable for a given path) says so in the report
rather than staying silent about it. Where a specific record's evidence is
incomplete — git could not confirm whether a marker sits in a live conflict,
or whether a file is tracked — the detector reports it as a candidate, with
the uncertainty named in its also_caused_by, rather than asserting it as a
confirmed finding. And it never asserts a negative ("no problems found") from
a scan that lost files it could not read.
The three layers
| layer | what you get | needs |
| raw | works on any text-based repo | git + Python 3.11 |
| the project's own toolchain | whatever it already configured | its Makefile / npm scripts / pre-commit / CI |
| specialist handoff | parser-backed depth | python-code-doctor / typescript-code-doctor installed |
Defer when a specialist exists
Check before reviewing by hand. A specialist sees types and syntax this skill structurally cannot:
| the tree is mostly | load |
| Python | python-code-doctor |
| TypeScript / TSX | typescript-code-doctor |
| Django | django-code-doctor |
This skill also ships scripts/route.py (decides, from the repo's own manifests
rather than a filename census, which specialists are justified) and
scripts/merge_reports.py (unions several doctors' reports into one attributed
envelope). See Routing to the specialists below for the full protocol.
Running the scripts
Let SKILL=/path/to/this/skill — the directory holding this SKILL.md. The
commands run from the project being reviewed, so they need that prefix.
Needs Python 3.11+ and nothing else. The detectors are stdlib-only, so there is nothing to install and no build to wait for.
python "$SKILL/scripts/analyze_all.py" . # everything, unified report
python "$SKILL/scripts/analyze_all.py" . --format json # for tooling
python "$SKILL/scripts/analyze_all.py" . --skip secrets # drop a category
python "$SKILL/scripts/analyze_all.py" . --only hygiene # run one category alone
python "$SKILL/scripts/find_hygiene_issues.py" . # merge markers, oversized files, TODO debt, .env
python "$SKILL/scripts/find_secrets.py" . # key material, cloud credentialsAll detectors share one interface: --format text|json, --ignore type1,type2,
🔴/🟡/🟢 severities. They are deliberately conservative — false negatives over
false positives — so the output stays trustworthy, and a file that cannot be read
is named on stderr rather than counted clean.
Workflow
- Establish what the repo is. Read the manifest and the entry points. If a specialist covers the bulk of it, load that skill and use this one for the rest.
- Run the analyzer. Triage deterministic findings before spending judgment.
- Separate findings from candidates. Act on findings. Verify candidates.
- Find the hot files. Effort follows change frequency, not line count:
Don't refactor cold code.git log --since="1 year ago" --name-only --pretty=format: \ | sort | uniq -c | sort -rn | head -30 - Run the project's own checks — see
references/unknown-language-review.md. Never run one without knowing what it does; alintscript may carry--fix. - Produce a findings artifact.
analyze_all.py's own text output already groups findings ahead of candidates and labels each severity — one smell → one entry → one small PR.
Output & ticketing
The deliverable is always an artifact, never a side effect. Produce a findings list, cards, or JSON. This skill does not create tickets in any system on its own. When the user wants findings filed, ask which tracker or MCP to use and create them through that tool — never assume or fabricate one.
Routing to the specialists
The raw layer works on any repository. Where the project declares a language this repo has a specialist for, that specialist finds things the raw layer cannot, so run it too. Ask the repository, not the filenames:
python "$SKILL/scripts/route.py" <repo> --format jsonIt answers with the specialists the repo's own manifests justify —
python-code-doctor, django-code-doctor, typescript-code-doctor — each
with the evidence: a declared dependency, a tsconfig.json, a manage.py
beside a settings module defining INSTALLED_APPS. A Go service containing
three Python scripts routes nowhere, on purpose — a filename census would send
it to python-code-doctor, which would report the missing pyproject.toml it
was never supposed to have as a finding.
You are half of this protocol. A Python subprocess cannot load a skill, so
route.py only names one and stops — loading it is on you. Run its
analyze_all.py over the repository root, never a package subdirectory,
where a doctor cannot see the root manifest or the test tree and reports their
absence as findings.
Keep every report, then union them:
python "$SKILL/scripts/merge_reports.py" \
--report code-doctor:$WORK/raw.json \
--report python-code-doctor:$WORK/py.json \
--report django-code-doctor:$WORK/dj.json \
--out $WORK/merged.json --format jsonThe envelope carries doctors_run, per-doctor analyzers_run, doctor_errors,
completeness, and every record stamped with the doctor that produced it —
findings and candidates in separate lists. It does not deduplicate: two
security detectors flagging one hardcoded key stay two records, because
collapsing them changes a count a grader divides by, and that decision belongs
to the grader.
Three results are not the same and the envelope keeps them apart:
- A doctor that ran appears in
doctors_runwith itsanalyzers_run. - A doctor that failed appears in
doctor_errors. An empty report file is a failure, not a clean result — re-run it, and if you cannot, say which categories now rest on nothing. - A doctor with no coverage evidence — a bare JSON list, which is what a
single detector and a whole
analyze_django.pyrun both emit — appears incoverage_unknown. Nothing in the file distinguishes a full run from one detector that found nothing, so it grants no coverage.
merge_reports.py exits 1 when every report failed. That is not a clean
repository; it is a merge with no input.
If a routed specialist is not installed, say so and continue with the raw layer. Correctness is the category that suffers: the only correctness-class defect this skill can prove on its own is a merge marker in a path git reports as unmerged, so a consumer that grades this report should leave Correctness ungraded rather than score it from silence.
Reference index (load on demand)
| Load this when… | File |
| Reading critically — the per-unit questions, the triage rubric, how to write a finding | references/critical-review-guide.md |
| Reviewing a language you do not know well; what each heuristic can and cannot support | references/unknown-language-review.md |
When NOT to act
- On a candidate you have not verified. That is what the kind means.
- Untested code — write a characterization test first, then refactor.
- Cold code that never changes and blocks nothing.
- Complexity genuinely forced by an external API or a real present requirement.
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.

