diff --git a/docs/skills.md b/docs/skills.md index 6a003e8c2..66cc15ec1 100644 --- a/docs/skills.md +++ b/docs/skills.md @@ -910,7 +910,7 @@ gstack's own templates and for any skill folder you own. `/write-skill` is not `/skillify`: `/skillify` codifies a browser scrape into a browser-skill. Adapted from [nicobailon/skill-diet](https://github.com/nicobailon/skill-diet) (MIT). The first diet, /learn, cut its template from -5,797 to 2,707 bytes. +5,797 to 2,955 bytes. ## `/test-audit` diff --git a/learn/SKILL.md b/learn/SKILL.md index d35c1feda..bd368ee9d 100644 --- a/learn/SKILL.md +++ b/learn/SKILL.md @@ -101,18 +101,18 @@ telemetry — it never blocks the workflow. **Hard gate:** manage learnings only. Make no code changes, even when a learning names a fix. -`~/.claude/skills/gstack/bin/gstack-learnings-search` reads this project's learnings (latest entry per key+type); -`~/.claude/skills/gstack/bin/gstack-learnings-log` appends one. Both take `--help`. Pick the mode from the request: +`gstack-learnings-search` reads this project's learnings (latest entry per key+type); `gstack-learnings-log` +appends one. Both live in `~/.claude/skills/gstack/bin/` and take `--help`. Pick the mode from the request: | Request | Run | Then | |---|---|---| -| show (default) | `gstack-learnings-search --limit 20` | group by type; if empty, say none are recorded yet and that /review, /ship, /investigate and other skills record them as they work | -| search | `gstack-learnings-search --query "" --limit 20` | show the matches | +| show (default) | `~/.claude/skills/gstack/bin/gstack-learnings-search --limit 20` | group by type; if empty, say none are recorded yet and that /review, /ship, /investigate and other skills record them as they work | +| search | `~/.claude/skills/gstack/bin/gstack-learnings-search --query "" --limit 20` | show the matches | | other projects | add `--cross-project` | only user-stated learnings from other projects appear | -| stats | `gstack-learnings-search --stats` | show the counts as a table | -| export | `gstack-learnings-search --limit 50` | a `## Project Learnings` section, `### s` per type, lines `- **key**: insight (confidence: N/10)`; show it, and write it into CLAUDE.md or a file only if the user asks | -| add | `gstack-learnings-log ''` | ask only for what is missing: type, kebab-case key, one-sentence insight, confidence 1-10, files; `"source":"user-stated"` | -| prune | `gstack-learnings-search --limit 100` | see Prune | +| stats | `~/.claude/skills/gstack/bin/gstack-learnings-search --stats` | show the counts as a table | +| export | `~/.claude/skills/gstack/bin/gstack-learnings-search --limit 50` | a `## Project Learnings` section, `### s` per type, lines `- **key**: insight (confidence: N/10)`; show it, and write it into CLAUDE.md or a file only if the user asks | +| add | `~/.claude/skills/gstack/bin/gstack-learnings-log ''` | ask only for what is missing: type, kebab-case key, one-sentence insight, confidence 1-10, files; `"source":"user-stated"` | +| prune | `~/.claude/skills/gstack/bin/gstack-learnings-search --limit 100` | see Prune | ## Prune @@ -120,7 +120,7 @@ Flag each learning that is: - **STALE**: a path in its `files` no longer exists in the repo. - **CONFLICT**: the same key appears under two types with opposing insights (within one type the latest entry already wins). -For each flagged entry, unless the user already approved the action, ask: remove, keep, or update. +For each flagged entry, ask: remove, keep, or update. Only a request that already names the action for these entries ("remove the stale ones without asking") answers it; never infer approval. - Remove: delete its lines (that key and type) from the file this prints, leaving every other line as it is: ```bash SLUG=$(~/.claude/skills/gstack/bin/gstack-slug --get SLUG) diff --git a/learn/SKILL.md.tmpl b/learn/SKILL.md.tmpl index ea36d2d27..187beaab1 100644 --- a/learn/SKILL.md.tmpl +++ b/learn/SKILL.md.tmpl @@ -28,18 +28,18 @@ allowed-tools: **Hard gate:** manage learnings only. Make no code changes, even when a learning names a fix. -`~/.claude/skills/gstack/bin/gstack-learnings-search` reads this project's learnings (latest entry per key+type); -`~/.claude/skills/gstack/bin/gstack-learnings-log` appends one. Both take `--help`. Pick the mode from the request: +`gstack-learnings-search` reads this project's learnings (latest entry per key+type); `gstack-learnings-log` +appends one. Both live in `~/.claude/skills/gstack/bin/` and take `--help`. Pick the mode from the request: | Request | Run | Then | |---|---|---| -| show (default) | `gstack-learnings-search --limit 20` | group by type; if empty, say none are recorded yet and that /review, /ship, /investigate and other skills record them as they work | -| search | `gstack-learnings-search --query "" --limit 20` | show the matches | +| show (default) | `~/.claude/skills/gstack/bin/gstack-learnings-search --limit 20` | group by type; if empty, say none are recorded yet and that /review, /ship, /investigate and other skills record them as they work | +| search | `~/.claude/skills/gstack/bin/gstack-learnings-search --query "" --limit 20` | show the matches | | other projects | add `--cross-project` | only user-stated learnings from other projects appear | -| stats | `gstack-learnings-search --stats` | show the counts as a table | -| export | `gstack-learnings-search --limit 50` | a `## Project Learnings` section, `### s` per type, lines `- **key**: insight (confidence: N/10)`; show it, and write it into CLAUDE.md or a file only if the user asks | -| add | `gstack-learnings-log ''` | ask only for what is missing: type, kebab-case key, one-sentence insight, confidence 1-10, files; `"source":"user-stated"` | -| prune | `gstack-learnings-search --limit 100` | see Prune | +| stats | `~/.claude/skills/gstack/bin/gstack-learnings-search --stats` | show the counts as a table | +| export | `~/.claude/skills/gstack/bin/gstack-learnings-search --limit 50` | a `## Project Learnings` section, `### s` per type, lines `- **key**: insight (confidence: N/10)`; show it, and write it into CLAUDE.md or a file only if the user asks | +| add | `~/.claude/skills/gstack/bin/gstack-learnings-log ''` | ask only for what is missing: type, kebab-case key, one-sentence insight, confidence 1-10, files; `"source":"user-stated"` | +| prune | `~/.claude/skills/gstack/bin/gstack-learnings-search --limit 100` | see Prune | ## Prune @@ -47,7 +47,7 @@ Flag each learning that is: - **STALE**: a path in its `files` no longer exists in the repo. - **CONFLICT**: the same key appears under two types with opposing insights (within one type the latest entry already wins). -For each flagged entry, unless the user already approved the action, ask: remove, keep, or update. +For each flagged entry, ask: remove, keep, or update. Only a request that already names the action for these entries ("remove the stale ones without asking") answers it; never infer approval. - Remove: delete its lines (that key and type) from the file this prints, leaving every other line as it is: ```bash SLUG=$(~/.claude/skills/gstack/bin/gstack-slug --get SLUG) diff --git a/write-skill/SKILL.md b/write-skill/SKILL.md index 97fbf54fd..f579737cc 100644 --- a/write-skill/SKILL.md +++ b/write-skill/SKILL.md @@ -136,7 +136,7 @@ When code changes a name or flag a skill teaches, update the skill in the same c ## 4. Check and record -- Run `gstack-skill-bill` before and after, and put `Skill-Size: → bytes ()` in the commit +- Run `~/.claude/skills/gstack/bin/gstack-skill-bill` before and after, and put `Skill-Size: → bytes ()` in the commit message. DUE means it grew over 10% since its last `Skill-Diet:` commit: diet it instead of adding. - In a gstack checkout: `bun test test/skill-bin-drift.test.ts test/parity-suite.test.ts` and the budgets in CONTRIBUTING.md. A red context-budget ratchet means diet, not a higher ceiling. diff --git a/write-skill/SKILL.md.tmpl b/write-skill/SKILL.md.tmpl index 845dbf5b8..e9fa9189b 100644 --- a/write-skill/SKILL.md.tmpl +++ b/write-skill/SKILL.md.tmpl @@ -63,7 +63,7 @@ When code changes a name or flag a skill teaches, update the skill in the same c ## 4. Check and record -- Run `gstack-skill-bill` before and after, and put `Skill-Size: → bytes ()` in the commit +- Run `~/.claude/skills/gstack/bin/gstack-skill-bill` before and after, and put `Skill-Size: → bytes ()` in the commit message. DUE means it grew over 10% since its last `Skill-Diet:` commit: diet it instead of adding. - In a gstack checkout: `bun test test/skill-bin-drift.test.ts test/parity-suite.test.ts` and the budgets in CONTRIBUTING.md. A red context-budget ratchet means diet, not a higher ceiling. diff --git a/write-skill/references/diet.md b/write-skill/references/diet.md index a3b8c9d83..fe2b3d425 100644 --- a/write-skill/references/diet.md +++ b/write-skill/references/diet.md @@ -5,7 +5,7 @@ nicobailon/skill-diet (MIT) at 5f41df1. ## 1. Report first (free) -Run `gstack-skill-bill ` and, in a gstack checkout, `bun run scripts/skill-bin-drift.ts --skill `. +Run `~/.claude/skills/gstack/bin/gstack-skill-bill ` and, in a gstack checkout, `bun run scripts/skill-bin-drift.ts --skill `. Show the user the size per level, every drift finding, and the moves you propose (what goes to `references/`, to the tool's `--help` or errors, or out). Ask go or no-go before writing eval tasks. @@ -42,7 +42,8 @@ per reference. Run the before, after and no-skill versions through the shared skill eval (docs/designs/SKILL_EVAL_CONTRACT.md), 3 trials each on the same model. Ship only when no task whose before panel passed fails after, no safety task breaks, and after is not worse by more than chance. Until the shared eval is -available, run upstream skill-diet's `scripts/eval.mjs` with the same tasks and apply those rules to its per-task table; +available, run upstream skill-diet's `scripts/eval.mjs` at commit 5f41df1 (the version this text adapts) with the +same tasks and apply those rules to its per-task table; when neither can run, write "eval: not run" and ship only the tool and drift fixes, not the cuts. Commit with `Skill-Diet: ` and `Skill-Size: → bytes ()` lines, and report tokens per run