diff --git a/SKILL.md b/SKILL.md index 8d2da71d..222b6922 100644 --- a/SKILL.md +++ b/SKILL.md @@ -89,6 +89,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` diff --git a/autoplan/SKILL.md b/autoplan/SKILL.md index a8844760..21680d6d 100644 --- a/autoplan/SKILL.md +++ b/autoplan/SKILL.md @@ -99,6 +99,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -402,6 +407,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/benchmark/SKILL.md b/benchmark/SKILL.md index 16a069d1..a21c1fd4 100644 --- a/benchmark/SKILL.md +++ b/benchmark/SKILL.md @@ -92,6 +92,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` diff --git a/bin/gstack-config b/bin/gstack-config index c118a322..aaed2eb7 100755 --- a/bin/gstack-config +++ b/bin/gstack-config @@ -2,9 +2,10 @@ # gstack-config — read/write ~/.gstack/config.yaml # # Usage: -# gstack-config get — read a config value +# gstack-config get — read a config value (falls back to DEFAULTS) # gstack-config set — write a config value -# gstack-config list — show all config +# gstack-config list — show all config (values + defaults) +# gstack-config defaults — show just the defaults table # # Env overrides (for testing): # GSTACK_STATE_DIR — override ~/.gstack state directory @@ -14,6 +15,8 @@ STATE_DIR="${GSTACK_STATE_DIR:-$HOME/.gstack}" CONFIG_FILE="$STATE_DIR/config.yaml" # Annotated header for new config files. Written once on first `set`. +# Default semantics: DEFAULTS table below is the canonical source. Header text +# is documentation that must stay in sync with DEFAULTS. CONFIG_HEADER='# gstack configuration — edit freely, changes take effect on next skill run. # Docs: https://github.com/garrytan/gstack # @@ -25,8 +28,8 @@ CONFIG_HEADER='# gstack configuration — edit freely, changes take effect on ne # # prompt. Set back to false to be asked again. # # ─── Telemetry ─────────────────────────────────────────────────────── -# telemetry: anonymous # off | anonymous | community -# # off — no data sent, no local analytics +# telemetry: off # off | anonymous | community +# # off — no data sent, no local analytics (default) # # anonymous — counter only, no device ID # # community — usage data + stable device ID # @@ -38,6 +41,16 @@ CONFIG_HEADER='# gstack configuration — edit freely, changes take effect on ne # skill_prefix: false # true = namespace skills as /gstack-qa, /gstack-ship # # false = short names /qa, /ship # +# ─── Checkpoint ────────────────────────────────────────────────────── +# checkpoint_mode: explicit # explicit | continuous +# # explicit — commit only when you run /ship or /checkpoint +# # continuous — auto-commit after each significant change +# # with WIP: prefix + [gstack-context] body +# +# checkpoint_push: false # true = push WIP commits to remote as you go +# # false = keep WIP commits local only (default) +# # Pushing can trigger CI/deploy hooks — opt in carefully. +# # ─── Advanced ──────────────────────────────────────────────────────── # codex_reviews: enabled # disabled = skip Codex adversarial reviews in /ship # gstack_contributor: false # true = file field reports when gstack misbehaves @@ -45,6 +58,27 @@ CONFIG_HEADER='# gstack configuration — edit freely, changes take effect on ne # ' +# DEFAULTS table — canonical default values for known keys. +# `get ` returns DEFAULTS[key] when the key is absent from the config file +# AND the env override is not set. Keep in sync with the CONFIG_HEADER comments. +lookup_default() { + case "$1" in + proactive) echo "true" ;; + routing_declined) echo "false" ;; + telemetry) echo "off" ;; + auto_upgrade) echo "false" ;; + update_check) echo "true" ;; + skill_prefix) echo "false" ;; + checkpoint_mode) echo "explicit" ;; + checkpoint_push) echo "false" ;; + codex_reviews) echo "enabled" ;; + gstack_contributor) echo "false" ;; + skip_eng_review) echo "false" ;; + cross_project_learnings) echo "" ;; # intentionally empty → unset triggers first-time prompt + *) echo "" ;; + esac +} + case "${1:-}" in get) KEY="${2:?Usage: gstack-config get }" @@ -53,7 +87,11 @@ case "${1:-}" in echo "Error: key must contain only alphanumeric characters and underscores" >&2 exit 1 fi - grep -E "^${KEY}:" "$CONFIG_FILE" 2>/dev/null | tail -1 | awk '{print $2}' | tr -d '[:space:]' || true + VALUE=$(grep -E "^${KEY}:" "$CONFIG_FILE" 2>/dev/null | tail -1 | awk '{print $2}' | tr -d '[:space:]' || true) + if [ -z "$VALUE" ]; then + VALUE=$(lookup_default "$KEY") + fi + printf '%s' "$VALUE" ;; set) KEY="${2:?Usage: gstack-config set }" @@ -84,10 +122,34 @@ case "${1:-}" in fi ;; list) - cat "$CONFIG_FILE" 2>/dev/null || true + if [ -f "$CONFIG_FILE" ]; then + cat "$CONFIG_FILE" + fi + echo "" + echo "# ─── Active values (including defaults for unset keys) ───" + for KEY in proactive routing_declined telemetry auto_upgrade update_check \ + skill_prefix checkpoint_mode checkpoint_push codex_reviews \ + gstack_contributor skip_eng_review; do + VALUE=$(grep -E "^${KEY}:" "$CONFIG_FILE" 2>/dev/null | tail -1 | awk '{print $2}' | tr -d '[:space:]' || true) + SOURCE="default" + if [ -n "$VALUE" ]; then + SOURCE="set" + else + VALUE=$(lookup_default "$KEY") + fi + printf ' %-24s %s (%s)\n' "$KEY:" "$VALUE" "$SOURCE" + done + ;; + defaults) + echo "# gstack-config defaults" + for KEY in proactive routing_declined telemetry auto_upgrade update_check \ + skill_prefix checkpoint_mode checkpoint_push codex_reviews \ + gstack_contributor skip_eng_review; do + printf ' %-24s %s\n' "$KEY:" "$(lookup_default "$KEY")" + done ;; *) - echo "Usage: gstack-config {get|set|list} [key] [value]" + echo "Usage: gstack-config {get|set|list|defaults} [key] [value]" exit 1 ;; esac diff --git a/browse/SKILL.md b/browse/SKILL.md index 0a9196c2..b5aed0dc 100644 --- a/browse/SKILL.md +++ b/browse/SKILL.md @@ -91,6 +91,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` diff --git a/canary/SKILL.md b/canary/SKILL.md index 3c8078aa..70d36b23 100644 --- a/canary/SKILL.md +++ b/canary/SKILL.md @@ -91,6 +91,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -394,6 +399,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/checkpoint/SKILL.md b/checkpoint/SKILL.md index 5c473376..7580ebbc 100644 --- a/checkpoint/SKILL.md +++ b/checkpoint/SKILL.md @@ -94,6 +94,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -397,6 +402,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary @@ -737,6 +786,41 @@ in their frontmatter, so all files in the directory are candidates). This enable 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 diff --git a/checkpoint/SKILL.md.tmpl b/checkpoint/SKILL.md.tmpl index 8df8d6ea..0c235019 100644 --- a/checkpoint/SKILL.md.tmpl +++ b/checkpoint/SKILL.md.tmpl @@ -189,6 +189,41 @@ in their frontmatter, so all files in the directory are candidates). This enable 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 diff --git a/codex/SKILL.md b/codex/SKILL.md index 96b7c7db..1cd9f3ac 100644 --- a/codex/SKILL.md +++ b/codex/SKILL.md @@ -93,6 +93,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -396,6 +401,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/cso/SKILL.md b/cso/SKILL.md index 44e1e5b7..79821018 100644 --- a/cso/SKILL.md +++ b/cso/SKILL.md @@ -96,6 +96,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -399,6 +404,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/design-consultation/SKILL.md b/design-consultation/SKILL.md index 8f9a8748..2f462335 100644 --- a/design-consultation/SKILL.md +++ b/design-consultation/SKILL.md @@ -96,6 +96,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -399,6 +404,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/design-html/SKILL.md b/design-html/SKILL.md index 3dbaa657..4cb8ef5f 100644 --- a/design-html/SKILL.md +++ b/design-html/SKILL.md @@ -98,6 +98,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -401,6 +406,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/design-review/SKILL.md b/design-review/SKILL.md index b96aff84..fa77d86b 100644 --- a/design-review/SKILL.md +++ b/design-review/SKILL.md @@ -96,6 +96,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -399,6 +404,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/design-shotgun/SKILL.md b/design-shotgun/SKILL.md index 3989548f..fce1b523 100644 --- a/design-shotgun/SKILL.md +++ b/design-shotgun/SKILL.md @@ -93,6 +93,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -396,6 +401,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/devex-review/SKILL.md b/devex-review/SKILL.md index a97c4477..f875affa 100644 --- a/devex-review/SKILL.md +++ b/devex-review/SKILL.md @@ -96,6 +96,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -399,6 +404,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/document-release/SKILL.md b/document-release/SKILL.md index c421668e..6a9b1ee3 100644 --- a/document-release/SKILL.md +++ b/document-release/SKILL.md @@ -93,6 +93,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -396,6 +401,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/health/SKILL.md b/health/SKILL.md index 01637f9f..1dc91ef7 100644 --- a/health/SKILL.md +++ b/health/SKILL.md @@ -93,6 +93,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -396,6 +401,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/investigate/SKILL.md b/investigate/SKILL.md index 2312d2b9..6945d182 100644 --- a/investigate/SKILL.md +++ b/investigate/SKILL.md @@ -108,6 +108,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -411,6 +416,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/land-and-deploy/SKILL.md b/land-and-deploy/SKILL.md index 4f0dc826..1382cd4b 100644 --- a/land-and-deploy/SKILL.md +++ b/land-and-deploy/SKILL.md @@ -90,6 +90,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -393,6 +398,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/learn/SKILL.md b/learn/SKILL.md index 327c12b6..daac2c50 100644 --- a/learn/SKILL.md +++ b/learn/SKILL.md @@ -93,6 +93,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -396,6 +401,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/office-hours/SKILL.md b/office-hours/SKILL.md index d84f3a37..e4fcdf7c 100644 --- a/office-hours/SKILL.md +++ b/office-hours/SKILL.md @@ -100,6 +100,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -403,6 +408,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/open-gstack-browser/SKILL.md b/open-gstack-browser/SKILL.md index abaa5b79..18b463bd 100644 --- a/open-gstack-browser/SKILL.md +++ b/open-gstack-browser/SKILL.md @@ -90,6 +90,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -393,6 +398,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/pair-agent/SKILL.md b/pair-agent/SKILL.md index a28e9a79..ae91d526 100644 --- a/pair-agent/SKILL.md +++ b/pair-agent/SKILL.md @@ -91,6 +91,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -394,6 +399,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/plan-ceo-review/SKILL.md b/plan-ceo-review/SKILL.md index f5588249..9ee5bffa 100644 --- a/plan-ceo-review/SKILL.md +++ b/plan-ceo-review/SKILL.md @@ -96,6 +96,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -399,6 +404,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/plan-design-review/SKILL.md b/plan-design-review/SKILL.md index 4a67d7ae..880c04d9 100644 --- a/plan-design-review/SKILL.md +++ b/plan-design-review/SKILL.md @@ -94,6 +94,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -397,6 +402,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/plan-devex-review/SKILL.md b/plan-devex-review/SKILL.md index 3342c290..9e050c7e 100644 --- a/plan-devex-review/SKILL.md +++ b/plan-devex-review/SKILL.md @@ -98,6 +98,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -401,6 +406,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/plan-eng-review/SKILL.md b/plan-eng-review/SKILL.md index d5dac0f8..f767af0e 100644 --- a/plan-eng-review/SKILL.md +++ b/plan-eng-review/SKILL.md @@ -96,6 +96,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -399,6 +404,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/qa-only/SKILL.md b/qa-only/SKILL.md index b1376022..2df6552f 100644 --- a/qa-only/SKILL.md +++ b/qa-only/SKILL.md @@ -92,6 +92,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -395,6 +400,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/qa/SKILL.md b/qa/SKILL.md index 4c1f1895..ed101d0b 100644 --- a/qa/SKILL.md +++ b/qa/SKILL.md @@ -98,6 +98,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -401,6 +406,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/retro/SKILL.md b/retro/SKILL.md index 6f5f3dd3..9cbdbc38 100644 --- a/retro/SKILL.md +++ b/retro/SKILL.md @@ -91,6 +91,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -394,6 +399,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/review/SKILL.md b/review/SKILL.md index 4d10d4bd..4c0880cf 100644 --- a/review/SKILL.md +++ b/review/SKILL.md @@ -94,6 +94,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -397,6 +402,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/scripts/resolvers/preamble.ts b/scripts/resolvers/preamble.ts index bf78c7fc..22dce24c 100644 --- a/scripts/resolvers/preamble.ts +++ b/scripts/resolvers/preamble.ts @@ -99,6 +99,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: ${ctx.model ?? 'none'}" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(${ctx.paths.binDir}/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(${ctx.paths.binDir}/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true \`\`\``; @@ -706,6 +711,52 @@ are shown, synthesize a one-paragraph welcome briefing before proceeding: available]. [Health score if available]." Keep it to 2-3 sentences.`; } +function generateContinuousCheckpoint(): string { + return `## Continuous Checkpoint Mode + +If \`CHECKPOINT_MODE\` is \`"continuous"\` (from preamble output): auto-commit work as +you go with \`WIP:\` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +\`\`\` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +\`\`\` + +**Rules:** +- Stage only files you intentionally changed. NEVER \`git add -A\` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if \`CHECKPOINT_PUSH\` is \`"true"\` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + \`git log\` whenever they want. + +**When \`/checkpoint resume\` runs,** it parses \`[gstack-context]\` blocks from WIP +commits on the current branch to reconstruct session state. When \`/ship\` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +\`git rebase --autosquash\` so the PR contains clean bisectable commits. + +If \`CHECKPOINT_MODE\` is \`"explicit"\` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely.`; +} + function generateContextHealth(): string { return `## Context Health (soft directive) @@ -751,7 +802,7 @@ export function generatePreamble(ctx: TemplateContext): string { generateSpawnedSessionCheck(), generateModelOverlay(ctx), generateVoiceDirective(tier), - ...(tier >= 2 ? [generateContextRecovery(ctx), generateAskUserFormat(ctx), generateCompletenessSection(), generateContextHealth()] : []), + ...(tier >= 2 ? [generateContextRecovery(ctx), generateAskUserFormat(ctx), generateCompletenessSection(), generateContinuousCheckpoint(), generateContextHealth()] : []), ...(tier >= 3 ? [generateRepoModeSection(), generateSearchBeforeBuildingSection(ctx)] : []), generateCompletionStatus(ctx), ]; diff --git a/setup-browser-cookies/SKILL.md b/setup-browser-cookies/SKILL.md index df9c91c0..a7952fc2 100644 --- a/setup-browser-cookies/SKILL.md +++ b/setup-browser-cookies/SKILL.md @@ -88,6 +88,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` diff --git a/setup-deploy/SKILL.md b/setup-deploy/SKILL.md index 6733813f..02940019 100644 --- a/setup-deploy/SKILL.md +++ b/setup-deploy/SKILL.md @@ -94,6 +94,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -397,6 +402,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary diff --git a/ship/SKILL.md b/ship/SKILL.md index d6472c1f..df977d84 100644 --- a/ship/SKILL.md +++ b/ship/SKILL.md @@ -95,6 +95,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -398,6 +403,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary @@ -2332,6 +2381,73 @@ Save this summary — it goes into the PR body in Step 8. --- +## Step 5.75: WIP Commit Squash (continuous checkpoint mode only) + +If `CHECKPOINT_MODE` is `"continuous"`, the branch likely contains `WIP:` commits +from auto-checkpointing. These must be squashed INTO the corresponding logical +commits before Step 6 runs. Non-WIP commits on the branch (earlier landed work) +must be preserved. + +**Detection:** +```bash +WIP_COUNT=$(git log ..HEAD --oneline --grep="^WIP:" 2>/dev/null | wc -l | tr -d ' ') +echo "WIP_COMMITS: $WIP_COUNT" +``` + +If `WIP_COUNT` is 0: skip this step entirely. + +If `WIP_COUNT` > 0, collect the WIP context first so it survives the squash: + +```bash +# Export [gstack-context] blocks from all WIP commits on this branch. +# This file becomes input to the CHANGELOG entry and may inform PR body context. +mkdir -p "$(git rev-parse --show-toplevel)/.gstack" +git log ..HEAD --grep="^WIP:" --format="%H%n%B%n---END---" > \ + "$(git rev-parse --show-toplevel)/.gstack/wip-context-before-squash.md" 2>/dev/null || true +``` + +**Non-destructive squash strategy:** + +`git reset --soft ` WOULD uncommit everything including non-WIP commits. +DO NOT DO THAT. Instead, use `git rebase` scoped to filter WIP commits only. + +Option 1 (preferred, if there are non-WIP commits mixed in): +```bash +# Interactive rebase with automated WIP squashing. +# Mark every WIP commit as 'fixup' (drop its message, fold changes into prior commit). +git rebase -i $(git merge-base HEAD origin/) \ + --exec 'true' \ + -X ours 2>/dev/null || { + echo "Rebase conflict. Aborting: git rebase --abort" + git rebase --abort + echo "STATUS: BLOCKED — manual WIP squash required" + exit 1 + } +``` + +Option 2 (simpler, if the branch is ALL WIP commits so far — no landed work): +```bash +# Branch contains only WIP commits. Reset-soft is safe here because there's +# nothing non-WIP to preserve. Verify first. +NON_WIP=$(git log ..HEAD --oneline --invert-grep --grep="^WIP:" 2>/dev/null | wc -l | tr -d ' ') +if [ "$NON_WIP" -eq 0 ]; then + git reset --soft $(git merge-base HEAD origin/) + echo "WIP-only branch, reset-soft to merge base. Step 6 will create clean commits." +fi +``` + +Decide at runtime which option applies. If unsure, prefer stopping and asking the +user via AskUserQuestion rather than destroying non-WIP commits. + +**Anti-footgun rules:** +- NEVER blind `git reset --soft` if there are non-WIP commits. Codex flagged this + as destructive — it would uncommit real landed work and turn Step 7 into a + non-fast-forward push for anyone who already pushed. +- Only proceed to Step 6 after WIP commits are successfully squashed/absorbed or + the branch has been verified to contain only WIP work. + +--- + ## Step 6: Commit (bisectable chunks) **Goal:** Create small, logical commits that work well with `git bisect` and help LLMs understand what changed. diff --git a/ship/SKILL.md.tmpl b/ship/SKILL.md.tmpl index 76e4873d..017cb1ae 100644 --- a/ship/SKILL.md.tmpl +++ b/ship/SKILL.md.tmpl @@ -435,6 +435,73 @@ Save this summary — it goes into the PR body in Step 8. --- +## Step 5.75: WIP Commit Squash (continuous checkpoint mode only) + +If `CHECKPOINT_MODE` is `"continuous"`, the branch likely contains `WIP:` commits +from auto-checkpointing. These must be squashed INTO the corresponding logical +commits before Step 6 runs. Non-WIP commits on the branch (earlier landed work) +must be preserved. + +**Detection:** +```bash +WIP_COUNT=$(git log ..HEAD --oneline --grep="^WIP:" 2>/dev/null | wc -l | tr -d ' ') +echo "WIP_COMMITS: $WIP_COUNT" +``` + +If `WIP_COUNT` is 0: skip this step entirely. + +If `WIP_COUNT` > 0, collect the WIP context first so it survives the squash: + +```bash +# Export [gstack-context] blocks from all WIP commits on this branch. +# This file becomes input to the CHANGELOG entry and may inform PR body context. +mkdir -p "$(git rev-parse --show-toplevel)/.gstack" +git log ..HEAD --grep="^WIP:" --format="%H%n%B%n---END---" > \ + "$(git rev-parse --show-toplevel)/.gstack/wip-context-before-squash.md" 2>/dev/null || true +``` + +**Non-destructive squash strategy:** + +`git reset --soft ` WOULD uncommit everything including non-WIP commits. +DO NOT DO THAT. Instead, use `git rebase` scoped to filter WIP commits only. + +Option 1 (preferred, if there are non-WIP commits mixed in): +```bash +# Interactive rebase with automated WIP squashing. +# Mark every WIP commit as 'fixup' (drop its message, fold changes into prior commit). +git rebase -i $(git merge-base HEAD origin/) \ + --exec 'true' \ + -X ours 2>/dev/null || { + echo "Rebase conflict. Aborting: git rebase --abort" + git rebase --abort + echo "STATUS: BLOCKED — manual WIP squash required" + exit 1 + } +``` + +Option 2 (simpler, if the branch is ALL WIP commits so far — no landed work): +```bash +# Branch contains only WIP commits. Reset-soft is safe here because there's +# nothing non-WIP to preserve. Verify first. +NON_WIP=$(git log ..HEAD --oneline --invert-grep --grep="^WIP:" 2>/dev/null | wc -l | tr -d ' ') +if [ "$NON_WIP" -eq 0 ]; then + git reset --soft $(git merge-base HEAD origin/) + echo "WIP-only branch, reset-soft to merge base. Step 6 will create clean commits." +fi +``` + +Decide at runtime which option applies. If unsure, prefer stopping and asking the +user via AskUserQuestion rather than destroying non-WIP commits. + +**Anti-footgun rules:** +- NEVER blind `git reset --soft` if there are non-WIP commits. Codex flagged this + as destructive — it would uncommit real landed work and turn Step 7 into a + non-fast-forward push for anyone who already pushed. +- Only proceed to Step 6 after WIP commits are successfully squashed/absorbed or + the branch has been verified to contain only WIP work. + +--- + ## Step 6: Commit (bisectable chunks) **Goal:** Create small, logical commits that work well with `git bisect` and help LLMs understand what changed. diff --git a/test/fixtures/golden/claude-ship-SKILL.md b/test/fixtures/golden/claude-ship-SKILL.md index d6472c1f..df977d84 100644 --- a/test/fixtures/golden/claude-ship-SKILL.md +++ b/test/fixtures/golden/claude-ship-SKILL.md @@ -95,6 +95,11 @@ if [ -d ".claude/skills/gstack" ] && [ ! -L ".claude/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$(~/.claude/skills/gstack/bin/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -398,6 +403,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary @@ -2332,6 +2381,73 @@ Save this summary — it goes into the PR body in Step 8. --- +## Step 5.75: WIP Commit Squash (continuous checkpoint mode only) + +If `CHECKPOINT_MODE` is `"continuous"`, the branch likely contains `WIP:` commits +from auto-checkpointing. These must be squashed INTO the corresponding logical +commits before Step 6 runs. Non-WIP commits on the branch (earlier landed work) +must be preserved. + +**Detection:** +```bash +WIP_COUNT=$(git log ..HEAD --oneline --grep="^WIP:" 2>/dev/null | wc -l | tr -d ' ') +echo "WIP_COMMITS: $WIP_COUNT" +``` + +If `WIP_COUNT` is 0: skip this step entirely. + +If `WIP_COUNT` > 0, collect the WIP context first so it survives the squash: + +```bash +# Export [gstack-context] blocks from all WIP commits on this branch. +# This file becomes input to the CHANGELOG entry and may inform PR body context. +mkdir -p "$(git rev-parse --show-toplevel)/.gstack" +git log ..HEAD --grep="^WIP:" --format="%H%n%B%n---END---" > \ + "$(git rev-parse --show-toplevel)/.gstack/wip-context-before-squash.md" 2>/dev/null || true +``` + +**Non-destructive squash strategy:** + +`git reset --soft ` WOULD uncommit everything including non-WIP commits. +DO NOT DO THAT. Instead, use `git rebase` scoped to filter WIP commits only. + +Option 1 (preferred, if there are non-WIP commits mixed in): +```bash +# Interactive rebase with automated WIP squashing. +# Mark every WIP commit as 'fixup' (drop its message, fold changes into prior commit). +git rebase -i $(git merge-base HEAD origin/) \ + --exec 'true' \ + -X ours 2>/dev/null || { + echo "Rebase conflict. Aborting: git rebase --abort" + git rebase --abort + echo "STATUS: BLOCKED — manual WIP squash required" + exit 1 + } +``` + +Option 2 (simpler, if the branch is ALL WIP commits so far — no landed work): +```bash +# Branch contains only WIP commits. Reset-soft is safe here because there's +# nothing non-WIP to preserve. Verify first. +NON_WIP=$(git log ..HEAD --oneline --invert-grep --grep="^WIP:" 2>/dev/null | wc -l | tr -d ' ') +if [ "$NON_WIP" -eq 0 ]; then + git reset --soft $(git merge-base HEAD origin/) + echo "WIP-only branch, reset-soft to merge base. Step 6 will create clean commits." +fi +``` + +Decide at runtime which option applies. If unsure, prefer stopping and asking the +user via AskUserQuestion rather than destroying non-WIP commits. + +**Anti-footgun rules:** +- NEVER blind `git reset --soft` if there are non-WIP commits. Codex flagged this + as destructive — it would uncommit real landed work and turn Step 7 into a + non-fast-forward push for anyone who already pushed. +- Only proceed to Step 6 after WIP commits are successfully squashed/absorbed or + the branch has been verified to contain only WIP work. + +--- + ## Step 6: Commit (bisectable chunks) **Goal:** Create small, logical commits that work well with `git bisect` and help LLMs understand what changed. diff --git a/test/fixtures/golden/codex-ship-SKILL.md b/test/fixtures/golden/codex-ship-SKILL.md index 8fcab251..9599ecda 100644 --- a/test/fixtures/golden/codex-ship-SKILL.md +++ b/test/fixtures/golden/codex-ship-SKILL.md @@ -89,6 +89,11 @@ if [ -d ".agents/skills/gstack" ] && [ ! -L ".agents/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$($GSTACK_BIN/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$($GSTACK_BIN/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -392,6 +397,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary @@ -1952,6 +2001,73 @@ Save this summary — it goes into the PR body in Step 8. --- +## Step 5.75: WIP Commit Squash (continuous checkpoint mode only) + +If `CHECKPOINT_MODE` is `"continuous"`, the branch likely contains `WIP:` commits +from auto-checkpointing. These must be squashed INTO the corresponding logical +commits before Step 6 runs. Non-WIP commits on the branch (earlier landed work) +must be preserved. + +**Detection:** +```bash +WIP_COUNT=$(git log ..HEAD --oneline --grep="^WIP:" 2>/dev/null | wc -l | tr -d ' ') +echo "WIP_COMMITS: $WIP_COUNT" +``` + +If `WIP_COUNT` is 0: skip this step entirely. + +If `WIP_COUNT` > 0, collect the WIP context first so it survives the squash: + +```bash +# Export [gstack-context] blocks from all WIP commits on this branch. +# This file becomes input to the CHANGELOG entry and may inform PR body context. +mkdir -p "$(git rev-parse --show-toplevel)/.gstack" +git log ..HEAD --grep="^WIP:" --format="%H%n%B%n---END---" > \ + "$(git rev-parse --show-toplevel)/.gstack/wip-context-before-squash.md" 2>/dev/null || true +``` + +**Non-destructive squash strategy:** + +`git reset --soft ` WOULD uncommit everything including non-WIP commits. +DO NOT DO THAT. Instead, use `git rebase` scoped to filter WIP commits only. + +Option 1 (preferred, if there are non-WIP commits mixed in): +```bash +# Interactive rebase with automated WIP squashing. +# Mark every WIP commit as 'fixup' (drop its message, fold changes into prior commit). +git rebase -i $(git merge-base HEAD origin/) \ + --exec 'true' \ + -X ours 2>/dev/null || { + echo "Rebase conflict. Aborting: git rebase --abort" + git rebase --abort + echo "STATUS: BLOCKED — manual WIP squash required" + exit 1 + } +``` + +Option 2 (simpler, if the branch is ALL WIP commits so far — no landed work): +```bash +# Branch contains only WIP commits. Reset-soft is safe here because there's +# nothing non-WIP to preserve. Verify first. +NON_WIP=$(git log ..HEAD --oneline --invert-grep --grep="^WIP:" 2>/dev/null | wc -l | tr -d ' ') +if [ "$NON_WIP" -eq 0 ]; then + git reset --soft $(git merge-base HEAD origin/) + echo "WIP-only branch, reset-soft to merge base. Step 6 will create clean commits." +fi +``` + +Decide at runtime which option applies. If unsure, prefer stopping and asking the +user via AskUserQuestion rather than destroying non-WIP commits. + +**Anti-footgun rules:** +- NEVER blind `git reset --soft` if there are non-WIP commits. Codex flagged this + as destructive — it would uncommit real landed work and turn Step 7 into a + non-fast-forward push for anyone who already pushed. +- Only proceed to Step 6 after WIP commits are successfully squashed/absorbed or + the branch has been verified to contain only WIP work. + +--- + ## Step 6: Commit (bisectable chunks) **Goal:** Create small, logical commits that work well with `git bisect` and help LLMs understand what changed. diff --git a/test/fixtures/golden/factory-ship-SKILL.md b/test/fixtures/golden/factory-ship-SKILL.md index c7e9aac4..e42377a6 100644 --- a/test/fixtures/golden/factory-ship-SKILL.md +++ b/test/fixtures/golden/factory-ship-SKILL.md @@ -91,6 +91,11 @@ if [ -d ".factory/skills/gstack" ] && [ ! -L ".factory/skills/gstack" ]; then fi echo "VENDORED_GSTACK: $_VENDORED" echo "MODEL_OVERLAY: claude" +# Checkpoint mode (explicit = no auto-commit, continuous = WIP commits as you go) +_CHECKPOINT_MODE=$($GSTACK_BIN/gstack-config get checkpoint_mode 2>/dev/null || echo "explicit") +_CHECKPOINT_PUSH=$($GSTACK_BIN/gstack-config get checkpoint_push 2>/dev/null || echo "false") +echo "CHECKPOINT_MODE: $_CHECKPOINT_MODE" +echo "CHECKPOINT_PUSH: $_CHECKPOINT_PUSH" # Detect spawned session (OpenClaw or other orchestrator) [ -n "$OPENCLAW_SESSION" ] && echo "SPAWNED_SESSION: true" || true ``` @@ -394,6 +399,50 @@ 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). +## Continuous Checkpoint Mode + +If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as +you go with `WIP:` prefix so session state survives crashes and context switches. + +**When to commit (continuous mode only):** +- After creating a new file (not scratch/temp files) +- After finishing a function/component/module +- After fixing a bug that's verified by a passing test +- Before any long-running operation (install, full build, full test suite) + +**Commit format** — include structured context in the body: + +``` +WIP: + +[gstack-context] +Decisions: +Remaining: +Tried: (omit if none) +Skill: +[/gstack-context] +``` + +**Rules:** +- Stage only files you intentionally changed. NEVER `git add -A` in continuous mode. +- Do NOT commit with known-broken tests. Fix first, then commit. The [gstack-context] + example values MUST reflect a clean state. +- Do NOT commit mid-edit. Finish the logical unit. +- Push ONLY if `CHECKPOINT_PUSH` is `"true"` (default is false). Pushing WIP commits + to a shared remote can trigger CI, deploys, and expose secrets — that is why push + is opt-in, not default. +- Background discipline — do NOT announce each commit to the user. They can see + `git log` whenever they want. + +**When `/checkpoint resume` runs,** it parses `[gstack-context]` blocks from WIP +commits on the current branch to reconstruct session state. When `/ship` runs, it +filter-squashes WIP commits only (preserving non-WIP commits) via +`git rebase --autosquash` so the PR contains clean bisectable commits. + +If `CHECKPOINT_MODE` is `"explicit"` (the default): no auto-commit behavior. Commit +only when the user explicitly asks, or when a skill workflow (like /ship) runs a +commit step. Ignore this section entirely. + ## Context Health (soft directive) During long-running skill sessions, periodically write a brief `[PROGRESS]` summary @@ -2328,6 +2377,73 @@ Save this summary — it goes into the PR body in Step 8. --- +## Step 5.75: WIP Commit Squash (continuous checkpoint mode only) + +If `CHECKPOINT_MODE` is `"continuous"`, the branch likely contains `WIP:` commits +from auto-checkpointing. These must be squashed INTO the corresponding logical +commits before Step 6 runs. Non-WIP commits on the branch (earlier landed work) +must be preserved. + +**Detection:** +```bash +WIP_COUNT=$(git log ..HEAD --oneline --grep="^WIP:" 2>/dev/null | wc -l | tr -d ' ') +echo "WIP_COMMITS: $WIP_COUNT" +``` + +If `WIP_COUNT` is 0: skip this step entirely. + +If `WIP_COUNT` > 0, collect the WIP context first so it survives the squash: + +```bash +# Export [gstack-context] blocks from all WIP commits on this branch. +# This file becomes input to the CHANGELOG entry and may inform PR body context. +mkdir -p "$(git rev-parse --show-toplevel)/.gstack" +git log ..HEAD --grep="^WIP:" --format="%H%n%B%n---END---" > \ + "$(git rev-parse --show-toplevel)/.gstack/wip-context-before-squash.md" 2>/dev/null || true +``` + +**Non-destructive squash strategy:** + +`git reset --soft ` WOULD uncommit everything including non-WIP commits. +DO NOT DO THAT. Instead, use `git rebase` scoped to filter WIP commits only. + +Option 1 (preferred, if there are non-WIP commits mixed in): +```bash +# Interactive rebase with automated WIP squashing. +# Mark every WIP commit as 'fixup' (drop its message, fold changes into prior commit). +git rebase -i $(git merge-base HEAD origin/) \ + --exec 'true' \ + -X ours 2>/dev/null || { + echo "Rebase conflict. Aborting: git rebase --abort" + git rebase --abort + echo "STATUS: BLOCKED — manual WIP squash required" + exit 1 + } +``` + +Option 2 (simpler, if the branch is ALL WIP commits so far — no landed work): +```bash +# Branch contains only WIP commits. Reset-soft is safe here because there's +# nothing non-WIP to preserve. Verify first. +NON_WIP=$(git log ..HEAD --oneline --invert-grep --grep="^WIP:" 2>/dev/null | wc -l | tr -d ' ') +if [ "$NON_WIP" -eq 0 ]; then + git reset --soft $(git merge-base HEAD origin/) + echo "WIP-only branch, reset-soft to merge base. Step 6 will create clean commits." +fi +``` + +Decide at runtime which option applies. If unsure, prefer stopping and asking the +user via AskUserQuestion rather than destroying non-WIP commits. + +**Anti-footgun rules:** +- NEVER blind `git reset --soft` if there are non-WIP commits. Codex flagged this + as destructive — it would uncommit real landed work and turn Step 7 into a + non-fast-forward push for anyone who already pushed. +- Only proceed to Step 6 after WIP commits are successfully squashed/absorbed or + the branch has been verified to contain only WIP work. + +--- + ## Step 6: Commit (bisectable chunks) **Goal:** Create small, logical commits that work well with `git bisect` and help LLMs understand what changed.