mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-05 08:23:59 +01:00
fix(learn,write-skill): full bin paths in the mode table; prune asks per entry unless the request names the action
Skill-Diet: learn Skill-Size: 2707→2955 bytes (learn/SKILL.md.tmpl) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
a57463ad1d
commit
d4303d223d
6 files changed
+24
-23
No files matched your search
+1
-1
@@ -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`
|
||||
|
||||
|
||||
+9
-9
@@ -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 "<words>" --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 "<words>" --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, `### <Type>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 '<json>'` | 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, `### <Type>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 '<json>'` | 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)
|
||||
|
||||
+9
-9
@@ -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 "<words>" --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 "<words>" --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, `### <Type>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 '<json>'` | 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, `### <Type>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 '<json>'` | 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)
|
||||
|
||||
@@ -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: <before>→<after> bytes (<file>)` in the commit
|
||||
- Run `~/.claude/skills/gstack/bin/gstack-skill-bill` before and after, and put `Skill-Size: <before>→<after> bytes (<file>)` 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.
|
||||
|
||||
@@ -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: <before>→<after> bytes (<file>)` in the commit
|
||||
- Run `~/.claude/skills/gstack/bin/gstack-skill-bill` before and after, and put `Skill-Size: <before>→<after> bytes (<file>)` 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.
|
||||
|
||||
@@ -5,7 +5,7 @@ nicobailon/skill-diet (MIT) at 5f41df1.
|
||||
|
||||
## 1. Report first (free)
|
||||
|
||||
Run `gstack-skill-bill <skill>` and, in a gstack checkout, `bun run scripts/skill-bin-drift.ts --skill <skill>`.
|
||||
Run `~/.claude/skills/gstack/bin/gstack-skill-bill <skill>` and, in a gstack checkout, `bun run scripts/skill-bin-drift.ts --skill <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: <name>` and `Skill-Size: <before>→<after> bytes (<file>)` lines, and report tokens per run
|
||||
|
||||
Reference in new issue
Block a user