# 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.
