---
name: skill-runtime-manager
description: Safely slim a local Skill runtime without deleting source. Use for usage audits, duplicate consolidation, implicit-to-explicit policy changes, AGENTS cleanup, on-demand packs, rollback, or runtime comparisons. Preserve domain Skills and explicit invocation.
---

# Skill Runtime Manager

Reduce default Skill context while preserving source, explicit invocation, and recoverability.

## Route the slimming pass

- For ordinary zero-use cold storage, use the audit workflow below.
- For duplicated controllers, stale plugins/config, canonical-source cleanup, or cognitive-runtime slimming, read `references/two-pass-slimming.md` before changing state.
- Keep stable method in references and dated local counts outside the public Skill.

## Cold-storage workflow

1. Scan structured Codex and Claude tool-call records. Ignore developer Skill listings, ordinary name mentions, and function outputs:

   ```bash
   python3 scripts/skill_usage_audit.py audit --min-age-days 14
   ```

2. Review `~/.codex/skill_usage_report.json`. Only `candidate` entries have zero observed invocation evidence, are older than the observation threshold, are locally controlled, and are not conflicted or protected.
3. When the user authorizes cold storage, apply the exact report:

   ```bash
   python3 scripts/skill_usage_audit.py apply
   ```

4. Regenerate the runtime Skill registry and verify its implicit/explicit policy counts.
5. Restore a batch from the manifest recorded by `apply`:

   ```bash
   python3 scripts/skill_usage_audit.py restore --manifest /path/to/manifest.json
   ```

Treat zero observed evidence as a conservative log conclusion, not proof about sessions outside the available history.

Do not forge a `candidate` report to demote a used Skill. For a used cognitive-process Skill that duplicates model and global-instruction behavior, require explicit authorization for the named policy change, record every policy file, and verify explicit invocation remains available.

## On-demand pack workflow

1. Add only reviewed pack definitions to `references/packs.json`; never accept an arbitrary source or destination path at runtime.
2. Inspect live state:

   ```bash
   python3 scripts/skill_pack_manager.py status
   ```

3. Confirm that exactly one of the allowlisted active or archived paths exists.
4. Require authorization for the named pack unless the request already authorizes the change.
5. Apply one reversible action:

   ```bash
   python3 scripts/skill_pack_manager.py disable <pack> --apply
   python3 scripts/skill_pack_manager.py enable <pack> --apply
   ```

6. Run `status` again, regenerate the runtime registry, and compare counts and conflicts.

## Safety rules

- Never delete Skill source as a slimming shortcut.
- Never disable this manager, a system/plugin Skill, or a pack outside the allowlist.
- Never mark conflicted, recently installed, or already explicit-only Skills as new cold candidates.
- Never infer value from invocation count alone; the audit measures exact-path access, not outcome quality.
- Back up existing policy files and record newly created ones so restoration can remove them.
- Preserve file contents, symlinks, permissions, and relative paths. Treat collision, digest mismatch, or unexpected Skill counts as visible failures.
- Keep domain controllers with unique paths, APIs, validation, or failure boundaries implicit unless evidence supports a narrower trigger.

## Boundaries

- Install third-party Skills with a dedicated installer workflow.
- Restructure Skill content with a Skill-authoring workflow.
- Audit rights and public packaging with an open-source release workflow.
- This Skill manages the local active/on-demand and implicit/explicit boundary.
