Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/block-agent-pr-title-prefixes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
---

ci: reject agent-prefixed PR titles such as `[codex]`.

Empty changeset because this only affects repository automation and agent
guidance, not the published Java SDK package.
5 changes: 5 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Check for agent/tool PR title prefix
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: node scripts/check-pr-title.cjs "$PR_TITLE"

- name: Validate PR title follows conventional commits
env:
PR_TITLE: ${{ github.event.pull_request.title }}
Expand Down
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Build infrastructure:
- **`*Request` builds, `*Response` doesn't.** This naming invariant prevents IDE auto-complete from suggesting `.builder()` on response types.
- **SLF4J for logging.** Not `java.util.logging`.
- **Conventional Commits** for commit messages. Types: `feat fix docs style refactor perf test build ci chore revert`.
- **Conventional PR titles** without agent/tool prefixes. Never start titles with `[codex]`, `[claude]`, `[cursor]`, or similar ownership tags.
- **Changesets** for adopter-visible changes (`npx changeset`).

## Don't
Expand Down
18 changes: 18 additions & 0 deletions scripts/check-pr-title.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env node

const title = (process.argv.slice(2).join(' ') || process.env.PR_TITLE || '').trim();

if (!title) {
console.error('PR title is empty.');
process.exit(1);
}

const disallowedAgentPrefix =
/^\[(codex|claude|claude-code|openai|chatgpt|copilot|cursor|aider|devin|agent|ai)\](?:\s|:|-|$)/i;

if (disallowedAgentPrefix.test(title)) {
console.error(`Invalid PR title: ${title}`);
console.error('Remove the leading agent/tool prefix. Use a concrete conventional-commits title instead, for example:');
console.error(' fix(ci): block agent PR title prefixes');
process.exit(1);
}
Loading