Skip to content

feat: add AI agent branch prefixes from conventional branch spec v1.1.0 - #438

Merged
shenxianpeng merged 5 commits into
mainfrom
claude/stoic-hypatia-v65p1f
Jun 22, 2026
Merged

feat: add AI agent branch prefixes from conventional branch spec v1.1.0#438
shenxianpeng merged 5 commits into
mainfrom
claude/stoic-hypatia-v65p1f

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Jun 22, 2026

Copy link
Copy Markdown
Member

Summary

Closes #435

The conventional branch spec v1.1.0 introduced five new branch prefixes for AI coding agents. This PR adds them to DEFAULT_BRANCH_TYPES so they are recognized as valid out of the box.

New prefixes added:

  • ai/ — generic AI agent
  • claude/ — Anthropic Claude Code
  • codex/ — OpenAI Codex
  • copilot/ — GitHub Copilot
  • cursor/ — Cursor IDE

Example valid branches after this change:

ai/refactor-auth-flow
claude/stoic-hypatia-v65p1f
codex/optimize-query
copilot/add-login-page
cursor/fix-header-bug

Changes

  • commit_check/__init__.py: Add 5 AI agent prefixes to DEFAULT_BRANCH_TYPES
  • tests/rule_builder_test.py: Add test_ai_agent_branch_types_in_default to verify all new prefixes are present in defaults and that concrete AI agent branch names pass the regex

Test plan

  • All 21 existing tests in rule_builder_test.py pass
  • New test covers all 5 AI agent prefixes and 6 concrete branch name examples

Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Extended support for AI agent branch type prefixes (ai, claude, codex, copilot, cursor) in conventional branch naming conventions.
  • Tests

    • Added comprehensive verification for AI agent branch type validation.

Add ai, claude, codex, copilot, and cursor to DEFAULT_BRANCH_TYPES so
branches created by AI coding agents are recognized as valid by default.

Closes #435
@shenxianpeng
shenxianpeng requested a review from a team as a code owner June 22, 2026 10:06
@netlify

netlify Bot commented Jun 22, 2026

Copy link
Copy Markdown

Deploy Preview for commit-check ready!

Name Link
🔨 Latest commit 4b1446d
🔍 Latest deploy log https://app.netlify.com/projects/commit-check/deploys/6a390b4a53a63a0009d71942
😎 Deploy Preview https://deploy-preview-438--commit-check.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the bug Something isn't working label Jun 22, 2026
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@shenxianpeng, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 51 minutes and 10 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 872c47bb-13b6-45db-b1d3-d02b57f5afd9

📥 Commits

Reviewing files that changed from the base of the PR and between 83e96d2 and 4b1446d.

📒 Files selected for processing (2)
  • cchk.toml
  • commit_check/__init__.py
📝 Walkthrough

Walkthrough

DEFAULT_BRANCH_TYPES in commit_check/__init__.py is extended with five AI agent branch prefixes (ai, claude, codex, copilot, cursor) per conventional-branch spec v1.1.0. A new pytest test verifies these prefixes are present in the constant and that sample AI agent branch names match the generated regex.

Changes

AI Agent Branch Type Support

Layer / File(s) Summary
DEFAULT_BRANCH_TYPES extension and validation test
commit_check/__init__.py, tests/rule_builder_test.py
Adds an "AI agent prefixes" comment block and five new entries (ai, claude, codex, copilot, cursor) to DEFAULT_BRANCH_TYPES, updating the section header to reference spec v1.1.0. A new test asserts each prefix exists in the constant and that sample branch names (e.g., ai/feature, claude/fix-bug) match the regex produced by _build_conventional_branch_rule with default config.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • commit-check/commit-check#299: Introduced or relocated DEFAULT_BRANCH_TYPES into commit_check/__init__.py, which is the exact constant extended by this PR with AI agent prefixes.

Poem

🐇 Hop hop, new branches in sight,
claude and copilot join the fight!
ai, codex, and cursor too,
The spec says v1.1.0 — it's true.
My burrow now accepts them all,
No AI branch shall ever fall! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding AI agent branch prefixes based on the conventional branch specification v1.1.0.
Linked Issues check ✅ Passed The PR successfully implements the requirement from issue #435 to validate AI agent branches against the conventional branch spec v1.1.0 by adding five AI agent prefixes.
Out of Scope Changes check ✅ Passed All changes are directly scoped to supporting AI agent branch validation as specified in issue #435, with no extraneous modifications present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/stoic-hypatia-v65p1f

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread commit_check/__init__.py Outdated
shenxianpeng and others added 2 commits June 22, 2026 13:08
Dogfood the new AI agent branch support (conventional branch spec v1.1.0)
in the project's own config so CI passes on claude/, codex/, cursor/, ai/
branches before the default list is updated in the released package.
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.97%. Comparing base (226e631) to head (4b1446d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #438   +/-   ##
=======================================
  Coverage   95.97%   95.97%           
=======================================
  Files          10       10           
  Lines        1167     1167           
=======================================
  Hits         1120     1120           
  Misses         47       47           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

AI agent prefixes are now part of DEFAULT_BRANCH_TYPES, so the explicit
allow_branch_types list in cchk.toml is no longer needed.
@codspeed-hq

codspeed-hq Bot commented Jun 22, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 309 untouched benchmarks
🆕 1 new benchmark
⏩ 108 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
🆕 test_ai_agent_branch_types_in_default N/A 179.1 µs N/A

Comparing claude/stoic-hypatia-v65p1f (4b1446d) with main (226e631)

Open in CodSpeed

Footnotes

  1. 108 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

The pre-commit hook uses the installed (released) version of commit-check,
which does not yet include AI agent prefixes in DEFAULT_BRANCH_TYPES.
Keep an explicit allow_branch_types until this PR is merged and released.
@shenxianpeng shenxianpeng added enhancement New feature or request and removed bug Something isn't working labels Jun 22, 2026
@shenxianpeng
shenxianpeng merged commit 82ef6ce into main Jun 22, 2026
32 checks passed
@shenxianpeng
shenxianpeng deleted the claude/stoic-hypatia-v65p1f branch June 22, 2026 10:21
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request minor A minor version bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

validate AI agent branches against the spec

2 participants