AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Codex Doctor

skill-zjp1997720-zhijian-skills-codex-doctor · by zjp1997720

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

No reviews yet
0 installs
29 views
0.0% view→install

Install

$ agentstack add skill-zjp1997720-zhijian-skills-codex-doctor

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-zjp1997720-zhijian-skills-codex-doctor)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Codex Doctor? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

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

python3 /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:

python3 /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](references/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:

python3 /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:

# 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

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.