Skip to content
Workflow

PR hygiene for agents

Commit and PR rules for coding agents: small PRs, a four-part body, screenshots with gh --attach and a leak check for session links and secrets before pushing.

Verified install Not agent-tested v1.0.0 MIT updated gitgithub
Equips
  • 1 1 Rules
  • 1 1 Skills
  • – 0 MCP

Agent-written pull requests fail review for boring reasons: too big, no test evidence, no screenshots, and sometimes a private session link or local path in a public commit. This loadout sets commit and PR rules an agent can follow, a pre-push leak check, and a gh-based procedure that uses the --attach flag added in GitHub CLI 2.99 for screenshots. It respects each repository's own AI-disclosure policy rather than hiding attribution.

What's in it

  • Commit and PR size rules, with a What / Why / How tested / Notes body
  • Screenshots attached with gh pr create --attach and alt text (gh 2.99+)
  • Pre-push leak check for session URLs, local paths and secret-looking lines
  • Claude Code attribution.sessionUrl setting for cloud and Remote Control sessions
  • Draft first, ready when checks are green

You'll need

  • Tools: git, gh
Level 1 · automated

Verification

Verified install

Checked at commit 316f4bc · 8 passed, 0 failed, 2 not applicable

CheckResultWhat we found
Listinglisting.yaml matches the schema and declares every file in the folder. Pass
Schema valid; 6 files declared, none missing or extra
  • tested.status: untested (agent tests are separate from Level 1)
Files parseJSON parses; SKILL.md and .mdc front matter is valid YAML with the fields each agent needs; code fences are closed. Pass All 6 files parse; front matter valid
AdaptersCLAUDE.md imports @AGENTS.md, GEMINI.md imports @./AGENTS.md, and both match the generator. Pass
CLAUDE.md and GEMINI.md import AGENTS.md and are up to date
  • CLAUDE.md: matches the generator
  • GEMINI.md: matches the generator
Install pathsEvery file lands where each agent documents it, with no collisions, and the laid-out project is re-discovered correctly. Pass
Correct paths for all 6 agents; layouts re-discovered
  • Claude Code: 5 files, 1 skill in .claude/skills/
  • Codex CLI: 4 files, 1 skill in .agents/skills/
  • Cursor: 4 files, 1 skill in .agents/skills/
  • Gemini CLI: 5 files, 1 skill in .agents/skills/
  • Antigravity CLI: 4 files, 1 skill in .agents/skills/
  • GitHub Copilot: 4 files, 1 skill in .agents/skills/
MCP configmcp.json is structurally valid, converts to each agent's format, declares no literal secrets, and referenced packages exist on npm/PyPI. Not applicable No MCP servers in this loadout
Safety scanThe intake scanner finds no credentials, risky shell, hidden Unicode or prompt-injection wording, and the listing's network flag is honest. Pass
Clean: no credentials, risky shell or hidden text
  • Scanner intake-precheck/1: verdict clean; network no (listing says no)
ReferencesLinks and file paths between the loadout's files resolve, including for each agent's installed layout. Pass 3 references between files resolve for every agent
Size limitsFile count and sizes are within the submission limits; SKILL.md bodies stay under 500 lines. Pass
6 files, 4.1 KB total; largest AGENTS.md 1.5 KB
  • Limits: 30 files, 32 KB per file, 128 KB total, 500 lines per skill or rule
LicenceA recognised SPDX licence, with the licence text available. Pass MIT, by Agent Loadout; text in the repository LICENSE
Starter buildA minimal fixture project with the loadout applied installs and builds or type-checks, and the loadout's own code examples compile. Not applicable
Not applicable: commit and pull request rules with no project or code to build
  • The loadout is working rules, a PR body template and a settings snippet; the procedure needs a GitHub repository and a signed-in gh.
  • The settings snippet is still parsed as JSON.
  • Every other Level 1 check still runs on this loadout.

What this means: a script checked the files themselves: they parse, they install where each agent looks, any MCP config is sound, the safety scan is clean, references between files resolve, and, where a free and repeatable fixture exists, a small starter project builds with the loadout applied. No AI agent was run. Per-agent results ("tested with agent") are separate and stay untested until an agent actually runs.

Install

Choose your agent. Run the commands from your project root, or download a zip already laid out in the right folders.

Claude Code reads CLAUDE.md (imports AGENTS.md with @AGENTS.md) and skills from .claude/skills/.

