Home › Agent workflows › Git commits & PRs AGENTS.md

Git commits & PRs AGENTS.md

AGENTS.md rules for how agents commit: Conventional Commits, atomic changes, safe git commands, and PR descriptions.

AGENTS.mdAgent workflows

How to use

Save this as AGENTS.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.

AGENTS.mdDownload  
# AGENTS.md: Git, commits and pull requests

## Commit messages (Conventional Commits)
- Format: `type(scope): summary` with types `feat`, `fix`, `refactor`, `perf`, `test`, `docs`, `build`, `ci`, `chore`.
- Summary: imperative, lowercase, no period, under 72 chars (`fix(auth): refresh token before expiry`).
- Body explains *why* and any trade-offs; wrap at 72. Reference issues (`Closes #123`).
- Breaking changes: `feat(api)!: ...` plus a `BREAKING CHANGE:` footer.

## Commit hygiene
- One logical change per commit. Don't mix refactors, formatting, and features.
- Run the project's lint and tests before committing.
- Review `git diff --staged` before every commit; never commit `.env`, credentials, large binaries, or generated build output.
- Stage specific files (`git add path`), not blindly `git add -A`, when the working tree has unrelated changes.

## Safety
- Never run `git push --force`, `git reset --hard`, `git clean -fd`, `git rebase` of pushed branches, or `--no-verify` without explicit approval.
- Don't amend commits that are already pushed.
- Work on a feature branch (`feat/<short-name>`), never directly on `main`.

## Pull request description
- **What** changed and **why** (2-4 sentences).
- **How to test:** exact commands or steps.
- **Risk:** migrations, config changes, breaking changes, rollout notes.
- Screenshots for UI changes.

Related rules

REST API design AGENTS.md

AGENTS.md for designing consistent HTTP/JSON APIs: resource naming, status codes, errors, pagination, and versioning.

AGENTS.mdAPI design

Bevy game engine AGENTS.md

AGENTS.md for Bevy (0.16+) games in Rust: ECS systems, plugins, required components, and fast dev builds.

AGENTS.mdBevy (Rust)

Code review Copilot instructions

Copilot instructions focused on pull request review: what to flag, severity labels, and how to word comments.

GitHub CopilotAgent workflows

Code reviewer subagent (Claude Code)

A Claude Code subagent definition that reviews the current diff for bugs, security, and tests, reporting by severity.

Claude Code (CLAUDE.md)Agent workflows

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.