Skill Ecosystem Doctor
Treat the local Skill collection as a governed software supply chain. Audit first,
plan repairs from evidence, apply only authorized changes, and finish with fresh
cross-runtime verification and a durable handoff.
This workflow is at skill maturity, not unattended automation maturity. Do
not schedule or silently apply repairs.
Select the mode
| User intent |
Mode |
Routing |
| Inspect, review, inventory, or diagnose |
audit |
execute_direct; read-only |
| Explain what should change |
plan |
plan_first; no mutations |
| Fix, unify, quarantine, or retire |
repair |
plan_first; explicit scope and rollback |
| Recheck an existing governance file |
verify |
execute_direct; read-only |
| Rotate credentials, rewrite history, push, publish, or change remotes |
external action |
clarify_first unless the current request grants that exact action |
If the request mixes modes, run audit before repair. Do not infer repair
authorization from a request to inspect or diagnose.
Operating Contract
- Direct actions: read-only discovery, deterministic audits, report drafts,
and local validation.
- Escalate before: destructive changes, credential actions, history
rewriting, remote publication, or any mutation not named by the current
repair request.
- Evidence-backed pushback: challenge a proposed source, deletion, or
completion claim only with paths, state queries, tests, ownership records, or
a concrete data-loss or security risk.
- Feedback loop: promote repeated false positives, runtime-layout changes,
and manual recovery steps into checks, fixtures, references, or evals.
1. Discover before creating
- Search active roots and source repositories before creating a Skill,
governance file, script, alias, or projection.
- Locate every applicable
AGENTS.md or equivalent before editing a source
repository.
- Read runtime contracts and classify each
path as canonical source, managed projection, generated cache, or unknown.
- Record the task goal, context, constraints, done-when conditions, dirty
worktrees, runtime versions, and unavailable external permissions.
- If work will span many files or sessions, use
flowguard and keep the
handoff outside parent context.
Common roots are discovery candidates, not declarations. Verify them on the
current machine; no data means unknown, not a guessed source relationship.
2. Run the deterministic audit
Use an existing governance file when one exists. Otherwise read
the governance schema, adapt
the example from discovered facts, and
show the proposed configuration before writing it.
From this Skill directory, run:
python3 scripts/ecosystem_doctor.py --governance ./skill-ecosystem-governance.json
python3 scripts/ecosystem_doctor.py --governance ./skill-ecosystem-governance.json --json
Use --skip-loom only when Loom is intentionally outside scope. A missing Loom
binary is an error when Loom validation is requested. Use --fail-on-warn for a
strict release gate.
The audit checks:
- broken roots, links, and local support-file references
- declared-name versus directory-name mismatches
- divergent active projections for the same declared name
- physical runtime copies without an exact source pin
- drift in pinned composite materializations
- active retired, quarantined, or projection-denied Skills
- active references to retired entry points
- high-confidence secret-like literals without printing their values
- Loom health, projection drift, and pending remote synchronization
Treat test-fixture secret patterns as visible warnings, not silent allowlists.
3. Classify findings
Order repairs by security, logic, data integrity, source lineage, and naming.
Separate facts from decisions:
- A digest conflict proves different content; it does not prove which copy is
correct.
- A physical copy proves unmanaged materialization; it does not prove deletion
is safe.
- A secret pattern proves local exposure risk; it does not prove account-side
rotation occurred.
- A healthy projection proves installed consistency; it does not prove the
upstream source is committed or remotely backed up.
Read the remediation playbook before
planning mutations.
4. Produce a repair plan
For every proposed action, record:
- finding and evidence
- owning source repository or unresolved owner
- exact writable files or paths
- authorization level
- reversible alternative and quarantine path
- repository-specific tests
- cross-runtime verification
- stop condition
Use disjoint file ownership for any parallel work. Do not let two agents edit a
shared registry, lockfile, manifest, or high-context file.
5. Apply only approved repairs
Safe direct actions are read-only inspection, report generation, local tests,
and drafting a plan. During an authorized repair run:
- prefer an independent clean Git worktree for source edits
- patch the canonical source, then regenerate managed outputs
- quarantine before removal and record original path plus digest
- preserve unrelated dirty worktree changes
- migrate genuinely neutral assets before retiring an entry point
- remove retired registrations, rules, references, projections, and installer
sources without creating compatibility aliases
- update generated registries through their owning generator
- stop if the same hypothesis fails three times
Never print secrets, overwrite unknown user content, use force push, rewrite
history, or claim external credential rotation without direct evidence.
6. Verify and hand off
Run verification from the current session:
- Run targeted tests for each changed source repository.
- Run each repository's build and full test gate when applicable.
- Re-run
ecosystem_doctor.py and require zero errors.
- Classify every remaining warning with evidence; do not suppress it merely to
reach a clean count.
- Confirm Codex and Claude resolve the intended source or exact pin.
- For retired Skills, scan all active paths and test the relevant installer so
reinstall does not restore them.
- Run
git diff --check in every changed Git worktree.
- Fill the remediation log template.
Use the eval cases when forward-testing trigger boundaries,
read-only behavior, secret redaction, retirement, or dirty-worktree handling.
If commit, push, PR, merge, or landing is requested, prepare a review pack and
use review-gate unless the current request already grants that exact action.
Done when
- canonical ownership is explicit for every in-scope active Skill
- active projections have no unresolved content conflicts or broken resources
- retired and denied names have no active path or invocation reference
- high-confidence embedded-secret findings are cleared or explicitly blocked
- every mutation has a rollback or quarantine record
- fresh source-specific tests and the ecosystem audit pass
- residual warnings and external actions are listed without overstating closure
Gotchas, negative examples, and drift signals
- Do not choose the newest-looking fork automatically. Compare source history,
contracts, tests, and ownership first.
- Do not turn a read-only audit into a bulk cleanup. Produce a repair plan.
- Do not replace quarantine with recursive deletion. Preserve a recoverable copy.
- Do not accept “should work” as verification. Run fresh commands.
- Do not automate this workflow after one successful machine repair. Promote
only repeatedly stable, deterministic, read-only checks to scheduling.
Patch this Skill when the validator no longer understands an installed layout,
the same false positive recurs, a runtime changes projection semantics, or users
repeat the same safety correction.
1---2name: skill-ecosystem-doctor3description: Audit and safely remediate a cross-runtime Skill ecosystem spanning Codex, Claude Code, Loom, VibeGuard, Spellbook, and independent Git sources. Use when the user asks to inspect all local skills, resolve duplicate or divergent Skill copies, establish canonical sources and managed projections, retire obsolete skills without reinstall resurrection, scan Skill files for embedded credentials, quarantine unsafe automation, or prove Codex/Claude visibility with fresh checks. Do not use for invocation statistics alone; use skill-usage-stats for usage and zombie-skill evidence.4---5
6# Skill Ecosystem Doctor
7
8Treat the local Skill collection as a governed software supply chain. Audit first,
9plan repairs from evidence, apply only authorized changes, and finish with fresh
10cross-runtime verification and a durable handoff.
11
12This workflow is at `skill` maturity, not unattended `automation` maturity. Do
13not schedule or silently apply repairs.
14
15## Select the mode
16
17| User intent | Mode | Routing |
18|---|---|---|
19| Inspect, review, inventory, or diagnose | `audit` | `execute_direct`; read-only |
20| Explain what should change | `plan` | `plan_first`; no mutations |
21| Fix, unify, quarantine, or retire | `repair` | `plan_first`; explicit scope and rollback |
22| Recheck an existing governance file | `verify` | `execute_direct`; read-only |
23| Rotate credentials, rewrite history, push, publish, or change remotes | external action | `clarify_first` unless the current request grants that exact action |
24
25If the request mixes modes, run `audit` before `repair`. Do not infer repair
26authorization from a request to inspect or diagnose.
27
28## Operating Contract
29
30- **Direct actions:** read-only discovery, deterministic audits, report drafts,
31 and local validation.
32- **Escalate before:** destructive changes, credential actions, history
33 rewriting, remote publication, or any mutation not named by the current
34 repair request.
35- **Evidence-backed pushback:** challenge a proposed source, deletion, or
36 completion claim only with paths, state queries, tests, ownership records, or
37 a concrete data-loss or security risk.
38- **Feedback loop:** promote repeated false positives, runtime-layout changes,
39 and manual recovery steps into checks, fixtures, references, or evals.
40
41## 1. Discover before creating
42
431. Search active roots and source repositories before creating a Skill,
44 governance file, script, alias, or projection.
452. Locate every applicable `AGENTS.md` or equivalent before editing a source
46 repository.
473. Read [runtime contracts](references/runtime-contracts.md) and classify each
48 path as canonical source, managed projection, generated cache, or unknown.
494. Record the task goal, context, constraints, done-when conditions, dirty
50 worktrees, runtime versions, and unavailable external permissions.
515. If work will span many files or sessions, use `flowguard` and keep the
52 handoff outside parent context.
53
54Common roots are discovery candidates, not declarations. Verify them on the
55current machine; no data means unknown, not a guessed source relationship.
56
57## 2. Run the deterministic audit
58
59Use an existing governance file when one exists. Otherwise read
60[the governance schema](references/governance-schema.md), adapt
61[the example](assets/skill-governance.example.json) from discovered facts, and
62show the proposed configuration before writing it.
63
64From this Skill directory, run:
65
66```bash
67python3 scripts/ecosystem_doctor.py --governance ./skill-ecosystem-governance.json
68python3 scripts/ecosystem_doctor.py --governance ./skill-ecosystem-governance.json --json
69```
70
71Use `--skip-loom` only when Loom is intentionally outside scope. A missing Loom
72binary is an error when Loom validation is requested. Use `--fail-on-warn` for a
73strict release gate.
74
75The audit checks:
76
77- broken roots, links, and local support-file references
78- declared-name versus directory-name mismatches
79- divergent active projections for the same declared name
80- physical runtime copies without an exact source pin
81- drift in pinned composite materializations
82- active retired, quarantined, or projection-denied Skills
83- active references to retired entry points
84- high-confidence secret-like literals without printing their values
85- Loom health, projection drift, and pending remote synchronization
86
87Treat test-fixture secret patterns as visible warnings, not silent allowlists.
88
89## 3. Classify findings
90
91Order repairs by security, logic, data integrity, source lineage, and naming.
92Separate facts from decisions:
93
94- A digest conflict proves different content; it does not prove which copy is
95 correct.
96- A physical copy proves unmanaged materialization; it does not prove deletion
97 is safe.
98- A secret pattern proves local exposure risk; it does not prove account-side
99 rotation occurred.
100- A healthy projection proves installed consistency; it does not prove the
101 upstream source is committed or remotely backed up.
102
103Read [the remediation playbook](references/remediation-playbook.md) before
104planning mutations.
105
106## 4. Produce a repair plan
107
108For every proposed action, record:
109
110- finding and evidence
111- owning source repository or unresolved owner
112- exact writable files or paths
113- authorization level
114- reversible alternative and quarantine path
115- repository-specific tests
116- cross-runtime verification
117- stop condition
118
119Use disjoint file ownership for any parallel work. Do not let two agents edit a
120shared registry, lockfile, manifest, or high-context file.
121
122## 5. Apply only approved repairs
123
124Safe direct actions are read-only inspection, report generation, local tests,
125and drafting a plan. During an authorized `repair` run:
126
127- prefer an independent clean Git worktree for source edits
128- patch the canonical source, then regenerate managed outputs
129- quarantine before removal and record original path plus digest
130- preserve unrelated dirty worktree changes
131- migrate genuinely neutral assets before retiring an entry point
132- remove retired registrations, rules, references, projections, and installer
133 sources without creating compatibility aliases
134- update generated registries through their owning generator
135- stop if the same hypothesis fails three times
136
137Never print secrets, overwrite unknown user content, use force push, rewrite
138history, or claim external credential rotation without direct evidence.
139
140## 6. Verify and hand off
141
142Run verification from the current session:
143
1441. Run targeted tests for each changed source repository.
1452. Run each repository's build and full test gate when applicable.
1463. Re-run `ecosystem_doctor.py` and require zero errors.
1474. Classify every remaining warning with evidence; do not suppress it merely to
148 reach a clean count.
1495. Confirm Codex and Claude resolve the intended source or exact pin.
1506. For retired Skills, scan all active paths and test the relevant installer so
151 reinstall does not restore them.
1527. Run `git diff --check` in every changed Git worktree.
1538. Fill [the remediation log template](assets/remediation-log-template.md).
154
155Use [the eval cases](evals/evals.json) when forward-testing trigger boundaries,
156read-only behavior, secret redaction, retirement, or dirty-worktree handling.
157
158If commit, push, PR, merge, or landing is requested, prepare a review pack and
159use `review-gate` unless the current request already grants that exact action.
160
161## Done when
162
163- canonical ownership is explicit for every in-scope active Skill
164- active projections have no unresolved content conflicts or broken resources
165- retired and denied names have no active path or invocation reference
166- high-confidence embedded-secret findings are cleared or explicitly blocked
167- every mutation has a rollback or quarantine record
168- fresh source-specific tests and the ecosystem audit pass
169- residual warnings and external actions are listed without overstating closure
170
171## Gotchas, negative examples, and drift signals
172
173- Do not choose the newest-looking fork automatically. Compare source history,
174 contracts, tests, and ownership first.
175- Do not turn a read-only audit into a bulk cleanup. Produce a repair plan.
176- Do not replace quarantine with recursive deletion. Preserve a recoverable copy.
177- Do not accept “should work” as verification. Run fresh commands.
178- Do not automate this workflow after one successful machine repair. Promote
179 only repeatedly stable, deterministic, read-only checks to scheduling.
180
181Patch this Skill when the validator no longer understands an installed layout,
182the same false positive recurs, a runtime changes projection semantics, or users
183repeat the same safety correction.