Download zip
curl -fsSL --create-dirs -o AGENTS.md https://loadout.jnw-it.com/raw/pr-hygiene-for-agents/1.0.0/AGENTS.md
curl -fsSL --create-dirs -o CLAUDE.md https://loadout.jnw-it.com/raw/pr-hygiene-for-agents/1.0.0/CLAUDE.md
curl -fsSL --create-dirs -o .claude/skills/open-pull-request/SKILL.md https://loadout.jnw-it.com/raw/pr-hygiene-for-agents/1.0.0/skills/open-pull-request/SKILL.md
curl -fsSL --create-dirs -o .claude/skills/open-pull-request/references/pr-body.md https://loadout.jnw-it.com/raw/pr-hygiene-for-agents/1.0.0/skills/open-pull-request/references/pr-body.md
curl -fsSL --create-dirs -o .claude/skills/open-pull-request/references/attribution.json https://loadout.jnw-it.com/raw/pr-hygiene-for-agents/1.0.0/skills/open-pull-request/references/attribution.json
FileGoes to
AGENTS.mdAGENTS.md
CLAUDE.mdCLAUDE.md
skills/open-pull-request/SKILL.md.claude/skills/open-pull-request/SKILL.md
skills/open-pull-request/references/pr-body.md.claude/skills/open-pull-request/references/pr-body.md
skills/open-pull-request/references/attribution.json.claude/skills/open-pull-request/references/attribution.json

Already have an AGENTS.md or CLAUDE.md? The commands above overwrite it — download the file instead and merge the sections you want.

Files

Rules AGENTS.md Commit, pull request and leak rules for agents. 23 lines
Download Raw
# AGENTS.md: commits and pull requests made by agents

Review is the bottleneck. Make every commit and pull request cheap to review and safe to publish.

## Commits
- One logical change per commit. Message: imperative subject under 72 characters, blank line, why (not what).
- Never commit generated build output, lockfile churn you did not intend, `.env*` files, logs or editor folders.
- Never push to the default branch. Never force-push a branch someone else may have pulled.

## Pull requests
- Small: aim for under ~400 changed lines. Split refactors from behaviour changes.
- The body has four headings: **What**, **Why** (link the issue: `Fixes #123`), **How tested** (commands run and results), **Notes** (risks, follow-ups).
- UI changes include before/after screenshots. With gh 2.99+: `gh pr create --attach before.png#"Before: empty state" --attach after.png#"After"`.
- Open as draft until checks pass and you have reviewed your own diff once.
- Answer every review comment, with a commit or a reason.

## Attribution and leaks
- Follow the repository's policy on AI disclosure (CONTRIBUTING.md, PR template). If it asks for disclosure, disclose plainly.
- Never put private links in public places: agent session URLs, internal dashboards, local file paths, customer names.
- Before pushing, run the leak check in the `open-pull-request` skill.
- Claude Code users: `attribution.sessionUrl: false` in settings stops session links being added to commits from cloud and
  Remote Control sessions (snippet in the `open-pull-request` skill).
Adapter CLAUDE.md Imports AGENTS.md for Claude Code. 10 lines
Download Raw
# CLAUDE.md

@AGENTS.md

## Claude Code notes
- Skills from this loadout live in `.claude/skills/`: `open-pull-request`. Use them when their description matches the task.
- Follow AGENTS.md above; where this file and AGENTS.md disagree, AGENTS.md wins.

<!-- From the Agent Loadout "PR hygiene for agents" v1.0.0 — https://loadout.jnw-it.com/loadouts/pr-hygiene-for-agents/ -->
Adapter GEMINI.md Imports AGENTS.md for Gemini CLI. 10 lines
Download Raw
# GEMINI.md

@./AGENTS.md

## Gemini CLI notes
- Skills from this loadout live in `.agents/skills/`: `open-pull-request`. Use them when their description matches the task.
- Follow AGENTS.md above; where this file and AGENTS.md disagree, AGENTS.md wins.

<!-- From the Agent Loadout "PR hygiene for agents" v1.0.0 — https://loadout.jnw-it.com/loadouts/pr-hygiene-for-agents/ -->
Skill skills/open-pull-request/SKILL.md Self-review, leak check, screenshots and gh pr create. 21 lines
Download Raw
---
name: open-pull-request
description: Prepare and open a reviewable pull request with gh, including a leak check, a structured body and screenshots for UI changes. Use when work on a branch is ready for review.
---

# Open a pull request

1. **Self-review.** `git diff origin/<base>...HEAD --stat`, then read the full diff once. Remove debug output and stray files.
2. **Checks.** Run the project's test, lint and type-check commands. Note the results for the body.
3. **Leak check.** Inspect commit messages and the diff for things that must not go public:
   ```sh
   git log origin/<base>..HEAD --format='%H %s%n%b' | grep -niE 'session|claude\.ai/code|chatgpt\.com|localhost:|/Users/|/home/' || echo "messages clean"
   git diff origin/<base>...HEAD | grep -nE '^\+.*(api[_-]?key|secret|password|token)\s*[:=]' || echo "diff clean"
   ```
   Matches are not always problems; read each one. Rewrite messages of unpushed commits with `git commit --amend` or an
   interactive rebase only on your own unpushed branch. If something sensitive was already pushed, stop and tell the human.
4. **Screenshots** for UI changes: capture before and after (same viewport), save outside the repo, attach with `--attach`.
5. **Create.** Write the body from `references/pr-body.md` into a temporary file, then:
   `gh pr create --draft --base <base> --title "<subject>" --body-file <file> [--attach <img>#"<alt text>"]`
