diff --git a/ship/SKILL.md.tmpl b/ship/SKILL.md.tmpl index 5a7c34661..85738671e 100644 --- a/ship/SKILL.md.tmpl +++ b/ship/SKILL.md.tmpl @@ -916,6 +916,56 @@ Print the branch name, remote URL, and instruct the user to create the PR/MR man --- +## Step 19.5: Write SHIP-RECEIPT.md (for recipe-runtime detection) + +Write a one-page ship receipt into the phase folder Step 8 audited. Recipe runners +(e.g. Dev OS workflow recipes) watch for this file and use it to detect successful +ship completion. Non-GSD projects skip this step silently. + +1. Identify the target phase folder. From Step 8's audit output, take the highest-numbered + phase under `.planning/phases/`. If Step 8 audited multiple phases (cross-phase branch), + pick the one with the largest leading number. If Step 8 found zero plan files, or + `.planning/phases/` does not exist in cwd, log `[ship] no .planning/phases/ found, + skipping SHIP-RECEIPT.md write` and proceed to Step 20. + +2. Gather the field values: + + ```bash + BRANCH=$(git branch --show-current) + SHA=$(git rev-parse --short HEAD) + PR_URL=$(gh pr view --json url -q .url 2>/dev/null || glab mr view -F json 2>/dev/null | jq -r .web_url || echo "") + TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ) + VERSION_VAL=$(cat VERSION 2>/dev/null | tr -d '\r\n[:space:]') + ``` + +3. Write the receipt to `{cwd}/.planning/phases//SHIP-RECEIPT.md`, + overwriting any prior receipt: + + ```bash + cat > ".planning/phases/$PHASE_DIR/SHIP-RECEIPT.md" <