$curl -o .claude/agents/GIT_COLLABORATION.md https://raw.githubusercontent.com/Heretyc/subagent-mcp/HEAD/agents/GIT_COLLABORATION.mdUse this checklist for repository work. The normative policy is docs/spec/dev-loop/git-collaboration.md; AGENTS.md holds root invariants.
| 1 | # Agent Git Collaboration Checklist |
| 2 | |
| 3 | Use this checklist for repository work. The normative policy is |
| 4 | `docs/spec/dev-loop/git-collaboration.md`; `AGENTS.md` holds root invariants. |
| 5 | |
| 6 | ## Before Work |
| 7 | |
| 8 | 1. Run `git status --short --branch`. |
| 9 | 2. Identify unowned dirty files. Do not overwrite, stage, commit, reset, clean, |
| 10 | rebase, move, or hide them without explicit owner authorization. |
| 11 | 3. Follow `docs/spec/safety-scope.md` for interactive cascades, automated |
| 12 | declarations, credential handling, and sub-agent prompts. |
| 13 | 4. Read the task scope and name the owned files or directories. |
| 14 | 5. Use a topic branch for non-trivial work unless the owner explicitly directed |
| 15 | a different workflow that still respects protected/default-branch rules. |
| 16 | |
| 17 | ## Branches |
| 18 | |
| 19 | - Branch names must pass `git check-ref-format --branch`. |
| 20 | - Use `<type>/<short-topic>` or `<type>/<actor>/<short-topic>`. |
| 21 | - Allowed types: `feature`, `fix`, `hotfix`, `release`, `docs`, `test`, |
| 22 | `refactor`, `chore`, `agent`, `user`, `integration`, `audit`. |
| 23 | - Use lowercase ASCII, digits, hyphen, underscore, period, and single slash |
| 24 | separators only. |
| 25 | - Do not reuse merged, closed, abandoned, or stale branches. |
| 26 | - Do not force-push or rewrite shared history without explicit coordination. |
| 27 | |
| 28 | ## Worktrees |
| 29 | |
| 30 | - Use at most one writable worktree per branch. |
| 31 | - Put linked worktrees under a sibling worktree root, never inside another |
| 32 | repository or worktree. |
| 33 | - Before branch/worktree cleanup or force-updates, inspect |
| 34 | `git worktree list --porcelain -z`. |
| 35 | - Use `git worktree remove` for cleanup and do not remove unclean worktrees |
| 36 | unless work is committed, preserved, or confirmed disposable. |
| 37 | |
| 38 | ## Commits |
| 39 | |
| 40 | - Inspect the exact staged diff before committing. |
| 41 | - Commit the smallest coherent logical unit. |
| 42 | - Do not commit unrelated changes, conflict markers, secrets, debug output, |
| 43 | generated noise, caches, large artifacts, or unverified work. |
| 44 | - Add tests or validation for behavior changes, or record why not. |
| 45 | - Do not add AI attribution or co-author lines. |
| 46 | - Do not use `--no-verify` or empty commits unless policy explicitly requires it. |
| 47 | |
| 48 | ## Pull Requests |
| 49 | |
| 50 | - Use draft PRs for early visibility or CI signal. |
| 51 | - Mark ready only after self-review, validation, completed description, and |
| 52 | blocker disclosure. |
| 53 | - PR descriptions must include summary, scope, validation, risk, rollback, and |
| 54 | reviewer notes. |
| 55 | - Do not merge draft, failing, conflicted, stale, superseded, unsafe, or |
| 56 | under-reviewed PRs. |
| 57 | |
| 58 | ## GitHub Actions |
| 59 | |
| 60 | - Claude Code Routines are the canonical CI/CD path. |
| 61 | - The required workflow bridge lives in `.github/workflows/claude-routine.yml`. |
| 62 | - Required jobs use least-privilege permissions and routine API secrets only. |
| 63 | - The workflow dispatch check proves routine dispatch, not routine completion. |
| 64 | - Human review must inspect the Claude session URL or PR report before merge. |
| 65 | - Do not use `pull_request_target` to execute untrusted PR code. |
| 66 | - Treat all event fields as untrusted input. |
| 67 | - Workflow and CI-invoked script changes require owner/CODEOWNER review. |
| 68 | |
| 69 | ## Handoff |
| 70 | |
| 71 | Report branch, worktree path, HEAD SHA, changed files, validation run, unowned |
| 72 | dirty files observed, and any blocked policy question. |