# Skills Audit Documentation

Progressive-disclosure design pattern for ALAI skill system.

# Pillar #4 — Skills Audit Overview

# Pillar #4 — Skills Audit Overview

**Date:** 2026-05-04  
**MC:** #99131  
**Phase:** DESIGN + PoC (Phase 2)  
**Spec:** `agentic-os-pillar4-skills-audit-2026-05-04.md`

---

## Executive Summary

This audit covers the ALAI skill system progressive-disclosure refactor: 79 skills inventoried, top-20 refactor priorities identified, L0-L3 rubric established, and PoC analysis completed for `task-postflight` skill.

### Key Findings

- 79 active skill directories on disk; 94 rows in skill-registry.db (32 phantoms, 17 unregistered)
- Only 15 skills have any log invocations in the 19-day measurement window
- `mehanik` (186 hits) and `update-config` (1 hit) appear in logs but have no disk directory — ghost invocations
- 9 skills with references/ dir; 70 are monolithic (L0/L1)
- 12 TOB skills have nested structure — invisible to Claude Code flat-discovery loader
- Highest-priority refactor target: `task-postflight` (5,367 tokens × 21 measured invocations = priority\_score 82.05)
- **Reality anchor:** At current ALAI scale (Claude Max flat-rate subscription), context-bloat incremental cost is approximately $0-2/month. The value of this audit is **context window capacity management**, not dollar cost reduction.

---

## Inventory Summary

<table id="bkmrk-metricvaluesource-ac"><thead><tr><th>Metric</th><th>Value</th><th>Source</th></tr></thead><tbody><tr><td>Active skill dirs on disk</td><td>79</td><td>`ls ~/.claude/skills/ | grep -v _archived | wc -l`</td></tr><tr><td>Archived skills</td><td>32</td><td>`ls ~/.claude/skills/_archived/ | wc -l`</td></tr><tr><td>skill-registry.db rows</td><td>94</td><td>`sqlite3 skill-registry.db 'SELECT COUNT(*) FROM skills;'`</td></tr><tr><td>DB-only phantoms</td><td>32</td><td>comm comparison</td></tr><tr><td>Disk-only unregistered</td><td>17</td><td>comm comparison</td></tr><tr><td>Skills with references/ dir</td><td>9</td><td>find query</td></tr><tr><td>Skills with invocations in window</td><td>15</td><td>log grep</td></tr><tr><td>Measurement window</td><td>19 days</td><td>2026-04-16 to 2026-05-05</td></tr><tr><td>Total invocations in window</td><td>267</td><td>awk filter</td></tr><tr><td>Ghost invocations (mehanik)</td><td>186</td><td>log grep — mehanik not on disk</td></tr></tbody></table>

---

## Aggregate Savings Projection

<table id="bkmrk-skills-loaded-per-tu"><thead><tr><th>Skills loaded per turn</th><th>Tokens saved vs. baseline</th><th>% context window recovered (128K window)</th></tr></thead><tbody><tr><td>Only task-postflight (PASS path)</td><td>3,500 tokens</td><td>2.7%</td></tr><tr><td>task-postflight + prompt-forge</td><td>4,700 tokens</td><td>3.7%</td></tr><tr><td>Top-5 hot-path skills (ranks 1-5)</td><td>7,300 tokens</td><td>5.7%</td></tr><tr><td>All top-20 (max benefit, full session)</td><td>19,500 tokens</td><td>15.2%</td></tr><tr><td>All 79 skills at L3 (theoretical max)</td><td>~35,000 tokens</td><td>27.3%</td></tr></tbody></table>

*Assumes 40-50% body-token reduction per skill post-refactor. These are per-turn estimates derived from body-token reduction; monthly projections without measured session counts would be phantom claims.*

---

## Related Documentation

- **Skills Inventory:** Top 20 Priority table with per-skill triage
- **L0-L3 Design Pattern:** Progressive-disclosure rubric and anti-pattern catalog
- **PoC Analysis:** task-postflight refactor demonstration (541 → 194 LOC, 64.7% reduction)