6. **Mark ready** with `gh pr ready` once checks are green. Report the PR URL.
Skill file skills/open-pull-request/references/pr-body.md PR body template. 18 lines
Download Raw
# Pull request body template

```markdown
## What
<one paragraph: the change in plain words>

## Why
<the problem or request>. Fixes #<issue>.

## How tested
- `<command>`: <result>
- Manual: <steps, browser and viewport if UI>

## Notes
- Risks: <what could break, who should look closely>
- Follow-ups: <deliberately left out, with issue links>
```
Skill file skills/open-pull-request/references/attribution.json Claude Code settings snippet that drops session links. 6 lines
Download Raw
{
  "attribution": {
    "sessionUrl": false
  }
}

All files: source zip · Licence MIT · By Agent Loadout · First listed

Credits

Public work that inspired this loadout. The wording here is our own; follow the links for the originals.

Installing and testing

How do I install PR hygiene for agents in Claude Code?

From your project root, put AGENTS.md, CLAUDE.md, skills/open-pull-request/SKILL.md at .claude/skills/open-pull-request/SKILL.md, skills/open-pull-request/references/pr-body.md at .claude/skills/open-pull-request/references/pr-body.md, skills/open-pull-request/references/attribution.json at .claude/skills/open-pull-request/references/attribution.json. The "Claude Code" tab on this page has the curl commands, or download https://loadout.jnw-it.com/download/pr-hygiene-for-agents/claude-code.zip, which is already laid out. Do not overwrite an existing AGENTS.md or CLAUDE.md; merge it.

How do I install PR hygiene for agents in Codex CLI?

From your project root, put AGENTS.md, skills/open-pull-request/SKILL.md at .agents/skills/open-pull-request/SKILL.md, skills/open-pull-request/references/pr-body.md at .agents/skills/open-pull-request/references/pr-body.md, skills/open-pull-request/references/attribution.json at .agents/skills/open-pull-request/references/attribution.json. The "Codex CLI" tab on this page has the curl commands, or download https://loadout.jnw-it.com/download/pr-hygiene-for-agents/codex.zip, which is already laid out. Do not overwrite an existing AGENTS.md or CLAUDE.md; merge it.

How do I install PR hygiene for agents in Cursor?

From your project root, put AGENTS.md, skills/open-pull-request/SKILL.md at .agents/skills/open-pull-request/SKILL.md, skills/open-pull-request/references/pr-body.md at .agents/skills/open-pull-request/references/pr-body.md, skills/open-pull-request/references/attribution.json at .agents/skills/open-pull-request/references/attribution.json. The "Cursor" tab on this page has the curl commands, or download https://loadout.jnw-it.com/download/pr-hygiene-for-agents/cursor.zip, which is already laid out. Do not overwrite an existing AGENTS.md or CLAUDE.md; merge it.

How do I install PR hygiene for agents in Gemini CLI?

From your project root, put AGENTS.md, GEMINI.md, skills/open-pull-request/SKILL.md at .agents/skills/open-pull-request/SKILL.md, skills/open-pull-request/references/pr-body.md at .agents/skills/open-pull-request/references/pr-body.md, skills/open-pull-request/references/attribution.json at .agents/skills/open-pull-request/references/attribution.json. The "Gemini CLI" tab on this page has the curl commands, or download https://loadout.jnw-it.com/download/pr-hygiene-for-agents/gemini-cli.zip, which is already laid out. Do not overwrite an existing AGENTS.md or CLAUDE.md; merge it.

How do I install PR hygiene for agents in Antigravity CLI?

From your project root, put AGENTS.md, skills/open-pull-request/SKILL.md at .agents/skills/open-pull-request/SKILL.md, skills/open-pull-request/references/pr-body.md at .agents/skills/open-pull-request/references/pr-body.md, skills/open-pull-request/references/attribution.json at .agents/skills/open-pull-request/references/attribution.json. The "Antigravity CLI" tab on this page has the curl commands, or download https://loadout.jnw-it.com/download/pr-hygiene-for-agents/antigravity-cli.zip, which is already laid out. Do not overwrite an existing AGENTS.md or CLAUDE.md; merge it.

How do I install PR hygiene for agents in GitHub Copilot?

From your project root, put AGENTS.md, skills/open-pull-request/SKILL.md at .agents/skills/open-pull-request/SKILL.md, skills/open-pull-request/references/pr-body.md at .agents/skills/open-pull-request/references/pr-body.md, skills/open-pull-request/references/attribution.json at .agents/skills/open-pull-request/references/attribution.json. The "GitHub Copilot" tab on this page has the curl commands, or download https://loadout.jnw-it.com/download/pr-hygiene-for-agents/copilot.zip, which is already laid out. Do not overwrite an existing AGENTS.md or CLAUDE.md; merge it.

Has PR hygiene for agents been tested?

It passed the Level 1 automated install checks on 2026-10-17: the files parse, install to each agent's documented paths, and pass the safety scan. No AI agent has run it yet, so no agent pass or fail is claimed.

More for Claude Code, Codex, Cursor, Gemini CLI, Antigravity CLI and GitHub Copilot.