plastic-doctor
Use when diagnosing Plastic installation health, after updates, or when something seems broken. Runs checks and reports findings with fix options.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when diagnosing Plastic installation health, after updates, or when something seems broken. Runs checks and reports findings with fix options.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Wrap, finish, close, or mark an intent Done, delivered or abandoned. Use when completing or abandoning an intent, when a checklist reaches 100 percent and Exec is finished, or when asked to "wrap this up".
Autonomous intent delivery - agent takes over How and Exec. Use when user says "auto", "take it from here", "deliver this", or when brainstorming-grill-me concludes and user confirms autonomous execution. Requires an active intent in INDEX.md.
Use when updating Plastic. Runs the `update` verb, which reads the installed VERSION, derives its channel, queries npm dist-tags, and advances to the next version on that channel (or switches channel with a flag).
Use when merging a feature branch to main and tagging a release, bumping the version, or when the user says "release", "tag", or "ship it"
Use when completing or reviewing intents, reorganizing the index, or when the intent store needs maintenance. Examples: <example>Context: User has finished implementing a feature. user: "This intent is done, clean up the index" assistant: "I'll use the intent-curator to update the intent status and reorganize INDEX.md" <commentary>Intent lifecycle change triggers curator for index maintenance.</commentary></example> <example>Context: The intent store has grown and clusters need review. user: "Organize the intents" assistant: "I'll use the intent-curator to review clusters, flag orphans, and suggest connections" <commentary>Periodic maintenance of the Zettelkasten structure.</commentary></example>
Board a session onto an intent: take the lock FIRST, confirm savepoint state, ask auto or guided ONCE, then resume at the latest delivered station and run the cycle to Done. Use on `continuing --intent {id}`, when a new intent is registered and the user asks to work it, or when the user picks an intent to work. Requires the intent in INDEX `## Active`.
| name | plastic-doctor |
| description | Use when diagnosing Plastic installation health, after updates, or when something seems broken. Runs checks and reports findings with fix options. |
| user-invocable | true |
Doctor has three scopes. Pick the right one for the situation:
| Scope | Flag | When it runs | States |
|---|---|---|---|
| Core check | --core | SessionStart hook (automatic), also available on demand | Binary: pass or error |
| Store check | --store [global|<slug>] | Dashboard load, plastic-project-continuing | Three-state: pass / warn / fail |
| Full check | (no flag) | After every update (automatic), or /plastic-doctor | Three-state: pass / warn / fail |
--core (binary, operational-readiness only)Checks ONLY that Plastic is loaded and ready for work: agent registration (skills,
subagents, hooks/harnesses present and registered), core files (manifest-backed
presence/hash checks, excluding agent_model_drift, which is a non-boot
config-honoring check, never run at core), manifest sync (global + agent manifest
SHA256), every registered project's path resolving to a real, existing directory,
and the global store being reachable (INDEX.md present; no orphan/ghost content
scanning). Result is binary: exit 0 on pass, non-zero on error. It never produces
warnings, and it never scans store content.
It checks two install manifests as part of core files and manifest sync:
~/.plastic/manifest.json (global manifest, covers PLASTIC.md and global scripts)~/.claude/plastic/manifest.json (agent-side manifest, covers agent scripts and hooks)Each manifest maps a file path to its SHA256.
On failure, the report states this guided route, in order:
plastic doctor --fix (the Fix all / Select individually / Skip router from
Step 4-5 below).plastic-rollback (restores from the local, append-only versions.json ledger of
versions actually run).scripts/feedback-report,
backing the plastic-feedback skill), which composes a local report plus a
prefilled GitHub issue URL and never holds a credential or contacts GitHub
directly.--store [global|<slug>]Checks the operations Plastic itself depends on in one store: QMD search reachability (scoped
to that store's own collection; global uses plastic-global, a project slug uses
plastic-<slug>), sources/chain resolution, cross-store resolution, INDEX parsing, and links
projection. A project slug also checks tool readiness (Serena, Enola): each is a pass whether
present or absent, present naming it available, absent noting it as an optional integration
never installed by doctor. Scope options:
:all): checks all stores (global and all project stores), QMD reachability
unscoped across every collection.global: checks only the global store, QMD scoped to plastic-global, no tool-readiness
checks (code-navigation tools have no meaning against the global store).--store plastic): checks only that project's store, QMD scoped to
plastic-<slug>, plus Serena/Enola readiness for that project.Produces three-state results (pass / warn / fail) and is run per-scope at dashboard load time:
the global board uses --store global, a project board uses --store <slug>. This IS the
load-time full project check named by 219's doctrine: no separate mechanism exists or is
needed, since a project slug's scan already carries every per-project finding scoped to that
project alone.
Runs the install-wide surface: agent registration, core files (including config-honoring
drift), manifest sync is core-only and not part of this run, deprecation checks, config-ask
checks, install-integrity checks, skill-lint (advisory), QMD reachability (unscoped, every
collection), and the global store's own conventions/done-signals content. Never carries a
per-project finding; that is --store <slug>'s job (see above). This is what
/plastic-doctor invokes, and it also runs automatically after every plastic-update
(informational, does not block or revert the update).
/plastic-doctor (full check)plastic-update completes (automatically, full check)ruby ~/.plastic/scripts/doctor.rb --agent claude
Replace claude with the current agent type if known (codex, hermes).
Parse the JSON output from stdout. The script is read-only and never modifies files. Errors go to stderr.
Exit codes indicate check results, not script failure:
0: all checks passed1: warnings found2: failures foundAll three exit codes mean the script ran successfully. Do not treat non-zero as an error.
Read the status field from the JSON root:
| Status | Meaning |
|---|---|
pass | Everything is healthy |
warn | Warnings found but Plastic works normally |
fail | Blocking issues that prevent Plastic from operating |
Read report.md from the same directory as this SKILL.md
(~/.plastic/skills/doctor/report.md at runtime, or the plugin source
skills/doctor/report.md during development).
Group checks by category. For each category, list the checks with their
status icon and message. If a check has details, list them as sub-items.
Present the filled template to the user.
If any checks have fixable: true AND status is not pass:
fix_hint)If no fixable issues exist, skip this step.
This "Fix all / Select individually / Skip" prompt IS the router the spec calls
doctor --fix-all (intent 197): doctor itself never mutates anything (see Step 5's table and
"Important Notes" below); "Fix all" means "dispatch every fixable finding to the maintenance
tool or skill that owns that class of repair," one row per fix_hint pattern.
Use the fix_hint value to determine the correct action:
| Fix hint pattern | Agent action |
|---|---|
| "chmod +x on the listed files" | Run chmod +x on each file listed in details |
| "Create missing directory" | Run mkdir -p on the path |
| "Create INDEX.md with required sections" | Write INDEX.md with the 5 sections: Active, Future, Clusters, Abandoned, Completed |
| "Add missing entries to INDEX.md" | Add orphaned intents to the appropriate INDEX.md section |
| "Remove stale references from INDEX.md" | Edit INDEX.md to remove ghost references |
| "Inject the missing required frontmatter field(s)" | Edit the intent's {ID}--{slug}.md frontmatter to add the missing key (e.g. chain: []) without touching other keys |
| "Run: provision-project-store {slug}" | Run provision-project-store <slug> (or invoke the plastic-store-provisioning skill) to create the missing store |
| "Re-run installer" | Run npx -y @zalom/plastic@<channel> install --agent <agent> (channel: -alpha->@alpha, -beta->@beta, else @latest) |
| "Run the Plastic installer to bootstrap the store" | Run npx -y @zalom/plastic@<channel> install --agent <agent> (channel: -alpha->@alpha, -beta->@beta, else @latest) to restore the global store's plastic_home directory or INDEX.md |
| "Dispatch plastic-store-curating ... revisions.md ..." | Invoke the plastic-store-curating (or the agent) to relocate the flagged section or ref into the intent's revisions.md via move-and-record (one dated, [rule: <tag>]-tagged entry per item), per PLASTIC.md > Structural maintenance and revisions.md. For a missing required section, restore or reproject it instead. |
| "Run scripts/project-links ... PRESERVES ... --drop-unbacked-links" | Run ruby ~/.plastic/scripts/maintenance-run --tool project-links --intent <id> --apply for the one flagged id (never run bare project-links against a real store outside the rare owner-approved batch exception, D2) |
For fixes the agent cannot handle automatically, explain what the user needs
to do manually. The revisions.md remedy is curator-applied (a move-and-record
relocation, not a mechanical edit) and stays human-gated by the Step 4
Fix / Select / Skip prompt.
After applying fixes, re-run the diagnostic script:
ruby ~/.plastic/scripts/doctor.rb --agent claude
Show the updated results.
When invoked from plastic-update (not directly by the user):
This keeps the update flow clean when nothing is wrong.
references/gates-stuck-detection.md for the full gate enforcement table, bridge file pattern, and stuck detection thresholds when diagnosing gate failures or stuck agents