mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-02 23:14:33 +01:00
* test(skill-evals): /learn before/after tasks, written before any cut (GSTA-133) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(learnings): --help, unknown-flag errors and --stats on the learnings bins; cross-project search no longer drops every project when the state root path contains the slug Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * refactor(learn): diet /learn onto the levels: tool flags replace the inline stats program, one mode table, prune rules kept Skill-Diet: learn Skill-Size: 5797→2586 bytes (SKILL.md.tmpl) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * feat(write-skill): /write-skill skill, gstack-skill-bill, static skill-to-bin drift ratchet, shared skill eval contract Skill-Size: 0→3245 bytes (write-skill/SKILL.md.tmpl) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(learn): guard the state-root lookup in Prune; re-measure the learn ceiling Skill-Size: 2586→2707 bytes (learn/SKILL.md.tmpl) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: pre-landing review fixes (drift scanner, learnings flags, skill-bill baselines, eval fixtures) - skill-bin-drift: a redirect no longer ends a command, so `bin/x 2>/dev/null --bogus` is checked - gstack-learnings-search: a missing value or a non-positive --limit exits 2 like an unknown flag - gstack-skill-bill: the gstack root skill is a checkout skill; Skill-Diet trailers match the exact name; the baseline counts the committed bytes untrimmed - skill-evals task files get a free contract test and are registered in FREE_FIXTURES, with the drift allowlist - learn eval: the no-code-change safety task no longer asks the model to fix code (its check penalised obeying the user) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * 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> * docs(changelog): /write-skill, gstack-skill-bill, drift ratchet, eval contract, /learn diet Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: drift ratchet in CONTRIBUTING's static tests; /learn prune example asks per entry Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(skill-bill): report a checkout skill's eval task file and check it against the contract The skill-evals task-file test now exercises lib/skill-bill.ts's checkEvalTasks, with a negative control, instead of a test-only validator (test-of-test ratchet). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(skill-bill): EVAL TASKS path uses forward slashes on every platform; a non-object task entry is a problem, not a crash Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(learn): BASH_COMPAT guard on in-window heredocs; count skill-e2e-write-skill in the paid census Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
58 lines
2.9 KiB
Cheetah
58 lines
2.9 KiB
Cheetah
---
|
|
name: learn
|
|
preamble-tier: 2
|
|
version: 1.1.0
|
|
description: |
|
|
Manage project learnings. Review, search, prune, and export what gstack
|
|
has learned across sessions. Use when asked to "what have we learned",
|
|
"show learnings", "prune stale learnings", or "export learnings".
|
|
Proactively suggest when the user asks about past patterns or wonders
|
|
"didn't we fix this before?"
|
|
triggers:
|
|
- show learnings
|
|
- what have we learned
|
|
- manage project learnings
|
|
allowed-tools:
|
|
- Bash
|
|
- Read
|
|
- Write
|
|
- Edit
|
|
- AskUserQuestion
|
|
- Glob
|
|
- Grep
|
|
---
|
|
|
|
{{PREAMBLE}}
|
|
|
|
# /learn: project learnings
|
|
|
|
**Hard gate:** manage learnings only. Make no code changes, even when a learning names a fix.
|
|
|
|
`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) | `~/.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 | `~/.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
|
|
|
|
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, 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)
|
|
GSTACK_STATE_ROOT=$(~/.claude/skills/gstack/bin/gstack-paths --get GSTACK_STATE_ROOT); : "${GSTACK_STATE_ROOT:?gstack-paths failed; reinstall with ./setup or /gstack-upgrade}"
|
|
echo "$GSTACK_STATE_ROOT/projects/$SLUG/learnings.jsonl"
|
|
```
|
|
- Update: log a corrected entry with the same key and type; the latest one wins.
|