# Skill Library Audit

## When to Use

- User wants to "clean up" skills they don't use
- User asks which skills are worth keeping or disabling
- Hermes system prompt has grown long with skills that never get loaded
- Pre-onboarding step before running the curator for bulk archival

## Audit Checklist

### 1. Inventory

```bash
for cat in ~/.hermes/skills/*/; do
  catname=$(basename "$cat")
  count=$(find "$cat" -name "SKILL.md" -maxdepth 2 | wc -l)
  echo "  [$catname] $count skills"
done
```

### 2. Check Current Disabled List

```bash
python3 -c "
import yaml
with open('/home/rurouni/.hermes/config.yaml') as f:
    cfg = yaml.safe_load(f)
disabled = cfg.get('skills', {}).get('disabled', [])
print(f'Currently disabled: {len(disabled)} skills')
"
```

### 3. Evidence Collection

Use `session_search` to check if skills were ever loaded. Cross-reference with:
- Known user workflow (dev, Android TV, GitHub, local LLMs)
- Skill category relevance (Apple skills on Linux = never used)
- Tool requirements (ComfyUI without GPU setup = never used)

### 4. Categorization

Group skills into:

| Category | Criteria | Action |
|----------|----------|--------|
| **Core** | Loaded regularly, central to user workflow | Keep |
| **Occasional** | Used once or twice, legitimate need | Keep |
| **Never used** | Zero evidence, irrelevant to user's setup | Disable |
| **Placeholder** | Templates left behind | Disable/Delete |

### 5. Disable via Config

**WARNING:** `hermes config set skills.disabled '[...]'` writes the list as a **YAML STRING** (`disabled: '["a","b"]'`) instead of a YAML list. This breaks the skill loader. Use a YAML-aware tool instead:

```python
import yaml
path = '/home/rurouni/.hermes/config.yaml'
with open(path) as f:
    cfg = yaml.safe_load(f)
cfg['skills']['disabled'] = ['skill-1', 'skill-2', ...]
with open(path, 'w') as f:
    yaml.dump(cfg, f, default_flow_style=False, sort_keys=False, allow_unicode=True)
```

**Verify:**
```python
cfg['skills']['disabled']  # Must be 'list', not 'str'
```

### 6. Verify

```bash
hermes config check
```

## Re-enabling a Disabled Skill

Remove from the disabled list (same YAML technique as step 5).

## Accessing a Disabled Skill (v0.16.0+)

**IMPORTANT: In Hermes v0.16.0+, `skill_view("disabled-skill")` returns an error.** The skill loader blocks `skill_view()` for disabled skills. 

**Workaround:** Read the SKILL.md directly via `read_file()`:
```
read_file("~/.hermes/skills/<category>/<name>/SKILL.md")
```

The content is fully intact on disk — only `skill_view()` is blocked. The disabled list prevents auto-loading into the system prompt, not file access.

## Pitfalls

- **`hermes config set skills.disabled '[...]'` writes YAML STRING, not list** — always use Python `yaml.dump` for this field.
- **`skill_view()` blocks disabled skills in v0.16.0+** — use `read_file()` to access SKILL.md directly. This is a behavioral change from earlier versions.
- **Gateway restart needed after config edit** — the skill loader caches the disabled list at process start.
- **Session DB may be empty after crash** — cross-reference against known user environment and workflow.
- **Duplicate skill directories**: Check `mlops/` category for stale duplicates of active skills (e.g. `mlops/inference/llama-cpp` and `inference/llama-cpp` may both exist).
