Codex Doctor logo

Codex Doctor

Community
zjp1997720
codex-doctor

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.

Overview

Publisherzjp1997720
Repositoryzhijian-skills
Skill namecodex-doctor
Stars
780
Forks
99
Bundled files
5
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 5 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by zjp1997720 on GitHub. Read the source before you install it.

Installation

Install the Codex Doctor AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/zjp1997720/zhijian-skills/tree/main/skills/codex-doctor
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/zjp1997720/zhijian-skills.git /tmp/zhijian-skills
mkdir -p .claude/skills
cp -r /tmp/zhijian-skills/skills/codex-doctor .claude/skills/codex-doctor
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Codex Doctor in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Codex Doctor on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Codex Doctor is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Codex Doctor

Run a two-layer health check:

  1. Reuse Codex's stable built-in codex doctor --json for 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.
  2. 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:

bash
python3 <skill-dir>/scripts/scan_workspace.py --cwd "$PWD" --compact-json

For a faster workspace-only pass when the built-in report was already run in the same task:

bash
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 risk
  • S1: broken effective configuration, truncated hard rules, missing enabled executables, or installation/update mismatch
  • S2: exact redundancy, duplicate active names/sources, or a clear project hygiene violation
  • S3: maintenance pressure, stale disabled entries, new-version notice, or oversized descriptions
  • S4: 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:

bash
python3 <codex-skill-admin-dir>/scripts/codex_skill_admin.py audit-unused --cwd "$PWD" --days 30

Report 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:

markdown
# 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 data

Preserve 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:

  1. Show one finding ID, the exact source, why it is wrong, and a single-file unified diff.
  2. 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.
  3. Recompute the source file SHA-256 immediately before applying the patch. Stop if it differs from the scan evidence.
  4. Apply only the approved diff with apply_patch.
  5. 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

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Codex Doctor AI skill do?

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,...

Why use Codex Doctor on TypingMind?

Because you install it once and use it with any model. Codex Doctor is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Codex Doctor in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/zjp1997720/zhijian-skills/tree/main/skills/codex-doctor. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Codex Doctor?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Codex Doctor?

As many as you like. As long as a model supports skills, you can use Codex Doctor with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Codex Doctor AI skill free?

Yes. It is published on GitHub by zjp1997720 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