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.

More: all Agent workflows rules · all AGENTS.md rules

Related rules

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

/commit slash command (Claude Code)

A Claude Code /commit slash command that reviews staged changes and writes a Conventional Commits message.

Claude Code (CLAUDE.md)Agent workflows

Debugger subagent (Claude Code)

A Claude Code subagent for root-cause analysis of errors, crashes, and failing behavior, with a verified minimal fix.

Claude Code (CLAUDE.md)Agent workflows

Systematic debugging CLAUDE.md

CLAUDE.md workflow for debugging with Claude Code: reproduce, isolate, hypothesize, verify, and avoid guess-fixes.

Claude Code (CLAUDE.md)Agent workflows

Markdown docs Copilot path instructions

Path-specific Copilot instructions for Markdown docs and READMEs: structure, runnable commands, and concise style.

GitHub CopilotAgent 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.