Babel internal issue protocol — close a handoff after downstream agent picked it up or user signed off. Moves designs/<name>/.handoff/<label>.md to .handoff/closed/ (using mv per CLAUDE.md), appends to handoff_log.jsonl.
name: bb-close-issue
description: "Babel internal issue protocol — close a handoff after downstream agent picked it up or user signed off. Moves designs//.handoff/
bb-close-issue
Inputs
--label <label> — handoff label to close
--design-name <name> — required
--reason <text> (optional) — close reason
--close-gh (flag) — also close paired gh issue
Output Contract
field
值
closed_path
designs/<name>/.handoff/closed/<label>_<stamp>.md
log_path
designs/<name>/.handoff/handoff_log.jsonl
gh_closed
bool
valid
bool
4-Phase 执行
Phase 1 — validate
src="designs/<name>/.handoff/<label>.md"
[ -f "$src" ] || exit 2 # nothing to close
if [ "<close-gh>" = "true" ] && command -v gh >/dev/null 2>&1; then
gh issue list --label "<label>" --state open --json number \
| python3 -c "import sys,json; [print(i['number']) for i in json.load(sys.stdin)]" \
| xargs -I{} gh issue close {} --comment "Closed by bb-close-issue: <reason>"
fi