codex-doctor
Skill787 starsChanged 4 months agoMITView on GitHub
Audit Codex installation health and workspace context quality by combining the built-in `codex doctor` report with read-only checks for AGENTS.md scope, instruction bloat or duplication, Skills, MCP, hooks, config, thread-provider history scope, Git state, and repository-root hygiene. Use whenever the user asks for `/doctor`, `/checkup`, Codex health checks, context cleanup, AGENTS.md cleanup, unused or broken Skills/MCP/hooks, missing history after provider changes, slow or polluted context, or asks why Codex is ignoring rules. Default to diagnosis only; never edit, disable, delete, trust, install, update, authenticate, move, or clean anything without a separately approved finding-level diff.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- WardLu/skillstheir own version, first seen Sep 9, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- WardLu/skills★ 1same 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 repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- codex-cli-model-bridgeSkill
- codex-external-handoffSkill
- codex-handoffSkill
- codex-image-genSkill
- codex-model-routing-teamSkill
- codex-skill-adminSkill
- codex-theme-studioSkill
- enterprise-clone-builderSkill
- gpt56-sol-pro-consultSkill
- html-expressSkill
- leadbookSkill
- light-plan-and-workSkill
- scholar-stickersSkill
- skill-open-sourcerSkill
- web-clipperSkill
- wechat-article-searchSkill
- wechat-stylerSkill
- workbuddy-cli-model-bridgeSkill
- wxmp-article-harvesterSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 8 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
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 8
Run a two-layer health check:
- Distinctive: line 11
Run the bundled read-only scanner for workspace context governance that the built-in command does not cover.
- Very specific: line 31
Do not save the raw built-in report inside the repository.
- Distinctive: line 35
Read checks-and-repair-policy.md before proposing any cleanup or repair.
- Very specific: line 43
Treat semantic_candidates as prompts for inspection, not findings.
- Distinctive: line 93
Ask for explicit approval of that finding ID when the change deletes or semantically rewrites instructions, changes config, …
- Distinctive: line 100
delete or weaken safety rules, brand/persona rules, business facts, project facts, Git gates, or directory boundaries
- Distinctive: line 101
delete text merely because it is duplicated across AGENTS.md and CLAUDE.md.
- Distinctive: line 105
run destructive Git commands, clean untracked files, or move protected project directories
- Distinctive: line 115
if repairs were approved, verify each changed file and rerun its domain check
≈ “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
Codex Doctor
Run a two-layer health check:
- Reuse Codex's stable built-in
codex doctor --jsonfor installation, config, auth, runtime, Git environment, terminal, app-server, update, and thread-inventory checks. Derive one narrow provider-scope warning when the default provider represents only a small minority of indexed history. - Run the bundled read-only scanner for workspace context governance that the built-in command does not cover.
The scanner gathers deterministic evidence. You make the semantic judgment. This separation matters because a script can prove that text repeats, but it cannot safely decide that a business fact, safety boundary, brand voice, or directory rule is disposable.
Run the check
Resolve the Skill directory from the loaded Skill path, then run:
python3 <skill-dir>/scripts/scan_workspace.py --cwd "$PWD" --compact-jsonFor a faster workspace-only pass when the built-in report was already run in the same task:
python3 <skill-dir>/scripts/scan_workspace.py --cwd "$PWD" --compact-json --skip-built-in--compact-json preserves every finding and every built-in check row while omitting large Skill inventories and verbose passing-check details. Use --json only when full deterministic inventory evidence is required.
Do not save the raw built-in report inside the repository. If temporary storage is needed, use /tmp and remove it before finishing.
Interpret findings
Read checks-and-repair-policy.md before proposing any cleanup or repair. Keep severity and confidence separate:
S0: proven secret exposure or proven destructive riskS1: broken effective configuration, truncated hard rules, missing enabled executables, or installation/update mismatchS2: exact redundancy, duplicate active names/sources, or a clear project hygiene violationS3: maintenance pressure, stale disabled entries, new-version notice, or oversized descriptionsS4: informational, semantic candidate, or evidence gap
Treat semantic_candidates as prompts for inspection, not findings. Read the relevant source section and classify it as one of:
- behavior rule or safety boundary: preserve
- user preference, brand voice, business fact, or directory contract: preserve
- repo fact that requires multi-file synthesis: usually preserve
- directly discoverable inventory, framework version, dependency list, or directory listing: candidate to trim
- stale or contradictory statement: verify against the repository before proposing a change
Unused Skill evidence
Static discovery cannot prove a Skill is unused. If the user explicitly asks for unused or low-frequency Skills, use the installed codex-skill-admin Skill in read-only audit mode:
python3 <codex-skill-admin-dir>/scripts/codex_skill_admin.py audit-unused --cwd "$PWD" --days 30Report the evidence window and distinct session/source count. Do not disable anything unless the user separately asks and approves the target list.
Report structure
Lead with the overall result, then show only actionable or decision-relevant items:
# Codex 健康检查
状态:PASS / WARN / FAIL
## 需要处理
- [finding id] severity / confidence — conclusion
Evidence: source and observed state
Impact: concrete failure or context cost
Recommendation: exact next action
## 建议人工审查
- semantic candidates with why they may be inferable or stale
## 已通过
- grouped domains, not every low-level row
## Evidence gaps
- checks that cannot be proven from public/local dataPreserve built-in doctor sub-checks as separate facts. For example, an HTTP reachability failure and a WebSocket success must remain two rows; do not collapse them into “the network is broken.”
Repair protocol
Diagnosis does not authorize repair. When the user asks to fix findings:
- Show one finding ID, the exact source, why it is wrong, and a single-file unified diff.
- Ask for explicit approval of that finding ID when the change deletes or semantically rewrites instructions, changes config, enables/disables a component, or moves files.
- Recompute the source file SHA-256 immediately before applying the patch. Stop if it differs from the scan evidence.
- Apply only the approved diff with
apply_patch. - Rerun the relevant check and report the before/after result.
Never automatically:
- delete or weaken safety rules, brand/persona rules, business facts, project facts, Git gates, or directory boundaries
- delete text merely because it is duplicated across AGENTS.md and CLAUDE.md; cross-host parity may be intentional
- execute hooks to measure performance
- trust hooks, log in to MCP, expose credentials, install dependencies, update Codex, or change providers
- modify sandbox, approval, model, network, or authentication settings
- run destructive Git commands, clean untracked files, or move protected project directories
Completion checks
Before reporting completion:
- confirm the scanner made no repository changes
- distinguish built-in Codex diagnostics from workspace-governance findings
- label inference as inference
- report skipped checks and evidence gaps
- if repairs were approved, verify each changed file and rerun its domain check
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.

