mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-20 23:23:26 +01:00
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>
This commit is contained in:
1 parent
b286989895
commit
92c90ba66e
32 files changed
+1948
-11
No files matched your search
@@ -8,7 +8,7 @@ GSTACK_DOCTOR_COMPONENTS="claude codex patch codex-cli browse-bundle browser cso
|
||||
GSTACK_DOCTOR_CORE="runtime pins state-root privacy cores revision floor wrapper"
|
||||
GSTACK_DOCTOR_HOSTS="claude codex"
|
||||
GSTACK_DOCTOR_OPTIONAL="codex-cli cso"
|
||||
GSTACK_DOCTOR_SKILLS="autoplan plan-ceo-review plan-eng-review plan-design-review plan-devex-review plan-tune office-hours spec review ship investigate codex cso browse qa qa-only design-review design-consultation design-html design-motion devex-review scrape skillify canary benchmark make-pdf diagram pair-agent open-gstack-browser setup-browser-cookies connect-chrome land-and-deploy benchmark-models captain careful claude-code context-restore context-save design-shotgun deslop-shared-libs document-generate document-release eval-plan freeze gstack-upgrade guard health ios-clean ios-design-review ios-fix ios-qa ios-sync landing-report learn modernize retro setup-deploy setup-gbrain sync-gbrain test-audit ubicloud unfreeze review-voice"
|
||||
GSTACK_DOCTOR_SKILLS="autoplan plan-ceo-review plan-eng-review plan-design-review plan-devex-review plan-tune office-hours spec review ship investigate codex cso browse qa qa-only design-review design-consultation design-html design-motion devex-review scrape skillify canary benchmark make-pdf diagram pair-agent open-gstack-browser setup-browser-cookies connect-chrome land-and-deploy benchmark-models captain careful claude-code context-restore context-save design-shotgun deslop-shared-libs document-generate document-release eval-plan freeze gstack-upgrade guard health ios-clean ios-design-review ios-fix ios-qa ios-sync landing-report learn write-skill modernize retro setup-deploy setup-gbrain sync-gbrain test-audit ubicloud unfreeze review-voice"
|
||||
GSTACK_BROWSER_LAZY_REASON="lazy; gstack-browser-ensure installs on first use"
|
||||
GSTACK_DOCTOR_HELPERS="gstack-pregate gstack-plan-reality gstack-artifact gstack-autoplan"
|
||||
GSTACK_DOCTOR_NOT_NEEDED="none"
|
||||
@@ -69,7 +69,7 @@ gstack_doctor_skill_requires() {
|
||||
codex) printf '%s' 'claude codex patch codex-cli' ;;
|
||||
cso) printf '%s' 'claude cso' ;;
|
||||
browse|qa|qa-only|design-review|design-consultation|design-html|design-motion|devex-review|scrape|skillify|canary|benchmark|make-pdf|diagram|pair-agent|open-gstack-browser|setup-browser-cookies|connect-chrome|land-and-deploy) printf '%s' 'claude codex patch browse-bundle browser' ;;
|
||||
benchmark-models|captain|careful|claude-code|context-restore|context-save|design-shotgun|deslop-shared-libs|document-generate|document-release|eval-plan|freeze|gstack-upgrade|guard|health|ios-clean|ios-design-review|ios-fix|ios-qa|ios-sync|landing-report|learn|modernize|retro|setup-deploy|setup-gbrain|sync-gbrain|test-audit|ubicloud|unfreeze) printf '%s' 'claude' ;;
|
||||
benchmark-models|captain|careful|claude-code|context-restore|context-save|design-shotgun|deslop-shared-libs|document-generate|document-release|eval-plan|freeze|gstack-upgrade|guard|health|ios-clean|ios-design-review|ios-fix|ios-qa|ios-sync|landing-report|learn|write-skill|modernize|retro|setup-deploy|setup-gbrain|sync-gbrain|test-audit|ubicloud|unfreeze) printf '%s' 'claude' ;;
|
||||
review-voice) printf '%s' 'helpers' ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
@@ -82,7 +82,7 @@ gstack_doctor_skill_optional() {
|
||||
codex) printf '%s' '' ;;
|
||||
cso) printf '%s' '' ;;
|
||||
browse|qa|qa-only|design-review|design-consultation|design-html|design-motion|devex-review|scrape|skillify|canary|benchmark|make-pdf|diagram|pair-agent|open-gstack-browser|setup-browser-cookies|connect-chrome|land-and-deploy) printf '%s' 'codex-cli' ;;
|
||||
benchmark-models|captain|careful|claude-code|context-restore|context-save|design-shotgun|deslop-shared-libs|document-generate|document-release|eval-plan|freeze|gstack-upgrade|guard|health|ios-clean|ios-design-review|ios-fix|ios-qa|ios-sync|landing-report|learn|modernize|retro|setup-deploy|setup-gbrain|sync-gbrain|test-audit|ubicloud|unfreeze) printf '%s' '' ;;
|
||||
benchmark-models|captain|careful|claude-code|context-restore|context-save|design-shotgun|deslop-shared-libs|document-generate|document-release|eval-plan|freeze|gstack-upgrade|guard|health|ios-clean|ios-design-review|ios-fix|ios-qa|ios-sync|landing-report|learn|write-skill|modernize|retro|setup-deploy|setup-gbrain|sync-gbrain|test-audit|ubicloud|unfreeze) printf '%s' '' ;;
|
||||
review-voice) printf '%s' '' ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env -S bun --no-env-file --config=/dev/null
|
||||
// gstack-skill-bill — size per level for one skill and growth since its last diet. Logic: lib/skill-bill.ts.
|
||||
import { buildSkillBill, renderSkillBill, resolveSkill, SkillBillError } from "../lib/skill-bill";
|
||||
|
||||
const USAGE = `Usage: gstack-skill-bill <skill-name|skill-dir> [--json]
|
||||
gstack-skill-bill --help
|
||||
|
||||
Prints bytes and estimated tokens for each level of one skill: its description (loaded every
|
||||
session), SKILL.md and its template (every use), and sections/ or references/ files (on demand).
|
||||
Names the skill's kind: gstack-checkout (edit SKILL.md.tmpl, then bun run gen:skill-docs),
|
||||
gstack-install (never edit; gstack-upgrade overwrites it) or user. BASELINE is the newest commit
|
||||
with a "Skill-Diet: <name>" trailer; DUE means the authored file grew over 10% since then.
|
||||
A name must match exactly; pass a path when it names more than one skill.
|
||||
Exit 0 on a report, 2 on SKILL_NOT_FOUND, SKILL_AMBIGUOUS or SKILL_MD_MISSING (each with a fix line).`;
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
if (args.includes("--help") || args.includes("-h")) { console.log(USAGE); process.exit(0); }
|
||||
const unknown = args.find((a) => a.startsWith("-") && a !== "--json");
|
||||
const targets = args.filter((a) => !a.startsWith("-"));
|
||||
if (unknown || targets.length !== 1) {
|
||||
console.error(unknown ? `gstack-skill-bill: unknown argument '${unknown}'; valid: --json --help` : USAGE);
|
||||
process.exit(2);
|
||||
}
|
||||
try {
|
||||
const report = buildSkillBill(resolveSkill(targets[0], process.cwd()));
|
||||
console.log(args.includes("--json") ? JSON.stringify(report, null, 2) : renderSkillBill(report));
|
||||
} catch (e) {
|
||||
if (!(e instanceof SkillBillError)) throw e;
|
||||
console.error(`gstack-skill-bill: ${e.message} (${e.code})\nfix: ${e.fix}`);
|
||||
process.exit(2);
|
||||
}
|
||||
Reference in new issue
Block a user