From b6fcfd84b7f959b32dd8468c89653b965313b7b5 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sun, 29 Mar 2026 21:02:50 -0700 Subject: [PATCH 1/6] refactor: remove dead contributor mode, replace with operational self-improvement slot Contributor mode never fired in 18 days of heavy use (required manual opt-in via gstack-config, gated behind _CONTRIB=true, wrote disconnected markdown). Removes: generateContributorMode(), _CONTRIB bash var, 2 E2E tests, touchfile entry, doc references. Cleans up skip-lists in plan-ceo-review, autoplan, review resolver, and document-release templates. The operational self-improvement system (next commit) replaces this slot with automatic learning capture that requires no opt-in. Co-Authored-By: Claude Opus 4.6 (1M context) --- ARCHITECTURE.md | 2 +- CONTRIBUTING.md | 23 +++++--------- SKILL.md | 19 ------------ autoplan/SKILL.md | 21 ------------- autoplan/SKILL.md.tmpl | 1 - benchmark/SKILL.md | 19 ------------ browse/SKILL.md | 19 ------------ canary/SKILL.md | 19 ------------ codex/SKILL.md | 19 ------------ connect-chrome/SKILL.md | 19 ------------ cso/SKILL.md | 19 ------------ design-consultation/SKILL.md | 19 ------------ design-review/SKILL.md | 19 ------------ design-shotgun/SKILL.md | 19 ------------ document-release/SKILL.md | 21 +------------ document-release/SKILL.md.tmpl | 2 +- investigate/SKILL.md | 19 ------------ land-and-deploy/SKILL.md | 19 ------------ learn/SKILL.md | 19 ------------ office-hours/SKILL.md | 19 ------------ plan-ceo-review/SKILL.md | 22 +------------ plan-ceo-review/SKILL.md.tmpl | 2 +- plan-design-review/SKILL.md | 19 ------------ plan-eng-review/SKILL.md | 20 ------------ qa-only/SKILL.md | 19 ------------ qa/SKILL.md | 19 ------------ retro/SKILL.md | 19 ------------ review/SKILL.md | 19 ------------ scripts/resolvers/preamble.ts | 24 +-------------- scripts/resolvers/review.ts | 1 - setup-browser-cookies/SKILL.md | 19 ------------ setup-deploy/SKILL.md | 19 ------------ ship/SKILL.md | 19 ------------ test/gen-skill-docs.test.ts | 8 ++--- test/helpers/touchfiles.ts | 2 -- test/skill-e2e-bws.test.ts | 45 --------------------------- test/skill-e2e.test.ts | 56 ---------------------------------- 37 files changed, 18 insertions(+), 650 deletions(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index e9d63d83b..086bb2e43 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -217,7 +217,7 @@ Every skill starts with a `{{PREAMBLE}}` block that runs before the skill's own 1. **Update check** — calls `gstack-update-check`, reports if an upgrade is available. 2. **Session tracking** — touches `~/.gstack/sessions/$PPID` and counts active sessions (files modified in the last 2 hours). When 3+ sessions are running, all skills enter "ELI16 mode" — every question re-grounds the user on context because they're juggling windows. -3. **Contributor mode** — reads `gstack_contributor` from config. When true, the agent files casual field reports to `~/.gstack/contributor-logs/` when gstack itself misbehaves. +3. **Operational self-improvement** — at the end of every skill session, the agent reflects on failures (CLI errors, wrong approaches, project quirks) and logs operational learnings to the project's JSONL file for future sessions. 4. **AskUserQuestion format** — universal format: context, question, `RECOMMENDATION: Choose X because ___`, lettered options. Consistent across all skills. 5. **Search Before Building** — before building infrastructure or unfamiliar patterns, search first. Three layers of knowledge: tried-and-true (Layer 1), new-and-popular (Layer 2), first-principles (Layer 3). When first-principles reasoning reveals conventional wisdom is wrong, the agent names the "eureka moment" and logs it. See `ETHOS.md` for the full builder philosophy. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b6dba47cd..fcb9c279a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,26 +20,19 @@ Now edit any `SKILL.md`, invoke it in Claude Code (e.g. `/review`), and see your bin/dev-teardown # deactivate — back to your global install ``` -## Contributor mode +## Operational self-improvement -Contributor mode turns gstack into a self-improving tool. Enable it and Claude Code -will periodically reflect on its gstack experience — rating it 0-10 at the end of -each major workflow step. When something isn't a 10, it thinks about why and files -a report to `~/.gstack/contributor-logs/` with what happened, repro steps, and what -would make it better. +gstack automatically learns from failures. At the end of every skill session, the agent +reflects on what went wrong (CLI errors, wrong approaches, project quirks) and logs +operational learnings to `~/.gstack/projects/{slug}/learnings.jsonl`. Future sessions +surface these learnings automatically, so gstack gets smarter on your codebase over time. -```bash -~/.claude/skills/gstack/bin/gstack-config set gstack_contributor true -``` - -The logs are for **you**. When something bugs you enough to fix, the report is -already written. Fork gstack, symlink your fork into the project where you hit -the issue, fix it, and open a PR. +No setup needed. Learnings are logged automatically. View them with `/learn`. ### The contributor workflow -1. **Use gstack normally** — contributor mode reflects and logs issues automatically -2. **Check your logs:** `ls ~/.gstack/contributor-logs/` +1. **Use gstack normally** — operational learnings are captured automatically +2. **Check your learnings:** `/learn` or `ls ~/.gstack/projects/*/learnings.jsonl` 3. **Fork and clone gstack** (if you haven't already) 4. **Symlink your fork into the project where you hit the bug:** ```bash diff --git a/SKILL.md b/SKILL.md index ec0ed5aa5..9849e78fe 100644 --- a/SKILL.md +++ b/SKILL.md @@ -25,7 +25,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -155,24 +154,6 @@ This only happens once. If `PROACTIVE_PROMPTED` is `yes`, skip this entirely. The user always has context you don't. Cross-model agreement is a recommendation, not a decision — the user decides. -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: diff --git a/autoplan/SKILL.md b/autoplan/SKILL.md index 338a1af89..7831d0b4a 100644 --- a/autoplan/SKILL.md +++ b/autoplan/SKILL.md @@ -34,7 +34,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -247,24 +246,6 @@ Before building anything unfamiliar, **search first.** See `~/.claude/skills/gst jq -n --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$(git branch --show-current 2>/dev/null)" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> ~/.gstack/analytics/eureka.jsonl 2>/dev/null || true ``` -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: @@ -430,7 +411,6 @@ Follow it inline, **skipping these sections** (already handled by the parent ski - AskUserQuestion Format - Completeness Principle — Boil the Lake - Search Before Building -- Contributor Mode - Completion Status Protocol - Telemetry (run last) @@ -623,7 +603,6 @@ Read each file using the Read tool: - AskUserQuestion Format - Completeness Principle — Boil the Lake - Search Before Building -- Contributor Mode - Completion Status Protocol - Telemetry (run last) - Step 0: Detect base branch diff --git a/autoplan/SKILL.md.tmpl b/autoplan/SKILL.md.tmpl index 5577b64bc..2d137334f 100644 --- a/autoplan/SKILL.md.tmpl +++ b/autoplan/SKILL.md.tmpl @@ -202,7 +202,6 @@ Read each file using the Read tool: - AskUserQuestion Format - Completeness Principle — Boil the Lake - Search Before Building -- Contributor Mode - Completion Status Protocol - Telemetry (run last) - Step 0: Detect base branch diff --git a/benchmark/SKILL.md b/benchmark/SKILL.md index 10d716737..929140835 100644 --- a/benchmark/SKILL.md +++ b/benchmark/SKILL.md @@ -27,7 +27,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -157,24 +156,6 @@ This only happens once. If `PROACTIVE_PROMPTED` is `yes`, skip this entirely. The user always has context you don't. Cross-model agreement is a recommendation, not a decision — the user decides. -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: diff --git a/browse/SKILL.md b/browse/SKILL.md index 440871c86..d97d737d3 100644 --- a/browse/SKILL.md +++ b/browse/SKILL.md @@ -27,7 +27,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -157,24 +156,6 @@ This only happens once. If `PROACTIVE_PROMPTED` is `yes`, skip this entirely. The user always has context you don't. Cross-model agreement is a recommendation, not a decision — the user decides. -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: diff --git a/canary/SKILL.md b/canary/SKILL.md index c91bf15d5..a711689df 100644 --- a/canary/SKILL.md +++ b/canary/SKILL.md @@ -27,7 +27,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -222,24 +221,6 @@ AI makes completeness near-free. Always recommend the complete option over short Include `Completeness: X/10` for each option (10=all edge cases, 7=happy path, 3=shortcut). -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: diff --git a/codex/SKILL.md b/codex/SKILL.md index a9f409cf4..ea3657764 100644 --- a/codex/SKILL.md +++ b/codex/SKILL.md @@ -28,7 +28,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -241,24 +240,6 @@ Before building anything unfamiliar, **search first.** See `~/.claude/skills/gst jq -n --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$(git branch --show-current 2>/dev/null)" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> ~/.gstack/analytics/eureka.jsonl 2>/dev/null || true ``` -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: diff --git a/connect-chrome/SKILL.md b/connect-chrome/SKILL.md index 58df84f99..fe0d14e63 100644 --- a/connect-chrome/SKILL.md +++ b/connect-chrome/SKILL.md @@ -25,7 +25,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -238,24 +237,6 @@ Before building anything unfamiliar, **search first.** See `~/.claude/skills/gst jq -n --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$(git branch --show-current 2>/dev/null)" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> ~/.gstack/analytics/eureka.jsonl 2>/dev/null || true ``` -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: diff --git a/cso/SKILL.md b/cso/SKILL.md index 14b712f49..77b11979d 100644 --- a/cso/SKILL.md +++ b/cso/SKILL.md @@ -31,7 +31,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -226,24 +225,6 @@ AI makes completeness near-free. Always recommend the complete option over short Include `Completeness: X/10` for each option (10=all edge cases, 7=happy path, 3=shortcut). -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: diff --git a/design-consultation/SKILL.md b/design-consultation/SKILL.md index dc5c9ec7e..cc73ec6a2 100644 --- a/design-consultation/SKILL.md +++ b/design-consultation/SKILL.md @@ -32,7 +32,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -245,24 +244,6 @@ Before building anything unfamiliar, **search first.** See `~/.claude/skills/gst jq -n --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$(git branch --show-current 2>/dev/null)" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> ~/.gstack/analytics/eureka.jsonl 2>/dev/null || true ``` -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: diff --git a/design-review/SKILL.md b/design-review/SKILL.md index fa1f104f8..2e0b1d177 100644 --- a/design-review/SKILL.md +++ b/design-review/SKILL.md @@ -32,7 +32,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -245,24 +244,6 @@ Before building anything unfamiliar, **search first.** See `~/.claude/skills/gst jq -n --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$(git branch --show-current 2>/dev/null)" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> ~/.gstack/analytics/eureka.jsonl 2>/dev/null || true ``` -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: diff --git a/design-shotgun/SKILL.md b/design-shotgun/SKILL.md index e1e4d02d0..3ebd118e7 100644 --- a/design-shotgun/SKILL.md +++ b/design-shotgun/SKILL.md @@ -29,7 +29,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -224,24 +223,6 @@ AI makes completeness near-free. Always recommend the complete option over short Include `Completeness: X/10` for each option (10=all edge cases, 7=happy path, 3=shortcut). -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: diff --git a/document-release/SKILL.md b/document-release/SKILL.md index f75962d7e..0fe79991c 100644 --- a/document-release/SKILL.md +++ b/document-release/SKILL.md @@ -29,7 +29,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -224,24 +223,6 @@ AI makes completeness near-free. Always recommend the complete option over short Include `Completeness: X/10` for each option (10=all edge cases, 7=happy path, 3=shortcut). -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: @@ -461,7 +442,7 @@ Read each documentation file and cross-reference it against the diff. Use these - Walk through the setup instructions as if you are a brand new contributor. - Are the listed commands accurate? Would each step succeed? - Do test tier descriptions match the current test infrastructure? -- Are workflow descriptions (dev setup, contributor mode, etc.) current? +- Are workflow descriptions (dev setup, operational learnings, etc.) current? - Flag anything that would fail or confuse a first-time contributor. **CLAUDE.md / project instructions:** diff --git a/document-release/SKILL.md.tmpl b/document-release/SKILL.md.tmpl index 6b1fb7e34..050936f66 100644 --- a/document-release/SKILL.md.tmpl +++ b/document-release/SKILL.md.tmpl @@ -108,7 +108,7 @@ Read each documentation file and cross-reference it against the diff. Use these - Walk through the setup instructions as if you are a brand new contributor. - Are the listed commands accurate? Would each step succeed? - Do test tier descriptions match the current test infrastructure? -- Are workflow descriptions (dev setup, contributor mode, etc.) current? +- Are workflow descriptions (dev setup, operational learnings, etc.) current? - Flag anything that would fail or confuse a first-time contributor. **CLAUDE.md / project instructions:** diff --git a/investigate/SKILL.md b/investigate/SKILL.md index 365a9ca98..1dba6b974 100644 --- a/investigate/SKILL.md +++ b/investigate/SKILL.md @@ -43,7 +43,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -238,24 +237,6 @@ AI makes completeness near-free. Always recommend the complete option over short Include `Completeness: X/10` for each option (10=all edge cases, 7=happy path, 3=shortcut). -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: diff --git a/land-and-deploy/SKILL.md b/land-and-deploy/SKILL.md index e36426f0f..997684412 100644 --- a/land-and-deploy/SKILL.md +++ b/land-and-deploy/SKILL.md @@ -26,7 +26,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -239,24 +238,6 @@ Before building anything unfamiliar, **search first.** See `~/.claude/skills/gst jq -n --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$(git branch --show-current 2>/dev/null)" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> ~/.gstack/analytics/eureka.jsonl 2>/dev/null || true ``` -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: diff --git a/learn/SKILL.md b/learn/SKILL.md index 254c7dcfb..6172e1b79 100644 --- a/learn/SKILL.md +++ b/learn/SKILL.md @@ -29,7 +29,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -224,24 +223,6 @@ AI makes completeness near-free. Always recommend the complete option over short Include `Completeness: X/10` for each option (10=all edge cases, 7=happy path, 3=shortcut). -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: diff --git a/office-hours/SKILL.md b/office-hours/SKILL.md index d624dc377..b46e9f601 100644 --- a/office-hours/SKILL.md +++ b/office-hours/SKILL.md @@ -34,7 +34,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -247,24 +246,6 @@ Before building anything unfamiliar, **search first.** See `~/.claude/skills/gst jq -n --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$(git branch --show-current 2>/dev/null)" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> ~/.gstack/analytics/eureka.jsonl 2>/dev/null || true ``` -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: diff --git a/plan-ceo-review/SKILL.md b/plan-ceo-review/SKILL.md index 0090752c3..b3ac1b25d 100644 --- a/plan-ceo-review/SKILL.md +++ b/plan-ceo-review/SKILL.md @@ -32,7 +32,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -245,24 +244,6 @@ Before building anything unfamiliar, **search first.** See `~/.claude/skills/gst jq -n --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$(git branch --show-current 2>/dev/null)" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> ~/.gstack/analytics/eureka.jsonl 2>/dev/null || true ``` -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: @@ -533,7 +514,6 @@ Follow it inline, **skipping these sections** (already handled by the parent ski - AskUserQuestion Format - Completeness Principle — Boil the Lake - Search Before Building -- Contributor Mode - Completion Status Protocol - Telemetry (run last) @@ -569,7 +549,7 @@ If they choose A: Read the office-hours skill file from disk: Follow it inline, skipping these sections (already handled by parent skill): Preamble, AskUserQuestion Format, Completeness Principle, Search Before Building, -Contributor Mode, Completion Status Protocol, Telemetry. +Completion Status Protocol, Telemetry. Note current Step 0A progress so you don't re-ask questions already answered. After completion, re-run the design doc check and resume the review. diff --git a/plan-ceo-review/SKILL.md.tmpl b/plan-ceo-review/SKILL.md.tmpl index d32a076ee..16aea4f94 100644 --- a/plan-ceo-review/SKILL.md.tmpl +++ b/plan-ceo-review/SKILL.md.tmpl @@ -148,7 +148,7 @@ If they choose A: Read the office-hours skill file from disk: Follow it inline, skipping these sections (already handled by parent skill): Preamble, AskUserQuestion Format, Completeness Principle, Search Before Building, -Contributor Mode, Completion Status Protocol, Telemetry. +Completion Status Protocol, Telemetry. Note current Step 0A progress so you don't re-ask questions already answered. After completion, re-run the design doc check and resume the review. diff --git a/plan-design-review/SKILL.md b/plan-design-review/SKILL.md index a6be97823..af43a0693 100644 --- a/plan-design-review/SKILL.md +++ b/plan-design-review/SKILL.md @@ -30,7 +30,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -243,24 +242,6 @@ Before building anything unfamiliar, **search first.** See `~/.claude/skills/gst jq -n --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$(git branch --show-current 2>/dev/null)" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> ~/.gstack/analytics/eureka.jsonl 2>/dev/null || true ``` -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: diff --git a/plan-eng-review/SKILL.md b/plan-eng-review/SKILL.md index 52b6993d8..badef1f9a 100644 --- a/plan-eng-review/SKILL.md +++ b/plan-eng-review/SKILL.md @@ -31,7 +31,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -244,24 +243,6 @@ Before building anything unfamiliar, **search first.** See `~/.claude/skills/gst jq -n --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$(git branch --show-current 2>/dev/null)" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> ~/.gstack/analytics/eureka.jsonl 2>/dev/null || true ``` -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: @@ -443,7 +424,6 @@ Follow it inline, **skipping these sections** (already handled by the parent ski - AskUserQuestion Format - Completeness Principle — Boil the Lake - Search Before Building -- Contributor Mode - Completion Status Protocol - Telemetry (run last) diff --git a/qa-only/SKILL.md b/qa-only/SKILL.md index 3aa960427..659571f90 100644 --- a/qa-only/SKILL.md +++ b/qa-only/SKILL.md @@ -27,7 +27,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -240,24 +239,6 @@ Before building anything unfamiliar, **search first.** See `~/.claude/skills/gst jq -n --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$(git branch --show-current 2>/dev/null)" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> ~/.gstack/analytics/eureka.jsonl 2>/dev/null || true ``` -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: diff --git a/qa/SKILL.md b/qa/SKILL.md index 89d281e4f..57dfe86a5 100644 --- a/qa/SKILL.md +++ b/qa/SKILL.md @@ -33,7 +33,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -246,24 +245,6 @@ Before building anything unfamiliar, **search first.** See `~/.claude/skills/gst jq -n --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$(git branch --show-current 2>/dev/null)" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> ~/.gstack/analytics/eureka.jsonl 2>/dev/null || true ``` -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: diff --git a/retro/SKILL.md b/retro/SKILL.md index 41058c8c4..19b487eef 100644 --- a/retro/SKILL.md +++ b/retro/SKILL.md @@ -27,7 +27,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -222,24 +221,6 @@ AI makes completeness near-free. Always recommend the complete option over short Include `Completeness: X/10` for each option (10=all edge cases, 7=happy path, 3=shortcut). -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: diff --git a/review/SKILL.md b/review/SKILL.md index 52560d774..538353271 100644 --- a/review/SKILL.md +++ b/review/SKILL.md @@ -30,7 +30,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -243,24 +242,6 @@ Before building anything unfamiliar, **search first.** See `~/.claude/skills/gst jq -n --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$(git branch --show-current 2>/dev/null)" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> ~/.gstack/analytics/eureka.jsonl 2>/dev/null || true ``` -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: diff --git a/scripts/resolvers/preamble.ts b/scripts/resolvers/preamble.ts index aa0441a20..846129259 100644 --- a/scripts/resolvers/preamble.ts +++ b/scripts/resolvers/preamble.ts @@ -33,7 +33,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(${ctx.paths.binDir}/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(${ctx.paths.binDir}/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -323,26 +322,6 @@ jq -n --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg b \`\`\``; } -function generateContributorMode(): string { - return `## Contributor Mode - -If \`_CONTRIB\` is \`true\`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write \`~/.gstack/contributor-logs/{slug}.md\`: -\`\`\` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -\`\`\` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop.`; -} - function generateCompletionStatus(): string { return `## Completion Status Protocol @@ -499,7 +478,7 @@ Avoid filler, throat-clearing, generic optimism, founder cosplay, and unsupporte // Preamble Composition (tier → sections) // ───────────────────────────────────────────── -// T1: core + upgrade + lake + telemetry + voice(trimmed) + contributor + completion +// T1: core + upgrade + lake + telemetry + voice(trimmed) + completion // T2: T1 + voice(full) + ask + completeness // T3: T2 + repo-mode + search // T4: (same as T3 — TEST_FAILURE_TRIAGE is a separate {{}} placeholder, not preamble) @@ -523,7 +502,6 @@ export function generatePreamble(ctx: TemplateContext): string { generateVoiceDirective(tier), ...(tier >= 2 ? [generateAskUserFormat(ctx), generateCompletenessSection()] : []), ...(tier >= 3 ? [generateRepoModeSection(), generateSearchBeforeBuildingSection(ctx)] : []), - generateContributorMode(), generateCompletionStatus(), ]; return sections.join('\n\n'); diff --git a/scripts/resolvers/review.ts b/scripts/resolvers/review.ts index 02fd77659..6200ec09a 100644 --- a/scripts/resolvers/review.ts +++ b/scripts/resolvers/review.ts @@ -240,7 +240,6 @@ Follow it inline, **skipping these sections** (already handled by the parent ski - AskUserQuestion Format - Completeness Principle — Boil the Lake - Search Before Building -- Contributor Mode - Completion Status Protocol - Telemetry (run last) diff --git a/setup-browser-cookies/SKILL.md b/setup-browser-cookies/SKILL.md index 3272d6135..5c2fe7fe7 100644 --- a/setup-browser-cookies/SKILL.md +++ b/setup-browser-cookies/SKILL.md @@ -24,7 +24,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -154,24 +153,6 @@ This only happens once. If `PROACTIVE_PROMPTED` is `yes`, skip this entirely. The user always has context you don't. Cross-model agreement is a recommendation, not a decision — the user decides. -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: diff --git a/setup-deploy/SKILL.md b/setup-deploy/SKILL.md index 3c353e912..79cff939e 100644 --- a/setup-deploy/SKILL.md +++ b/setup-deploy/SKILL.md @@ -30,7 +30,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -225,24 +224,6 @@ AI makes completeness near-free. Always recommend the complete option over short Include `Completeness: X/10` for each option (10=all edge cases, 7=happy path, 3=shortcut). -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: diff --git a/ship/SKILL.md b/ship/SKILL.md index a4ff1bd2b..aede6dd57 100644 --- a/ship/SKILL.md +++ b/ship/SKILL.md @@ -28,7 +28,6 @@ mkdir -p ~/.gstack/sessions touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true -_CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) _PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _PROACTIVE_PROMPTED=$([ -f ~/.gstack/.proactive-prompted ] && echo "yes" || echo "no") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") @@ -241,24 +240,6 @@ Before building anything unfamiliar, **search first.** See `~/.claude/skills/gst jq -n --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$(git branch --show-current 2>/dev/null)" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> ~/.gstack/analytics/eureka.jsonl 2>/dev/null || true ``` -## Contributor Mode - -If `_CONTRIB` is `true`: you are in **contributor mode**. At the end of each major workflow step, rate your gstack experience 0-10. If not a 10 and there's an actionable bug or improvement — file a field report. - -**File only:** gstack tooling bugs where the input was reasonable but gstack failed. **Skip:** user app bugs, network errors, auth failures on user's site. - -**To file:** write `~/.gstack/contributor-logs/{slug}.md`: -``` -# {Title} -**What I tried:** {action} | **What happened:** {result} | **Rating:** {0-10} -## Repro -1. {step} -## What would make this a 10 -{one sentence} -**Date:** {YYYY-MM-DD} | **Version:** {version} | **Skill:** /{skill} -``` -Slug: lowercase hyphens, max 60 chars. Skip if exists. Max 3/session. File inline, don't stop. - ## Completion Status Protocol When completing a skill workflow, report status using one of: diff --git a/test/gen-skill-docs.test.ts b/test/gen-skill-docs.test.ts index 27672ede8..29162ab14 100644 --- a/test/gen-skill-docs.test.ts +++ b/test/gen-skill-docs.test.ts @@ -213,11 +213,11 @@ describe('gen-skill-docs', () => { expect(browseTmpl).toContain('{{PREAMBLE}}'); }); - test('generated SKILL.md contains contributor mode check', () => { + test('generated SKILL.md contains no contributor mode (removed)', () => { const content = fs.readFileSync(path.join(ROOT, 'SKILL.md'), 'utf-8'); - expect(content).toContain('Contributor Mode'); - expect(content).toContain('gstack_contributor'); - expect(content).toContain('contributor-logs'); + expect(content).not.toContain('Contributor Mode'); + expect(content).not.toContain('gstack_contributor'); + expect(content).not.toContain('contributor-logs'); }); test('generated SKILL.md contains session awareness', () => { diff --git a/test/helpers/touchfiles.ts b/test/helpers/touchfiles.ts index b475daad7..f28a933e7 100644 --- a/test/helpers/touchfiles.ts +++ b/test/helpers/touchfiles.ts @@ -41,7 +41,6 @@ export const E2E_TOUCHFILES: Record = { 'skillmd-no-local-binary': ['SKILL.md', 'SKILL.md.tmpl', 'scripts/gen-skill-docs.ts'], 'skillmd-outside-git': ['SKILL.md', 'SKILL.md.tmpl', 'scripts/gen-skill-docs.ts'], - 'contributor-mode': ['SKILL.md.tmpl', 'scripts/gen-skill-docs.ts'], 'session-awareness': ['SKILL.md', 'SKILL.md.tmpl', 'scripts/gen-skill-docs.ts'], // QA (+ test-server dependency) @@ -182,7 +181,6 @@ export const E2E_TIERS: Record = { 'skillmd-setup-discovery': 'gate', 'skillmd-no-local-binary': 'gate', 'skillmd-outside-git': 'gate', - 'contributor-mode': 'gate', 'session-awareness': 'gate', // QA — gate for functional, periodic for quality/benchmarks diff --git a/test/skill-e2e-bws.test.ts b/test/skill-e2e-bws.test.ts index 6a611fe7c..d207f4162 100644 --- a/test/skill-e2e-bws.test.ts +++ b/test/skill-e2e-bws.test.ts @@ -177,51 +177,6 @@ Report the exact output — either "READY: " or "NEEDS_SETUP".`, try { fs.rmSync(nonGitDir, { recursive: true, force: true }); } catch {} }, 60_000); - testConcurrentIfSelected('contributor-mode', async () => { - const contribDir = fs.mkdtempSync(path.join(os.tmpdir(), 'skill-e2e-contrib-')); - const logsDir = path.join(contribDir, 'contributor-logs'); - fs.mkdirSync(logsDir, { recursive: true }); - - const result = await runSkillTest({ - prompt: `You are in contributor mode (gstack_contributor=true). You just ran this browse command and it failed: - -$ /nonexistent/browse goto https://example.com -/nonexistent/browse: No such file or directory - -Per the contributor mode instructions, file a field report to ${logsDir}/browse-missing-binary.md using the Write tool. Include all required sections: title, what you tried, what happened, rating, repro steps, raw output, what would make it a 10, and the date/version footer.`, - workingDirectory: contribDir, - maxTurns: 5, - timeout: 30_000, - testName: 'contributor-mode', - runId, - }); - - logCost('contributor mode', result); - // Override passed: this test intentionally triggers a browse error (nonexistent binary) - // so browseErrors will be non-empty — that's expected, not a failure - recordE2E(evalCollector, 'contributor mode report', 'Skill E2E tests', result, { - passed: result.exitReason === 'success', - }); - - // Verify a contributor log was created with expected format - const logFiles = fs.readdirSync(logsDir).filter(f => f.endsWith('.md')); - expect(logFiles.length).toBeGreaterThan(0); - - // Verify report has key structural sections (agent may phrase differently) - const logContent = fs.readFileSync(path.join(logsDir, logFiles[0]), 'utf-8'); - // Must have a title (# heading) - expect(logContent).toMatch(/^#\s/m); - // Must mention the failed command or browse - expect(logContent).toMatch(/browse|nonexistent|not found|no such file/i); - // Must have some kind of rating - expect(logContent).toMatch(/rating|\/10/i); - // Must have steps or reproduction info - expect(logContent).toMatch(/step|repro|reproduce/i); - - // Clean up - try { fs.rmSync(contribDir, { recursive: true, force: true }); } catch {} - }, 90_000); - testConcurrentIfSelected('session-awareness', async () => { const sessionDir = fs.mkdtempSync(path.join(os.tmpdir(), 'skill-e2e-session-')); diff --git a/test/skill-e2e.test.ts b/test/skill-e2e.test.ts index 91c95f7a7..f1a13cec9 100644 --- a/test/skill-e2e.test.ts +++ b/test/skill-e2e.test.ts @@ -325,62 +325,6 @@ Report the exact output — either "READY: " or "NEEDS_SETUP".`, try { fs.rmSync(nonGitDir, { recursive: true, force: true }); } catch {} }, 60_000); - testIfSelected('contributor-mode', async () => { - const contribDir = fs.mkdtempSync(path.join(os.tmpdir(), 'skill-e2e-contrib-')); - const logsDir = path.join(contribDir, 'contributor-logs'); - fs.mkdirSync(logsDir, { recursive: true }); - - // Extract contributor mode instructions from generated SKILL.md - const skillMd = fs.readFileSync(path.join(ROOT, 'SKILL.md'), 'utf-8'); - const contribStart = skillMd.indexOf('## Contributor Mode'); - const contribEnd = skillMd.indexOf('\n## ', contribStart + 1); - const contribBlock = skillMd.slice(contribStart, contribEnd > 0 ? contribEnd : undefined); - - const result = await runSkillTest({ - prompt: `You are in contributor mode (_CONTRIB=true). - -${contribBlock} - -OVERRIDE: Write contributor logs to ${logsDir}/ instead of ~/.gstack/contributor-logs/ - -Now try this browse command (it will fail — there is no binary at this path): -/nonexistent/path/browse goto https://example.com - -This is a gstack issue (the browse binary is missing/misconfigured). -File a contributor report about this issue. Then tell me what you filed.`, - workingDirectory: contribDir, - maxTurns: 8, - timeout: 60_000, - testName: 'contributor-mode', - runId, - }); - - logCost('contributor mode', result); - // Override passed: this test intentionally triggers a browse error (nonexistent binary) - // so browseErrors will be non-empty — that's expected, not a failure - recordE2E('contributor mode report', 'Skill E2E tests', result, { - passed: result.exitReason === 'success', - }); - - // Verify a contributor log was created with expected format - const logFiles = fs.readdirSync(logsDir).filter(f => f.endsWith('.md')); - expect(logFiles.length).toBeGreaterThan(0); - - // Verify new reflection-based format - const logContent = fs.readFileSync(path.join(logsDir, logFiles[0]), 'utf-8'); - expect(logContent).toContain('Hey gstack team'); - expect(logContent).toContain('What I was trying to do'); - expect(logContent).toContain('What happened instead'); - expect(logContent).toMatch(/rating/i); - // Verify report has repro steps (agent may use "Steps to reproduce", "Repro Steps", etc.) - expect(logContent).toMatch(/repro|steps to reproduce|how to reproduce/i); - // Verify report has date/version footer (agent may format differently) - expect(logContent).toMatch(/date.*2026|2026.*date/i); - - // Clean up - try { fs.rmSync(contribDir, { recursive: true, force: true }); } catch {} - }, 90_000); - testIfSelected('session-awareness', async () => { const sessionDir = fs.mkdtempSync(path.join(os.tmpdir(), 'skill-e2e-session-')); From cade276c2086afb77567dfde75a0e23bd0182864 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sun, 29 Mar 2026 21:04:35 -0700 Subject: [PATCH 2/6] =?UTF-8?q?feat:=20operational=20self-improvement=20?= =?UTF-8?q?=E2=80=94=20every=20skill=20learns=20from=20failures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds universal operational learning capture to the preamble completion protocol. At the end of every skill session, the agent reflects on CLI failures, wrong approaches, and project quirks, logging them as type "operational" to the learnings JSONL. Future sessions surface these automatically. - generateCompletionStatus(ctx) now includes operational capture section - Preamble bash shows top 3 learnings inline when count > 5 - New "operational" type in generateLearningsLog alongside pattern/pitfall/etc - Updated unit tests + operational seed entry in learnings E2E Co-Authored-By: Claude Opus 4.6 (1M context) --- SKILL.md | 21 +++++++++++++++++++++ autoplan/SKILL.md | 21 +++++++++++++++++++++ benchmark/SKILL.md | 21 +++++++++++++++++++++ browse/SKILL.md | 21 +++++++++++++++++++++ canary/SKILL.md | 21 +++++++++++++++++++++ codex/SKILL.md | 21 +++++++++++++++++++++ connect-chrome/SKILL.md | 21 +++++++++++++++++++++ cso/SKILL.md | 21 +++++++++++++++++++++ design-consultation/SKILL.md | 21 +++++++++++++++++++++ design-review/SKILL.md | 21 +++++++++++++++++++++ design-shotgun/SKILL.md | 21 +++++++++++++++++++++ document-release/SKILL.md | 21 +++++++++++++++++++++ investigate/SKILL.md | 24 +++++++++++++++++++++++- land-and-deploy/SKILL.md | 21 +++++++++++++++++++++ learn/SKILL.md | 21 +++++++++++++++++++++ office-hours/SKILL.md | 21 +++++++++++++++++++++ plan-ceo-review/SKILL.md | 21 +++++++++++++++++++++ plan-design-review/SKILL.md | 21 +++++++++++++++++++++ plan-eng-review/SKILL.md | 21 +++++++++++++++++++++ qa-only/SKILL.md | 21 +++++++++++++++++++++ qa/SKILL.md | 21 +++++++++++++++++++++ retro/SKILL.md | 24 +++++++++++++++++++++++- review/SKILL.md | 24 +++++++++++++++++++++++- scripts/resolvers/learnings.ts | 3 ++- scripts/resolvers/preamble.ts | 25 +++++++++++++++++++++++-- setup-browser-cookies/SKILL.md | 21 +++++++++++++++++++++ setup-deploy/SKILL.md | 21 +++++++++++++++++++++ ship/SKILL.md | 24 +++++++++++++++++++++++- test/gen-skill-docs.test.ts | 11 ++++++++++- test/skill-e2e-learnings.test.ts | 5 +++++ 30 files changed, 594 insertions(+), 8 deletions(-) diff --git a/SKILL.md b/SKILL.md index 9849e78fe..1eeeff2fe 100644 --- a/SKILL.md +++ b/SKILL.md @@ -62,6 +62,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -179,6 +182,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. diff --git a/autoplan/SKILL.md b/autoplan/SKILL.md index 7831d0b4a..c831c835f 100644 --- a/autoplan/SKILL.md +++ b/autoplan/SKILL.md @@ -71,6 +71,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -271,6 +274,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. diff --git a/benchmark/SKILL.md b/benchmark/SKILL.md index 929140835..abfa24daa 100644 --- a/benchmark/SKILL.md +++ b/benchmark/SKILL.md @@ -64,6 +64,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -181,6 +184,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. diff --git a/browse/SKILL.md b/browse/SKILL.md index d97d737d3..36fc89898 100644 --- a/browse/SKILL.md +++ b/browse/SKILL.md @@ -64,6 +64,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -181,6 +184,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. diff --git a/canary/SKILL.md b/canary/SKILL.md index a711689df..5e245bae2 100644 --- a/canary/SKILL.md +++ b/canary/SKILL.md @@ -64,6 +64,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -246,6 +249,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. diff --git a/codex/SKILL.md b/codex/SKILL.md index ea3657764..f01bcba29 100644 --- a/codex/SKILL.md +++ b/codex/SKILL.md @@ -65,6 +65,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -265,6 +268,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. diff --git a/connect-chrome/SKILL.md b/connect-chrome/SKILL.md index fe0d14e63..5084c0e01 100644 --- a/connect-chrome/SKILL.md +++ b/connect-chrome/SKILL.md @@ -62,6 +62,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -262,6 +265,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. diff --git a/cso/SKILL.md b/cso/SKILL.md index 77b11979d..f5dbca095 100644 --- a/cso/SKILL.md +++ b/cso/SKILL.md @@ -68,6 +68,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -250,6 +253,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. diff --git a/design-consultation/SKILL.md b/design-consultation/SKILL.md index cc73ec6a2..91325e11f 100644 --- a/design-consultation/SKILL.md +++ b/design-consultation/SKILL.md @@ -69,6 +69,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -269,6 +272,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. diff --git a/design-review/SKILL.md b/design-review/SKILL.md index 2e0b1d177..31519c551 100644 --- a/design-review/SKILL.md +++ b/design-review/SKILL.md @@ -69,6 +69,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -269,6 +272,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. diff --git a/design-shotgun/SKILL.md b/design-shotgun/SKILL.md index 3ebd118e7..a4dbaa889 100644 --- a/design-shotgun/SKILL.md +++ b/design-shotgun/SKILL.md @@ -66,6 +66,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -248,6 +251,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. diff --git a/document-release/SKILL.md b/document-release/SKILL.md index 0fe79991c..c4f840b6c 100644 --- a/document-release/SKILL.md +++ b/document-release/SKILL.md @@ -66,6 +66,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -248,6 +251,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. diff --git a/investigate/SKILL.md b/investigate/SKILL.md index 1dba6b974..bab696b12 100644 --- a/investigate/SKILL.md +++ b/investigate/SKILL.md @@ -80,6 +80,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -262,6 +265,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. @@ -528,7 +549,8 @@ this session, log it for future sessions: ``` **Types:** `pattern` (reusable approach), `pitfall` (what NOT to do), `preference` -(user stated), `architecture` (structural decision), `tool` (library/framework insight). +(user stated), `architecture` (structural decision), `tool` (library/framework insight), +`operational` (project environment/CLI/workflow knowledge). **Sources:** `observed` (you found this in the code), `user-stated` (user told you), `inferred` (AI deduction), `cross-model` (both Claude and Codex agree). diff --git a/land-and-deploy/SKILL.md b/land-and-deploy/SKILL.md index 997684412..7d40518ca 100644 --- a/land-and-deploy/SKILL.md +++ b/land-and-deploy/SKILL.md @@ -63,6 +63,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -263,6 +266,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. diff --git a/learn/SKILL.md b/learn/SKILL.md index 6172e1b79..f23f89ff7 100644 --- a/learn/SKILL.md +++ b/learn/SKILL.md @@ -66,6 +66,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -248,6 +251,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. diff --git a/office-hours/SKILL.md b/office-hours/SKILL.md index b46e9f601..323a63b0e 100644 --- a/office-hours/SKILL.md +++ b/office-hours/SKILL.md @@ -71,6 +71,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -271,6 +274,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. diff --git a/plan-ceo-review/SKILL.md b/plan-ceo-review/SKILL.md index b3ac1b25d..cffd87478 100644 --- a/plan-ceo-review/SKILL.md +++ b/plan-ceo-review/SKILL.md @@ -69,6 +69,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -269,6 +272,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. diff --git a/plan-design-review/SKILL.md b/plan-design-review/SKILL.md index af43a0693..a7479bf92 100644 --- a/plan-design-review/SKILL.md +++ b/plan-design-review/SKILL.md @@ -67,6 +67,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -267,6 +270,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. diff --git a/plan-eng-review/SKILL.md b/plan-eng-review/SKILL.md index badef1f9a..5ecd68716 100644 --- a/plan-eng-review/SKILL.md +++ b/plan-eng-review/SKILL.md @@ -68,6 +68,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -268,6 +271,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. diff --git a/qa-only/SKILL.md b/qa-only/SKILL.md index 659571f90..4a538657c 100644 --- a/qa-only/SKILL.md +++ b/qa-only/SKILL.md @@ -64,6 +64,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -264,6 +267,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. diff --git a/qa/SKILL.md b/qa/SKILL.md index 57dfe86a5..0e03a4c61 100644 --- a/qa/SKILL.md +++ b/qa/SKILL.md @@ -70,6 +70,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -270,6 +273,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. diff --git a/retro/SKILL.md b/retro/SKILL.md index 19b487eef..4d202efa0 100644 --- a/retro/SKILL.md +++ b/retro/SKILL.md @@ -64,6 +64,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -246,6 +249,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. @@ -621,7 +642,8 @@ this session, log it for future sessions: ``` **Types:** `pattern` (reusable approach), `pitfall` (what NOT to do), `preference` -(user stated), `architecture` (structural decision), `tool` (library/framework insight). +(user stated), `architecture` (structural decision), `tool` (library/framework insight), +`operational` (project environment/CLI/workflow knowledge). **Sources:** `observed` (you found this in the code), `user-stated` (user told you), `inferred` (AI deduction), `cross-model` (both Claude and Codex agree). diff --git a/review/SKILL.md b/review/SKILL.md index 538353271..6463e80ec 100644 --- a/review/SKILL.md +++ b/review/SKILL.md @@ -67,6 +67,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -267,6 +270,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. @@ -1190,7 +1211,8 @@ this session, log it for future sessions: ``` **Types:** `pattern` (reusable approach), `pitfall` (what NOT to do), `preference` -(user stated), `architecture` (structural decision), `tool` (library/framework insight). +(user stated), `architecture` (structural decision), `tool` (library/framework insight), +`operational` (project environment/CLI/workflow knowledge). **Sources:** `observed` (you found this in the code), `user-stated` (user told you), `inferred` (AI deduction), `cross-model` (both Claude and Codex agree). diff --git a/scripts/resolvers/learnings.ts b/scripts/resolvers/learnings.ts index 3bcba7b1f..685188fb2 100644 --- a/scripts/resolvers/learnings.ts +++ b/scripts/resolvers/learnings.ts @@ -80,7 +80,8 @@ ${binDir}/gstack-learnings-log '{"skill":"${ctx.skillName}","type":"TYPE","key": \`\`\` **Types:** \`pattern\` (reusable approach), \`pitfall\` (what NOT to do), \`preference\` -(user stated), \`architecture\` (structural decision), \`tool\` (library/framework insight). +(user stated), \`architecture\` (structural decision), \`tool\` (library/framework insight), +\`operational\` (project environment/CLI/workflow knowledge). **Sources:** \`observed\` (you found this in the code), \`user-stated\` (user told you), \`inferred\` (AI deduction), \`cross-model\` (both Claude and Codex agree). diff --git a/scripts/resolvers/preamble.ts b/scripts/resolvers/preamble.ts index 846129259..978bf51c7 100644 --- a/scripts/resolvers/preamble.ts +++ b/scripts/resolvers/preamble.ts @@ -70,6 +70,9 @@ _LEARN_FILE="\${GSTACK_HOME:-$HOME/.gstack}/projects/\${SLUG:-unknown}/learnings if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ${ctx.paths.binDir}/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -322,7 +325,7 @@ jq -n --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg b \`\`\``; } -function generateCompletionStatus(): string { +function generateCompletionStatus(ctx: TemplateContext): string { return `## Completion Status Protocol When completing a skill workflow, report status using one of: @@ -348,6 +351,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] \`\`\` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +\`\`\`bash +${ctx.paths.binDir}/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +\`\`\` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. @@ -502,7 +523,7 @@ export function generatePreamble(ctx: TemplateContext): string { generateVoiceDirective(tier), ...(tier >= 2 ? [generateAskUserFormat(ctx), generateCompletenessSection()] : []), ...(tier >= 3 ? [generateRepoModeSection(), generateSearchBeforeBuildingSection(ctx)] : []), - generateCompletionStatus(), + generateCompletionStatus(ctx), ]; return sections.join('\n\n'); } diff --git a/setup-browser-cookies/SKILL.md b/setup-browser-cookies/SKILL.md index 5c2fe7fe7..ea1a59636 100644 --- a/setup-browser-cookies/SKILL.md +++ b/setup-browser-cookies/SKILL.md @@ -61,6 +61,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -178,6 +181,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. diff --git a/setup-deploy/SKILL.md b/setup-deploy/SKILL.md index 79cff939e..16e4ab6f6 100644 --- a/setup-deploy/SKILL.md +++ b/setup-deploy/SKILL.md @@ -67,6 +67,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -249,6 +252,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. diff --git a/ship/SKILL.md b/ship/SKILL.md index aede6dd57..b801bc792 100644 --- a/ship/SKILL.md +++ b/ship/SKILL.md @@ -65,6 +65,9 @@ _LEARN_FILE="${GSTACK_HOME:-$HOME/.gstack}/projects/${SLUG:-unknown}/learnings.j if [ -f "$_LEARN_FILE" ]; then _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ') echo "LEARNINGS: $_LEARN_COUNT entries loaded" + if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 3 2>/dev/null || true + fi else echo "LEARNINGS: 0" fi @@ -265,6 +268,24 @@ ATTEMPTED: [what you tried] RECOMMENDATION: [what the user should do next] ``` +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? +- Did you take a wrong approach and have to backtrack? +- Did you discover a project-specific quirk (build order, env vars, timing, auth)? +- Did something take longer than expected because of a missing flag or config? + +If yes, log an operational learning for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +``` + +Replace SKILL_NAME with the current skill name. Only log genuine operational discoveries. +Don't log obvious things or one-time transient errors (network blips, rate limits). +A good test: would knowing this save 5+ minutes in a future session? If yes, log it. + ## Telemetry (run last) After the skill workflow completes (success, error, or abort), log the telemetry event. @@ -1662,7 +1683,8 @@ this session, log it for future sessions: ``` **Types:** `pattern` (reusable approach), `pitfall` (what NOT to do), `preference` -(user stated), `architecture` (structural decision), `tool` (library/framework insight). +(user stated), `architecture` (structural decision), `tool` (library/framework insight), +`operational` (project environment/CLI/workflow knowledge). **Sources:** `observed` (you found this in the code), `user-stated` (user told you), `inferred` (AI deduction), `cross-model` (both Claude and Codex agree). diff --git a/test/gen-skill-docs.test.ts b/test/gen-skill-docs.test.ts index 29162ab14..9dfac539d 100644 --- a/test/gen-skill-docs.test.ts +++ b/test/gen-skill-docs.test.ts @@ -213,11 +213,20 @@ describe('gen-skill-docs', () => { expect(browseTmpl).toContain('{{PREAMBLE}}'); }); - test('generated SKILL.md contains no contributor mode (removed)', () => { + test('generated SKILL.md contains operational self-improvement (replaced contributor mode)', () => { const content = fs.readFileSync(path.join(ROOT, 'SKILL.md'), 'utf-8'); expect(content).not.toContain('Contributor Mode'); expect(content).not.toContain('gstack_contributor'); expect(content).not.toContain('contributor-logs'); + expect(content).toContain('Operational Self-Improvement'); + expect(content).toContain('gstack-learnings-log'); + expect(content).toContain('gstack-learnings-search --limit 3'); + }); + + test('generated SKILL.md with LEARNINGS_LOG contains operational type', () => { + // Check a skill that has LEARNINGS_LOG (e.g., review) + const content = fs.readFileSync(path.join(ROOT, 'review', 'SKILL.md'), 'utf-8'); + expect(content).toContain('operational'); }); test('generated SKILL.md contains session awareness', () => { diff --git a/test/skill-e2e-learnings.test.ts b/test/skill-e2e-learnings.test.ts index dfd185135..390eedf7f 100644 --- a/test/skill-e2e-learnings.test.ts +++ b/test/skill-e2e-learnings.test.ts @@ -67,6 +67,11 @@ describeIfSelected('Learnings E2E', ['learnings-show'], () => { insight: 'User wants rubocop to run before every commit, no exceptions.', confidence: 10, source: 'user-stated', ts: new Date().toISOString(), }, + { + skill: 'qa', type: 'operational', key: 'test-timeout-flag', + insight: 'bun test requires --timeout 30000 for E2E tests in this project.', + confidence: 9, source: 'observed', ts: new Date().toISOString(), + }, ]; fs.writeFileSync( From d6530583a8985139e7a044e248255e8a788ea88b Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sun, 29 Mar 2026 21:06:36 -0700 Subject: [PATCH 3/6] feat: wire learnings into all insight-producing skills Adds LEARNINGS_SEARCH and/or LEARNINGS_LOG to 10 skill templates that produce reusable insights but were previously disconnected from the learning system: - office-hours, plan-ceo-review, plan-eng-review: add LOG (had SEARCH) - plan-design-review: add both SEARCH + LOG (had neither) - design-review, design-consultation, cso, qa, qa-only: add both - retro: add SEARCH (had LOG) 13 skills now fully participate in the learning loop (read + write). Every review, QA, investigation, and design session both consults prior learnings and contributes new ones. Co-Authored-By: Claude Opus 4.6 (1M context) --- cso/SKILL.md | 63 +++++++++++++++++++++++++++++++ cso/SKILL.md.tmpl | 4 ++ design-consultation/SKILL.md | 63 +++++++++++++++++++++++++++++++ design-consultation/SKILL.md.tmpl | 4 ++ design-review/SKILL.md | 63 +++++++++++++++++++++++++++++++ design-review/SKILL.md.tmpl | 4 ++ office-hours/SKILL.md | 25 ++++++++++++ office-hours/SKILL.md.tmpl | 2 + plan-ceo-review/SKILL.md | 25 ++++++++++++ plan-ceo-review/SKILL.md.tmpl | 2 + plan-design-review/SKILL.md | 63 +++++++++++++++++++++++++++++++ plan-design-review/SKILL.md.tmpl | 4 ++ plan-eng-review/SKILL.md | 25 ++++++++++++ plan-eng-review/SKILL.md.tmpl | 2 + qa-only/SKILL.md | 63 +++++++++++++++++++++++++++++++ qa-only/SKILL.md.tmpl | 4 ++ qa/SKILL.md | 63 +++++++++++++++++++++++++++++++ qa/SKILL.md.tmpl | 4 ++ retro/SKILL.md | 38 +++++++++++++++++++ retro/SKILL.md.tmpl | 2 + 20 files changed, 523 insertions(+) diff --git a/cso/SKILL.md b/cso/SKILL.md index f5dbca095..ba801a1b3 100644 --- a/cso/SKILL.md +++ b/cso/SKILL.md @@ -420,6 +420,44 @@ grep -q "laravel" composer.json 2>/dev/null && echo "FRAMEWORK: Laravel" This is NOT a checklist — it's a reasoning phase. The output is understanding, not findings. +## Prior Learnings + +Search for relevant learnings from previous sessions: + +```bash +_CROSS_PROJ=$(~/.claude/skills/gstack/bin/gstack-config get cross_project_learnings 2>/dev/null || echo "unset") +echo "CROSS_PROJECT: $_CROSS_PROJ" +if [ "$_CROSS_PROJ" = "true" ]; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 10 --cross-project 2>/dev/null || true +else + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 10 2>/dev/null || true +fi +``` + +If `CROSS_PROJECT` is `unset` (first time): Use AskUserQuestion: + +> gstack can search learnings from your other projects on this machine to find +> patterns that might apply here. This stays local (no data leaves your machine). +> Recommended for solo developers. Skip if you work on multiple client codebases +> where cross-contamination would be a concern. + +Options: +- A) Enable cross-project learnings (recommended) +- B) Keep learnings project-scoped only + +If A: run `~/.claude/skills/gstack/bin/gstack-config set cross_project_learnings true` +If B: run `~/.claude/skills/gstack/bin/gstack-config set cross_project_learnings false` + +Then re-run the search with the appropriate flag. + +If learnings are found, incorporate them into your analysis. When a review finding +matches a past learning, display: + +**"Prior learning applied: [key] (confidence N/10, from [date])"** + +This makes the compounding visible. The user should see that gstack is getting +smarter on their codebase over time. + ### Phase 1: Attack Surface Census Map what an attacker sees — both code surface and infrastructure surface. @@ -939,6 +977,31 @@ Write findings to `.gstack/security-reports/{date}-{HHMMSS}.json` using this sch If `.gstack/` is not in `.gitignore`, note it in findings — security reports should stay local. +## Capture Learnings + +If you discovered a non-obvious pattern, pitfall, or architectural insight during +this session, log it for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"cso","type":"TYPE","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"SOURCE","files":["path/to/relevant/file"]}' +``` + +**Types:** `pattern` (reusable approach), `pitfall` (what NOT to do), `preference` +(user stated), `architecture` (structural decision), `tool` (library/framework insight), +`operational` (project environment/CLI/workflow knowledge). + +**Sources:** `observed` (you found this in the code), `user-stated` (user told you), +`inferred` (AI deduction), `cross-model` (both Claude and Codex agree). + +**Confidence:** 1-10. Be honest. An observed pattern you verified in the code is 8-9. +An inference you're not sure about is 4-5. A user preference they explicitly stated is 10. + +**files:** Include the specific file paths this learning references. This enables +staleness detection: if those files are later deleted, the learning can be flagged. + +**Only log genuine discoveries.** Don't log obvious things. Don't log things the user +already knows. A good test: would this insight save time in a future session? If yes, log it. + ## Important Rules - **Think like an attacker, report like a defender.** Show the exploit path, then the fix. diff --git a/cso/SKILL.md.tmpl b/cso/SKILL.md.tmpl index 5bd86a9ce..8ea276bf4 100644 --- a/cso/SKILL.md.tmpl +++ b/cso/SKILL.md.tmpl @@ -102,6 +102,8 @@ grep -q "laravel" composer.json 2>/dev/null && echo "FRAMEWORK: Laravel" This is NOT a checklist — it's a reasoning phase. The output is understanding, not findings. +{{LEARNINGS_SEARCH}} + ### Phase 1: Attack Surface Census Map what an attacker sees — both code surface and infrastructure surface. @@ -598,6 +600,8 @@ Write findings to `.gstack/security-reports/{date}-{HHMMSS}.json` using this sch If `.gstack/` is not in `.gitignore`, note it in findings — security reports should stay local. +{{LEARNINGS_LOG}} + ## Important Rules - **Think like an attacker, report like a defender.** Show the exploit path, then the fix. diff --git a/design-consultation/SKILL.md b/design-consultation/SKILL.md index 91325e11f..aa4b36d4a 100644 --- a/design-consultation/SKILL.md +++ b/design-consultation/SKILL.md @@ -478,6 +478,44 @@ If `DESIGN_NOT_AVAILABLE`: Phase 5 falls back to the HTML preview page (still go --- +## Prior Learnings + +Search for relevant learnings from previous sessions: + +```bash +_CROSS_PROJ=$(~/.claude/skills/gstack/bin/gstack-config get cross_project_learnings 2>/dev/null || echo "unset") +echo "CROSS_PROJECT: $_CROSS_PROJ" +if [ "$_CROSS_PROJ" = "true" ]; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 10 --cross-project 2>/dev/null || true +else + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 10 2>/dev/null || true +fi +``` + +If `CROSS_PROJECT` is `unset` (first time): Use AskUserQuestion: + +> gstack can search learnings from your other projects on this machine to find +> patterns that might apply here. This stays local (no data leaves your machine). +> Recommended for solo developers. Skip if you work on multiple client codebases +> where cross-contamination would be a concern. + +Options: +- A) Enable cross-project learnings (recommended) +- B) Keep learnings project-scoped only + +If A: run `~/.claude/skills/gstack/bin/gstack-config set cross_project_learnings true` +If B: run `~/.claude/skills/gstack/bin/gstack-config set cross_project_learnings false` + +Then re-run the search with the appropriate flag. + +If learnings are found, incorporate them into your analysis. When a review finding +matches a past learning, display: + +**"Prior learning applied: [key] (confidence N/10, from [date])"** + +This makes the compounding visible. The user should see that gstack is getting +smarter on their codebase over time. + ## Phase 1: Product Context Ask the user a single question that covers everything you need to know. Pre-fill what you can infer from the codebase. @@ -961,6 +999,31 @@ List all decisions. Flag any that used agent defaults without explicit user conf --- +## Capture Learnings + +If you discovered a non-obvious pattern, pitfall, or architectural insight during +this session, log it for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"design-consultation","type":"TYPE","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"SOURCE","files":["path/to/relevant/file"]}' +``` + +**Types:** `pattern` (reusable approach), `pitfall` (what NOT to do), `preference` +(user stated), `architecture` (structural decision), `tool` (library/framework insight), +`operational` (project environment/CLI/workflow knowledge). + +**Sources:** `observed` (you found this in the code), `user-stated` (user told you), +`inferred` (AI deduction), `cross-model` (both Claude and Codex agree). + +**Confidence:** 1-10. Be honest. An observed pattern you verified in the code is 8-9. +An inference you're not sure about is 4-5. A user preference they explicitly stated is 10. + +**files:** Include the specific file paths this learning references. This enables +staleness detection: if those files are later deleted, the learning can be flagged. + +**Only log genuine discoveries.** Don't log obvious things. Don't log things the user +already knows. A good test: would this insight save time in a future session? If yes, log it. + ## Important Rules 1. **Propose, don't present menus.** You are a consultant, not a form. Make opinionated recommendations based on the product context, then let the user adjust. diff --git a/design-consultation/SKILL.md.tmpl b/design-consultation/SKILL.md.tmpl index 2ce7c1d3b..5a0095550 100644 --- a/design-consultation/SKILL.md.tmpl +++ b/design-consultation/SKILL.md.tmpl @@ -79,6 +79,8 @@ If `DESIGN_NOT_AVAILABLE`: Phase 5 falls back to the HTML preview page (still go --- +{{LEARNINGS_SEARCH}} + ## Phase 1: Product Context Ask the user a single question that covers everything you need to know. Pre-fill what you can infer from the codebase. @@ -415,6 +417,8 @@ List all decisions. Flag any that used agent defaults without explicit user conf --- +{{LEARNINGS_LOG}} + ## Important Rules 1. **Propose, don't present menus.** You are a consultant, not a form. Make opinionated recommendations based on the product context, then let the user adjust. diff --git a/design-review/SKILL.md b/design-review/SKILL.md index 31519c551..d77a6a240 100644 --- a/design-review/SKILL.md +++ b/design-review/SKILL.md @@ -648,6 +648,44 @@ echo "REPORT_DIR: $REPORT_DIR" --- +## Prior Learnings + +Search for relevant learnings from previous sessions: + +```bash +_CROSS_PROJ=$(~/.claude/skills/gstack/bin/gstack-config get cross_project_learnings 2>/dev/null || echo "unset") +echo "CROSS_PROJECT: $_CROSS_PROJ" +if [ "$_CROSS_PROJ" = "true" ]; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 10 --cross-project 2>/dev/null || true +else + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 10 2>/dev/null || true +fi +``` + +If `CROSS_PROJECT` is `unset` (first time): Use AskUserQuestion: + +> gstack can search learnings from your other projects on this machine to find +> patterns that might apply here. This stays local (no data leaves your machine). +> Recommended for solo developers. Skip if you work on multiple client codebases +> where cross-contamination would be a concern. + +Options: +- A) Enable cross-project learnings (recommended) +- B) Keep learnings project-scoped only + +If A: run `~/.claude/skills/gstack/bin/gstack-config set cross_project_learnings true` +If B: run `~/.claude/skills/gstack/bin/gstack-config set cross_project_learnings false` + +Then re-run the search with the appropriate flag. + +If learnings are found, incorporate them into your analysis. When a review finding +matches a past learning, display: + +**"Prior learning applied: [key] (confidence N/10, from [date])"** + +This makes the compounding visible. The user should see that gstack is getting +smarter on their codebase over time. + ## Phases 1-6: Design Audit Baseline ## Modes @@ -1314,6 +1352,31 @@ If the repo has a `TODOS.md`: --- +## Capture Learnings + +If you discovered a non-obvious pattern, pitfall, or architectural insight during +this session, log it for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"design-review","type":"TYPE","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"SOURCE","files":["path/to/relevant/file"]}' +``` + +**Types:** `pattern` (reusable approach), `pitfall` (what NOT to do), `preference` +(user stated), `architecture` (structural decision), `tool` (library/framework insight), +`operational` (project environment/CLI/workflow knowledge). + +**Sources:** `observed` (you found this in the code), `user-stated` (user told you), +`inferred` (AI deduction), `cross-model` (both Claude and Codex agree). + +**Confidence:** 1-10. Be honest. An observed pattern you verified in the code is 8-9. +An inference you're not sure about is 4-5. A user preference they explicitly stated is 10. + +**files:** Include the specific file paths this learning references. This enables +staleness detection: if those files are later deleted, the learning can be flagged. + +**Only log genuine discoveries.** Don't log obvious things. Don't log things the user +already knows. A good test: would this insight save time in a future session? If yes, log it. + ## Additional Rules (design-review specific) 11. **Clean working tree required.** If dirty, use AskUserQuestion to offer commit/stash/abort before proceeding. diff --git a/design-review/SKILL.md.tmpl b/design-review/SKILL.md.tmpl index 904a732c4..c3ef77311 100644 --- a/design-review/SKILL.md.tmpl +++ b/design-review/SKILL.md.tmpl @@ -97,6 +97,8 @@ echo "REPORT_DIR: $REPORT_DIR" --- +{{LEARNINGS_SEARCH}} + ## Phases 1-6: Design Audit Baseline {{DESIGN_METHODOLOGY}} @@ -287,6 +289,8 @@ If the repo has a `TODOS.md`: --- +{{LEARNINGS_LOG}} + ## Additional Rules (design-review specific) 11. **Clean working tree required.** If dirty, use AskUserQuestion to offer commit/stash/abort before proceeding. diff --git a/office-hours/SKILL.md b/office-hours/SKILL.md index 323a63b0e..8b0eeea9a 100644 --- a/office-hours/SKILL.md +++ b/office-hours/SKILL.md @@ -1354,6 +1354,31 @@ The design doc at `~/.gstack/projects/` is automatically discoverable by downstr --- +## Capture Learnings + +If you discovered a non-obvious pattern, pitfall, or architectural insight during +this session, log it for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"office-hours","type":"TYPE","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"SOURCE","files":["path/to/relevant/file"]}' +``` + +**Types:** `pattern` (reusable approach), `pitfall` (what NOT to do), `preference` +(user stated), `architecture` (structural decision), `tool` (library/framework insight), +`operational` (project environment/CLI/workflow knowledge). + +**Sources:** `observed` (you found this in the code), `user-stated` (user told you), +`inferred` (AI deduction), `cross-model` (both Claude and Codex agree). + +**Confidence:** 1-10. Be honest. An observed pattern you verified in the code is 8-9. +An inference you're not sure about is 4-5. A user preference they explicitly stated is 10. + +**files:** Include the specific file paths this learning references. This enables +staleness detection: if those files are later deleted, the learning can be flagged. + +**Only log genuine discoveries.** Don't log obvious things. Don't log things the user +already knows. A good test: would this insight save time in a future session? If yes, log it. + ## Important Rules - **Never start implementation.** This skill produces design docs, not code. Not even scaffolding. diff --git a/office-hours/SKILL.md.tmpl b/office-hours/SKILL.md.tmpl index 358f82900..b921259e6 100644 --- a/office-hours/SKILL.md.tmpl +++ b/office-hours/SKILL.md.tmpl @@ -642,6 +642,8 @@ The design doc at `~/.gstack/projects/` is automatically discoverable by downstr --- +{{LEARNINGS_LOG}} + ## Important Rules - **Never start implementation.** This skill produces design docs, not code. Not even scaffolding. diff --git a/plan-ceo-review/SKILL.md b/plan-ceo-review/SKILL.md index cffd87478..5be7dedc7 100644 --- a/plan-ceo-review/SKILL.md +++ b/plan-ceo-review/SKILL.md @@ -1545,6 +1545,31 @@ If promoted, copy the CEO plan content to `docs/designs/{FEATURE}.md` (create th * After each section, pause and wait for feedback. * Use **CRITICAL GAP** / **WARNING** / **OK** for scannability. +## Capture Learnings + +If you discovered a non-obvious pattern, pitfall, or architectural insight during +this session, log it for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"plan-ceo-review","type":"TYPE","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"SOURCE","files":["path/to/relevant/file"]}' +``` + +**Types:** `pattern` (reusable approach), `pitfall` (what NOT to do), `preference` +(user stated), `architecture` (structural decision), `tool` (library/framework insight), +`operational` (project environment/CLI/workflow knowledge). + +**Sources:** `observed` (you found this in the code), `user-stated` (user told you), +`inferred` (AI deduction), `cross-model` (both Claude and Codex agree). + +**Confidence:** 1-10. Be honest. An observed pattern you verified in the code is 8-9. +An inference you're not sure about is 4-5. A user preference they explicitly stated is 10. + +**files:** Include the specific file paths this learning references. This enables +staleness detection: if those files are later deleted, the learning can be flagged. + +**Only log genuine discoveries.** Don't log obvious things. Don't log things the user +already knows. A good test: would this insight save time in a future session? If yes, log it. + ## Mode Quick Reference ``` ┌────────────────────────────────────────────────────────────────────────────────┐ diff --git a/plan-ceo-review/SKILL.md.tmpl b/plan-ceo-review/SKILL.md.tmpl index 16aea4f94..739ca8e6a 100644 --- a/plan-ceo-review/SKILL.md.tmpl +++ b/plan-ceo-review/SKILL.md.tmpl @@ -782,6 +782,8 @@ If promoted, copy the CEO plan content to `docs/designs/{FEATURE}.md` (create th * After each section, pause and wait for feedback. * Use **CRITICAL GAP** / **WARNING** / **OK** for scannability. +{{LEARNINGS_LOG}} + ## Mode Quick Reference ``` ┌────────────────────────────────────────────────────────────────────────────────┐ diff --git a/plan-design-review/SKILL.md b/plan-design-review/SKILL.md index a7479bf92..38f8af758 100644 --- a/plan-design-review/SKILL.md +++ b/plan-design-review/SKILL.md @@ -860,6 +860,44 @@ descriptions of what 10/10 looks like. ## Review Sections (7 passes, after scope is agreed) +## Prior Learnings + +Search for relevant learnings from previous sessions: + +```bash +_CROSS_PROJ=$(~/.claude/skills/gstack/bin/gstack-config get cross_project_learnings 2>/dev/null || echo "unset") +echo "CROSS_PROJECT: $_CROSS_PROJ" +if [ "$_CROSS_PROJ" = "true" ]; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 10 --cross-project 2>/dev/null || true +else + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 10 2>/dev/null || true +fi +``` + +If `CROSS_PROJECT` is `unset` (first time): Use AskUserQuestion: + +> gstack can search learnings from your other projects on this machine to find +> patterns that might apply here. This stays local (no data leaves your machine). +> Recommended for solo developers. Skip if you work on multiple client codebases +> where cross-contamination would be a concern. + +Options: +- A) Enable cross-project learnings (recommended) +- B) Keep learnings project-scoped only + +If A: run `~/.claude/skills/gstack/bin/gstack-config set cross_project_learnings true` +If B: run `~/.claude/skills/gstack/bin/gstack-config set cross_project_learnings false` + +Then re-run the search with the appropriate flag. + +If learnings are found, incorporate them into your analysis. When a review finding +matches a past learning, display: + +**"Prior learning applied: [key] (confidence N/10, from [date])"** + +This makes the compounding visible. The user should see that gstack is getting +smarter on their codebase over time. + ### Pass 1: Information Architecture Rate 0-10: Does the plan define what the user sees first, second, third? FIX TO 10: Add information hierarchy to the plan. Include ASCII diagram of screen/page structure and navigation flow. Apply "constraint worship" — if you can only show 3 things, which 3? @@ -1215,6 +1253,31 @@ plan's living status. - Always place it as the very last section in the plan file. If it was found mid-file, move it: delete the old location and append at the end. +## Capture Learnings + +If you discovered a non-obvious pattern, pitfall, or architectural insight during +this session, log it for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"plan-design-review","type":"TYPE","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"SOURCE","files":["path/to/relevant/file"]}' +``` + +**Types:** `pattern` (reusable approach), `pitfall` (what NOT to do), `preference` +(user stated), `architecture` (structural decision), `tool` (library/framework insight), +`operational` (project environment/CLI/workflow knowledge). + +**Sources:** `observed` (you found this in the code), `user-stated` (user told you), +`inferred` (AI deduction), `cross-model` (both Claude and Codex agree). + +**Confidence:** 1-10. Be honest. An observed pattern you verified in the code is 8-9. +An inference you're not sure about is 4-5. A user preference they explicitly stated is 10. + +**files:** Include the specific file paths this learning references. This enables +staleness detection: if those files are later deleted, the learning can be flagged. + +**Only log genuine discoveries.** Don't log obvious things. Don't log things the user +already knows. A good test: would this insight save time in a future session? If yes, log it. + ## Next Steps — Review Chaining After displaying the Review Readiness Dashboard, recommend the next review(s) based on what this design review discovered. Read the dashboard output to see which reviews have already been run and whether they are stale. diff --git a/plan-design-review/SKILL.md.tmpl b/plan-design-review/SKILL.md.tmpl index cfafa6e6a..c008acf1c 100644 --- a/plan-design-review/SKILL.md.tmpl +++ b/plan-design-review/SKILL.md.tmpl @@ -257,6 +257,8 @@ descriptions of what 10/10 looks like. ## Review Sections (7 passes, after scope is agreed) +{{LEARNINGS_SEARCH}} + ### Pass 1: Information Architecture Rate 0-10: Does the plan define what the user sees first, second, third? FIX TO 10: Add information hierarchy to the plan. Include ASCII diagram of screen/page structure and navigation flow. Apply "constraint worship" — if you can only show 3 things, which 3? @@ -431,6 +433,8 @@ Substitute values from the Completion Summary: {{PLAN_FILE_REVIEW_REPORT}} +{{LEARNINGS_LOG}} + ## Next Steps — Review Chaining After displaying the Review Readiness Dashboard, recommend the next review(s) based on what this design review discovered. Read the dashboard output to see which reviews have already been run and whether they are stale. diff --git a/plan-eng-review/SKILL.md b/plan-eng-review/SKILL.md index 5ecd68716..b6f117ce0 100644 --- a/plan-eng-review/SKILL.md +++ b/plan-eng-review/SKILL.md @@ -1172,6 +1172,31 @@ plan's living status. - Always place it as the very last section in the plan file. If it was found mid-file, move it: delete the old location and append at the end. +## Capture Learnings + +If you discovered a non-obvious pattern, pitfall, or architectural insight during +this session, log it for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"plan-eng-review","type":"TYPE","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"SOURCE","files":["path/to/relevant/file"]}' +``` + +**Types:** `pattern` (reusable approach), `pitfall` (what NOT to do), `preference` +(user stated), `architecture` (structural decision), `tool` (library/framework insight), +`operational` (project environment/CLI/workflow knowledge). + +**Sources:** `observed` (you found this in the code), `user-stated` (user told you), +`inferred` (AI deduction), `cross-model` (both Claude and Codex agree). + +**Confidence:** 1-10. Be honest. An observed pattern you verified in the code is 8-9. +An inference you're not sure about is 4-5. A user preference they explicitly stated is 10. + +**files:** Include the specific file paths this learning references. This enables +staleness detection: if those files are later deleted, the learning can be flagged. + +**Only log genuine discoveries.** Don't log obvious things. Don't log things the user +already knows. A good test: would this insight save time in a future session? If yes, log it. + ## Next Steps — Review Chaining After displaying the Review Readiness Dashboard, check if additional reviews would be valuable. Read the dashboard output to see which reviews have already been run and whether they are stale. diff --git a/plan-eng-review/SKILL.md.tmpl b/plan-eng-review/SKILL.md.tmpl index 415315a83..c0311e092 100644 --- a/plan-eng-review/SKILL.md.tmpl +++ b/plan-eng-review/SKILL.md.tmpl @@ -287,6 +287,8 @@ Substitute values from the Completion Summary: {{PLAN_FILE_REVIEW_REPORT}} +{{LEARNINGS_LOG}} + ## Next Steps — Review Chaining After displaying the Review Readiness Dashboard, check if additional reviews would be valuable. Read the dashboard output to see which reviews have already been run and whether they are stale. diff --git a/qa-only/SKILL.md b/qa-only/SKILL.md index 4a538657c..f728cd56f 100644 --- a/qa-only/SKILL.md +++ b/qa-only/SKILL.md @@ -407,6 +407,44 @@ mkdir -p "$REPORT_DIR/screenshots" --- +## Prior Learnings + +Search for relevant learnings from previous sessions: + +```bash +_CROSS_PROJ=$(~/.claude/skills/gstack/bin/gstack-config get cross_project_learnings 2>/dev/null || echo "unset") +echo "CROSS_PROJECT: $_CROSS_PROJ" +if [ "$_CROSS_PROJ" = "true" ]; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 10 --cross-project 2>/dev/null || true +else + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 10 2>/dev/null || true +fi +``` + +If `CROSS_PROJECT` is `unset` (first time): Use AskUserQuestion: + +> gstack can search learnings from your other projects on this machine to find +> patterns that might apply here. This stays local (no data leaves your machine). +> Recommended for solo developers. Skip if you work on multiple client codebases +> where cross-contamination would be a concern. + +Options: +- A) Enable cross-project learnings (recommended) +- B) Keep learnings project-scoped only + +If A: run `~/.claude/skills/gstack/bin/gstack-config set cross_project_learnings true` +If B: run `~/.claude/skills/gstack/bin/gstack-config set cross_project_learnings false` + +Then re-run the search with the appropriate flag. + +If learnings are found, incorporate them into your analysis. When a review finding +matches a past learning, display: + +**"Prior learning applied: [key] (confidence N/10, from [date])"** + +This makes the compounding visible. The user should see that gstack is getting +smarter on their codebase over time. + ## Test Plan Context Before falling back to git diff heuristics, check for richer test plan sources: @@ -731,6 +769,31 @@ Report filenames use the domain and date: `qa-report-myapp-com-2026-03-12.md` --- +## Capture Learnings + +If you discovered a non-obvious pattern, pitfall, or architectural insight during +this session, log it for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"qa-only","type":"TYPE","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"SOURCE","files":["path/to/relevant/file"]}' +``` + +**Types:** `pattern` (reusable approach), `pitfall` (what NOT to do), `preference` +(user stated), `architecture` (structural decision), `tool` (library/framework insight), +`operational` (project environment/CLI/workflow knowledge). + +**Sources:** `observed` (you found this in the code), `user-stated` (user told you), +`inferred` (AI deduction), `cross-model` (both Claude and Codex agree). + +**Confidence:** 1-10. Be honest. An observed pattern you verified in the code is 8-9. +An inference you're not sure about is 4-5. A user preference they explicitly stated is 10. + +**files:** Include the specific file paths this learning references. This enables +staleness detection: if those files are later deleted, the learning can be flagged. + +**Only log genuine discoveries.** Don't log obvious things. Don't log things the user +already knows. A good test: would this insight save time in a future session? If yes, log it. + ## Additional Rules (qa-only specific) 11. **Never fix bugs.** Find and document only. Do not read source code, edit files, or suggest fixes in the report. Your job is to report what's broken, not to fix it. Use `/qa` for the test-fix-verify loop. diff --git a/qa-only/SKILL.md.tmpl b/qa-only/SKILL.md.tmpl index 0bb59c0c0..71bc0566b 100644 --- a/qa-only/SKILL.md.tmpl +++ b/qa-only/SKILL.md.tmpl @@ -49,6 +49,8 @@ mkdir -p "$REPORT_DIR/screenshots" --- +{{LEARNINGS_SEARCH}} + ## Test Plan Context Before falling back to git diff heuristics, check for richer test plan sources: @@ -97,6 +99,8 @@ Report filenames use the domain and date: `qa-report-myapp-com-2026-03-12.md` --- +{{LEARNINGS_LOG}} + ## Additional Rules (qa-only specific) 11. **Never fix bugs.** Find and document only. Do not read source code, edit files, or suggest fixes in the report. Your job is to report what's broken, not to fix it. Use `/qa` for the test-fix-verify loop. diff --git a/qa/SKILL.md b/qa/SKILL.md index 0e03a4c61..32b717126 100644 --- a/qa/SKILL.md +++ b/qa/SKILL.md @@ -637,6 +637,44 @@ mkdir -p .gstack/qa-reports/screenshots --- +## Prior Learnings + +Search for relevant learnings from previous sessions: + +```bash +_CROSS_PROJ=$(~/.claude/skills/gstack/bin/gstack-config get cross_project_learnings 2>/dev/null || echo "unset") +echo "CROSS_PROJECT: $_CROSS_PROJ" +if [ "$_CROSS_PROJ" = "true" ]; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 10 --cross-project 2>/dev/null || true +else + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 10 2>/dev/null || true +fi +``` + +If `CROSS_PROJECT` is `unset` (first time): Use AskUserQuestion: + +> gstack can search learnings from your other projects on this machine to find +> patterns that might apply here. This stays local (no data leaves your machine). +> Recommended for solo developers. Skip if you work on multiple client codebases +> where cross-contamination would be a concern. + +Options: +- A) Enable cross-project learnings (recommended) +- B) Keep learnings project-scoped only + +If A: run `~/.claude/skills/gstack/bin/gstack-config set cross_project_learnings true` +If B: run `~/.claude/skills/gstack/bin/gstack-config set cross_project_learnings false` + +Then re-run the search with the appropriate flag. + +If learnings are found, incorporate them into your analysis. When a review finding +matches a past learning, display: + +**"Prior learning applied: [key] (confidence N/10, from [date])"** + +This makes the compounding visible. The user should see that gstack is getting +smarter on their codebase over time. + ## Test Plan Context Before falling back to git diff heuristics, check for richer test plan sources: @@ -1138,6 +1176,31 @@ If the repo has a `TODOS.md`: --- +## Capture Learnings + +If you discovered a non-obvious pattern, pitfall, or architectural insight during +this session, log it for future sessions: + +```bash +~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"qa","type":"TYPE","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"SOURCE","files":["path/to/relevant/file"]}' +``` + +**Types:** `pattern` (reusable approach), `pitfall` (what NOT to do), `preference` +(user stated), `architecture` (structural decision), `tool` (library/framework insight), +`operational` (project environment/CLI/workflow knowledge). + +**Sources:** `observed` (you found this in the code), `user-stated` (user told you), +`inferred` (AI deduction), `cross-model` (both Claude and Codex agree). + +**Confidence:** 1-10. Be honest. An observed pattern you verified in the code is 8-9. +An inference you're not sure about is 4-5. A user preference they explicitly stated is 10. + +**files:** Include the specific file paths this learning references. This enables +staleness detection: if those files are later deleted, the learning can be flagged. + +**Only log genuine discoveries.** Don't log obvious things. Don't log things the user +already knows. A good test: would this insight save time in a future session? If yes, log it. + ## Additional Rules (qa-specific) 11. **Clean working tree required.** If dirty, use AskUserQuestion to offer commit/stash/abort before proceeding. diff --git a/qa/SKILL.md.tmpl b/qa/SKILL.md.tmpl index 0283ffc7c..6c946e298 100644 --- a/qa/SKILL.md.tmpl +++ b/qa/SKILL.md.tmpl @@ -90,6 +90,8 @@ mkdir -p .gstack/qa-reports/screenshots --- +{{LEARNINGS_SEARCH}} + ## Test Plan Context Before falling back to git diff heuristics, check for richer test plan sources: @@ -315,6 +317,8 @@ If the repo has a `TODOS.md`: --- +{{LEARNINGS_LOG}} + ## Additional Rules (qa-specific) 11. **Clean working tree required.** If dirty, use AskUserQuestion to offer commit/stash/abort before proceeding. diff --git a/retro/SKILL.md b/retro/SKILL.md index 4d202efa0..e80324a31 100644 --- a/retro/SKILL.md +++ b/retro/SKILL.md @@ -413,6 +413,44 @@ Usage: /retro [window | compare | global] **If the first argument is `global`:** Skip the normal repo-scoped retro (Steps 1-14). Instead, follow the **Global Retrospective** flow at the end of this document. The optional second argument is the time window (default 7d). This mode does NOT require being inside a git repo. +## Prior Learnings + +Search for relevant learnings from previous sessions: + +```bash +_CROSS_PROJ=$(~/.claude/skills/gstack/bin/gstack-config get cross_project_learnings 2>/dev/null || echo "unset") +echo "CROSS_PROJECT: $_CROSS_PROJ" +if [ "$_CROSS_PROJ" = "true" ]; then + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 10 --cross-project 2>/dev/null || true +else + ~/.claude/skills/gstack/bin/gstack-learnings-search --limit 10 2>/dev/null || true +fi +``` + +If `CROSS_PROJECT` is `unset` (first time): Use AskUserQuestion: + +> gstack can search learnings from your other projects on this machine to find +> patterns that might apply here. This stays local (no data leaves your machine). +> Recommended for solo developers. Skip if you work on multiple client codebases +> where cross-contamination would be a concern. + +Options: +- A) Enable cross-project learnings (recommended) +- B) Keep learnings project-scoped only + +If A: run `~/.claude/skills/gstack/bin/gstack-config set cross_project_learnings true` +If B: run `~/.claude/skills/gstack/bin/gstack-config set cross_project_learnings false` + +Then re-run the search with the appropriate flag. + +If learnings are found, incorporate them into your analysis. When a review finding +matches a past learning, display: + +**"Prior learning applied: [key] (confidence N/10, from [date])"** + +This makes the compounding visible. The user should see that gstack is getting +smarter on their codebase over time. + ### Step 1: Gather Raw Data First, fetch origin and identify the current user: diff --git a/retro/SKILL.md.tmpl b/retro/SKILL.md.tmpl index b1b44ee1a..755a6f9c3 100644 --- a/retro/SKILL.md.tmpl +++ b/retro/SKILL.md.tmpl @@ -58,6 +58,8 @@ Usage: /retro [window | compare | global] **If the first argument is `global`:** Skip the normal repo-scoped retro (Steps 1-14). Instead, follow the **Global Retrospective** flow at the end of this document. The optional second argument is the time window (default 7d). This mode does NOT require being inside a git repo. +{{LEARNINGS_SEARCH}} + ### Step 1: Gather Raw Data First, fetch origin and identify the current user: From 835cc172ef78954a02967a7cd42698785b7a1825 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sun, 29 Mar 2026 21:09:11 -0700 Subject: [PATCH 4/6] test: add operational-learning E2E test (gate-tier) Validates the write path: agent encounters a CLI failure, logs an operational learning to JSONL via gstack-learnings-log. Replaces the removed contributor-mode E2E test. Setup: temp git repo, copy bin scripts, set GSTACK_HOME. Prompt: simulated npm test failure needing --experimental-vm-modules. Assert: learnings.jsonl exists with type=operational entry. Co-Authored-By: Claude Opus 4.6 (1M context) --- test/helpers/touchfiles.ts | 2 + test/skill-e2e-bws.test.ts | 93 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) diff --git a/test/helpers/touchfiles.ts b/test/helpers/touchfiles.ts index f28a933e7..d21ef3476 100644 --- a/test/helpers/touchfiles.ts +++ b/test/helpers/touchfiles.ts @@ -42,6 +42,7 @@ export const E2E_TOUCHFILES: Record = { 'skillmd-outside-git': ['SKILL.md', 'SKILL.md.tmpl', 'scripts/gen-skill-docs.ts'], 'session-awareness': ['SKILL.md', 'SKILL.md.tmpl', 'scripts/gen-skill-docs.ts'], + 'operational-learning': ['scripts/resolvers/preamble.ts', 'bin/gstack-learnings-log'], // QA (+ test-server dependency) 'qa-quick': ['qa/**', 'browse/src/**', 'browse/test/test-server.ts'], @@ -182,6 +183,7 @@ export const E2E_TIERS: Record = { 'skillmd-no-local-binary': 'gate', 'skillmd-outside-git': 'gate', 'session-awareness': 'gate', + 'operational-learning': 'gate', // QA — gate for functional, periodic for quality/benchmarks 'qa-quick': 'gate', diff --git a/test/skill-e2e-bws.test.ts b/test/skill-e2e-bws.test.ts index d207f4162..c1a1be15d 100644 --- a/test/skill-e2e-bws.test.ts +++ b/test/skill-e2e-bws.test.ts @@ -20,6 +20,7 @@ let tmpDir: string; describeIfSelected('Skill E2E tests', [ 'browse-basic', 'browse-snapshot', 'skillmd-setup-discovery', 'skillmd-no-local-binary', 'skillmd-outside-git', 'session-awareness', + 'operational-learning', ], () => { beforeAll(() => { testServer = startTestServer(); @@ -177,6 +178,98 @@ Report the exact output — either "READY: " or "NEEDS_SETUP".`, try { fs.rmSync(nonGitDir, { recursive: true, force: true }); } catch {} }, 60_000); + testConcurrentIfSelected('operational-learning', async () => { + const opDir = fs.mkdtempSync(path.join(os.tmpdir(), 'skill-e2e-oplearn-')); + const gstackHome = path.join(opDir, '.gstack-home'); + + // Init git repo + const run = (cmd: string, args: string[]) => + spawnSync(cmd, args, { cwd: opDir, stdio: 'pipe', timeout: 5000 }); + run('git', ['init', '-b', 'main']); + run('git', ['config', 'user.email', 'test@test.com']); + run('git', ['config', 'user.name', 'Test']); + fs.writeFileSync(path.join(opDir, 'app.ts'), 'console.log("hello");\n'); + run('git', ['add', '.']); + run('git', ['commit', '-m', 'initial']); + + // Copy bin scripts + const binDir = path.join(opDir, 'bin'); + fs.mkdirSync(binDir, { recursive: true }); + for (const script of ['gstack-learnings-log', 'gstack-slug']) { + fs.copyFileSync(path.join(ROOT, 'bin', script), path.join(binDir, script)); + fs.chmodSync(path.join(binDir, script), 0o755); + } + + // gstack-learnings-log will create the project dir automatically via gstack-slug + + const result = await runSkillTest({ + prompt: `You just ran \`npm test\` in this project and it failed with this error: + +Error: --experimental-vm-modules flag is required for ESM support in this project. +Run: npm test --experimental-vm-modules + +Per the Operational Self-Improvement instructions below, log an operational learning about this failure. + +## Operational Self-Improvement + +Before completing, reflect on this session: +- Did any commands fail unexpectedly? + +If yes, log an operational learning for future sessions: + +\`\`\`bash +GSTACK_HOME="${gstackHome}" ${binDir}/gstack-learnings-log '{"skill":"qa","type":"operational","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"observed"}' +\`\`\` + +Replace SHORT_KEY with a kebab-case key like "esm-vm-modules-flag". +Replace DESCRIPTION with a one-sentence description of what you learned. +Replace N with a confidence score 1-10. + +Log the operational learning now. Then say what you logged.`, + workingDirectory: opDir, + maxTurns: 5, + timeout: 30_000, + testName: 'operational-learning', + runId, + }); + + logCost('operational learning', result); + + const exitOk = ['success', 'error_max_turns'].includes(result.exitReason); + + // Check if learnings file was created with an operational entry + // The slug is derived from the git repo (dirname), so search all project dirs + let hasOperational = false; + const projectsDir = path.join(gstackHome, 'projects'); + if (fs.existsSync(projectsDir)) { + for (const slug of fs.readdirSync(projectsDir)) { + const lPath = path.join(projectsDir, slug, 'learnings.jsonl'); + if (fs.existsSync(lPath)) { + const jsonl = fs.readFileSync(lPath, 'utf-8').trim(); + if (jsonl) { + const entries = jsonl.split('\n').map(l => { try { return JSON.parse(l); } catch { return null; } }).filter(Boolean); + const opEntry = entries.find(e => e.type === 'operational'); + if (opEntry) { + hasOperational = true; + console.log(`Operational learning logged: key="${opEntry.key}" insight="${opEntry.insight}" (slug: ${slug})`); + break; + } + } + } + } + } + + recordE2E(evalCollector, 'operational learning', 'Skill E2E tests', result, { + passed: exitOk && hasOperational, + }); + + expect(exitOk).toBe(true); + expect(hasOperational).toBe(true); + + // Clean up + try { fs.rmSync(opDir, { recursive: true, force: true }); } catch {} + }, 90_000); + testConcurrentIfSelected('session-awareness', async () => { const sessionDir = fs.mkdtempSync(path.join(os.tmpdir(), 'skill-e2e-session-')); From 314e96ac4306008f839b576069405a540bc0188b Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sun, 29 Mar 2026 21:21:26 -0700 Subject: [PATCH 5/6] =?UTF-8?q?fix:=20learnings-show=20E2E=20slug=20mismat?= =?UTF-8?q?ch=20=E2=80=94=20seed=20at=20computed=20slug,=20not=20hardcoded?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test seeded learnings at projects/test-project/ but gstack-slug computes the slug from basename(workDir) when no git remote exists. The agent's search looked at the wrong path and found nothing. Fix: compute slug the same way gstack-slug does (basename + sanitize) and seed the learnings there. Co-Authored-By: Claude Opus 4.6 (1M context) --- test/skill-e2e-learnings.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/skill-e2e-learnings.test.ts b/test/skill-e2e-learnings.test.ts index 390eedf7f..8b6dec944 100644 --- a/test/skill-e2e-learnings.test.ts +++ b/test/skill-e2e-learnings.test.ts @@ -44,8 +44,9 @@ describeIfSelected('Learnings E2E', ['learnings-show'], () => { fs.chmodSync(path.join(binDir, script), 0o755); } - // Seed learnings JSONL with 3 entries of different types - const slug = 'test-project'; + // Seed learnings JSONL — slug must match what gstack-slug computes. + // With no git remote, gstack-slug falls back to basename(workDir). + const slug = path.basename(workDir).replace(/[^a-zA-Z0-9._-]/g, ''); const projectDir = path.join(gstackHome, 'projects', slug); fs.mkdirSync(projectDir, { recursive: true }); From c050b0400833901dbb3c941b2da9ca92d9d45d92 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sun, 29 Mar 2026 21:24:20 -0700 Subject: [PATCH 6/6] chore: bump version and changelog (v0.13.8.0) Co-Authored-By: Claude Opus 4.6 (1M context) --- CHANGELOG.md | 18 ++++++++++++++++++ VERSION | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cee02336e..fb4bbc68a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## [0.13.8.0] - 2026-03-29 — Recursive Self-Improvement + +gstack now learns from its own mistakes. Every skill session captures operational failures (CLI errors, wrong approaches, project quirks) and surfaces them in future sessions. No setup needed, just works. + +### Added + +- **Operational self-improvement.** When a command fails or you hit a project-specific gotcha, gstack logs it. Next session, it remembers. "bun test needs --timeout 30000" or "login flow requires cookie import first" ... the kind of stuff that wastes 10 minutes every time you forget it. +- **Learnings summary in preamble.** When your project has 5+ learnings, gstack shows the top 3 at the start of every session so you see them before you start working. +- **13 skills now learn.** office-hours, plan-ceo-review, plan-eng-review, plan-design-review, design-review, design-consultation, cso, qa, qa-only, and retro all now read prior learnings AND contribute new ones. Previously only review, ship, and investigate were wired. + +### Changed + +- **Contributor mode replaced.** The old contributor mode (manual opt-in, markdown reports to ~/.gstack/contributor-logs/) never fired in 18 days of heavy use. Replaced with automatic operational learning that captures the same insights without any setup. + +### Fixed + +- **learnings-show E2E test slug mismatch.** The test seeded learnings at a hardcoded path but gstack-slug computed a different path at runtime. Now computes the slug dynamically. + ## [0.13.7.0] - 2026-03-29 — Community Wave Six community fixes with 16 new tests. Telemetry off now means off everywhere. Skills are findable by name. And changing your prefix setting actually works now. diff --git a/VERSION b/VERSION index a4029e21a..f4040e84c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.13.7.0 +0.13.8.0