From 6de595e8d5782f17e8cb760fd2066ee1c3066bf1 Mon Sep 17 00:00:00 2001 From: garrytan Date: Sat, 3 Oct 2026 21:34:19 +0000 Subject: [PATCH] B5: shorter capture variable names (parity budget) --- investigate/SKILL.md.tmpl | 4 ++-- qa/SKILL.md.tmpl | 4 ++-- scripts/resolvers/learnings.ts | 4 ++-- ship/sections/adversarial.md.tmpl | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/investigate/SKILL.md.tmpl b/investigate/SKILL.md.tmpl index ca3533607..7ddded7d3 100644 --- a/investigate/SKILL.md.tmpl +++ b/investigate/SKILL.md.tmpl @@ -106,8 +106,8 @@ Pick ONE keyword from the hypothesis. The keyword should be a noun: the failing Worked examples (investigate-specific): good keywords are `auth-cookie`, `session-expiry`, `redirect-loop`. Bad: `auth.ts:47`, `fix the auth bug`, ``. ```bash -{ _LERR=$(~/.claude/skills/gstack/bin/gstack-learnings-search --query "" --limit 5 2>&1 >&3 3>&-); _LRC=$?; } 3>&1 -[ "$_LRC" = 0 ] || { _LERR=${_LERR%%$'\n'*}; echo "LEARNINGS: unavailable (${_LERR:-exit $_LRC})"; } +{ _LE=$(~/.claude/skills/gstack/bin/gstack-learnings-search --query "" --limit 5 2>&1 >&3 3>&-); _LR=$?; } 3>&1 +[ "$_LR" = 0 ] || { _LE=${_LE%%$'\n'*}; echo "LEARNINGS: unavailable (${_LE:-exit $_LR})"; } ``` If any learnings come back, name which one applies to your investigation in one sentence. If none come back, continue without reference — the absence of a matching prior learning is itself useful information. diff --git a/qa/SKILL.md.tmpl b/qa/SKILL.md.tmpl index 11708c434..5b390f79e 100644 --- a/qa/SKILL.md.tmpl +++ b/qa/SKILL.md.tmpl @@ -158,8 +158,8 @@ only letters, digits or hyphens (e.g., `checkout-button`, `payment`), never a pa quotes, whitespace or other punctuation; simplify to an alphanumeric stem if needed. ```bash -{ _LERR=$(~/.claude/skills/gstack/bin/gstack-learnings-search --query "" --limit 5 2>&1 >&3 3>&-); _LRC=$?; } 3>&1 -[ "$_LRC" = 0 ] || { _LERR=${_LERR%%$'\n'*}; echo "LEARNINGS: unavailable (${_LERR:-exit $_LRC})"; } +{ _LE=$(~/.claude/skills/gstack/bin/gstack-learnings-search --query "" --limit 5 2>&1 >&3 3>&-); _LR=$?; } 3>&1 +[ "$_LR" = 0 ] || { _LE=${_LE%%$'\n'*}; echo "LEARNINGS: unavailable (${_LE:-exit $_LR})"; } ``` Name an applicable learning in one sentence, or continue if none applies. diff --git a/scripts/resolvers/learnings.ts b/scripts/resolvers/learnings.ts index a00528c31..964a0c567 100644 --- a/scripts/resolvers/learnings.ts +++ b/scripts/resolvers/learnings.ts @@ -26,8 +26,8 @@ const QUERY_SAFE_RE = /^[A-Za-z0-9 _-]+$/; * exit status kept, so a missing bun or a failed script prints why instead of * reading as "nothing recorded". Two lines: the capture, then the verdict. */ -export const learningsCapture = (command: string) => `{ _LERR=$(${command} 2>&1 >&3 3>&-); _LRC=$?; } 3>&1`; -export const LEARNINGS_VERDICT = `[ "$_LRC" = 0 ] || { _LERR=\${_LERR%%$'\\n'*}; echo "LEARNINGS: unavailable (\${_LERR:-exit $_LRC})"; }`; +export const learningsCapture = (command: string) => `{ _LE=$(${command} 2>&1 >&3 3>&-); _LR=$?; } 3>&1`; +export const LEARNINGS_VERDICT = `[ "$_LR" = 0 ] || { _LE=\${_LE%%$'\\n'*}; echo "LEARNINGS: unavailable (\${_LE:-exit $_LR})"; }`; export function generateLearningsSearch(ctx: TemplateContext, args?: string[]): string { // Parse query= arg. Empty value falls through to no-query (principle of least surprise: diff --git a/ship/sections/adversarial.md.tmpl b/ship/sections/adversarial.md.tmpl index 16665f0f8..fe27bb106 100644 --- a/ship/sections/adversarial.md.tmpl +++ b/ship/sections/adversarial.md.tmpl @@ -14,8 +14,8 @@ be alphanumeric or hyphen only; simplify other characters. For example, use `token-or-search`, not `feat: token-or search`. ```bash -{ _LERR=$(~/.claude/skills/gstack/bin/gstack-learnings-search --query "" --limit 5 2>&1 >&3 3>&-); _LRC=$?; } 3>&1 -[ "$_LRC" = 0 ] || { _LERR=${_LERR%%$'\n'*}; echo "LEARNINGS: unavailable (${_LERR:-exit $_LRC})"; } +{ _LE=$(~/.claude/skills/gstack/bin/gstack-learnings-search --query "" --limit 5 2>&1 >&3 3>&-); _LR=$?; } 3>&1 +[ "$_LR" = 0 ] || { _LE=${_LE%%$'\n'*}; echo "LEARNINGS: unavailable (${_LE:-exit $_LR})"; } ``` Name an applicable learning and its effect on the version bump or CHANGELOG in