filip-podstavec/claude-leverage/repo-doctor
Claude Code and agent skill by filip-podstavec/claude-leverage
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
USE WHEN inheriting a legacy repo, when user asks "what's missing for AI-first work here?", "is this repo agent-ready?", "audit my repo", "is anything out of sync with the code?", or when the bare-repo-nudge / cheatsheet hook suggests a checkup. Read-only AI-readiness audit — scores ~24 dimensions across Foundation (AGENTS.md / CLAUDE.md / per-dir AGENTS.md), Why (ADRs + session logs), What (GLOSSARY.md + architecture.yml), In-code (AIDEV anchor density + overdue), Hygiene (tests, LOC ratio, structured logging, .gitignore, README, manifest, CI config, .env.example, repro env, secret guardrails), AND Sync (code↔docs drift: arch-map vs disk, glossary vs code, per-dir AGENTS.md vs dir activity, CHANGELOG vs version, README slash-refs). Each gap → concrete fix action. Reports a readiness level L0-L4 (gated, ADR 0012) + local score trend; --fix walks the top gaps; --semantic adds an advisory truthfulness review via the readiness-reviewer subagent. Differentiated from /init-repo (one-shot bootstrap, writes files) and /stack-check (time-based freshness) — this skill answers completeness, drift AND (opt-in) truthfulness in one pass. See ADR 0006 (initial design), ADR 0007 (Sync addition), ADR 0012 (levels + deterministic core) for rationale.
Install
npx vskill@latest install filip-podstavec/claude-leverage/repo-doctorSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
/repo-doctor
What it does
Reads the current repo and answers the question prose AGENTS.md doesn't cheaply answer per session: what's missing for AI-first work here? Output is a Markdown report scored across ~24 dimensions, with a concrete fix action per gap (often "invoke /X").
Read-only on the repo; writes only local state (see Hard rules). The skill is an audit, not a bootstrap.
This skill complements three existing ones with clean differentiation:
| Skill | Question it answers | |
|---|---|---|
/init-repo | "Set this fresh repo up." (writes files) | |
/stack-check | "What I have — is it stale?" (freshness audit) | |
/repo-doctor | "What I don't have — what's missing?" (presence + drift + opt-in truthfulness; guided handoff via `--fix`) | |
/security-review | "Is this diff safe to commit?" (orthogonal — code-level scan) | |
/dynamic-check | "Do the declared commands actually run?" (executes code — opt-in, separate skill per ADR 0013) |
When to invoke
- Inheriting an existing repo (legacy or new-to-you) and wondering
what's missing for AI-first development.
- After
/init-reporan, to see what else the bootstrap didn't
cover.
- Periodically (every few months) to catch drift.
- When the
skill-cheatsheetSessionStart hook suggests a checkup. - Before pitching a "make this repo agent-ready" piece of work to a
client — output is a ready-made list of concrete improvements.
Do NOT invoke for:
- Day-to-day "is this stale" checks — that's
/stack-check. - Security audit of changes — that's
/security-review. - One-shot setup — that's
/init-repo.
Output format
Dimensions
How each dimension can be gamed — and what counters it: `docs/repo-doctor-gaming.md`. Read it before trusting a suspiciously green report.
Predicate P (no-code repo): the repo has zero tracked files matching the Dim 3 code-extension list (which includes .sh — shell is code). Dimensions that reference P return N/A when it holds — a docs-only repo gets no verdict (and no free ✅) on code-shaped checks.
Prefer the dedicated Grep/Glob tools for pattern scans. The Bash allowlist covers simple single-binary helper calls only — compound commands and VAR=$(...) assignments (the history slug/append in step 5b) do not prefix-match any allowlist entry and ride the session's normal permission prompt by design (ADR 0012, Decision 6).
Foundation (3 checks — loaded every session, agent-facing)
- `AGENTS.md` (root) —
test -f AGENTS.md. Evaluate the size bands
largest-first (a 40 KiB file is a fail, not a warn):
- ❌ if missing.
- ❌ if size > 32 KiB — Codex silently drops content beyond
project_doc.max_bytes (32768), so part of the file is invisible to Codex agents. This is data loss, not a style nit.
- ⚠️ if size > 8 KiB — lean target exceeded; extract topic depth to
docs/ behind a when-to-read link. See ADR 0009.
- ✅ otherwise. Report size in KiB.
- `CLAUDE.md` (root) —
test -f CLAUDE.md.
- ❌ if missing.
- ⚠️ if exists but doesn't contain
@AGENTS.md(i.e., diverges
from canonical guidance — split surface to maintain).
- ✅ if exists with
@AGENTS.mdimport.
- Per-directory `AGENTS.md` — for each top-level source dir
(heuristic: has files matching *.py|*.ts|*.tsx|*.js|*.jsx|*.go|*.rs|*.java|*.rb|*.php|*.cs|*.kt|*.swift|*.sh|*.bash) compute LOC (wc -l aggregated). For each with > 500 LOC and no AGENTS.md at that dir root, count it.
- ✅ if 0 such dirs.
- ⚠️ if 1–3.
- ❌ if ≥4 (the per-module conventions story is broken at scale).
- Report names of the offending dirs (top 5).
Why (2 checks — load-bearing rationale)
- ADRs —
ls docs/adr/ 2>/dev/null | grep -E '^[0-9]{4}-.*\.md$'.
- ❌ if
docs/adr/absent OR 0 numbered ADR files. - ⚠️ if 1–2 (suspiciously few for any real project).
- ✅ if ≥3.
- Report count.
- Session logs —
ls docs/sessions/*.md 2>/dev/nulland parse
the date from filename (YYYY-MM-DD-topic.md) or mtime fallback.
- ❌ if
docs/sessions/absent OR 0 logs. - ⚠️ if most recent log > 60 days old.
- ✅ if most recent ≤ 60 days.
- Report age of newest log.
What (2 checks — v1.5.0 additions)
- `GLOSSARY.md` —
test -f GLOSSARY.md.
- ❌ if missing.
- ⚠️ if exists but >30% of entries are
<TODO>placeholders
(parse H2 sections, count those whose body contains the literal <TODO>).
- ✅ otherwise. Report entry count.
- `architecture.yml` —
test -f architecture.yml.
- ❌ if missing.
- ⚠️ if exists but >30% of modules have
<TODO>placeholders
for role or stability.
- ✅ otherwise. Report module count.
In-code discoverability (2 checks)
- AIDEV anchor density —
grep -rE 'AIDEV-(NOTE|TODO|QUESTION)'
across tracked files (skip bench archive, vendor, node_modules, __pycache__, .git, dist, build; exclude matches inside test files — there they are overwhelmingly fixture string literals, not anchors). Count matches. Divide by total tracked code LOC (git ls-files filtered to code extensions incl. .sh → wc -l). Express as anchors-per-KLOC. Bands use half-open intervals ([a, b)) so every value falls in exactly one band:
- ❌ if density
< 0.3/KLOCAND total LOC> 1000(the repo is
big enough that the absence is signal).
- ⚠️ if density
[0.3, 1.0)/KLOC(sparse for an AI-first repo). - ✅ if density
[1.0, 10.0]/KLOC(typical). - ⚠️ if density
> 10/KLOC(anchor noise — clutter dilutes
load-bearing ones).
- Overdue / due-soon anchors — borrowed from
/stack-check's
anchor walk (intentional overlap; /stack-check provides the full actionable detail, this dimension just surfaces the count in the completeness report). Parse AIDEV-(TODO|QUESTION)(by: YYYY-MM-DD) and compare to today. File scope mirrors the overdue-todo-nudge hook: source code only — skip markdown/json and the docs/templates/tests/bench/workflows trees (that's where the convention's own example anchors and fixture literals live), and apply the first-token rule (an AIDEV-NOTE quoting a TODO example doesn't count).
- ✅ if 0 overdue AND 0 due-soon.
- ⚠️ if ≥1 due-soon (next 14 days) but 0 overdue.
- ❌ if ≥1 overdue. Report top 3 with
file:lineand days
overdue; remind to run /stack-check for the rest.
Engineering hygiene (6 checks)
- Tests present — exists
tests/dir OR ≥1 file matching
**/test_*.{py}, **/*_test.{go,py}, **/*.test.{ts,tsx,js,jsx}, **/*.spec.{ts,tsx,js,jsx}, **/*Test.{java,kt}, etc.
- ❌ if 0 test files found.
- ⚠️ if 1–4 test files for repos with > 1000 LOC.
- ✅ otherwise. Report count.
- Test-to-source LOC ratio — sum LOC of test files (above
patterns) divided by sum LOC of source files (excluding tests, excluding the same noise paths as anchor walk). Bands use half-open intervals so every value falls in exactly one band. Note: the ❌ floor at 0.15 is claude-leverage's own judgment (below that the test suite is decorative); the ✅ band of [0.5, 1.5] is anchored on the Count.co healthy range of 0.5–1.0.
- ❌ if
ratio < 0.15. - ⚠️ if
[0.15, 0.5)(below the healthy range). - ✅ if
[0.5, 1.5](healthy). - ⚠️ if
ratio > 1.5(possible over-testing of trivial code
— judgment call).
- If ⚠️ or ❌, also report the largest source directory by LOC
with no tests inside it; that's the highest-ROI place to add coverage.
- Structured logging — grep for unstructured logging patterns
(print(, console\.(log|info|warn|error)\(, fmt\.Print, println!) vs structured logger imports (structlog, pino, slog, tracing::, log/slog).
- N/A if no programming language with an app-logging convention
is detected, OR the print(-style hits are CLI stdout of scripts/generators rather than application logging (shell-heavy meta-repos, build tooling — stdout IS their interface). N/A shrinks the divisor; don't award a ✅ for logging that doesn't exist.
- ❌ if ≥10 unstructured app-logging calls AND no
structured-logger import detected.
- ⚠️ if mixed (both kinds present).
- ✅ if all app logging looks structured.
- `.gitignore` claude-leverage state — `grep -E
'\.last-stack-check|claude-leverage' .gitignore`.
- ❌ if
.gitignoremissing entirely. - ⚠️ if exists but no claude-leverage state patterns AND state
files exist in the repo (would otherwise be tracked).
- ✅ otherwise.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/repo-doctor/SKILL.md
Popularity
- Repository stars
- 68
- Repository forks
- 3
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/filip-podstavec/claude-leverage/repo-doctor)