--- name: delivery-handoff description: > Use when a delivery Stage lead starts or finishes its stage. Owns the stage's entry gate and exit Handoff comment. Not a plain issue comment -> `gitea-issues`. Not writing the repo's delivery doc -> `delivery-repo-doc`. compatibility: Requires a Gitea forge reached through the Gitea MCP server (via the gitea-issues and gitea-prs skills), and a consuming repo carrying docs/agents/delivery.md. allowed-tools: Read mcp__gitea__issue_read mcp__gitea__issue_write mcp__gitea__pull_request_read metadata: category: delivery version: "0.2.2" --- ## Gotchas - `Status/Ready for Human` is a stop signal, not a Gate, so you may set it. Every real gate — `Status/Ready for Agent`, a gated dry run's label, a PR approval — is human-only: never set, add or remove a gate label, and never approve a PR. - Check gate *state*, not who set it: in step mode the human launching your stage is the approval. Do not read the issue timeline. - `Status/Ready for Agent` and `Status/Ready for Human` must not share an exclusive label scope: Gitea would then drop the gate label when you add Ready for Human. Never re-add it yourself. ## Step 1 — Read the repo's delivery doc Before any other work, read `docs/agents/delivery.md` at the consuming repo's root. Its format is owned by `delivery-repo-doc`'s `references/format.md`; you need only the Human allowlist: section `## Human allowlist`, one `` - `` `` item per line, never empty. File missing, first line not `# Delivery`, or the allowlist section missing, empty or `- none` → go to **Stop** with the reason, e.g. "`docs/agents/delivery.md` missing". ## Step 2 — Read the inbound Handoff comment Read the issue or PR you were pointed at via `gitea-issues` (or `gitea-prs` for the PR's own fields). Find the latest Handoff comment and apply `references/gates.md` §Inbound Handoff comment; if it says stop → **Stop**. ## Step 3 — Check the gate Run every check in your stage's row of `references/gates.md`. Any check fails → **Stop**, quoting the failed check as the reason. ## Step 4 — Do the stage's work Run your stage's own flow. A blocker mid-stage — a skill named in `docs/agents/delivery.md` that is not installed, a question only the human can answer — → **Stop**. ## Step 5 — Exit Read `references/handoff-comment.md` now and write exactly one Handoff comment from its template, with the Next command filled for your stage, and post it where its Rules say. Then run any step your agent puts after the Handoff comment (the `WIP:` title edit), and end the session. ## Stop Used by every step. Do both, then end the session without further work: 1. Add the `Status/Ready for Human` label to the issue or PR you were pointed at, via `gitea-issues`. 2. Post one comment where `references/handoff-comment.md` §Rules says a stop posts: - **Before the inbound check passed** (Step 1 or Step 2) → a plain comment stating the reason, not a Handoff comment, so the inbound rule is never bypassed. A relaunch comes from the latest real Handoff comment, or from scratch where your row's inbound is Optional for the item you were pointed at. - **After it passed** (Steps 3–4) → a Handoff comment from `references/handoff-comment.md`, filled per its stop row. Open questions states the reason; for a missing skill use the format's wording, "missing skill ``".