PAI Tools directory not surfaced into session context — no self-healing for skill-index.json
Problem
The skills/PAI/Tools/ directory contains ~42 TypeScript utilities (RebuildPAI.ts, GenerateSkillIndex.ts, Inference.ts, algorithm.ts, etc.) but none are surfaced into Claude's session context. When the agent needs a tool, it doesn't know it exists and reinvents the functionality.
Concrete example: skill-index.json was missing. Instead of running the existing GenerateSkillIndex.ts, a new workflow was created from scratch — because neither the tool's existence nor any self-healing mechanism was known to the agent.
Root Cause
Two gaps compound each other:
-
No tools inventory in context —
LoadContext.hook.tsloads exactly 3 files (SKILL.md, 2x AISTEERINGRULES.md).Tools/is never referenced, so the agent has no awareness of what utilities exist. -
No self-healing for
skill-index.json— The SKILL.md rebuild guard (lines ~520-535 in LoadContext.hook.ts) provides a model for how to auto-regenerate critical files. No equivalent guard exists forskill-index.json, so a missing index silently degrades capability rather than triggering recovery.
Proposed Fix
Part 1 — 35-tools-inventory.md component:
Add a new component that lists ~20 core PAI Tools grouped by category (System Maintenance, Skill & Session, Content & Media, AI & Analysis). Auto-discovered by RebuildPAI.ts via numeric prefix; slots between components 30 and 40 in SKILL.md. ~1.4KB added to SKILL.md (~1.7% size increase).
Part 2 — LoadContext self-healing guard:
Add a check after the SKILL.md rebuild guard that detects a missing skill-index.json and runs GenerateSkillIndex.ts to regenerate it. Follows the identical pattern of the existing guard. ~0.1ms overhead on the happy path (file exists).
Files Changed
Releases/v3.0/.claude/skills/PAI/Components/35-tools-inventory.md— newReleases/v3.0/.claude/hooks/LoadContext.hook.ts— insert ~15 lines after line 535
Testing
| Check | Expected |
|---|---|
grep "PAI Tools Quick Reference" SKILL.md |
Found between components 30 and 40 |
Delete skill-index.json, start new session |
"regenerating..." in stderr, file recreated |
| Normal session start (file exists) | No "regenerating" message, no overhead |
Hey @brycemagera — Kai here, Daniel's AI assistant, doing first-pass triage on the PAI repo.
Closing this out because v5.0.0 removes skill-index.json entirely — skills are auto-discovered from skills/*/SKILL.md at session start. The self-healing mechanism this issue called for is no longer needed because the index file it would heal no longer exists (verified: zero references to skill-index.json in v5 hooks/tools/skills).
If a related concern still applies in v5.0.0, please reopen or file a fresh issue against the new release. Thanks for taking the time to file this — really appreciated.
— Kai 🤖