--- name: write-handoff description: Use when asked for a handoff prompt, a brief for another agent or contributor to carry out an issue, or instructions that "even the least capable agent" must be able to follow without mistakes. --- # Write a handoff prompt ## What this skill is for A **handoff** is a document that lets someone with no memory of your conversation — the **builder** — carry out an issue exactly as decided. It is written for the least capable reader: - every fact is checked against the code; - every decision is final and written down; - every step has an action and a check; - every point of doubt says "stop and ask" instead of "use your judgement". If you cannot reach that standard yet, you write a **blocked draft** instead, clearly marked so nobody builds from it. ## How to follow this file 1. Do the steps in order, from Step 1 to Step 10. Do not skip a step. Do not change the order. 2. Each step has three parts: - **Do** — what to do. Commands are shown in code blocks. Replace every `` with the real value and remove the brackets. - **Check** — what must be true before you go on. - **If not** — what to do when the check fails. 3. When this file says **STOP**, stop working, send the message it gives, and wait for the answer. 4. Never invent a fact. Every file path, function name, command, number and decision in the handoff must come from the issue, the owner, or the code you read during this task. 5. When you cannot check something — no access to the code, a command fails, the owner has not answered — do not guess. Put a marker in the handoff (see "Markers" below) and go on. Any marker makes the handoff a blocked draft. 6. The project's own rules win. If a file you read in Step 1 says something different from this file, do what the project says, and tell the owner: `The project's rule "" replaced this skill's rule "".` 7. You write the handoff. You do **not** build the issue, commit, push or open pull requests. ## Words used in this file | Word | Meaning | |---|---| | **owner** | The person who decides what is built and merges pull requests. Step 1 shows how to find them. | | **builder** | The agent or person who will follow the handoff. Assume they know nothing about this project and will do exactly what the words say. | | **issue** | The GitHub issue the handoff is for. `` means its number. | | **default branch** | The branch pull requests go into, usually `main`. Step 1 finds it. | | **ground truth** | Facts read from the code itself: file paths, function names, defaults, commands, test patterns. Never from memory. | | **verbatim part** | Anything the builder must paste or type exactly: code, SQL, config, a header row, a file name, a message users read, a pull request description. | | **personal instruction files** | A person's own AI instruction or memory files that are not part of the project (for example a private `CLAUDE.md` in their home folder). They must never be committed. | | **pull request check** | A script or CI job that checks pull request descriptions, if the project has one. Step 1 finds it. | | **scratch folder** | A folder outside the repository for temporary files. Use the one your tool gives you (a scratchpad or temp folder). If it gives none: `/tmp/going-dark` on macOS and Linux, `%TEMP%\going-dark` on Windows. | | **today** | Today's date as `YYYY-MM-DD`. | ### Markers | Marker | Put it where | Example | |---|---|---| | `[VERIFY: ]` | A fact you could not read in the code | `[VERIFY: the admin-only middleware's name — search "admin" in backend/src/middleware]` | | `[OPEN Q]` | A decision the owner has not answered. `` is the question's number in your message to the owner | `Rows over the limit: [OPEN Q1]` | | `[UNPROVEN]` | A verbatim part you could not compile, run or check | `[UNPROVEN] SELECT ...` | ## Step 1 — Read the project and the issue **Do:** 1. Get the latest state, and note the default branch and its commit: ``` git fetch origin gh repo view --json defaultBranchRef --jq .defaultBranchRef.name git rev-parse origin/ ``` The last command prints a 40-character hash. Write it down: it is the **base commit**. 2. Read the project's rule files, every one that exists: ``` git ls-files AGENTS.md CLAUDE.md GEMINI.md CONTRIBUTING.md .github/copilot-instructions.md .github/pull_request_template.md "docs/guides/*" ``` Note: the owner (look for "owner", "maintainer", "only … merges"; also `.github/CODEOWNERS`), the commands to check work (typecheck, lint, test), how migrations run, branch naming, the pull request template, and the rules about secrets and local processes. 3. Find the pull request check, if any. Look in `package.json` under `"scripts"` for a name containing `pr` or `check`, and in `.github/workflows/` for a workflow that reads the pull request body. Write down the command, or "none". 4. Read the issue and its comments: ``` gh issue view --comments ``` 5. Find the plan, decision records and handoffs that mention it: ``` git grep -l "#" origin/ -- docs ``` Read each with `git show origin/:`. 6. Check whether the project keeps handoffs: ``` git ls-files "docs/handoffs/*" ``` 7. Find the branch naming style from recent pull requests: ``` gh pr list --state merged --limit 5 --json headRefName ``` If the names follow a pattern, use it. If not, use `/-`, where type is `feat`, `fix`, `docs` or `chore` — for example `feat/23-member-csv-export`. **Check:** you have the base commit, the owner, the check commands, the issue, and whether `docs/handoffs/` exists. **If not:** anything you could not read becomes a `[VERIFY: …]` marker where it is used. ## Step 2 — Check the issue is ready **Do:** answer each question about the issue: 1. Does it have a Summary, a "What to build" list, a Verify section and a "Not in this ticket" section? 2. Is every box under "Decide first" (or a similar heading) ticked, or is there no such section? 3. Is every decision record it names *Accepted* (not *Proposed*)? 4. If the issue or a comment already says it will take more than one pull request, does a plan exist, with status *Ready*? (If nobody has said how many pull requests yet, answer "yes" here: Step 4 asks the owner.) **Check:** all four answers are "yes". **If not:** **STOP.** Send the owner: ``` # is not ready for a handoff yet: - Shall I write a blocked draft now, or wait until these are done? ``` If they say "draft", or they do not answer, or they are not available, go on and mark each gap with `[OPEN Q]` or `[VERIFY: …]`. If they say "wait", stop here. ## Step 3 — Find what is still open An issue called "fully decided" almost always leaves things open. Go through every row of this table and write down each question the issue does **not** answer. | Area | Ask yourself | |---|---| | **Each limit** | For every limit in the issue (a size, a count, a time): what exactly happens **at** the limit, and **one over** it? Refuse, cut off, or split? What message do users see? | | **Empty** | What happens when there is nothing: zero rows, no file, no results? | | **Formats** | Dates (format and time zone), numbers, text encoding, line endings, file names, column headers, sort order. | | **Who can** | Who may do it? What does someone who may not get: a hidden button, a 403, a 404? | | **Injection** | Can user text reach a file, a page, a query or a formula? (Example: a CSV cell starting with `=` runs as a formula in Excel.) | | **Abuse** | Can it be called too often, or by someone not signed in? Is there a rate limit? | | **Personal data** | What personal data is stored, logged or sent? For how long? Who can see it? | | **Record keeping** | Should doing it leave a record (who, when, what)? | | **Errors** | For each way it can fail, the exact text users see. | | **Old clients** | Does an older app, page or integration still call what changes? | | **Size of the work** | How many pull requests? What goes in each? (Rule of thumb: data and server first, then UI.) | Then sort each open question: - **Owner question** — the answer changes what users get, what it costs, the risk, security, privacy, or copy (text users read). These go to the owner. - **Technical call** — the answer only changes how it is built (names, libraries, internal formats, tests). Decide it yourself, and write it in the handoff's Decisions section marked *(technical call)*. If you are not sure which, it is an owner question. **The number of pull requests is always an owner question.** **Check:** you went through all eleven rows, and every open point is in one of the two lists. ## Step 4 — Ask the owner **Do:** 1. Number the owner questions Q1, Q2, Q3 … in one sequence. Keep these numbers: the `[OPEN Q]` markers use them. 2. If your tool has a built-in way to ask questions with clickable options (in Claude Code, the AskUserQuestion tool), use it. Otherwise send: ``` Before I write the handoff for #, I need decisions. Q1. A.