一键导入
doctor
Run environment and workspace diagnostics, auto-fix what it can, and report blockers. Use at session start or when something seems broken.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run environment and workspace diagnostics, auto-fix what it can, and report blockers. Use at session start or when something seems broken.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run the author side of the review loop: request review, poll for feedback, optionally delegate triage or isolated fixes to Codex subagents, address findings, and report progress through inbox plus PR comments.
Run the author side of the review loop — address findings and drive to LGTM. Single-pass by default (exits after sending messages); use --poll for in-session polling. Hybrid split — leader handles Bash I/O, subagent does code fixes only.
Run the reviewer side of the review loop: gather PR context, optionally delegate read-only review analysis to a Codex subagent, write findings packets, and send feedback or LGTM.
Run the reviewer side of the review loop — review PR diffs, produce findings, and evaluate quality gate. Single-pass by default (exits after verdict); use --poll for in-session round 2 polling. Hybrid split — leader handles Bash I/O, subagent does analysis only.
Synthesize org-memory — fold new events into recent.md, promote cross-repo patterns to decisions.md and rules.md, and audit for staleness, cross-file conflicts, and drift. Invoke whenever the user asks "synthesize org-memory", "fold events", "is recent.md stale", "audit org-memory", or any phrasing like "did we synthesize org-memory" — even if they do not explicitly type the slash command.
Synthesize org-memory — fold new events into recent.md, promote cross-repo patterns to decisions.md and rules.md, and audit for staleness, cross-file conflicts, and drift. Invoke whenever the user asks "synthesize org-memory", "fold events", "is recent.md stale", "audit org-memory", or any phrasing like "did we synthesize org-memory" — even if they don't explicitly type the slash command.
| name | doctor |
| description | Run environment and workspace diagnostics, auto-fix what it can, and report blockers. Use at session start or when something seems broken. |
Run oacp doctor to check environment health, workspace structure, inbox state, YAML schemas, and agent status. Auto-fixes safe issues and reports blockers that need human intervention.
/doctor [--project <name>]
--project <name> — Which project to check. Auto-detected from .oacp project marker (may be a symlink to workspace.json) if omitted.When the user runs /doctor, do the following:
Before anything else, check that the CLI is available:
command -v oacp >/dev/null 2>&1 || echo "NOT_FOUND"
If not found, report immediately: "oacp CLI not found. Install: pip install oacp-cli" and stop.
If --project was provided, use it directly. Otherwise auto-detect:
PROJECT=$(python3 -c "import json; print(json.load(open('.oacp'))['project_name'])" 2>/dev/null || echo "")
If empty, ask the user which project to check. If the user only wants environment checks (no project), run without --project.
Run the doctor command with --fix and --json for structured parsing:
oacp doctor --project "${PROJECT}" --fix --json 2>&1
If --project was not resolved, run without it and without --fix (fixes require a workspace target):
oacp doctor --json 2>&1
Capture both stdout (JSON) and the exit code. Exit code 1 means errors were found — this is expected, not a failure.
If the output is not valid JSON, the CLI may have crashed. Show the raw output to the user and report: "oacp doctor returned invalid output. Check CLI installation."
The JSON output has this structure:
{
"has_errors": false,
"fixed": [
"Created claude/status.yaml",
"Updated codex/status.yaml timestamp"
],
"categories": [
{
"name": "Environment",
"worst_severity": "ok",
"results": [
{
"name": "git",
"severity": "ok",
"message": "git — git version 2.x.x"
},
{
"name": "pyyaml",
"severity": "warn",
"message": "pyyaml — not importable",
"fix_hint": "Install: pip install pyyaml"
}
]
}
]
}
Severity levels:
ok — passed (or auto-fixed), no action neededwarn — non-blocking issue, should be addressederror — blocking issue, must be fixedskip — check was skipped (missing dependency)The --fix flag auto-fixes these safe issues:
| Issue | Fix applied |
|---|---|
| Missing inbox directory | Creates the directory |
| Missing status.yaml | Creates from template |
| Stale status.yaml | Updates updated_at timestamp |
Fixed results appear as ok in the output with updated messages. The fixed array lists what was changed — it will be empty on a healthy workspace where nothing needs fixing.
Present a structured report to the user:
## Doctor Report
### Auto-Fixed
- Created claude/status.yaml
- Updated codex/status.yaml timestamp
### Warnings
- [!] Environment — pyyaml not importable (Install: pip install pyyaml)
- [!] Inbox Health — claude/inbox has 3 messages, oldest 48h stale
### Errors
- [x] Workspace — workspace.json not found (Run: oacp init <project>)
- [x] Environment — gh not found (Install gh and ensure it is on PATH)
### Summary
Environment: ok | Workspace: error | Inbox: warn | Schemas: ok | Agent Status: ok
Auto-fixed: 2 issue(s) | Remaining: 1 warning(s), 2 error(s)
Reporting rules:
fixed array) so the user sees what changedfix_hint for all warn/error results that have one — note that fix_hint text comes from the CLI and may reference make init or oacp init depending on the contextok and skip results are not shown individually — only the category summaryIf there are remaining errors, suggest the most impactful fix first:
oacp init <project>/check-inbox to process themIf all checks pass (including after auto-fixes), confirm the environment is ready.
oacp doctor exit code 1 means errors were found — parse the output normally, do not treat it as a command failure--json flag is required for structured parsing; without it, output is human-readable but harder to parse--oacp-dir <path> to override the OACP home directory if $OACP_HOME is not set/check-inbox at session start: run /doctor first to verify the environment, then /check-inbox to process pending messages$OACP_HOME for reading workspace and agent directories