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>
This commit is contained in:
2026-05-05 21:49:44 +03:00
parent 8c547d73af
commit 6e4f3f481b
16 changed files with 140 additions and 819 deletions

View File

@@ -0,0 +1,91 @@
---
title: compress vs caveman-compress dedup
type: concept
tags: [skills, dedup, caveman, repo-hygiene]
updated: 2026-05-05
---
# compress vs caveman-compress dedup
> Two skills shipped the same payload under different names. Kept `caveman-compress` (richer, on-brand), deleted `compress`. Recorded here so future readers don't reinvent the analysis.
## What we found
Side-by-side audit of `skills/compress/` and `skills/caveman-compress/`:
| Layer | `compress` | `caveman-compress` |
|---|---|---|
| `scripts/__init__.py` | identical (SHA256) | same |
| `scripts/__main__.py` | identical | same |
| `scripts/benchmark.py` | identical | same |
| `scripts/cli.py` | identical | same |
| `scripts/compress.py` | identical | same |
| `scripts/detect.py` | identical | same |
| `scripts/validate.py` | identical | same |
| `SKILL.md` description | byte-identical text | byte-identical text |
| `SKILL.md` Process step 2 | `cd <directory_containing_this_SKILL.md> && python3 -m scripts ...` (generic) | `cd caveman-compress && python3 -m scripts ...` (brittle, assumes cwd is parent) |
| `SKILL.md` `name:` | `compress` | `caveman-compress` |
| `README.md` | absent | present (benchmarks table, branding, "Part of Caveman" toolkit linkage) |
| `SECURITY.md` | absent | present (Snyk false-positive writeup: subprocess + file I/O patterns explained) |
| Frontmatter `version:` | absent | absent (added `1.0.0` as part of this dedup) |
Description text in both skills' frontmatter:
```
Compress natural language memory files (CLAUDE.md, todos, preferences) into caveman format
to save input tokens. ... Trigger: /caveman:compress <filepath> or "compress memory file"
```
— literally the same paragraph. The harness loads both skill listings, both register independently, descriptions identical ⇒ activation tie-break is arbitrary, and the listing budget pays twice.
## What we kept and why
**Canonical = `caveman-compress`.** Reasons in order of weight:
1. **Richer artefacts** — README.md and SECURITY.md exist only here. The README is not boilerplate: benchmarks table on real files (claude-md-preferences.md, project-notes.md, mixed-with-code.md), 46% average savings claim, before/after example. The SECURITY.md is what static-analysis (Snyk) hooks into, so deleting it would re-open the same false-positive ticket the upstream author already closed.
2. **On-brand naming** — the skill is part of the [JuliusBrussee/caveman](https://github.com/JuliusBrussee/caveman) toolkit. The `caveman-*` prefix lines up with the rest of the cluster: `caveman` (speak compressed), `caveman-commit` (commit-message variant), `caveman-review` (PR-review variant), `caveman-help` (help card), `caveman-compress` (compress files). `compress` was the lone exception that broke the prefix invariant.
3. **History reads cleanly** — the per-task `[skill-readmes]` plan groups the caveman cluster as a single batch for README work. Keeping the prefix means that batch covers all of them; mixing in a stray `compress` would force a "wait, do we README this one separately?" decision later.
## What we ported across before deleting
The only thing `compress` did better than `caveman-compress` was Process step 2. Original wording:
```
cd caveman-compress && python3 -m scripts <absolute_filepath>
```
This assumes cwd is the parent of `caveman-compress/`. When the agent invokes the skill from `~/.claude/skills/caveman-compress/`, that assumption is false (cwd is the skills dir, parent is `~/.claude/`). The `compress` SKILL.md had the robust form:
```
cd <directory_containing_this_SKILL.md> && python3 -m scripts <absolute_filepath>
```
— ported into `caveman-compress/SKILL.md` as part of this dedup. Net: the canonical skill now has the better instructions plus the README + SECURITY.
Also added `version: 1.0.0` to frontmatter — first versioned release. Aligns with the rest of the infra-skill cluster ([skill-versioning](skill-versioning.md)).
## What we rejected
**Alias-stub** — keep `skills/compress/SKILL.md` as a tiny pointer file with description "alias for caveman-compress, see that skill". Rejected: the harness has no alias mechanism. Every SKILL.md file fully registers as a skill, with its description text consuming the listing budget. An alias-stub still occupies a listing slot and a description allowance — there's no "see that skill" indirection at the harness level. Pure waste of a listing entry.
**Keep both, document them as siblings** — let the user pick which slash-command name they prefer (`/compress` vs `/caveman-compress`). Rejected: descriptions are identical; the harness has no signal to disambiguate; activation tie-break is arbitrary. Forces every future `/caveman:compress` call to gamble on which copy the harness picks.
**Delete `caveman-compress`, keep `compress` as the simpler name** — rejected because we'd lose the README, SECURITY.md, and the caveman-toolkit branding link. `compress` was the stripped-down fork; reverting to it would be a net regression in artefact quality.
## Install-path impact
`scripts/install.sh` has no prune step. Removing `skills/compress/` does **not** remove `~/.claude/skills/compress/` on the user's machine — the install script copies, never deletes. Manual `rm -rf ~/.claude/skills/compress/` is required during this dedup. Same applies to `dist/compress.skill`: deleted explicitly, since the next `build.sh` run iterates over `skills/<name>/` and won't recreate an artefact for a source folder that no longer exists.
> **Future work:** the [`install-ps1`](../../.tasks/STATUS.md) ⚪ task should at minimum match `install.sh`'s behavior, but is also the right time to add a `--prune` flag that removes `~/.claude/skills/<name>/` for every name not in `skills/<name>/`. Would have made this dedup automatic instead of three-step.
## Slash-command impact
Before: `/compress`, `/caveman-compress`, and `/caveman:compress` (toolkit-canonical) were all live.
After: `/compress` is gone. `/caveman-compress` and `/caveman:compress` still work. User confirmed `/compress` was effectively never used; no migration needed.
## See also
- [skill-versioning](skill-versioning.md) — why infra skills carry `version:` in frontmatter and the project-discipline Rule 3 bumps tie back here
- [repo-layout](repo-layout.md) — flat `skills/` layout means duplicates show up as flat sibling folders, easy to spot in a directory listing
- [skill-vs-plugin](skill-vs-plugin.md) — caveman-compress is a bare SKILL.md (no slash command, no hooks, no MCP), the right granularity for this workload

View File

@@ -28,6 +28,7 @@ Catalog of all wiki pages. One line per page, organized by type. Updated on ever
- [skill-vs-plugin.md](concepts/skill-vs-plugin.md) — when a bare SKILL.md is enough vs when you actually need a plugin (slash commands, hooks, sub-agents, MCP servers); concrete breakdown of `superpowers`
- [wiki-realignment.md](concepts/wiki-realignment.md) — fixing `project-bootstrap` to create the Karpathy-canonical wiki layout
- [interns-design](concepts/interns-design.md) — interns-design
- [compress-dedup.md](concepts/compress-dedup.md) — `skills/compress/` deleted as a byte-identical dupe of `skills/caveman-compress/`; canonical kept for README + SECURITY + caveman-toolkit branding; better Process-step wording ported across; `version: 1.0.0` added to caveman-compress frontmatter
## Packages

View File

@@ -45,3 +45,4 @@ Parseable: `grep "^## \[" .wiki/log.md | tail -20`.
## [2026-05-05] decision | interns-skills-mvp — shipped `setup-interns` v0.1.0 (8-phase install: detect `.common/lib/interns-mcp/`, `pip install -e`, `.common/secrets/interns.env` write, `mcpServers.interns` registration with absolute Python interpreter + `cwd`) and `using-interns` v0.1.0 (runtime policy mirroring project-discipline Rule 4: ask-mode default, conversational grant/revoke, always-ask paths for `.env`/secrets/keys/SSH/credentials with transitive rule, cost-cap >$0.10, session-end reset; routing hints for `bulk_text_read` + `transcript_distill`); `project-bootstrap` 1.5.0→1.6.0 with canonical CLAUDE.md trigger `delegate to interns when allowed` between `follow project discipline` and `we're on Windows`, Step 5 commentary paragraph, manifest table extended with both new skills + `project-discipline` row; root `CLAUDE.md` dogfood updated; both READMEs written; descriptions verified (setup-interns 899 chars, using-interns 814 chars, both under 900 budget); all three rebuilt + installed + listed by harness with full descriptions (no H1 fallback)
## [2026-05-05] ingest | concepts/bootstrap-skill-deps-check
## [2026-05-05] decision | bootstrap-skill-deps-check — `project-bootstrap` 1.6.0→1.7.0 collapses Step 5.6 from a single-skill detector (only `superpowers` plugin) into a generic `trigger → fulfiller` table walker. Map embedded in SKILL.md (9 rows: caveman, superpowers plugin, using-wiki, using-tasks, using-projects-meta, pulling-before-work, project-discipline, using-interns, active-platform); `kind: skill` vs `kind: plugin` flag drives the install command emitted in the recommendation block. Algorithm: read project's CLAUDE.md → match each line vs map (substring + tolower, mirrors Step 5 idempotent merge) → for each canonical match check disk (`~/.claude/skills/<name>/SKILL.md` or `installed_plugins.json` key); print one chat-only block listing every missing fulfiller + install commands, or one ✅ line if all satisfied. User-custom lines silently skipped; removed canonical lines silently skipped (respects user opt-out). Hard rule "never auto-install" carries over verbatim. Subsumes the deferred `[bootstrap-recommend-projects-meta]` task (closed by absorption — generic step handles `using-projects-meta` along with everything else). MCP-server-backed skills only check the `using-X` policy skill; `setup-X` self-fires on first use via Prerequisites pointer, bootstrap doesn't duplicate.
## [2026-05-05] decision | compress-dedup — `skills/compress/` was a stripped-down byte-for-byte dupe of `skills/caveman-compress/` (scripts/ identical SHA256 across all 7 files; SKILL.md diff = `name:` + Process step 2; descriptions textually identical = arbitrary harness tie-break + double-counted listing budget). Kept `caveman-compress` canonical: it carries README.md (benchmarks table + caveman-toolkit branding) and SECURITY.md (Snyk false-positive writeup), and matches the caveman-* prefix invariant. Ported the better Process-step wording from `compress` into `caveman-compress` (`cd <directory_containing_this_SKILL.md>` instead of brittle `cd caveman-compress` which assumes cwd). Added `version: 1.0.0` to caveman-compress frontmatter (first versioned release; aligns with skill-versioning concept). Deleted: `skills/compress/`, `dist/compress.skill`, `~/.claude/skills/compress/` (manual prune — install.sh has no prune step; future `[install-ps1]` task should add `--prune` flag). Rebuilt + reinstalled `caveman-compress`. Slash-command impact: `/compress` removed; `/caveman-compress` + `/caveman:compress` (toolkit-canonical) remain. Concept page `concepts/compress-dedup.md` written (rationale + rejected alternatives: alias-stub has no harness mechanism; "keep both" wastes listing budget; "delete caveman-compress" loses README + SECURITY).