Files
actual-actualbudget-1/.github/agents/pr-and-commit-rules.md
Matiss Janis Aboltins 73fa068fe9 [AI] Establish AI agent commit and PR guidelines (#7153)
* [AI] Extract PR/commit rules into shared agent skill

Deduplicate PR and commit instructions from AGENTS.md into a standalone
skill file at .github/agents/pr-and-commit-rules.md. This single source
of truth is consumed by both Claude Code (via CLAUDE.md @-import) and
Cursor (via .cursor/rules/pr-and-commit.mdc with alwaysApply: true).

AGENTS.md now references the shared file instead of repeating the rules
in three separate sections.

https://claude.ai/code/session_01KkHg7MYXrTyDkTw6u98Vam

* Add release notes for PR #7153

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-08 18:16:46 +00:00

2.6 KiB

PR and Commit Rules for AI Agents

This is the single source of truth for all commit and pull request rules that AI agents must follow when working with Actual Budget.

Commit Rules

[AI] Prefix Requirement

ALL commit messages MUST be prefixed with [AI]. This is a mandatory requirement with no exceptions.

Examples:

  • [AI] Fix type error in account validation
  • [AI] Add support for new transaction categories
  • Fix type error in account validation (MISSING PREFIX - NOT ALLOWED)
  • Add support for new transaction categories (MISSING PREFIX - NOT ALLOWED)

Git Safety Rules

  • Never update git config
  • Never run destructive git operations (force push, hard reset) unless the user explicitly requests it
  • Never skip hooks (--no-verify, --no-gpg-sign)
  • Never force push to main/master
  • Never commit unless explicitly asked by the user

Pre-Commit Quality Checklist

Before committing, ensure all of the following:

  • Commit message is prefixed with [AI]
  • yarn typecheck passes
  • yarn lint:fix has been run
  • Relevant tests pass
  • User-facing strings are translated
  • Code style conventions followed (see AGENTS.md for full style guide)

Pull Request Rules

[AI] Prefix Requirement

ALL pull request titles MUST be prefixed with [AI]. This is a mandatory requirement with no exceptions.

Examples:

  • [AI] Fix type error in account validation
  • [AI] Add support for new transaction categories
  • Fix type error in account validation (MISSING PREFIX - NOT ALLOWED)

Labels

Add the "AI generated" label to all AI-created pull requests. This helps maintainers understand the nature of the contribution.

PR Template: Do Not Fill In

  • NEVER fill in the PR template (.github/PULL_REQUEST_TEMPLATE.md). Leave all blank spaces and placeholder comments as-is. Humans are expected to fill in the Description, Related issue(s), Testing, and Checklist sections.
  • Exception: If a human explicitly asks you to fill out the PR template, then fill it out in Chinese, using Chinese characters (简体中文) for all content you add.

Quick-Reference Workflow

Follow these steps when committing and creating PRs:

  1. Make your changes
  2. Run yarn typecheck — fix any errors
  3. Run yarn lint:fix — fix any remaining lint errors
  4. Run relevant tests (yarn test for all, or workspace-specific)
  5. Stage files and commit with [AI] prefix — do not skip hooks
  6. When creating a PR:
    • Use [AI] prefix in the title
    • Add the "AI generated" label
    • Leave the PR template blank (do not fill it in)