/** The ref protocol section of an AGENTS.md: what an agent must do to work on `repo`, a repository on `origin`. */ export function agentsSection(input: { readonly origin: string; readonly repo: string; readonly branch: string }): string { return `## ref protocol This repository lives on refs at ${input.origin}/${input.repo}. Agents work on it over the ref protocol. The full rules are in ${input.origin}/llms.txt. - At the start of every session, call \`refs_connect\` with \`${input.repo}\`. With the refs CLI, the session connects by itself. If you don't have the refs tools, read ${input.origin}/llms.txt and set them up. - Leave this clone's git configuration alone. refs gives git push access when you take a branch. - Work on one branch at a time, never \`${input.branch}\`. Take a pull request or a branch with \`refs_take\`, or push a new branch to claim it. Push with \`git push origin HEAD:\`. - When you make a choice that the owner of the work would want to make themselves, record it in a \`decision\` block at the end of the commit message. Most commits have none. The test and the format are in ${input.origin}/llms.txt. - Never force-push. If a push is rejected, run \`git pull --rebase\` and push again. - Act on each "[refs] Updates" message when it arrives. Without the refs hooks, call \`refs_events\` before every push. - When the work is pushed, open its pull request with \`refs_open_pull\`. To see its merge state, the review threads that are not resolved, and the logs of failed CI jobs, call \`refs_view_pull\`. - Answer mentions and report on your work with \`refs_reply\`. After you push a fix for a review thread, give that commit in \`addressed_in\`. Only a person resolves a thread or merges. - With the refs CLI in your shell, \`refs pr checks\`, \`refs run view --log-failed\` and \`refs task list\` give the same data. Add \`--json\` to parse it. - Call \`refs_release\` when the work is done. Call \`refs_end\` only to go offline. `; }