code/docs-doctor/SKILL.md
Audits a repository's documentation for unused docs, wrong details, missing coverage, inaccurate data, broken structure, and writing best-practices. Generates a markdown report (HTML optional) with severity ratings. Supports modes (main, comprehensive, focused, quick), per-profile templates (open-source, internal-docs, blog, nextjs-app), optional --fix for low-risk auto-fixes (broken links, frontmatter, stale dates), and a /feedback subcommand that promotes recurring signals into Learned defaults. Use when you want a "docs doctor" pass on a repo before a release, after a refactor, or as a recurring DX health check.
npx skillsauth add mostafa-drz/claude-skills docs-doctorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Audit a repository's documentation like a doctor: triage what's missing, wrong, stale, structurally broken, or written badly. Produce a severity-ranked report; optionally apply low-risk fixes. Configurable by mode, scope, and template profile. Learns from your feedback over time.
On startup, use the Read tool to load ~/.claude/skills/docs-doctor/preferences.md. If missing, treat as "no preferences set" and continue with Defaults below.
On startup, use the Bash tool to detect: git repo root (git rev-parse --show-toplevel), current branch, and whether package.json / pyproject.toml / Cargo.toml / go.mod is present (for code-doc check selection). Use the Glob tool to list **/*.md, **/*.mdx, and any CLAUDE.md / AGENT.md files. Skip any detection step that fails — do not abort.
Check $ARGUMENTS:
help → display help, then stopconfig → interactive setup, then stopreset → delete ~/.claude/skills/docs-doctor/preferences.md, feedback-journal.md, sessions/, resume-state.md, confirm, stopfeedback → run the feedback flow (see § Feedback & learning), then stoptemplates → list available templates from ~/.claude/skills/docs-doctor/templates/, then stopresume → if resume-state.md exists, continue the last interrupted run; else say No session to resume.--from-template=<name> → load template, merge with flags, runDocs Doctor — audits repository documentation and produces a severity-ranked report
Usage:
/docs-doctor Interactive audit (asks for mode)
/docs-doctor --mode=main Default audit (6 core categories)
/docs-doctor --mode=comprehensive Adds link-check, code-doc drift, freshness vs git
/docs-doctor --mode=quick Smoke check (broken links + frontmatter + stale dates)
/docs-doctor --mode=focused --category=missing-docs
Run a single category
/docs-doctor --from-template=nextjs-app Use a preset profile
/docs-doctor --scope=markdown,frontmatter Limit doc types audited
/docs-doctor --fix Apply low-risk auto-fixes after report
/docs-doctor --html Also emit interactive HTML report
/docs-doctor templates List available templates
/docs-doctor feedback Rate the most recent session
/docs-doctor resume Continue an interrupted run
/docs-doctor config Set preferences
/docs-doctor reset Clear preferences + journal + sessions
/docs-doctor help This help
Categories (for --category):
unused-docs, wrong-details, missing-docs, inaccurate-data,
missing-structure, best-practices
Current preferences:
(loaded from ~/.claude/skills/docs-doctor/preferences.md)
Use AskUserQuestion to collect:
main / comprehensive / quickinfo+ / warn+ / error-onlynever (report only) / interactive (ask per fix) / auto-low-risk (apply allowed fixes without prompt)node_modules/**, vendor/**, .next/**)Write to ~/.claude/skills/docs-doctor/preferences.md in the three-tier format (see § Preferences file format below).
Use the Bash tool to delete the skill's state files:
~/.claude/skills/docs-doctor/preferences.md~/.claude/skills/docs-doctor/feedback-journal.md~/.claude/skills/docs-doctor/sessions/~/.claude/skills/docs-doctor/resume-state.mdConfirm: State cleared. Using defaults next run.
If preferences.md does not exist:
First time using
/docs-doctor? Run/docs-doctor configto set defaults, or continue with sensible defaults (mode=main, scope=markdown+frontmatter+agent-instructions, output=markdown, severity=warn+, fix=never).
Then proceed.
mainmarkdown, frontmatter, agent-instructionsmarkdownwarn+nevernode_modules/**, vendor/**, dist/**, build/**, .next/**, .turbo/**, coverage/**Read ~/.claude/skills/docs-doctor/preferences.md — apply Defaults / Profile / Learned in that order (Learned wins).Read ~/.claude/skills/docs-doctor/feedback-journal.md — note any recurring Signal: lines to bias severity and category emphasis.$ARGUMENTS.--from-template=<name>: Read ~/.claude/skills/docs-doctor/templates/<name>.md, merge template values under flags (flags override template).--mode is unset and not in preferences: use AskUserQuestion to pick mode. Pre-select the Learned mode if one exists, else main.--category is set but --mode is not focused, set --mode=focused.{ mode, scope, output, severity_threshold, fix_policy, ignored_paths, categories, target_files }.Glob to enumerate candidate files based on scope:
markdown: **/*.md, **/*.mdxfrontmatter: subset of markdown that starts with ---code-docs: **/*.{ts,tsx,js,jsx,py,rs,go} (filter by detected project type)agent-instructions: **/CLAUDE.md, **/AGENT.md, **/AGENTS.mdignored_paths.No docs found in scope. Check --scope or --ignored.For each enabled category, run the corresponding checks defined in reference/checks.md. Categories enabled by mode:
| Mode | Categories |
|---------------|-----------------------------------------------------------------------------------------------------|
| quick | wrong-details (broken-links subset), missing-structure (frontmatter only), inaccurate-data (dates) |
| main | all 6 core: unused-docs, wrong-details, missing-docs, inaccurate-data, missing-structure, best-practices |
| comprehensive | main + freshness-vs-git, external-link-check, code-doc-drift, onboarding-flow, search-ability |
| focused | only the category passed via --category |
Each check returns findings with: { file, line?, category, severity, rule, message, suggested_fix? }.
Run checks in parallel where independent (e.g. file-level reads can batch). Use Grep for pattern checks across files, Read for per-file inspection. Defer external network checks (WebFetch) to last; cap to 25 URLs per run unless --mode=comprehensive.
reference/severity.md.severity_threshold.<repo>/.docs-doctor/ if missing. Ensure it's in .gitignore (offer to add if not).<repo>/.docs-doctor/report-<YYYY-MM-DD-HHMM>.md with sections:
--fix requested)--html or output preference is html/both, also write <repo>/.docs-doctor/report-<ts>.html — single-file HTML with chip filters per severity/category (matches Decision Report pattern: hero summary, inline JS filters, gray-out-on-change).~/.claude/skills/docs-doctor/sessions/<YYYY-MM-DD-HHMM>.md with: config used, counts, top findings, decisions taken, follow-ups.--fix passIf --fix was passed and fix_policy ≠ never:
suggested_fix AND rule in the auto-fixable allowlist:
broken-internal-linkfrontmatter-missing-required (only safe defaults)frontmatter-key-disorderstale-last-updatedfix_policy = interactive: for each fix, show diff via AskUserQuestion (Apply / Skip / Apply all remaining).fix_policy = auto-low-risk: apply all allowlisted fixes without prompting; record them in the report.Edit for file changes. Never Write over a file unless creating a new doc the user approved.Destructive or wide-blast fixes (deleting whole docs, rewriting paragraphs) are never auto-applied — always require explicit confirmation.
Print to chat:
Docs Doctor: <mode> mode on <N> files
Errors: X · Warnings: Y · Info: Z
Top issues: <one-liners for top 3>
Report: .docs-doctor/report-<ts>.md
Fixes applied: <count> (if --fix)
Then ask via AskUserQuestion:
End with one line:
Run
/docs-doctor feedback— even one rating helps me sharpen severity and category emphasis for this repo.
Templates live in ~/.claude/skills/docs-doctor/templates/<name>.md. Each template declares default flags as YAML frontmatter:
---
name: <template-name>
description: <one-liner>
inputs: { mode, scope, severity_threshold, fix_policy }
tasks: [ordered-check-keys]
constraints: [rules]
ignored_paths: [globs]
postProcesses: [open-report, append-to-changelog]
---
Loading: when --from-template=<name> is passed, Read the file, parse the frontmatter, merge values under the workflow config (CLI flags still win).
Shipped templates:
open-source.md — emphasises README, CONTRIBUTING, LICENSE, public API docsinternal-docs.md — emphasises onboarding, runbooks, ADRsblog.md — content-first: frontmatter completeness, broken images, draft markers, datesnextjs-app.md — Next.js conventions: route-level docs, app/page coverage, CLAUDE.md sanityTo add a template: drop a new file in templates/ matching the schema above. List them via /docs-doctor templates.
# /docs-doctor preferences
Updated: YYYY-MM-DD
## Defaults
- mode: main
- scope: markdown, frontmatter, agent-instructions
- output: markdown
- severity_threshold: warn+
- fix_policy: never
- ignored_paths: node_modules/**, dist/**, .next/**
## Profile (optional — edit freely)
- (user-editable lines: bias which categories matter, custom severity per repo)
## Learned
- (populated from feedback; promoted after 3+ consistent signals)
When invoked as /docs-doctor feedback:
~/.claude/skills/docs-doctor/sessions/<YYYY-MM-DD-HHMM>.md. If none, say No recent session found. and stop.AskUserQuestion in one batch (4 questions):
--fix was used): all correct / some wrong / no fixes applied~/.claude/skills/docs-doctor/feedback-journal.md:
## <session slug> — <YYYY-MM-DD>
- Mode: <mode>
- Useful categories: <list>
- Noisy categories: <list>
- Severity calibration: <answer>
- Auto-fix accuracy: <answer>
- Output preference: <answer>
- Signal: <one-line generalisation of the takeaway>
Signal:, promote it to ## Learned in preferences.md and tell the user once: Noticed you consistently <signal>. Saved as standing default.Learned rule is contradicted in 2 newer sessions, demote it back to inactive and log the demotion in the journal as Signal: demoted "<rule>" — contradicted by <session-1>, <session-2>.AskUserQuestion rather than invent.resume-state.md with progress so /docs-doctor resume can continue.reference/checks.md and reference/severity.md.development
--- name: triage-board description: >- Generates a structured triage artifact from the current conversation's findings — a self-contained Desktop folder with a JSON Schema, schema-conformant report.json, prose markdown, and a single-file HTML viewer. Viewer ships with MD / CSV / JSON download buttons in the header and a per-finding "Copy as Markdown" action that produces a GitHub/Linear/Notion-ready ticket block. Stateless — triage state lives in the user's ticket system, not in the
development
Runs a beginner-mind end-to-end UI audit of any running app — local dev server, staging, production, or a specific URL. Drives Chrome through every interactive element on the target surface, collects structured findings (severity, category, where, symptom, impact, repro, triage), and hands the result off to `/triage-board` which produces the Desktop folder (schema + JSON + Markdown + single-file HTML viewer with MD/CSV/JSON exports and a per-finding Copy as Markdown button). Use when you want fresh-eyes verification of a feature, page, modal, flow, branch, or whole app — before shipping, before review, before a demo, or any time the UI deserves a careful poke.
development
Reviews the user's past Claude Code conversations from a wellbeing perspective — sentiment, tone, emotional arc, recurring patterns — and generates a supportive, science-grounded report in both Markdown and HTML. Default lookback is 48 hours across all projects. Uses recognised emotion frameworks (Plutchik, Ekman, Russell's circumplex, Pennebaker linguistic markers) and cites the science behind every observation. Learns the user's baseline tone over time so future reports flag genuine shifts, not noise. Use when the user asks for an emotional/wellbeing recap, mood check, sentiment review, or wants to understand their own ups and downs across recent work sessions.
development
--- name: workflow-advisor description: >- Analyzes recent Claude Code conversations and local Claude state (skills, settings, memory files, CLAUDE.md), researches the latest Claude Code features and best practices online, and suggests one workflow improvement at a time with reasoning and a concrete action item. Can save accepted suggestions to memory for tracking. Use when you want to discover underused Claude Code features, improve your development workflow, stay current with the lat