Skip to content

Commit 2053f18

Browse files
maebealeclaude
andauthored
Require AI agents to attribute their GitHub comments (#1567)
* Attribute Claude-authored GitHub comments gh posts comments as the authenticated user, making AI-generated review/issue comments indistinguishable from the human's own. Requiring a robot prefix keeps authorship transparent to reviewers. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Make AI comment attribution agent-agnostic Per review, the Copilot-facing instruction file should not hard-code "Claude" attribution. A generic prefix keeps both files correct for whichever agent authors the comment. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Generalize comment-attribution rule to any authenticated user Drops the hard-coded username so the guidance reads correctly for any contributor whose gh account posts the comment. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Tell agents to keep GitHub comments brief Verbose AI comments add noise to PR threads; a brevity rule keeps them scannable and pushes longer context into the PR description. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 3cb6b87 commit 2053f18

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

.github/copilot-instructions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ Follow the [Stimulus Handbook](https://stimulus.hotwired.dev/handbook/introducti
180180
- **On every push**, update the PR title and content to reflect the current diff — preserve any existing images/screenshots in the description
181181
- **On every push**, update AI instruction files if the diff adds, removes, or renames anything tracked in AGENTS.md — specifically: Stimulus controllers, services, model/controller concerns, mailers, rake tasks, and directory file counts
182182
- **On every push**, add PR review comments on notable lines of code — decisions, trade-offs, non-obvious logic, or anything a reviewer should understand. Use `gh api` to post line comments on the diff
183+
- **Attribute every AI-authored GitHub comment**`gh` posts as the authenticated user, so any comment you create (PR review comments, issue/PR comments, replies) MUST be prefixed to identify the AI agent that wrote it. Begin the comment body with `🤖 _From <agent>:_` (e.g. `🤖 _From Claude:_` or `🤖 _From Copilot:_`) followed by the content
184+
- **Keep GitHub comments short and to the point** — one or two sentences, stating the key insight directly. Skip preamble, restating the code, and hedging; if a comment needs more than a few lines, it usually belongs in the PR description instead
183185

184186
## Testing
185187

CLAUDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ Follow the [Stimulus Handbook](https://stimulus.hotwired.dev/handbook/introducti
180180
- **On every push**, update the PR title and content to reflect the current diff — preserve any existing images/screenshots in the description
181181
- **On every push**, update AI instruction files if the diff adds, removes, or renames anything tracked in AGENTS.md — specifically: Stimulus controllers, services, model/controller concerns, mailers, rake tasks, and directory file counts
182182
- **On every push**, add PR review comments on notable lines of code — decisions, trade-offs, non-obvious logic, or anything a reviewer should understand. Use `gh api` to post line comments on the diff
183+
- **Attribute every AI-authored GitHub comment**`gh` posts as the authenticated user, so any comment you create (PR review comments, issue/PR comments, replies) MUST be prefixed to identify the AI agent that wrote it. Begin the comment body with `🤖 _From <agent>:_` (e.g. `🤖 _From Claude:_` or `🤖 _From Copilot:_`) followed by the content
184+
- **Keep GitHub comments short and to the point** — one or two sentences, stating the key insight directly. Skip preamble, restating the code, and hedging; if a comment needs more than a few lines, it usually belongs in the PR description instead
183185

184186
## Ruby Version Manager
185187

0 commit comments

Comments
 (0)