From 9eb74debd50b9fdc83b7b9f2061339cb54ed2210 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sun, 22 Mar 2026 21:04:53 -0700 Subject: [PATCH] =?UTF-8?q?feat:=20inline=20/office-hours=20=E2=80=94=20no?= =?UTF-8?q?=20more=20"another=20window"=20(v0.11.3.1)=20(#352)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: inline /office-hours invocation — no more "another window" BENEFITS_FROM now uses read-and-follow pattern (same as /autoplan) to run /office-hours inline. Removes handoff note save infrastructure from plan-ceo-review template. Keeps handoff note check for backward compat. * chore: bump version and changelog (v0.11.3.1) Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Claude Opus 4.6 --- CHANGELOG.md | 7 ++++ VERSION | 2 +- autoplan/SKILL.md | 34 +++++++++++++++- plan-ceo-review/SKILL.md | 75 +++++++++++++++++------------------ plan-ceo-review/SKILL.md.tmpl | 55 +++++-------------------- plan-eng-review/SKILL.md | 34 +++++++++++++++- scripts/gen-skill-docs.ts | 36 ++++++++++++++++- test/gen-skill-docs.test.ts | 10 +++++ 8 files changed, 166 insertions(+), 87 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e541f40b17fdb460e25964be90fcb82b30c2626..4782dd6a01f48e6a3506b27f5ae95af0573512fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.11.5.1] - 2026-03-23 — Inline Office Hours + +### Changed + +- **No more "open another window" for /office-hours.** When `/plan-ceo-review` or `/plan-eng-review` offer to run `/office-hours` first, it now runs inline in the same conversation. The review picks up right where it left off after the design doc is ready. Same for mid-session detection when you're still figuring out what to build. +- **Handoff note infrastructure removed.** The handoff notes that bridged the old "go to another window" flow are no longer written. Existing notes from prior sessions are still read for backward compatibility. + ## [0.11.5.0] - 2026-03-23 — Bash Compatibility Fix ### Fixed diff --git a/VERSION b/VERSION index feca3c1f4be0c31f6c65a8356eeca58a590c4655..af928090b40ebc155e96304520ccfd919d7837fc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.11.5.0 +0.11.5.1 diff --git a/autoplan/SKILL.md b/autoplan/SKILL.md index 10ba35220265f53c699342555cb2b736db7d5eb8..7dcb9d17f2419f43207ea37223a5c399cb74a7b1 100644 --- a/autoplan/SKILL.md +++ b/autoplan/SKILL.md @@ -331,12 +331,44 @@ Say to the user via AskUserQuestion: > not per-product — it captures the thinking behind this specific change." Options: -- A) Run /office-hours first (in another window, then come back) +- A) Run /office-hours now (we'll pick up the review right after) - B) Skip — proceed with standard review If they skip: "No worries — standard review. If you ever want sharper input, try /office-hours first next time." Then proceed normally. Do not re-offer later in the session. +If they choose A: + +Say: "Running /office-hours inline. Once the design doc is ready, I'll pick up +the review right where we left off." + +Read the office-hours skill file from disk using the Read tool: +`~/.claude/skills/gstack/office-hours/SKILL.md` + +Follow it inline, **skipping these sections** (already handled by the parent skill): +- Preamble (run first) +- AskUserQuestion Format +- Completeness Principle — Boil the Lake +- Search Before Building +- Contributor Mode +- Completion Status Protocol +- Telemetry (run last) + +If the Read fails (file not found), say: +"Could not load /office-hours — proceeding with standard review." + +After /office-hours completes, re-run the design doc check: +```bash +SLUG=$(~/.claude/skills/gstack/browse/bin/remote-slug 2>/dev/null || basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)") +BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr '/' '-' || echo 'no-branch') +DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head -1) +[ -z "$DESIGN" ] && DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-design-*.md 2>/dev/null | head -1) +[ -n "$DESIGN" ] && echo "Design doc found: $DESIGN" || echo "No design doc found" +``` + +If a design doc is now found, read it and continue the review. +If none was produced (user may have cancelled), proceed with standard review. + # /autoplan — Auto-Review Pipeline One command. Rough plan in, fully reviewed plan out. diff --git a/plan-ceo-review/SKILL.md b/plan-ceo-review/SKILL.md index a9f4f67100ba25673530ba620b296e0bc72116ce..a0a64d837f8ca535893e1d3ce8ce719280a032db 100644 --- a/plan-ceo-review/SKILL.md +++ b/plan-ceo-review/SKILL.md @@ -432,65 +432,64 @@ Say to the user via AskUserQuestion: > not per-product — it captures the thinking behind this specific change." Options: -- A) Run /office-hours first (in another window, then come back) +- A) Run /office-hours now (we'll pick up the review right after) - B) Skip — proceed with standard review If they skip: "No worries — standard review. If you ever want sharper input, try /office-hours first next time." Then proceed normally. Do not re-offer later in the session. -**Handoff note save (BENEFITS_FROM):** If the user chose A (run /office-hours first), -save a handoff context note before they leave. Reuse $SLUG and $BRANCH from the -design doc check block above (they use the same `remote-slug || basename` fallback -that handles repos without an origin remote). Then run: -```bash -mkdir -p ~/.gstack/projects/$SLUG -USER=$(whoami) -DATETIME=$(date +%Y%m%d-%H%M%S) -``` -Write to `~/.gstack/projects/$SLUG/$USER-$BRANCH-ceo-handoff-$DATETIME.md`: -```markdown -# CEO Review Handoff Note +If they choose A: -Generated by /plan-ceo-review on {date} -Branch: {branch} -Repo: {owner/repo} +Say: "Running /office-hours inline. Once the design doc is ready, I'll pick up +the review right where we left off." + +Read the office-hours skill file from disk using the Read tool: +`~/.claude/skills/gstack/office-hours/SKILL.md` -## Why I paused -User chose to run /office-hours first (no design doc found). +Follow it inline, **skipping these sections** (already handled by the parent skill): +- Preamble (run first) +- AskUserQuestion Format +- Completeness Principle — Boil the Lake +- Search Before Building +- Contributor Mode +- Completion Status Protocol +- Telemetry (run last) -## System Audit Summary -{Summarize what the system audit found — recent git history, diff scope, -CLAUDE.md key points, TODOS.md relevant items, known pain points} +If the Read fails (file not found), say: +"Could not load /office-hours — proceeding with standard review." -## Discussion So Far -{Empty — handoff happened before Step 0. Frontend/UI scope detection has not -run yet — it will be assessed when the review resumes.} +After /office-hours completes, re-run the design doc check: +```bash +SLUG=$(~/.claude/skills/gstack/browse/bin/remote-slug 2>/dev/null || basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)") +BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr '/' '-' || echo 'no-branch') +DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head -1) +[ -z "$DESIGN" ] && DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-design-*.md 2>/dev/null | head -1) +[ -n "$DESIGN" ] && echo "Design doc found: $DESIGN" || echo "No design doc found" ``` -Tell the user: "Context saved. Run /office-hours in another window. When you come back -and invoke /plan-ceo-review, I'll pick up the context automatically — including the -design doc /office-hours produces." +If a design doc is now found, read it and continue the review. +If none was produced (user may have cancelled), proceed with standard review. **Mid-session detection:** During Step 0A (Premise Challenge), if the user can't articulate the problem, keeps changing the problem statement, answers with "I'm not sure," or is clearly exploring rather than reviewing — offer `/office-hours`: > "It sounds like you're still figuring out what to build — that's totally fine, but -> that's what /office-hours is designed for. Want to pause this review and run -> /office-hours first? It'll help you nail down the problem and approach, then come -> back here for the strategic review." +> that's what /office-hours is designed for. Want to run /office-hours right now? +> We'll pick up right where we left off." -Options: A) Yes, run /office-hours first. B) No, keep going. +Options: A) Yes, run /office-hours now. B) No, keep going. If they keep going, proceed normally — no guilt, no re-asking. -**Handoff note save (mid-session):** If the user chose A (run /office-hours first from -mid-session detection), save a handoff context note with the same format above, but -include any Step 0A progress in the "Discussion So Far" section — premises discussed, -problem framing attempts, user answers so far. Use the same bash block to generate the -file path. +If they choose A: Read the office-hours skill file from disk: +`~/.claude/skills/gstack/office-hours/SKILL.md` + +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. -Tell the user: "Context saved with your discussion so far. Run /office-hours, then -come back to /plan-ceo-review." +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. When reading TODOS.md, specifically: * Note any TODOs this plan touches, blocks, or unlocks diff --git a/plan-ceo-review/SKILL.md.tmpl b/plan-ceo-review/SKILL.md.tmpl index a94c9ffe1ccc57474213e65eadaf5517f4a25140..1c49b0197080c2cc4bf51141a7c2e88381010506 100644 --- a/plan-ceo-review/SKILL.md.tmpl +++ b/plan-ceo-review/SKILL.md.tmpl @@ -129,59 +129,26 @@ context to pick up where we left off." {{BENEFITS_FROM}} -**Handoff note save (BENEFITS_FROM):** If the user chose A (run /office-hours first), -save a handoff context note before they leave. Reuse $SLUG and $BRANCH from the -design doc check block above (they use the same `remote-slug || basename` fallback -that handles repos without an origin remote). Then run: -```bash -mkdir -p ~/.gstack/projects/$SLUG -USER=$(whoami) -DATETIME=$(date +%Y%m%d-%H%M%S) -``` -Write to `~/.gstack/projects/$SLUG/$USER-$BRANCH-ceo-handoff-$DATETIME.md`: -```markdown -# CEO Review Handoff Note - -Generated by /plan-ceo-review on {date} -Branch: {branch} -Repo: {owner/repo} - -## Why I paused -User chose to run /office-hours first (no design doc found). - -## System Audit Summary -{Summarize what the system audit found — recent git history, diff scope, -CLAUDE.md key points, TODOS.md relevant items, known pain points} - -## Discussion So Far -{Empty — handoff happened before Step 0. Frontend/UI scope detection has not -run yet — it will be assessed when the review resumes.} -``` - -Tell the user: "Context saved. Run /office-hours in another window. When you come back -and invoke /plan-ceo-review, I'll pick up the context automatically — including the -design doc /office-hours produces." - **Mid-session detection:** During Step 0A (Premise Challenge), if the user can't articulate the problem, keeps changing the problem statement, answers with "I'm not sure," or is clearly exploring rather than reviewing — offer `/office-hours`: > "It sounds like you're still figuring out what to build — that's totally fine, but -> that's what /office-hours is designed for. Want to pause this review and run -> /office-hours first? It'll help you nail down the problem and approach, then come -> back here for the strategic review." +> that's what /office-hours is designed for. Want to run /office-hours right now? +> We'll pick up right where we left off." -Options: A) Yes, run /office-hours first. B) No, keep going. +Options: A) Yes, run /office-hours now. B) No, keep going. If they keep going, proceed normally — no guilt, no re-asking. -**Handoff note save (mid-session):** If the user chose A (run /office-hours first from -mid-session detection), save a handoff context note with the same format above, but -include any Step 0A progress in the "Discussion So Far" section — premises discussed, -problem framing attempts, user answers so far. Use the same bash block to generate the -file path. +If they choose A: Read the office-hours skill file from disk: +`~/.claude/skills/gstack/office-hours/SKILL.md` + +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. -Tell the user: "Context saved with your discussion so far. Run /office-hours, then -come back to /plan-ceo-review." +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. When reading TODOS.md, specifically: * Note any TODOs this plan touches, blocks, or unlocks diff --git a/plan-eng-review/SKILL.md b/plan-eng-review/SKILL.md index 678d42a3bc4e89bb258bf88ab804a690bb706f61..a9bb39b4a26ab32bab25c23148fac64b54dcd293 100644 --- a/plan-eng-review/SKILL.md +++ b/plan-eng-review/SKILL.md @@ -363,12 +363,44 @@ Say to the user via AskUserQuestion: > not per-product — it captures the thinking behind this specific change." Options: -- A) Run /office-hours first (in another window, then come back) +- A) Run /office-hours now (we'll pick up the review right after) - B) Skip — proceed with standard review If they skip: "No worries — standard review. If you ever want sharper input, try /office-hours first next time." Then proceed normally. Do not re-offer later in the session. +If they choose A: + +Say: "Running /office-hours inline. Once the design doc is ready, I'll pick up +the review right where we left off." + +Read the office-hours skill file from disk using the Read tool: +`~/.claude/skills/gstack/office-hours/SKILL.md` + +Follow it inline, **skipping these sections** (already handled by the parent skill): +- Preamble (run first) +- AskUserQuestion Format +- Completeness Principle — Boil the Lake +- Search Before Building +- Contributor Mode +- Completion Status Protocol +- Telemetry (run last) + +If the Read fails (file not found), say: +"Could not load /office-hours — proceeding with standard review." + +After /office-hours completes, re-run the design doc check: +```bash +SLUG=$(~/.claude/skills/gstack/browse/bin/remote-slug 2>/dev/null || basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)") +BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr '/' '-' || echo 'no-branch') +DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head -1) +[ -z "$DESIGN" ] && DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-design-*.md 2>/dev/null | head -1) +[ -n "$DESIGN" ] && echo "Design doc found: $DESIGN" || echo "No design doc found" +``` + +If a design doc is now found, read it and continue the review. +If none was produced (user may have cancelled), proceed with standard review. + ### Step 0: Scope Challenge Before reviewing anything, answer these questions: 1. **What existing code already partially or fully solves each sub-problem?** Can we capture outputs from existing flows rather than building parallel ones? diff --git a/scripts/gen-skill-docs.ts b/scripts/gen-skill-docs.ts index c728dfae8cf7316120d4d9b5ca03bc25cd9f6ee8..33906183dec2e4643813c2615c9bf4debe6e62f7 100644 --- a/scripts/gen-skill-docs.ts +++ b/scripts/gen-skill-docs.ts @@ -2021,11 +2021,43 @@ Say to the user via AskUserQuestion: > not per-product — it captures the thinking behind this specific change." Options: -- A) Run /${first} first (in another window, then come back) +- A) Run /${first} now (we'll pick up the review right after) - B) Skip — proceed with standard review If they skip: "No worries — standard review. If you ever want sharper input, try -/${first} first next time." Then proceed normally. Do not re-offer later in the session.`; +/${first} first next time." Then proceed normally. Do not re-offer later in the session. + +If they choose A: + +Say: "Running /${first} inline. Once the design doc is ready, I'll pick up +the review right where we left off." + +Read the ${first} skill file from disk using the Read tool: +\`~/.claude/skills/gstack/${first}/SKILL.md\` + +Follow it inline, **skipping these sections** (already handled by the parent skill): +- Preamble (run first) +- AskUserQuestion Format +- Completeness Principle — Boil the Lake +- Search Before Building +- Contributor Mode +- Completion Status Protocol +- Telemetry (run last) + +If the Read fails (file not found), say: +"Could not load /${first} — proceeding with standard review." + +After /${first} completes, re-run the design doc check: +\`\`\`bash +SLUG=$(~/.claude/skills/gstack/browse/bin/remote-slug 2>/dev/null || basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)") +BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr '/' '-' || echo 'no-branch') +DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head -1) +[ -z "$DESIGN" ] && DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-design-*.md 2>/dev/null | head -1) +[ -n "$DESIGN" ] && echo "Design doc found: $DESIGN" || echo "No design doc found" +\`\`\` + +If a design doc is now found, read it and continue the review. +If none was produced (user may have cancelled), proceed with standard review.`; } function generateDesignSketch(_ctx: TemplateContext): string { diff --git a/test/gen-skill-docs.test.ts b/test/gen-skill-docs.test.ts index b5a402159b40ccd487f9eacf09269bf269aa755c..2882edc4b65a30d3c0cae6ce4111d731b647dbf6 100644 --- a/test/gen-skill-docs.test.ts +++ b/test/gen-skill-docs.test.ts @@ -773,6 +773,16 @@ describe('BENEFITS_FROM resolver', () => { const qaContent = fs.readFileSync(path.join(ROOT, 'qa', 'SKILL.md'), 'utf-8'); expect(qaContent).not.toContain('Prerequisite Skill Offer'); }); + + test('inline invocation — no "another window" language', () => { + expect(ceoContent).not.toContain('another window'); + expect(engContent).not.toContain('another window'); + }); + + test('inline invocation — read-and-follow path present', () => { + expect(ceoContent).toContain('office-hours/SKILL.md'); + expect(engContent).toContain('office-hours/SKILL.md'); + }); }); // --- {{DESIGN_OUTSIDE_VOICES}} resolver tests ---