**Source spec:** `~/system/specs/agentic-os-pillar4-skills-audit-2026-05-04.md` (479 lines)  
**HiveMind record:** TBD  
**MC:** #99131 (ready\_for\_review)

# Skills Inventory — Top 20 Priority

# Skills Inventory — Top 20 Priority

**Measurement window:** 19 days (2026-04-16 to 2026-05-05)  
**Priority formula:** `log10(skill_md_tokens_est) * (1 + invocations_30d)`

---

## Top-20 Refactor Priority Table

<table id="bkmrk-rankskill-nameloctok"><thead><tr><th>Rank</th><th>Skill Name</th><th>LOC</th><th>Tokens</th><th>Inv 30d</th><th>Est $/mo (current)</th><th>Est $/mo (post-L3)</th><th>Savings $/mo</th><th>Priority Score</th><th>Owner</th></tr></thead><tbody><tr><td>1</td><td>task-postflight</td><td>541</td><td>5,367</td><td>21</td><td>$0.547</td><td>$0.078</td><td>$0.469</td><td>82.054</td><td>john</td></tr><tr><td>2</td><td>prompt-forge</td><td>224</td><td>2,372</td><td>20</td><td>$0.350</td><td>$0.070</td><td>$0.280</td><td>70.877</td><td>john</td></tr><tr><td>3</td><td>plan-with-team</td><td>140</td><td>1,177</td><td>13</td><td>$0.105</td><td>$0.042</td><td>$0.063</td><td>42.991</td><td>john</td></tr><tr><td>4</td><td>build-plan</td><td>90</td><td>923</td><td>7</td><td>$0.126</td><td>$0.063</td><td>$0.063</td><td>23.722</td><td>john</td></tr><tr><td>5</td><td>ask-board</td><td>307</td><td>2,623</td><td>3</td><td>$0.125</td><td>$0.038</td><td>$0.087</td><td>13.675</td><td>john</td></tr><tr><td>6</td><td>build</td><td>79</td><td>838</td><td>3</td><td>$0.113</td><td>$0.057</td><td>$0.056</td><td>11.693</td><td>john</td></tr><tr><td>7</td><td>sentinel</td><td>105</td><td>990</td><td>2</td><td>$0.116</td><td>$0.058</td><td>$0.058</td><td>8.987</td><td>john</td></tr><tr><td>8</td><td>sync</td><td>46</td><td>346</td><td>2</td><td>$0.087</td><td>$0.087</td><td>$0.000</td><td>7.617</td><td>john</td></tr><tr><td>9</td><td>learning-opportunity</td><td>165</td><td>1,433</td><td>1</td><td>$0.067</td><td>$0.034</td><td>$0.033</td><td>6.313</td><td>john</td></tr><tr><td>10</td><td>vault-unlock</td><td>117</td><td>1,312</td><td>1</td><td>$0.142</td><td>$0.071</td><td>$0.071</td><td>6.236</td><td>john</td></tr><tr><td>11</td><td>incident-response</td><td>122</td><td>1,051</td><td>1</td><td>$0.067</td><td>$0.034</td><td>$0.033</td><td>6.043</td><td>john</td></tr><tr><td>12</td><td>youtube-learning</td><td>93</td><td>877</td><td>1</td><td>$0.136</td><td>$0.068</td><td>$0.068</td><td>5.886</td><td>john</td></tr><tr><td>13</td><td>code-review</td><td>87</td><td>674</td><td>1</td><td>$0.002</td><td>$0.001</td><td>$0.001</td><td>5.657</td><td>john</td></tr><tr><td>14</td><td>lightrag-upload</td><td>87</td><td>659</td><td>1</td><td>$0.117</td><td>$0.059</td><td>$0.058</td><td>5.638</td><td>john</td></tr><tr><td>15</td><td>lightrag-status</td><td>101</td><td>625</td><td>1</td><td>$0.121</td><td>$0.061</td><td>$0.060</td><td>5.592</td><td>john</td></tr><tr><td>16</td><td>product-lifecycle</td><td>491</td><td>5,103</td><td>0</td><td>$0.081</td><td>$0.041</td><td>$0.040</td><td>3.708</td><td>john</td></tr><tr><td>17</td><td>skill-creator</td><td>362</td><td>4,911</td><td>0</td><td>$0.088</td><td>$0.044</td><td>$0.044</td><td>3.691</td><td>john</td></tr><tr><td>18</td><td>doc-coauthoring</td><td>375</td><td>4,274</td><td>0</td><td>$0.208</td><td>$0.104</td><td>$0.104</td><td>3.631</td><td>john</td></tr><tr><td>19</td><td>mcp-builder</td><td>236</td><td>2,457</td><td>0</td><td>$0.135</td><td>$0.068</td><td>$0.067</td><td>3.390</td><td>john</td></tr><tr><td>20</td><td>plan-build-test</td><td>293</td><td>2,437</td><td>0</td><td>$0.099</td><td>$0.050</td><td>$0.049</td><td>3.387</td><td>john</td></tr></tbody></table>

