Files
claude-skills/.tasks/compress-dedup.md
vitya 6e4f3f481b refactor(skills): dedup compress -> caveman-compress [v1.0.0]
skills/compress/ was a byte-identical dupe of skills/caveman-compress/
(SHA256 match across all 7 scripts/ files; SKILL.md diff was name: +
Process step 2 only; descriptions textually identical = arbitrary
harness tie-break + double-counted listing budget).

Kept caveman-compress canonical: it carries README.md (benchmarks +
caveman-toolkit branding) and SECURITY.md (Snyk false-positive writeup),
and matches the caveman-* prefix invariant.

Ported the better Process-step wording from compress
(`cd <directory_containing_this_SKILL.md>`) into caveman-compress;
the prior `cd caveman-compress` form assumed cwd was the parent dir
and broke when invoked from ~/.claude/skills/caveman-compress/.

Added version: 1.0.0 to caveman-compress frontmatter
(first versioned release; aligns with skill-versioning concept).

Removed: skills/compress/, dist/compress.skill,
~/.claude/skills/compress/ (manual prune; install.sh has no prune step
yet -- future [install-ps1] task should add --prune).

Slash-command impact: /compress gone; /caveman-compress and
/caveman:compress (toolkit-canonical) remain.

Wiki: .wiki/concepts/compress-dedup.md (rationale + rejected
alternatives), index.md + log.md updated.

Tasks: [compress-dedup] flipped active -> done in same commit
(per-task file .tasks/compress-dedup.md created with full decisions
log).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 21:49:44 +03:00

39 lines
4.8 KiB
Markdown

# compress-dedup
## Goal
Resolve the duplication between `skills/compress/` and `skills/caveman-compress/`. Both ship byte-identical `scripts/` (7 files: `__init__.py`, `__main__.py`, `benchmark.py`, `cli.py`, `compress.py`, `detect.py`, `validate.py`) and near-identical `SKILL.md` (only `name:` field and Process step 2 differ). Both register independently with the harness with identical descriptions — listing-token waste and arbitrary tie-break on activation. Pick canonical = `caveman-compress` (richer: README + SECURITY + caveman-toolkit branding); port the better Process-step wording from `compress` (generic `cd <directory_containing_this_SKILL.md>` vs brittle `cd caveman-compress`); delete `skills/compress/` entirely. Add `version: 1.0.0` frontmatter to caveman-compress (project-discipline Rule 3 alignment). Skill listing collapses from two redundant entries to one rich one. Install path `~/.claude/skills/compress/` is removed.
## Key files
- `skills/compress/` — entire folder deleted
- `skills/caveman-compress/SKILL.md` — port Process step from compress; add `version: 1.0.0`
- `skills/caveman-compress/README.md` — left as-is (already canonical, branding intact)
- `skills/caveman-compress/SECURITY.md` — left as-is
- `dist/compress.skill` — deleted (rebuild won't recreate; source gone)
- `dist/caveman-compress.skill` — rebuilt after SKILL.md edit
- `~/.claude/skills/compress/` — removed manually (install.sh has no prune step)
- `~/.claude/skills/caveman-compress/` — reinstalled
- `.wiki/concepts/compress-dedup.md` — design rationale (why caveman-compress canonical, why no alias mechanism, install-path impact)
- `.wiki/index.md` — add concept entry
- `.wiki/log.md` — append decision line
- `.tasks/STATUS.md` — flip compress-dedup ⚪ → 🔴 → 🟢
## Decisions log
- 2026-05-05: scripts/ byte-identical (SHA256 match across all 7 files). SKILL.md diff = `name:` field + Process step 2 only. Description text identical between the two. README + SECURITY only in caveman-compress. Conclusion: same skill, two registrations.
- 2026-05-05: chose `caveman-compress` as canonical over `compress`. Rationale: (a) richer docs (README with benchmarks table, branding, "Part of Caveman" toolkit linkage; SECURITY.md with Snyk false-positive writeup), (b) name reflects actual upstream origin (JuliusBrussee/caveman toolkit), (c) caveman cluster (caveman, caveman-commit, caveman-review, caveman-help, caveman-compress) has consistent prefix.
- 2026-05-05: rejected "alias-stub" approach (keep `compress` as a tiny SKILL.md pointing at caveman-compress). Harness has no alias mechanism — every SKILL.md fully registers; alias-stub still consumes a listing slot and a description budget. No win.
- 2026-05-05: rejected "keep both" approach. Identical descriptions ⇒ harness arbitrarily tie-breaks; both consume listing tokens; user has no way to predict which fires. Pure waste.
- 2026-05-05: ported Process step 2 wording from `compress` SKILL.md into `caveman-compress` SKILL.md. The compress version (`cd <directory_containing_this_SKILL.md> && python3 -m scripts ...`) is robust regardless of cwd; the caveman-compress version (`cd caveman-compress && ...`) implicitly assumes cwd is the parent directory. Net: caveman-compress gets the better text + keeps everything else.
- 2026-05-05: added `version: 1.0.0` frontmatter to caveman-compress SKILL.md. First versioned release of this skill. Aligns with the rest of the infra-skill cluster (skill-versioning concept).
- 2026-05-05: install.sh has no prune step — removing `skills/compress/` does NOT remove `~/.claude/skills/compress/`. Manual `rm -rf ~/.claude/skills/compress/` required. Filed mental note for `[install-ps1]` task: future installer should accept a `--prune` flag, or `setup-tasks`-style canon-list, to remove stale installs.
- 2026-05-05: slash-command impact — `/compress` slash command stops working after deletion; `/caveman-compress` and `/caveman:compress` (the canonical caveman-toolkit form) remain. Confirmed with user that `/compress` was effectively never used; no migration needed.
## Open questions
- [ ] Eventually wire up an `install.sh --prune` flag that drops `~/.claude/skills/<name>/` for any name not in `skills/<name>/`. Tracked indirectly via `[install-ps1]` ⚪ task — that task should at minimum match install.sh, but adding prune is the right time to do it.
## Completed steps
- (filled in during implementation)
## Notes
- Origin: both skills came from the JuliusBrussee/caveman upstream toolkit (caveman-compress carries the "Part of Caveman" branding); `skills/compress/` looks like a stripped-down copy that lost README + SECURITY + branding. Never reconciled until this task.
- Frontmatter description budget reminder (~900 chars): caveman-compress description is well under, no risk on this edit.