mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-05 05:05:08 +02:00
feat: CEO review saves handoff context for /office-hours chaining
When /plan-ceo-review suggests running /office-hours, it now saves a handoff note with system audit findings and discussion context. On re-invocation, the note is auto-discovered and used to avoid redundant questions. Addresses Codex review feedback: no step tracking or resume logic — just context as additional input (same pattern as design docs).
This commit is contained in:
@@ -324,6 +324,21 @@ DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head
|
||||
```
|
||||
If a design doc exists (from `/office-hours`), read it. Use it as the source of truth for the problem statement, constraints, and chosen approach. If it has a `Supersedes:` field, note that this is a revised design.
|
||||
|
||||
**Handoff note check** (reuses $SLUG and $BRANCH from the design doc check above):
|
||||
```bash
|
||||
HANDOFF=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-ceo-handoff-*.md 2>/dev/null | head -1)
|
||||
[ -n "$HANDOFF" ] && echo "HANDOFF_FOUND: $HANDOFF" || echo "NO_HANDOFF"
|
||||
```
|
||||
If this block runs in a separate shell from the design doc check, recompute $SLUG and $BRANCH first using the same commands from that block.
|
||||
If a handoff note is found: read it. This contains system audit findings and discussion
|
||||
from a prior CEO review session that paused so the user could run `/office-hours`. Use it
|
||||
as additional context alongside the design doc. The handoff note helps you avoid re-asking
|
||||
questions the user already answered. Do NOT skip any steps — run the full review, but use
|
||||
the handoff note to inform your analysis and avoid redundant questions.
|
||||
|
||||
Tell the user: "Found a handoff note from your prior CEO review session. I'll use that
|
||||
context to pick up where we left off."
|
||||
|
||||
## Prerequisite Skill Offer
|
||||
|
||||
When the design doc check above prints "No design doc found," offer the prerequisite
|
||||
@@ -343,6 +358,39 @@ Options:
|
||||
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
|
||||
|
||||
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`:
|
||||
@@ -355,6 +403,15 @@ sure," or is clearly exploring rather than reviewing — offer `/office-hours`:
|
||||
Options: A) Yes, run /office-hours first. 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.
|
||||
|
||||
Tell the user: "Context saved with your discussion so far. Run /office-hours, then
|
||||
come back to /plan-ceo-review."
|
||||
|
||||
When reading TODOS.md, specifically:
|
||||
* Note any TODOs this plan touches, blocks, or unlocks
|
||||
* Check if deferred work from prior reviews relates to this plan
|
||||
@@ -942,6 +999,16 @@ List every ASCII diagram in files this plan touches. Still accurate?
|
||||
### Unresolved Decisions
|
||||
If any AskUserQuestion goes unanswered, note it here. Never silently default.
|
||||
|
||||
## Handoff Note Cleanup
|
||||
|
||||
After producing the Completion Summary, clean up any handoff notes for this branch —
|
||||
the review is complete and the context is no longer needed.
|
||||
|
||||
```bash
|
||||
source <(~/.codex/skills/gstack/bin/gstack-slug 2>/dev/null)
|
||||
rm -f ~/.gstack/projects/$SLUG/*-$BRANCH-ceo-handoff-*.md 2>/dev/null || true
|
||||
```
|
||||
|
||||
## Review Log
|
||||
|
||||
After producing the Completion Summary above, persist the review result.
|
||||
|
||||
@@ -332,6 +332,21 @@ DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head
|
||||
```
|
||||
If a design doc exists (from `/office-hours`), read it. Use it as the source of truth for the problem statement, constraints, and chosen approach. If it has a `Supersedes:` field, note that this is a revised design.
|
||||
|
||||
**Handoff note check** (reuses $SLUG and $BRANCH from the design doc check above):
|
||||
```bash
|
||||
HANDOFF=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-ceo-handoff-*.md 2>/dev/null | head -1)
|
||||
[ -n "$HANDOFF" ] && echo "HANDOFF_FOUND: $HANDOFF" || echo "NO_HANDOFF"
|
||||
```
|
||||
If this block runs in a separate shell from the design doc check, recompute $SLUG and $BRANCH first using the same commands from that block.
|
||||
If a handoff note is found: read it. This contains system audit findings and discussion
|
||||
from a prior CEO review session that paused so the user could run `/office-hours`. Use it
|
||||
as additional context alongside the design doc. The handoff note helps you avoid re-asking
|
||||
questions the user already answered. Do NOT skip any steps — run the full review, but use
|
||||
the handoff note to inform your analysis and avoid redundant questions.
|
||||
|
||||
Tell the user: "Found a handoff note from your prior CEO review session. I'll use that
|
||||
context to pick up where we left off."
|
||||
|
||||
## Prerequisite Skill Offer
|
||||
|
||||
When the design doc check above prints "No design doc found," offer the prerequisite
|
||||
@@ -351,6 +366,39 @@ Options:
|
||||
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
|
||||
|
||||
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`:
|
||||
@@ -363,6 +411,15 @@ sure," or is clearly exploring rather than reviewing — offer `/office-hours`:
|
||||
Options: A) Yes, run /office-hours first. 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.
|
||||
|
||||
Tell the user: "Context saved with your discussion so far. Run /office-hours, then
|
||||
come back to /plan-ceo-review."
|
||||
|
||||
When reading TODOS.md, specifically:
|
||||
* Note any TODOs this plan touches, blocks, or unlocks
|
||||
* Check if deferred work from prior reviews relates to this plan
|
||||
@@ -950,6 +1007,16 @@ List every ASCII diagram in files this plan touches. Still accurate?
|
||||
### Unresolved Decisions
|
||||
If any AskUserQuestion goes unanswered, note it here. Never silently default.
|
||||
|
||||
## Handoff Note Cleanup
|
||||
|
||||
After producing the Completion Summary, clean up any handoff notes for this branch —
|
||||
the review is complete and the context is no longer needed.
|
||||
|
||||
```bash
|
||||
source <(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null)
|
||||
rm -f ~/.gstack/projects/$SLUG/*-$BRANCH-ceo-handoff-*.md 2>/dev/null || true
|
||||
```
|
||||
|
||||
## Review Log
|
||||
|
||||
After producing the Completion Summary above, persist the review result.
|
||||
|
||||
@@ -111,8 +111,56 @@ DESIGN=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head
|
||||
```
|
||||
If a design doc exists (from `/office-hours`), read it. Use it as the source of truth for the problem statement, constraints, and chosen approach. If it has a `Supersedes:` field, note that this is a revised design.
|
||||
|
||||
**Handoff note check** (reuses $SLUG and $BRANCH from the design doc check above):
|
||||
```bash
|
||||
HANDOFF=$(ls -t ~/.gstack/projects/$SLUG/*-$BRANCH-ceo-handoff-*.md 2>/dev/null | head -1)
|
||||
[ -n "$HANDOFF" ] && echo "HANDOFF_FOUND: $HANDOFF" || echo "NO_HANDOFF"
|
||||
```
|
||||
If this block runs in a separate shell from the design doc check, recompute $SLUG and $BRANCH first using the same commands from that block.
|
||||
If a handoff note is found: read it. This contains system audit findings and discussion
|
||||
from a prior CEO review session that paused so the user could run `/office-hours`. Use it
|
||||
as additional context alongside the design doc. The handoff note helps you avoid re-asking
|
||||
questions the user already answered. Do NOT skip any steps — run the full review, but use
|
||||
the handoff note to inform your analysis and avoid redundant questions.
|
||||
|
||||
Tell the user: "Found a handoff note from your prior CEO review session. I'll use that
|
||||
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`:
|
||||
@@ -125,6 +173,15 @@ sure," or is clearly exploring rather than reviewing — offer `/office-hours`:
|
||||
Options: A) Yes, run /office-hours first. 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.
|
||||
|
||||
Tell the user: "Context saved with your discussion so far. Run /office-hours, then
|
||||
come back to /plan-ceo-review."
|
||||
|
||||
When reading TODOS.md, specifically:
|
||||
* Note any TODOs this plan touches, blocks, or unlocks
|
||||
* Check if deferred work from prior reviews relates to this plan
|
||||
@@ -652,6 +709,16 @@ List every ASCII diagram in files this plan touches. Still accurate?
|
||||
### Unresolved Decisions
|
||||
If any AskUserQuestion goes unanswered, note it here. Never silently default.
|
||||
|
||||
## Handoff Note Cleanup
|
||||
|
||||
After producing the Completion Summary, clean up any handoff notes for this branch —
|
||||
the review is complete and the context is no longer needed.
|
||||
|
||||
```bash
|
||||
source <(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null)
|
||||
rm -f ~/.gstack/projects/$SLUG/*-$BRANCH-ceo-handoff-*.md 2>/dev/null || true
|
||||
```
|
||||
|
||||
## Review Log
|
||||
|
||||
After producing the Completion Summary above, persist the review result.
|
||||
|
||||
Reference in New Issue
Block a user