doctor
Use when asked to run Crew Doctor, verify installation or onboarding, debug missing roles/skills, or report what this session can reach. Separates installed, enabled, runtime-loaded, granted, degraded, and untested evidence.
- License 许可
- MIT
- 所属仓库
- pixeloven/crew
- 最近更新
- 2026-11-07
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- doctor
- tier
- concept
- requires
- []
- description
- Use when asked to run Crew Doctor, verify installation or onboarding, debug missing roles/skills, or report what this session can reach. Separates installed, enabled, runtime-loaded, granted, degraded, and untested evidence.
03 SKILL.md 正文
Doctor
Crew Doctor is fully read-only. Never install, enable, update, delete, edit, or restart anything while running it. Absence is evidence, not permission to repair. Run free checks first and report only the current harness's runtime as runtime truth; one harness cannot verify another.
Evidence vocabulary
Keep these dimensions separate:
- installation — package/catalogue files exist at a declared install root;
- enablement — settings select that installation;
- resolved runtime — this harness actually loaded it in this session;
- capability grant — the session was given a tool or credential surface.
For observations use exactly: present (visible, not exercised), working
(a read-only probe succeeded), unavailable (absent or a probe proved unusable),
not tested (deliberately unprobed), loaded-but-undiscoverable (loaded but
its description is absent), truncated, and omitted. A config claim is
never working. Label every report item as fact, inference,
recommendation, or untested and retain the command/path that produced it.
Probe cost and order
Run these free, read-only checks before considering inference calls:
- inspect settings, manifests, registries, caches, and the session's supplied tool/skill/agent catalogues;
claude plugin validate <absolute-crew-root> --strictandclaude --plugin-dir <absolute-crew-root> plugin details crew;codex debug prompt-input "hi"for Codex's model-visible catalogue — this is native introspection and makes no model call;- the distributed validators under the resolved Crew package root.
claude -p, pi -p, codex exec, and equivalent prompt-mediated probes are
billed. Never run one without explicit approval for that probe. State what
the billed run would establish and leave it not tested when approval is absent.
A fresh session is sometimes the only runtime proof after an install change;
that does not make it free or implicitly authorized.
scripts/crew_doctor.py contains the fixture-tested evidence rules and probe
ledger. It starts no model processes. Locate it from the resolved package
root, never from the consumer's scripts/ directory:
- Pi git package: the checkout containing
.claude-plugin/plugin.json; - Claude: the marketplace/cache
installLocationorinstallPathroot; - Codex: the parent of the
/skillsroot shown bycodex debug prompt-input.
Run python3 /absolute/resolved/crew/root/scripts/check_skill_layout.py /absolute/consumer/repo. Both paths must be absolute. This prevents a consumer's
same-named script from being invoked. If the installed root lacks the validator,
report that installed version as unable to perform the gate; do not fall back to
an incidental source clone.
Checks
1. Reconcile installation, enablement, and version
Pi. In applicable project/user .pi/settings.json, find the current git
identity git:github.com/pixeloven/crew@vX.Y.Z. Report the configured pin and
the resolved checkout separately. Read the resolved version from that checkout's
.claude-plugin/plugin.json; never use git describe. A pin below v0.35.0 is
DEGRADED, not missing: pi-subagents silently drops roles without frontmatter
name:, so the Crew fleet is invisible below the first role-discoverable
release. From v0.62.0, Crew on Pi ships skills and readable role files only:
it declares no pi-subagents agents, peer, or crew_agent tool, so do not report
their absence as a fault. Also report duplicate
project/user scopes and which scope the current runtime actually resolved, if
this Pi session exposes it.
Claude Code. Reconcile four distinct facts:
- settings declare marketplace
pixeloven(sourced frompixeloven/marketplace) and enablecrew@pixeloven; known_marketplaces.jsonrecords source, install location, and timestamp — it does not carry a served version;- the marketplace clone's
.claude-plugin/plugin.jsoncarries the served version; installed_plugins.jsonrecords installed paths/versions/scopes. Enumerate everyplugins["crew@pixeloven"][]record and flag stale or duplicate scopes.
Only this Claude session's catalogue can prove its loaded version. Registry agreement is installation evidence, not runtime proof.
Codex. Check the marketplace pin and plugins."crew@pixeloven".enabled in
config.toml, then inspect
~/.codex/plugins/cache/<marketplace>/<plugin>/<version>/skills and the exact
skill-root paths from free codex debug prompt-input. A repo/user
.agents/skills/ copy remains a supported vendored alternative. Report every
root and version; duplicate/stale roots are findings. An absent mcp_servers
entry belongs only to the capability-grant check below, never installation.
After all three, report cross-harness version skew as an observed comparison, without claiming that any one harness loaded another harness's files.
2. Validate entry files without judging by size
Confirm the repo-root AGENTS.md; Claude projects normally have a CLAUDE.md
importing it. Audit behavior, filled placeholders, delegation, tripwires,
delivery contracts, and runbook pointers. Facts may merit an Onboarding
recommendation, but a mature or long file is not inherently degraded.
The reporting contract is a required spine section, however mature the file.
Check it with the read-only helper from the resolved package root:
python3 /absolute/resolved/crew/root/scripts/onboarding_contract.py --check-reporting /absolute/consumer/repo/AGENTS.md. A missing section is
MISSING and a section without its decisions-first rule is DEGRADED; both
are drift for Onboarding to merge, never for Doctor to repair. When the session's
host reserves AGENTS.md for humans, add --audit-profile hosted: a missing or
partial section is N/A instead of drift, because the host's task contract
supplies reporting; a complete section is still OK.
3. Separate capability declarations from working probes
Derive foundation requirements from installed requires: frontmatter and local
requirements from the consumer overlay. A listed tool/grant is present; call
only safe read-only probes and promote it to working on success. A failed probe
is unavailable; an intentionally skipped or billed probe is not tested.
Inspecting an MCP config proves configuration only. Record shell/CLI fallback as
a separate capability, not MCP parity.
4. Derive local slots and profile
Union the installed catalogue's actual expects-local: declarations. Today the
declared set is platform-conventions, topology, protected-seams,
secret-paths, agent-runtime, and decision-record-format; derive rather than hard-code it in a report.
Crew currently ships no recommended vocabulary beyond the declared slots; a name
that no installed skill declares must never appear as unfilled.
Pass the other installed plugin and package roots found in check 1 to
inspect_packs. A root is a pack when a skill declares plugin:crew@>=X or
provides:. Then pass the packs to declared_local_slots(..., packs=...): each
pack's slots.txt adds its own slots to the declared set, labelled with the
pack, and an unfilled one is reported as that pack's slot. A slot name two packs
declare, or a pack declares over a Crew slot, is DEGRADED; never pick an owner.
Then report who fills each declared slot. A local overlay skill fills a slot by
provides: or by the <project>-<slot> naming convention; a pack skill fills one
only by provides:, including a slot another pack declares. Report "slot X
filled by pack Y" alongside local fills. A local overlay outranks a pack. On
Claude and Codex both copies
load, so name both. A local fill that still carries ▸ Fill is DEGRADED
(partial): name its unfilled section headings and point at onboarding (Thorough). Verify every pack's plugin:crew@>=X against the resolved
Crew manifest; an unmet minimum is DEGRADED.
Then check for skills that moved out of Crew. moved_skill_references scans the
consumer's AGENTS.md, CLAUDE.md, local skills, and role overlays for any name
in the MOVED_SKILLS table, bare or crew:-prefixed; pass its result with the
detected packs to compose_doctor_report. A referenced skill whose pack is not
detected is DEGRADED — name the pack to install. With the pack installed, a
lingering crew:<skill> is still DEGRADED until it becomes <pack>:<skill>.
Report only; the rename is Onboarding's to propose.
Report the always-on description total for Crew plus every detected pack against
the dated harness budgets in crew_doctor.py, which are measurements and not
limits. This row never fails. When the total exceeds a budget, name the packs an
operator could disable for headroom.
Also pass entry_file_cost(<crew root>) as entry_file=. The
description-cost.entry-file row sizes, in the same characters, the sections
Onboarding merges from templates/AGENTS.md into the entry file, names the
largest, and adds them to the description total for the full always-on cost.
It measures Crew's template, not the consumer's file. This row never fails: the
merged sections, Work quality included, are always-on by design.
For Claude Code, also pass claude_listing_inputs(<project>, <home>, context_window=<this session's window>) as claude_listing=. The
description-cost.claude-code row predicts which Crew and pack skills Claude
Code would list by name only. It is DEGRADED when any would, and N/A when no
window is supplied, in which case it predicts for 200K and 1M. The fix it names
is skillListingBudgetFraction, sized for the smallest collapsing window, or
SLASH_COMMAND_TOOL_CHAR_BUDGET when that variable sets the budget. It also
recommends project-scope enablement for any pack enabled in user settings. Other plugins and synced skills are not
counted, so a crowded session collapses sooner than predicted.
Emit exactly one profile using this shared taxonomy:
personaswhen repository evidence declares an OpenClaw/persona runtime;- otherwise
platformwhen at least one project capability is working; - otherwise
portable.
Persona evidence takes precedence; list working platform capabilities separately. Onboarding consumes this exact value and rule.
5. Validate role files and effective posture
Validate package roles plus consumer agents/*.md, .claude/agents/**/*.md, and
.pi/agents/**/*.md with the absolute package-root layout validator. Require YAML
frontmatter name and description. Neutral and Pi role names must match their
filenames; a Claude consumer role's frontmatter name owns its resolved identity
and may differ from its filename. Claude role names use lowercase letters and
hyphens. Reject missing, malformed, or duplicate resolved identities. A Pi
overlay shadows a Crew role only when it declares package: crew with the same
name (identity crew.<role>); report a bare-named one as a separate agent, and a
bare reviewer or researcher as overriding the pi-subagents built-in. A missing
Pi name is a silent-drop finding. Reject model, thinking,
effort, model_reasoning_effort, turnBudget, and maxTurns: dispatch owns them.
Report every resolved role's effective tools, not only its declared posture.
drafts on Claude denies surgical Edit/NotebookEdit but retains Write, so
it can create and overwrite files. All shipped roles retain shell access;
therefore frontmatter write restrictions are advisory unless the host sandbox or
permission system enforces them.
Package-role runtime expectations are harness-specific: Claude and Pi should resolve the six rendered roles; Codex plugins do not carry them, so confirm the project's routing contract and available Codex dispatch primitives instead.
6. Check intake and collisions
If Triage is routed, read the repository's label taxonomy and verify it through
the configured GitHub interface. Do not create labels. For collisions, Pi's flat
namespace lets the nearest project entry win; Claude and Codex namespace plugin
skills (crew:name) so plugin and bare project entries coexist. Name both copies,
their roots, and whether the local copy appears stale. Counts are per resolved
runtime name, so a namespaced collision counts as two.
7. Compare disk and runtime in both directions
Enumerate directory-form skill files in the resolved foundation root and local overlay. Compare them with this harness's model-visible catalogue. Report:
- disk-only entries as
omittedwhen a runtime catalogue was captured, ornot testedwhen none was; - runtime-only entries as
presentfrom another root and identify that root; - entries with absent descriptions as
loaded-but-undiscoverable; - shortened descriptions as
truncated; - exact, usable entries as
working.
Both Codex and Claude can degrade catalogues under pressure. Codex may report
omitted_skills and truncated_skill_descriptions; observed totals are dated
measurements, not permanent byte limits. Pi runtime discovery must come from Pi;
if unavailable, say not tested. A matching count is insufficient: pass only
when names, backing roots, and full descriptions match after applying the
harness's namespace rules.
8. Compare the capability map with this machine
Run the read-only inventory engine from the resolved package root:
python3 /absolute/resolved/crew/root/scripts/crew_inventory.py --project /absolute/consumer/repo --format json. Pipe what only this session can see
with --observations -: the MCP servers and tool names visible to you, in the
capture shape (schema_version: 1, harness, captured_at,
source_command). Never run claude mcp list or codex mcp list to get
them. An observation can raise a provider to present, never to working.
Pass the result to compose_doctor_report as inventory=. The
inventory.capability-map row compares the ## Capabilities table in the
agent-runtime slot with this machine:
- OK when the digest in its markers matches;
- DEGRADED when it differs on this machine, naming the changed rows. A committed map can describe a teammate's machine, so recommend onboarding and let the operator decide;
- MISSING when there are no markers, or only the template's empty ones.
Report only. Writing the map is Onboarding's job.
9. Check the proposal queue and learned skills
Read the consumer's declared proposal-queue: and learned skills with
learn_contract.inspect_proposals(<consumer-root>, tool_versions=...) (or
python3 /absolute/resolved/crew/root/scripts/learn_contract.py --inspect <consumer-root> --tool-version gh=X.Y.Z), and pass the result to
compose_doctor_report(proposals=...). Supply only versions this session
observed, such as a gh --version you already ran; an unsupplied version stays
untested. The rows follow docs/LEARNING.md:
proposals.queue—N/Awhen nothing is declared (learn is report-only);DEGRADEDwhen the queue sits in a skill root or holds a malformed proposal.proposals.staleness—DEGRADEDwhen an open proposal's target hash or tool version moved since drafting.learned.skills—DEGRADEDwhen a learned skill's marker version differs from the current tool; name itspromoted-incommit to roll back.
There is no age threshold. Report only: promotion and rollback are the operator's.
Report contract
Produce one row per check:
check | status (OK / MISSING / DEGRADED / N/A) | fact | inference | recommendation | untested | repeatable evidence
Then include:
- Profile: one of
portable,platform,personas, using the rule above; - Top action: exactly one highest-leverage next action, or
healthy — nothing to do.
Never turn an untested state into an assertion. Keep Doctor read-only even when the next action is obvious.
04 同仓库更多 Skills
orchard-gh-runs
Use when reading a failed GitHub Actions run with the gh CLI in this project, before re-running it or reporting a CI failure, so the failing step's log is read instead of the whole run.
orchard-gh
Hand-edited after promotion; the learned marker was dropped, so Doctor and check_skills --local can no longer see it.
demo-topology
Use when exercising the inventory contract fixture so that this fixture description comfortably clears the schema-v2 minimum length.
helper-jq
Use when exercising the inventory contract fixture so that this fixture description comfortably clears the schema-v2 minimum length.
user-notes
Use when exercising the inventory contract fixture so that this fixture description comfortably clears the schema-v2 minimum length.
toolkit-gh
Use when exercising the inventory contract fixture so that this fixture description comfortably clears the schema-v2 minimum length.