Merge branch 'main' into garrytan/gbrain-support

Resolves:
- VERSION: keep 1.7.0.0 (my branch's bump is higher than main's 1.6.3.0)
- package.json: keep 1.7.0.0 (same logic)
- CHANGELOG.md: keep 1.7.0.0 entry on top, preserve main's 1.6.2.0 +
  1.6.3.0 entries chronologically between 1.7.0.0 and the shared 1.6.1.0
  tail
- context-save/SKILL.md.tmpl: accept main's deletion of the "Resume flow"
  section (logic moved to the separate /context-restore skill)
- Regenerated all SKILL.md files via bun run gen:skill-docs so they match
  both branches' template state post-merge
This commit is contained in:
Garry Tan
2026-04-23 07:30:58 -07:00
45 changed files with 981 additions and 373 deletions

View File

@@ -198,106 +198,6 @@ Restore later with /context-restore.
---
<<<<<<< HEAD:checkpoint/SKILL.md.tmpl
## Resume flow
### Step 1: Find checkpoints
```bash
{{SLUG_SETUP}}
CHECKPOINT_DIR="$HOME/.gstack/projects/$SLUG/checkpoints"
if [ -d "$CHECKPOINT_DIR" ]; then
find "$CHECKPOINT_DIR" -maxdepth 1 -name "*.md" -type f 2>/dev/null | xargs ls -1t 2>/dev/null | head -20
else
echo "NO_CHECKPOINTS"
fi
```
List checkpoints from **all branches** (checkpoint files contain the branch name
in their frontmatter, so all files in the directory are candidates). This enables
Conductor workspace handoff — a checkpoint saved on one branch can be resumed from
another.
### Step 1.5: Check for WIP commit context (continuous checkpoint mode)
If `CHECKPOINT_MODE` was `"continuous"` during prior work, the branch may have
`WIP:` commits with structured `[gstack-context]` blocks in their bodies. These
are a second recovery trail alongside the markdown checkpoint files.
```bash
_BRANCH=$(git branch --show-current 2>/dev/null)
# Detect if this branch has any WIP commits against the nearest remote ancestor
_BASE=$(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD origin/master 2>/dev/null)
if [ -n "$_BASE" ]; then
WIP_COMMITS=$(git log "$_BASE"..HEAD --grep="^WIP:" --format="%H" 2>/dev/null | head -20)
if [ -n "$WIP_COMMITS" ]; then
echo "WIP_COMMITS_FOUND"
# Extract [gstack-context] blocks from each WIP commit body
for SHA in $WIP_COMMITS; do
echo "--- commit $SHA ---"
git log -1 "$SHA" --format="%s%n%n%b" 2>/dev/null | \
awk '/\[gstack-context\]/,/\[\/gstack-context\]/ { print }'
done
else
echo "NO_WIP_COMMITS"
fi
fi
```
If `WIP_COMMITS_FOUND`: Read the extracted `[gstack-context]` blocks. Each block
represents a logical unit of prior work with Decisions/Remaining/Tried/Skill.
Merge these with the markdown checkpoint file to reconstruct session state. The
git history shows the chronological arc; the markdown checkpoint shows the
intentional save points. Both matter.
**Important:** Do NOT delete WIP commits during resume. They remain the recovery
trail until /ship squashes them into clean commits during PR creation.
### Step 2: Load checkpoint
If the user specified a checkpoint (by number, title fragment, or date), find the
matching file. Otherwise, load the **most recent** checkpoint.
Read the checkpoint file and present a summary:
```
RESUMING CHECKPOINT
════════════════════════════════════════
Title: {title}
Branch: {branch from checkpoint}
Saved: {timestamp, human-readable}
Duration: Last session was {formatted duration} (if available)
Status: {status}
════════════════════════════════════════
### Summary
{summary from checkpoint}
### Remaining Work
{remaining work items from checkpoint}
### Notes
{notes from checkpoint}
```
If the current branch differs from the checkpoint's branch, note this:
"This checkpoint was saved on branch `{branch}`. You are currently on
`{current branch}`. You may want to switch branches before continuing."
### Step 3: Offer next steps
After presenting the checkpoint, ask via AskUserQuestion:
- A) Continue working on the remaining items
- B) Show the full checkpoint file
- C) Just needed the context, thanks
If A, summarize the first remaining work item and suggest starting there.
---
=======
>>>>>>> origin/main:context-save/SKILL.md.tmpl
## List flow
### Step 1: Gather saved contexts