*est\_$/mo (post-L3) = estimate assuming 50% body-token reduction via progressive disclosure*

---

## Per-Skill Triage — Top 5

### \#1 task-postflight

- **Current footprint:** 541 LOC / 5,367 tokens
- **Why bloated:** BLOAT\_LOC\_GT\_300 — Contains anomaly decision tree (Section 3), learning-opportunity dispatch template (Section 4), memory writer procedure (Section 5), and failure mode reference table (Section 8) all inline in one file. Most of this content is only needed after an anomaly is detected.
- **Recommended action:** Split — progressive-disclose. Trigger skeleton ≤200 LOC stays in SKILL.md; Sections 3-5+8 move to references/.
- **Predicted savings:** ~3,500 tokens/session on typical PASS flows (63% context reduction); full 5,367 tokens only loaded on ANOMALY path.

### \#2 prompt-forge

- **Current footprint:** 224 LOC / 2,372 tokens
- **Why bloated:** Single references/agent-briefs.md exists but body still contains full 5-panelist dispatch protocol, model tier assignments, and synthesis rules inline.
- **Recommended action:** Split — move per-panelist briefs and synthesis rules to references/; keep trigger condition and dispatch skeleton in core.
- **Predicted savings:** ~1,200 tokens/session (50% reduction).

### \#3 plan-with-team

- **Current footprint:** 140 LOC / 1,177 tokens
- **Why bloated:** No references/ dir. Builder/validator role descriptions, round-robin protocol, and output templates are all inline. Frequently invoked (13x in window).
- **Recommended action:** Progressive-disclose — move builder brief and validator brief to references/. Keep selection logic in SKILL.md.
- **Predicted savings:** ~700 tokens/session (59% reduction) across 13 monthly invocations.

### \#4 build-plan

- **Current footprint:** 90 LOC / 923 tokens
- **Why bloated:** No references/ dir. Moderate size but high invocation frequency (7x). Output templates and TaskList format examples inline.
- **Recommended action:** Progressive-disclose — move TaskList format examples and edge-case handling to references/quick-ref.md.
- **Predicted savings:** ~400 tokens/session (43% reduction).

### \#5 ask-board

- **Current footprint:** 307 LOC / 2,623 tokens
- **Why bloated:** BLOAT\_LOC\_GT\_300 — 5-agent dispatch briefs are fully inline. Each panelist persona description (50-80 lines each) loads for every board invocation.
- **Recommended action:** Split — move per-panelist briefs to references/panelist-&lt;name&gt;.md. Keep dispatch skeleton (trigger, model tier, synthesis format) in SKILL.md.
- **Predicted savings:** ~1,800 tokens/session (69% reduction).

---

**Full per-skill triage for all 20:** See main audit spec `~/system/specs/agentic-os-pillar4-skills-audit-2026-05-04.md` §4.

**CSV inventory:** `~/system/specs/agentic-os-pillar4-skills-inventory.csv` (79 skills, 20 columns)