Skip to content

bloat(#236): audit script scans .claude/skills/ (consumer install path) - #320

Merged
BaseInfinity merged 1 commit into
mainfrom
bloat/audit-claude-skills-blindspot-v2
May 5, 2026
Merged

bloat(#236): audit script scans .claude/skills/ (consumer install path)#320
BaseInfinity merged 1 commit into
mainfrom
bloat/audit-claude-skills-blindspot-v2

Conversation

@BaseInfinity

Copy link
Copy Markdown
Owner

Summary

Last #236 cleanup: fix a measurement blind spot in scripts/audit-session-load.sh. The audit scanned only root skills/*/SKILL.md, but cli/init.js:32-35 copies SKILL.md files to .claude/skills/<name>/SKILL.md at install time. So the audit was silently invisible to bloat in real consumer projects — only the dev-maintainer dual-purpose layout was checked.

(Replaces #319, which got stranded after origin/main was force-updated mid-flow.)

Caught by Codex strategic review on the "should we keep going on bloat?" question. Codex flagged the asymmetry between hooks (already dual-path scanned via .claude/hooks/ block) and skills (root-only). Mirrors that existing pattern.

Why this matters

tests/test-audit-session-load.sh:174 enforces "wizard repo's own SKILL.md files all stay below 5000-token threshold." A consumer who customized their .claude/skills/sdlc/SKILL.md to >5K tokens would never trip the audit's TRIM flag — the tool wouldn't see them. That undermines the audit's own Prove-It framing ("a tool that surfaces real issues whose owner ignores them is just a louder lint warning").

Implementation (Codex-signed-off, 4 deltas applied)

  1. scripts/audit-session-load.sh: new .claude/skills/ scan block mirroring .claude/hooks/.
  2. Inventory comment block updated to mention both paths.
  3. tests/test-audit-session-load.sh: new test_audit_scans_consumer_install_layout using existing make_temp + make_file_with_size helpers.
  4. Test wired into the explicit-call runner block.
  5. Python predicate uses path.endswith("/.claude/skills/sdlc/SKILL.md") + flag == "TRIM" (strict, not substring match).

Test plan

  • tests/test-audit-session-load.sh — 10/10 PASS (was 9/9, +1 new regression). TDD RED confirmed.
  • tests/test-cli.sh — 78/78 PASS
  • tests/test-plugin.sh — 25/25 PASS
  • tests/test-doc-consistency.sh — 35/35 PASS
  • tests/test-workflow-triggers.sh — 169/169 PASS

Live audit shows both layouts inventoried. Dogfood double-counts (.claude/skills/ symlinks resolve to same files as skills/) — same trade-off the .claude/hooks/ scan already accepts.

No version bump

scripts/ + tests/ aren't in package.json files:. Same precedent as orphan-delete PR #318.

Close-out

Final #236 PR for this session. Combined session impact:

scripts/audit-session-load.sh scanned only root skills/*/SKILL.md.
But cli/init.js:32-35 copies SKILL.md files to .claude/skills/<name>/
SKILL.md at install time, so the audit was silently invisible to bloat
in real consumer projects. Mirrors the existing .claude/hooks/ pattern.

Caught by Codex strategic review on the bloat-sweep continuation
question — it pointed at the asymmetry between hooks (dual-path scanned)
and skills (root-only). Implementation plan went through a second Codex
round for sign-off; ships with all 4 deltas applied:
- inventory comment block updated to mention .claude/skills/
- new test uses existing make_temp + make_file_with_size helpers
- new test wired into the explicit-call runner block
- Python predicate uses path.endswith() not substring match

Will double-count in dogfood (where .claude/skills/ symlinks back to
skills/), same trade-off as the existing hooks scan accepts.

No version bump: scripts/ + tests/ are not in package.json files list,
so this never reaches npm consumers.
@BaseInfinity
BaseInfinity merged commit 112dd63 into main May 5, 2026
5 checks passed
@BaseInfinity
BaseInfinity deleted the bloat/audit-claude-skills-blindspot-v2 branch May 5, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant