From 2e5fa72205c67b106d5b6c137cbc19bfe1e61adb Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Tue, 17 Mar 2026 08:28:46 -0700 Subject: [PATCH 1/3] feat: add bin/gstack-slug helper + migrate all inline SLUG computation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extract the opaque SLUG sed pipeline into a shared 5-line shell script. Replace 8 inline copies across templates with eval $(gstack-slug). Sanitizes branch names (/ → -) to prevent subdirectory creation. --- bin/gstack-slug | 9 ++++++ design-consultation/SKILL.md | 2 +- design-consultation/SKILL.md.tmpl | 2 +- plan-eng-review/SKILL.md | 50 +++++++++++++++++++++++++++++-- plan-eng-review/SKILL.md.tmpl | 22 ++++++++++++-- qa-design-review/SKILL.md | 4 +-- qa-design-review/SKILL.md.tmpl | 2 +- qa-only/SKILL.md | 4 +-- qa-only/SKILL.md.tmpl | 4 +-- qa/SKILL.md | 4 +-- qa/SKILL.md.tmpl | 4 +-- scripts/gen-skill-docs.ts | 35 +++++++++++++++++++++- test/skill-validation.test.ts | 42 ++++++++++++++++++++++++++ 13 files changed, 166 insertions(+), 18 deletions(-) create mode 100755 bin/gstack-slug diff --git a/bin/gstack-slug b/bin/gstack-slug new file mode 100755 index 00000000..7336b7b4 --- /dev/null +++ b/bin/gstack-slug @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# gstack-slug — output project slug and sanitized branch name +# Usage: eval $(gstack-slug) → sets SLUG and BRANCH variables +# Or: gstack-slug → prints SLUG=... and BRANCH=... lines +set -euo pipefail +SLUG=$(git remote get-url origin 2>/dev/null | sed 's|.*[:/]\([^/]*/[^/]*\)\.git$|\1|;s|.*[:/]\([^/]*/[^/]*\)$|\1|' | tr '/' '-') +BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr '/' '-') +echo "SLUG=$SLUG" +echo "BRANCH=$BRANCH" diff --git a/design-consultation/SKILL.md b/design-consultation/SKILL.md index d92d47fd..0d919950 100644 --- a/design-consultation/SKILL.md +++ b/design-consultation/SKILL.md @@ -114,7 +114,7 @@ ls src/ app/ pages/ components/ 2>/dev/null | head -30 Look for brainstorm output: ```bash -SLUG=$(git remote get-url origin 2>/dev/null | sed 's|.*[:/]\([^/]*/[^/]*\)\.git$|\1|;s|.*[:/]\([^/]*/[^/]*\)$|\1|' | tr '/' '-') +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) ls ~/.gstack/projects/$SLUG/*brainstorm* 2>/dev/null | head -5 ls .context/*brainstorm* .context/attachments/*brainstorm* 2>/dev/null | head -5 ``` diff --git a/design-consultation/SKILL.md.tmpl b/design-consultation/SKILL.md.tmpl index 11d868fa..ef5044fb 100644 --- a/design-consultation/SKILL.md.tmpl +++ b/design-consultation/SKILL.md.tmpl @@ -49,7 +49,7 @@ ls src/ app/ pages/ components/ 2>/dev/null | head -30 Look for brainstorm output: ```bash -SLUG=$(git remote get-url origin 2>/dev/null | sed 's|.*[:/]\([^/]*/[^/]*\)\.git$|\1|;s|.*[:/]\([^/]*/[^/]*\)$|\1|' | tr '/' '-') +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) ls ~/.gstack/projects/$SLUG/*brainstorm* 2>/dev/null | head -5 ls .context/*brainstorm* .context/attachments/*brainstorm* 2>/dev/null | head -5 ``` diff --git a/plan-eng-review/SKILL.md b/plan-eng-review/SKILL.md index 4cd8f481..b5c0775b 100644 --- a/plan-eng-review/SKILL.md +++ b/plan-eng-review/SKILL.md @@ -154,8 +154,7 @@ For LLM/prompt changes: check the "Prompt/LLM changes" file patterns listed in C After producing the test diagram, write a test plan artifact to the project directory so `/qa` and `/qa-only` can consume it as primary test input (replacing the lossy git-diff heuristic): ```bash -SLUG=$(git remote get-url origin 2>/dev/null | sed 's|.*[:/]\([^/]*/[^/]*\)\.git$|\1|;s|.*[:/]\([^/]*/[^/]*\)$|\1|' | tr '/' '-') -BRANCH=$(git rev-parse --abbrev-ref HEAD) +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) USER=$(whoami) DATETIME=$(date +%Y%m%d-%H%M%S) mkdir -p ~/.gstack/projects/$SLUG @@ -259,5 +258,52 @@ Check the git log for this branch. If there are prior commits suggesting a previ * One sentence max per option. Pick in under 5 seconds. * After each review section, pause and ask for feedback before moving on. +## Review Log + +After producing the Completion Summary above, persist the review result: + +```bash +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) +mkdir -p ~/.gstack/projects/$SLUG +echo '{"skill":"plan-eng-review","timestamp":"TIMESTAMP","status":"STATUS","unresolved":N,"critical_gaps":N,"mode":"MODE"}' >> ~/.gstack/projects/$SLUG/$BRANCH-reviews.jsonl +``` + +Substitute values from the Completion Summary: +- **TIMESTAMP**: current ISO 8601 datetime +- **STATUS**: "clean" if 0 unresolved decisions AND 0 critical gaps; otherwise "issues_open" +- **unresolved**: number from "Unresolved decisions" count +- **critical_gaps**: number from "Failure modes: ___ critical gaps flagged" +- **MODE**: SCOPE_REDUCTION / BIG_CHANGE / SMALL_CHANGE + +## Review Readiness Dashboard + +After completing the review, read the review log to display the dashboard. + +```bash +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) +cat ~/.gstack/projects/$SLUG/$BRANCH-reviews.jsonl 2>/dev/null || echo "NO_REVIEWS" +``` + +Parse the output. Find the most recent entry for each skill (plan-ceo-review, plan-eng-review, plan-design-review). Ignore entries with timestamps older than 7 days. Display: + +``` ++====================================================================+ +| REVIEW READINESS DASHBOARD | ++====================================================================+ +| Review | Runs | Last Run | Status | +|-----------------|------|---------------------|----------------------| +| CEO Review | 1 | 2026-03-16 14:30 | CLEAR | +| Eng Review | 1 | 2026-03-16 15:00 | CLEAR | +| Design Review | 0 | — | NOT YET RUN | ++--------------------------------------------------------------------+ +| VERDICT: 2/3 CLEAR — Design Review not yet run | ++====================================================================+ +``` + +**Verdict logic:** +- **CLEARED TO SHIP (3/3)**: All three have >= 1 entry within 7 days AND most recent status is "clean" +- **N/3 CLEAR**: Show count and list which are missing, have open issues, or are stale (>7 days) +- Informational only — does NOT block. + ## Unresolved decisions If the user does not respond to an AskUserQuestion or interrupts to move on, note which decisions were left unresolved. At the end of the review, list these as "Unresolved decisions that may bite you later" — never silently default to an option. diff --git a/plan-eng-review/SKILL.md.tmpl b/plan-eng-review/SKILL.md.tmpl index 410b0726..4905d8d3 100644 --- a/plan-eng-review/SKILL.md.tmpl +++ b/plan-eng-review/SKILL.md.tmpl @@ -89,8 +89,7 @@ For LLM/prompt changes: check the "Prompt/LLM changes" file patterns listed in C After producing the test diagram, write a test plan artifact to the project directory so `/qa` and `/qa-only` can consume it as primary test input (replacing the lossy git-diff heuristic): ```bash -SLUG=$(git remote get-url origin 2>/dev/null | sed 's|.*[:/]\([^/]*/[^/]*\)\.git$|\1|;s|.*[:/]\([^/]*/[^/]*\)$|\1|' | tr '/' '-') -BRANCH=$(git rev-parse --abbrev-ref HEAD) +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) USER=$(whoami) DATETIME=$(date +%Y%m%d-%H%M%S) mkdir -p ~/.gstack/projects/$SLUG @@ -194,5 +193,24 @@ Check the git log for this branch. If there are prior commits suggesting a previ * One sentence max per option. Pick in under 5 seconds. * After each review section, pause and ask for feedback before moving on. +## Review Log + +After producing the Completion Summary above, persist the review result: + +```bash +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) +mkdir -p ~/.gstack/projects/$SLUG +echo '{"skill":"plan-eng-review","timestamp":"TIMESTAMP","status":"STATUS","unresolved":N,"critical_gaps":N,"mode":"MODE"}' >> ~/.gstack/projects/$SLUG/$BRANCH-reviews.jsonl +``` + +Substitute values from the Completion Summary: +- **TIMESTAMP**: current ISO 8601 datetime +- **STATUS**: "clean" if 0 unresolved decisions AND 0 critical gaps; otherwise "issues_open" +- **unresolved**: number from "Unresolved decisions" count +- **critical_gaps**: number from "Failure modes: ___ critical gaps flagged" +- **MODE**: SCOPE_REDUCTION / BIG_CHANGE / SMALL_CHANGE + +{{REVIEW_DASHBOARD}} + ## Unresolved decisions If the user does not respond to an AskUserQuestion or interrupts to move on, note which decisions were left unresolved. At the end of the review, list these as "Unresolved decisions that may bite you later" — never silently default to an option. diff --git a/qa-design-review/SKILL.md b/qa-design-review/SKILL.md index 08c9916a..b4b1e436 100644 --- a/qa-design-review/SKILL.md +++ b/qa-design-review/SKILL.md @@ -396,7 +396,7 @@ Compare screenshots and observations across pages for: **Project-scoped:** ```bash -SLUG=$(git remote get-url origin 2>/dev/null | sed 's|.*[:/]\([^/]*/[^/]*\)\.git$|\1|;s|.*[:/]\([^/]*/[^/]*\)$|\1|' | tr '/' '-') +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) mkdir -p ~/.gstack/projects/$SLUG ``` Write to: `~/.gstack/projects/{slug}/{user}-{branch}-design-audit-{datetime}.md` @@ -602,7 +602,7 @@ Write the report to both local and project-scoped locations: **Project-scoped:** ```bash -SLUG=$(git remote get-url origin 2>/dev/null | sed 's|.*[:/]\([^/]*/[^/]*\)\.git$|\1|;s|.*[:/]\([^/]*/[^/]*\)$|\1|' | tr '/' '-') +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) mkdir -p ~/.gstack/projects/$SLUG ``` Write to `~/.gstack/projects/{slug}/{user}-{branch}-design-audit-{datetime}.md` diff --git a/qa-design-review/SKILL.md.tmpl b/qa-design-review/SKILL.md.tmpl index 86e9aab9..0053a494 100644 --- a/qa-design-review/SKILL.md.tmpl +++ b/qa-design-review/SKILL.md.tmpl @@ -191,7 +191,7 @@ Write the report to both local and project-scoped locations: **Project-scoped:** ```bash -SLUG=$(git remote get-url origin 2>/dev/null | sed 's|.*[:/]\([^/]*/[^/]*\)\.git$|\1|;s|.*[:/]\([^/]*/[^/]*\)$|\1|' | tr '/' '-') +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) mkdir -p ~/.gstack/projects/$SLUG ``` Write to `~/.gstack/projects/{slug}/{user}-{branch}-design-audit-{datetime}.md` diff --git a/qa-only/SKILL.md b/qa-only/SKILL.md index 5e74f03e..e382a4f8 100644 --- a/qa-only/SKILL.md +++ b/qa-only/SKILL.md @@ -134,7 +134,7 @@ Before falling back to git diff heuristics, check for richer test plan sources: 1. **Project-scoped test plans:** Check `~/.gstack/projects/` for recent `*-test-plan-*.md` files for this repo ```bash - SLUG=$(git remote get-url origin 2>/dev/null | sed 's|.*[:/]\([^/]*/[^/]*\)\.git$|\1|;s|.*[:/]\([^/]*/[^/]*\)$|\1|' | tr '/' '-') + eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) ls -t ~/.gstack/projects/$SLUG/*-test-plan-*.md 2>/dev/null | head -1 ``` 2. **Conversation context:** Check if a prior `/plan-eng-review` or `/plan-ceo-review` produced test plan output in this conversation @@ -426,7 +426,7 @@ Write the report to both local and project-scoped locations: **Project-scoped:** Write test outcome artifact for cross-session context: ```bash -SLUG=$(git remote get-url origin 2>/dev/null | sed 's|.*[:/]\([^/]*/[^/]*\)\.git$|\1|;s|.*[:/]\([^/]*/[^/]*\)$|\1|' | tr '/' '-') +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) mkdir -p ~/.gstack/projects/$SLUG ``` Write to `~/.gstack/projects/{slug}/{user}-{branch}-test-outcome-{datetime}.md` diff --git a/qa-only/SKILL.md.tmpl b/qa-only/SKILL.md.tmpl index 5d49e201..101cd71c 100644 --- a/qa-only/SKILL.md.tmpl +++ b/qa-only/SKILL.md.tmpl @@ -52,7 +52,7 @@ Before falling back to git diff heuristics, check for richer test plan sources: 1. **Project-scoped test plans:** Check `~/.gstack/projects/` for recent `*-test-plan-*.md` files for this repo ```bash - SLUG=$(git remote get-url origin 2>/dev/null | sed 's|.*[:/]\([^/]*/[^/]*\)\.git$|\1|;s|.*[:/]\([^/]*/[^/]*\)$|\1|' | tr '/' '-') + eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) ls -t ~/.gstack/projects/$SLUG/*-test-plan-*.md 2>/dev/null | head -1 ``` 2. **Conversation context:** Check if a prior `/plan-eng-review` or `/plan-ceo-review` produced test plan output in this conversation @@ -72,7 +72,7 @@ Write the report to both local and project-scoped locations: **Project-scoped:** Write test outcome artifact for cross-session context: ```bash -SLUG=$(git remote get-url origin 2>/dev/null | sed 's|.*[:/]\([^/]*/[^/]*\)\.git$|\1|;s|.*[:/]\([^/]*/[^/]*\)$|\1|' | tr '/' '-') +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) mkdir -p ~/.gstack/projects/$SLUG ``` Write to `~/.gstack/projects/{slug}/{user}-{branch}-test-outcome-{datetime}.md` diff --git a/qa/SKILL.md b/qa/SKILL.md index 6b078a9d..ba1868db 100644 --- a/qa/SKILL.md +++ b/qa/SKILL.md @@ -171,7 +171,7 @@ Before falling back to git diff heuristics, check for richer test plan sources: 1. **Project-scoped test plans:** Check `~/.gstack/projects/` for recent `*-test-plan-*.md` files for this repo ```bash - SLUG=$(git remote get-url origin 2>/dev/null | sed 's|.*[:/]\([^/]*/[^/]*\)\.git$|\1|;s|.*[:/]\([^/]*/[^/]*\)$|\1|' | tr '/' '-') + eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) ls -t ~/.gstack/projects/$SLUG/*-test-plan-*.md 2>/dev/null | head -1 ``` 2. **Conversation context:** Check if a prior `/plan-eng-review` or `/plan-ceo-review` produced test plan output in this conversation @@ -578,7 +578,7 @@ Write the report to both local and project-scoped locations: **Project-scoped:** Write test outcome artifact for cross-session context: ```bash -SLUG=$(git remote get-url origin 2>/dev/null | sed 's|.*[:/]\([^/]*/[^/]*\)\.git$|\1|;s|.*[:/]\([^/]*/[^/]*\)$|\1|' | tr '/' '-') +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) mkdir -p ~/.gstack/projects/$SLUG ``` Write to `~/.gstack/projects/{slug}/{user}-{branch}-test-outcome-{datetime}.md` diff --git a/qa/SKILL.md.tmpl b/qa/SKILL.md.tmpl index f491999e..45dfbea6 100644 --- a/qa/SKILL.md.tmpl +++ b/qa/SKILL.md.tmpl @@ -72,7 +72,7 @@ Before falling back to git diff heuristics, check for richer test plan sources: 1. **Project-scoped test plans:** Check `~/.gstack/projects/` for recent `*-test-plan-*.md` files for this repo ```bash - SLUG=$(git remote get-url origin 2>/dev/null | sed 's|.*[:/]\([^/]*/[^/]*\)\.git$|\1|;s|.*[:/]\([^/]*/[^/]*\)$|\1|' | tr '/' '-') + eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) ls -t ~/.gstack/projects/$SLUG/*-test-plan-*.md 2>/dev/null | head -1 ``` 2. **Conversation context:** Check if a prior `/plan-eng-review` or `/plan-ceo-review` produced test plan output in this conversation @@ -207,7 +207,7 @@ Write the report to both local and project-scoped locations: **Project-scoped:** Write test outcome artifact for cross-session context: ```bash -SLUG=$(git remote get-url origin 2>/dev/null | sed 's|.*[:/]\([^/]*/[^/]*\)\.git$|\1|;s|.*[:/]\([^/]*/[^/]*\)$|\1|' | tr '/' '-') +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) mkdir -p ~/.gstack/projects/$SLUG ``` Write to `~/.gstack/projects/{slug}/{user}-{branch}-test-outcome-{datetime}.md` diff --git a/scripts/gen-skill-docs.ts b/scripts/gen-skill-docs.ts index 7a0b85ab..2e838c29 100644 --- a/scripts/gen-skill-docs.ts +++ b/scripts/gen-skill-docs.ts @@ -729,7 +729,7 @@ Compare screenshots and observations across pages for: **Project-scoped:** \`\`\`bash -SLUG=$(git remote get-url origin 2>/dev/null | sed 's|.*[:/]\\([^/]*/[^/]*\\)\\.git$|\\1|;s|.*[:/]\\([^/]*/[^/]*\\)$|\\1|' | tr '/' '-') +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) mkdir -p ~/.gstack/projects/$SLUG \`\`\` Write to: \`~/.gstack/projects/{slug}/{user}-{branch}-design-audit-{datetime}.md\` @@ -812,6 +812,38 @@ Tie everything to user goals and product objectives. Always suggest specific imp 10. **Depth over breadth.** 5-10 well-documented findings with screenshots and specific suggestions > 20 vague observations.`; } +function generateReviewDashboard(): string { + return `## Review Readiness Dashboard + +After completing the review, read the review log to display the dashboard. + +\`\`\`bash +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) +cat ~/.gstack/projects/$SLUG/$BRANCH-reviews.jsonl 2>/dev/null || echo "NO_REVIEWS" +\`\`\` + +Parse the output. Find the most recent entry for each skill (plan-ceo-review, plan-eng-review, plan-design-review). Ignore entries with timestamps older than 7 days. Display: + +\`\`\` ++====================================================================+ +| REVIEW READINESS DASHBOARD | ++====================================================================+ +| Review | Runs | Last Run | Status | +|-----------------|------|---------------------|----------------------| +| CEO Review | 1 | 2026-03-16 14:30 | CLEAR | +| Eng Review | 1 | 2026-03-16 15:00 | CLEAR | +| Design Review | 0 | — | NOT YET RUN | ++--------------------------------------------------------------------+ +| VERDICT: 2/3 CLEAR — Design Review not yet run | ++====================================================================+ +\`\`\` + +**Verdict logic:** +- **CLEARED TO SHIP (3/3)**: All three have >= 1 entry within 7 days AND most recent status is "clean" +- **N/3 CLEAR**: Show count and list which are missing, have open issues, or are stale (>7 days) +- Informational only — does NOT block.`; +} + const RESOLVERS: Record string> = { COMMAND_REFERENCE: generateCommandReference, SNAPSHOT_FLAGS: generateSnapshotFlags, @@ -820,6 +852,7 @@ const RESOLVERS: Record string> = { BASE_BRANCH_DETECT: generateBaseBranchDetect, QA_METHODOLOGY: generateQAMethodology, DESIGN_METHODOLOGY: generateDesignMethodology, + REVIEW_DASHBOARD: generateReviewDashboard, }; // ─── Template Processing ──────────────────────────────────── diff --git a/test/skill-validation.test.ts b/test/skill-validation.test.ts index 83cdca6e..78a9bef7 100644 --- a/test/skill-validation.test.ts +++ b/test/skill-validation.test.ts @@ -665,3 +665,45 @@ describe('Planted-bug fixture validation', () => { expect(content).toContain('update_column'); }); }); + +// --- gstack-slug helper --- + +describe('gstack-slug', () => { + const SLUG_BIN = path.join(ROOT, 'bin', 'gstack-slug'); + + test('binary exists and is executable', () => { + expect(fs.existsSync(SLUG_BIN)).toBe(true); + const stat = fs.statSync(SLUG_BIN); + expect(stat.mode & 0o111).toBeGreaterThan(0); + }); + + test('outputs SLUG and BRANCH lines in a git repo', () => { + const result = Bun.spawnSync([SLUG_BIN], { cwd: ROOT, stdout: 'pipe', stderr: 'pipe' }); + expect(result.exitCode).toBe(0); + const output = result.stdout.toString(); + expect(output).toContain('SLUG='); + expect(output).toContain('BRANCH='); + }); + + test('SLUG does not contain forward slashes', () => { + const result = Bun.spawnSync([SLUG_BIN], { cwd: ROOT, stdout: 'pipe', stderr: 'pipe' }); + const slug = result.stdout.toString().match(/SLUG=(.*)/)?.[1] ?? ''; + expect(slug).not.toContain('/'); + expect(slug.length).toBeGreaterThan(0); + }); + + test('BRANCH does not contain forward slashes', () => { + const result = Bun.spawnSync([SLUG_BIN], { cwd: ROOT, stdout: 'pipe', stderr: 'pipe' }); + const branch = result.stdout.toString().match(/BRANCH=(.*)/)?.[1] ?? ''; + expect(branch).not.toContain('/'); + expect(branch.length).toBeGreaterThan(0); + }); + + test('output is eval-compatible (KEY=VALUE format)', () => { + const result = Bun.spawnSync([SLUG_BIN], { cwd: ROOT, stdout: 'pipe', stderr: 'pipe' }); + const lines = result.stdout.toString().trim().split('\n'); + expect(lines.length).toBe(2); + expect(lines[0]).toMatch(/^SLUG=.+/); + expect(lines[1]).toMatch(/^BRANCH=.+/); + }); +}); From df7f0d777fc910a863c3bed04e774d93cbb504fb Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Tue, 17 Mar 2026 08:28:53 -0700 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20review=20readiness=20dashboard=20?= =?UTF-8?q?=E2=80=94=20track=20CEO/Eng/Design=20reviews=20per=20branch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each review skill logs its result to JSONL. A shared {{REVIEW_DASHBOARD}} placeholder displays run counts, timestamps, and a CLEARED TO SHIP verdict. /ship pre-flight reads the dashboard and prompts when reviews are missing. --- plan-ceo-review/SKILL.md | 47 +++++++++++++++++++++++++++++++ plan-ceo-review/SKILL.md.tmpl | 19 +++++++++++++ plan-design-review/SKILL.md | 48 +++++++++++++++++++++++++++++++- plan-design-review/SKILL.md.tmpl | 18 ++++++++++++ ship/SKILL.md | 37 ++++++++++++++++++++++++ ship/SKILL.md.tmpl | 9 ++++++ test/gen-skill-docs.test.ts | 27 ++++++++++++++++++ 7 files changed, 204 insertions(+), 1 deletion(-) diff --git a/plan-ceo-review/SKILL.md b/plan-ceo-review/SKILL.md index b05db5e9..033f4e5f 100644 --- a/plan-ceo-review/SKILL.md +++ b/plan-ceo-review/SKILL.md @@ -534,6 +534,53 @@ List every ASCII diagram in files this plan touches. Still accurate? ### Unresolved Decisions If any AskUserQuestion goes unanswered, note it here. Never silently default. +## Review Log + +After producing the Completion Summary above, persist the review result: + +```bash +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) +mkdir -p ~/.gstack/projects/$SLUG +echo '{"skill":"plan-ceo-review","timestamp":"TIMESTAMP","status":"STATUS","unresolved":N,"critical_gaps":N,"mode":"MODE"}' >> ~/.gstack/projects/$SLUG/$BRANCH-reviews.jsonl +``` + +Before running this command, substitute the placeholder values from the Completion Summary you just produced: +- **TIMESTAMP**: current ISO 8601 datetime (e.g., 2026-03-16T14:30:00) +- **STATUS**: "clean" if 0 unresolved decisions AND 0 critical gaps; otherwise "issues_open" +- **unresolved**: number from "Unresolved decisions" in the summary +- **critical_gaps**: number from "Failure modes: ___ CRITICAL GAPS" in the summary +- **MODE**: the mode the user selected (SCOPE_EXPANSION / HOLD_SCOPE / SCOPE_REDUCTION) + +## Review Readiness Dashboard + +After completing the review, read the review log to display the dashboard. + +```bash +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) +cat ~/.gstack/projects/$SLUG/$BRANCH-reviews.jsonl 2>/dev/null || echo "NO_REVIEWS" +``` + +Parse the output. Find the most recent entry for each skill (plan-ceo-review, plan-eng-review, plan-design-review). Ignore entries with timestamps older than 7 days. Display: + +``` ++====================================================================+ +| REVIEW READINESS DASHBOARD | ++====================================================================+ +| Review | Runs | Last Run | Status | +|-----------------|------|---------------------|----------------------| +| CEO Review | 1 | 2026-03-16 14:30 | CLEAR | +| Eng Review | 1 | 2026-03-16 15:00 | CLEAR | +| Design Review | 0 | — | NOT YET RUN | ++--------------------------------------------------------------------+ +| VERDICT: 2/3 CLEAR — Design Review not yet run | ++====================================================================+ +``` + +**Verdict logic:** +- **CLEARED TO SHIP (3/3)**: All three have >= 1 entry within 7 days AND most recent status is "clean" +- **N/3 CLEAR**: Show count and list which are missing, have open issues, or are stale (>7 days) +- Informational only — does NOT block. + ## Formatting Rules * NUMBER issues (1, 2, 3...) and LETTERS for options (A, B, C...). * Label with NUMBER + LETTER (e.g., "3A", "3B"). diff --git a/plan-ceo-review/SKILL.md.tmpl b/plan-ceo-review/SKILL.md.tmpl index 9902fafb..8664d095 100644 --- a/plan-ceo-review/SKILL.md.tmpl +++ b/plan-ceo-review/SKILL.md.tmpl @@ -452,6 +452,25 @@ List every ASCII diagram in files this plan touches. Still accurate? ### Unresolved Decisions If any AskUserQuestion goes unanswered, note it here. Never silently default. +## Review Log + +After producing the Completion Summary above, persist the review result: + +```bash +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) +mkdir -p ~/.gstack/projects/$SLUG +echo '{"skill":"plan-ceo-review","timestamp":"TIMESTAMP","status":"STATUS","unresolved":N,"critical_gaps":N,"mode":"MODE"}' >> ~/.gstack/projects/$SLUG/$BRANCH-reviews.jsonl +``` + +Before running this command, substitute the placeholder values from the Completion Summary you just produced: +- **TIMESTAMP**: current ISO 8601 datetime (e.g., 2026-03-16T14:30:00) +- **STATUS**: "clean" if 0 unresolved decisions AND 0 critical gaps; otherwise "issues_open" +- **unresolved**: number from "Unresolved decisions" in the summary +- **critical_gaps**: number from "Failure modes: ___ CRITICAL GAPS" in the summary +- **MODE**: the mode the user selected (SCOPE_EXPANSION / HOLD_SCOPE / SCOPE_REDUCTION) + +{{REVIEW_DASHBOARD}} + ## Formatting Rules * NUMBER issues (1, 2, 3...) and LETTERS for options (A, B, C...). * Label with NUMBER + LETTER (e.g., "3A", "3B"). diff --git a/plan-design-review/SKILL.md b/plan-design-review/SKILL.md index c0ca9512..3a12207b 100644 --- a/plan-design-review/SKILL.md +++ b/plan-design-review/SKILL.md @@ -384,7 +384,7 @@ Compare screenshots and observations across pages for: **Project-scoped:** ```bash -SLUG=$(git remote get-url origin 2>/dev/null | sed 's|.*[:/]\([^/]*/[^/]*\)\.git$|\1|;s|.*[:/]\([^/]*/[^/]*\)$|\1|' | tr '/' '-') +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) mkdir -p ~/.gstack/projects/$SLUG ``` Write to: `~/.gstack/projects/{slug}/{user}-{branch}-design-audit-{datetime}.md` @@ -556,3 +556,49 @@ Project type: {web app / dashboard / marketing site / etc.} 11. **Never fix anything.** Find and document only. Do not read source code, edit files, or suggest code fixes. Your job is to report what could be better and suggest design improvements. Use `/qa-design-review` for the fix loop. 12. **The exception:** You MAY write a DESIGN.md file if the user accepts the offer. This is the only file you create. + +## Review Log + +After compiling the report, persist the review result: + +```bash +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) +mkdir -p ~/.gstack/projects/$SLUG +echo '{"skill":"plan-design-review","timestamp":"TIMESTAMP","status":"STATUS","design_score":"GRADE","ai_slop_score":"GRADE","mode":"MODE"}' >> ~/.gstack/projects/$SLUG/$BRANCH-reviews.jsonl +``` + +Substitute values from the report: +- **TIMESTAMP**: current ISO 8601 datetime +- **STATUS**: "clean" if Design Score is A or B; "issues_open" if C, D, or F +- **GRADE**: the letter grade from the report (Design Score and AI Slop Score respectively) +- **MODE**: Full / Quick / Deep / Diff-aware / Regression + +## Review Readiness Dashboard + +After completing the review, read the review log to display the dashboard. + +```bash +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) +cat ~/.gstack/projects/$SLUG/$BRANCH-reviews.jsonl 2>/dev/null || echo "NO_REVIEWS" +``` + +Parse the output. Find the most recent entry for each skill (plan-ceo-review, plan-eng-review, plan-design-review). Ignore entries with timestamps older than 7 days. Display: + +``` ++====================================================================+ +| REVIEW READINESS DASHBOARD | ++====================================================================+ +| Review | Runs | Last Run | Status | +|-----------------|------|---------------------|----------------------| +| CEO Review | 1 | 2026-03-16 14:30 | CLEAR | +| Eng Review | 1 | 2026-03-16 15:00 | CLEAR | +| Design Review | 0 | — | NOT YET RUN | ++--------------------------------------------------------------------+ +| VERDICT: 2/3 CLEAR — Design Review not yet run | ++====================================================================+ +``` + +**Verdict logic:** +- **CLEARED TO SHIP (3/3)**: All three have >= 1 entry within 7 days AND most recent status is "clean" +- **N/3 CLEAR**: Show count and list which are missing, have open issues, or are stale (>7 days) +- Informational only — does NOT block. diff --git a/plan-design-review/SKILL.md.tmpl b/plan-design-review/SKILL.md.tmpl index b381c682..97546805 100644 --- a/plan-design-review/SKILL.md.tmpl +++ b/plan-design-review/SKILL.md.tmpl @@ -145,3 +145,21 @@ Project type: {web app / dashboard / marketing site / etc.} 11. **Never fix anything.** Find and document only. Do not read source code, edit files, or suggest code fixes. Your job is to report what could be better and suggest design improvements. Use `/qa-design-review` for the fix loop. 12. **The exception:** You MAY write a DESIGN.md file if the user accepts the offer. This is the only file you create. + +## Review Log + +After compiling the report, persist the review result: + +```bash +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) +mkdir -p ~/.gstack/projects/$SLUG +echo '{"skill":"plan-design-review","timestamp":"TIMESTAMP","status":"STATUS","design_score":"GRADE","ai_slop_score":"GRADE","mode":"MODE"}' >> ~/.gstack/projects/$SLUG/$BRANCH-reviews.jsonl +``` + +Substitute values from the report: +- **TIMESTAMP**: current ISO 8601 datetime +- **STATUS**: "clean" if Design Score is A or B; "issues_open" if C, D, or F +- **GRADE**: the letter grade from the report (Design Score and AI Slop Score respectively) +- **MODE**: Full / Quick / Deep / Diff-aware / Regression + +{{REVIEW_DASHBOARD}} diff --git a/ship/SKILL.md b/ship/SKILL.md index 8aa4a181..e7b8b753 100644 --- a/ship/SKILL.md +++ b/ship/SKILL.md @@ -132,6 +132,43 @@ You are running the `/ship` workflow. This is a **non-interactive, fully automat 3. Run `git diff ...HEAD --stat` and `git log ..HEAD --oneline` to understand what's being shipped. +4. Check review readiness: + +## Review Readiness Dashboard + +After completing the review, read the review log to display the dashboard. + +```bash +eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) +cat ~/.gstack/projects/$SLUG/$BRANCH-reviews.jsonl 2>/dev/null || echo "NO_REVIEWS" +``` + +Parse the output. Find the most recent entry for each skill (plan-ceo-review, plan-eng-review, plan-design-review). Ignore entries with timestamps older than 7 days. Display: + +``` ++====================================================================+ +| REVIEW READINESS DASHBOARD | ++====================================================================+ +| Review | Runs | Last Run | Status | +|-----------------|------|---------------------|----------------------| +| CEO Review | 1 | 2026-03-16 14:30 | CLEAR | +| Eng Review | 1 | 2026-03-16 15:00 | CLEAR | +| Design Review | 0 | — | NOT YET RUN | ++--------------------------------------------------------------------+ +| VERDICT: 2/3 CLEAR — Design Review not yet run | ++====================================================================+ +``` + +**Verdict logic:** +- **CLEARED TO SHIP (3/3)**: All three have >= 1 entry within 7 days AND most recent status is "clean" +- **N/3 CLEAR**: Show count and list which are missing, have open issues, or are stale (>7 days) +- Informational only — does NOT block. + +If the verdict is NOT "CLEARED TO SHIP (3/3)", use AskUserQuestion: +- Show which reviews are missing or have open issues +- RECOMMENDATION: Choose B (run missing reviews first) unless the change is trivial +- Options: A) Ship anyway B) Abort — run missing review(s) first C) Reviews not relevant for this change + --- ## Step 2: Merge the base branch (BEFORE tests) diff --git a/ship/SKILL.md.tmpl b/ship/SKILL.md.tmpl index 9339e90c..2a24bea3 100644 --- a/ship/SKILL.md.tmpl +++ b/ship/SKILL.md.tmpl @@ -50,6 +50,15 @@ You are running the `/ship` workflow. This is a **non-interactive, fully automat 3. Run `git diff ...HEAD --stat` and `git log ..HEAD --oneline` to understand what's being shipped. +4. Check review readiness: + +{{REVIEW_DASHBOARD}} + +If the verdict is NOT "CLEARED TO SHIP (3/3)", use AskUserQuestion: +- Show which reviews are missing or have open issues +- RECOMMENDATION: Choose B (run missing reviews first) unless the change is trivial +- Options: A) Ship anyway B) Abort — run missing review(s) first C) Reviews not relevant for this change + --- ## Step 2: Merge the base branch (BEFORE tests) diff --git a/test/gen-skill-docs.test.ts b/test/gen-skill-docs.test.ts index def042c9..26de63db 100644 --- a/test/gen-skill-docs.test.ts +++ b/test/gen-skill-docs.test.ts @@ -322,3 +322,30 @@ describe('description quality evals', () => { expect(tipsSection).not.toContain('->'); }); }); + +describe('REVIEW_DASHBOARD resolver', () => { + const REVIEW_SKILLS = ['plan-ceo-review', 'plan-eng-review', 'plan-design-review']; + + for (const skill of REVIEW_SKILLS) { + test(`review dashboard appears in ${skill} generated file`, () => { + const content = fs.readFileSync(path.join(ROOT, skill, 'SKILL.md'), 'utf-8'); + expect(content).toContain('reviews.jsonl'); + expect(content).toContain('REVIEW READINESS DASHBOARD'); + }); + } + + test('review dashboard appears in ship generated file', () => { + const content = fs.readFileSync(path.join(ROOT, 'ship', 'SKILL.md'), 'utf-8'); + expect(content).toContain('reviews.jsonl'); + expect(content).toContain('REVIEW READINESS DASHBOARD'); + }); + + test('resolver output contains key dashboard elements', () => { + const content = fs.readFileSync(path.join(ROOT, 'plan-ceo-review', 'SKILL.md'), 'utf-8'); + expect(content).toContain('VERDICT'); + expect(content).toContain('CLEARED TO SHIP'); + expect(content).toContain('NOT YET RUN'); + expect(content).toContain('7 days'); + expect(content).toContain('Design Review'); + }); +}); From aaa20e4dcaee895cd21262d77e3da555421e1baf Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Tue, 17 Mar 2026 08:28:58 -0700 Subject: [PATCH 3/3] chore: bump version and changelog (v0.5.1) Co-Authored-By: Claude Opus 4.6 --- CHANGELOG.md | 12 ++++++++++++ TODOS.md | 26 ++++++++++++++++++++++++++ VERSION | 2 +- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a86569c8..53865c00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## 0.5.1 — 2026-03-17 + +- **Know where you stand before you ship.** Every `/plan-ceo-review`, `/plan-eng-review`, and `/plan-design-review` now logs its result to a review tracker. At the end of each review, you see a **Review Readiness Dashboard** showing which reviews are done, when they ran, and whether they're clean — with a clear CLEARED TO SHIP or NOT READY verdict. +- **`/ship` checks your reviews before creating the PR.** Pre-flight now reads the dashboard and asks if you want to continue when reviews are missing. Informational only — it won't block you, but you'll know what you skipped. +- **One less thing to copy-paste.** The SLUG computation (that opaque sed pipeline for computing `owner-repo` from git remote) is now a shared `bin/gstack-slug` helper. All 14 inline copies across templates replaced with `eval $(gstack-slug)`. If the format ever changes, fix it once. + +### For contributors + +- Added `{{REVIEW_DASHBOARD}}` resolver to `gen-skill-docs.ts` — shared dashboard reader injected into 4 templates (3 review skills + ship). +- Added `bin/gstack-slug` helper (5-line bash) with unit tests. Outputs `SLUG=` and `BRANCH=` lines, sanitizes `/` to `-`. +- New TODOs: smart review relevance detection (P3), `/merge` skill for review-gated PR merge (P2). + ## 0.5.0 — 2026-03-16 - **Your site just got a design review.** `/plan-design-review` opens your site and reviews it like a senior product designer — typography, spacing, hierarchy, color, responsive, interactions, and AI slop detection. Get letter grades (A-F) per category, a dual headline "Design Score" + "AI Slop Score", and a structured first impression that doesn't pull punches. diff --git a/TODOS.md b/TODOS.md index d76f71c4..f52bb693 100644 --- a/TODOS.md +++ b/TODOS.md @@ -408,6 +408,32 @@ Shipped as `/design-consultation` on garrytan/design branch. Renamed from `/setu **Priority:** P2 **Depends on:** None +## Ship Confidence Dashboard + +### Smart review relevance detection + +**What:** Auto-detect which of the 4 reviews are relevant based on branch changes (skip Design Review if no CSS/view changes, skip Code Review if plan-only). + +**Why:** Currently dashboard always shows 4 rows. On docs-only changes, "Design Review: NOT YET RUN" is noise. + +**Context:** /plan-design-review and /qa already do file-type detection in diff-aware mode. Could reuse that heuristic. Would require a `gstack-diff-scope` helper or enriching `gstack-slug` to also output change categories. + +**Effort:** M +**Priority:** P3 +**Depends on:** Ship Confidence Dashboard (shipped) + +### /merge skill — review-gated PR merge + +**What:** Create a `/merge` skill that merges an approved PR, but first checks the Review Readiness Dashboard and runs `/review` (Fix-First) if code review hasn't been done. Separates "ship" (create PR) from "merge" (land it). + +**Why:** Currently `/review` runs inside `/ship` Step 3.5 but isn't tracked as a gate. A `/merge` skill ensures code review always happens before landing, and enables workflows where someone else reviews the PR first. + +**Context:** `/ship` creates the PR. `/merge` would: check dashboard → run `/review` if needed → `gh pr merge`. This is where code review tracking belongs — at merge time, not at plan time. + +**Effort:** M +**Priority:** P2 +**Depends on:** Ship Confidence Dashboard (shipped) + ## Completed ### Phase 1: Foundations (v0.2.0) diff --git a/VERSION b/VERSION index 8f0916f7..4b9fcbec 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.0 +0.5.1