Skip to content

Commit fe2a21e

Browse files
committed
feat(issue-auto-implement): require .comment_body when implement makes no code changes
Strengthen the implement prompt so Claude must write .comment_body when deciding not to make code changes (e.g. feedback is a question, current approach preferred). Without it the workflow posts a generic fallback; requiring .comment_body ensures reviewers get a specific reply. Update AGENTS.md to document that .comment_body is required in that case. Made-with: Cursor
1 parent a1a05ed commit fe2a21e

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

.github/actions/issue-auto-implement/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ From the workflow event payload, derive:
2929
## Request more info vs comment body from implement
3030

3131
- **Request more info (assess):** The **assess** step decides there is **not enough information** to implement. It returns `action: request_info` and a `comment_body`. The workflow posts that on the issue (or on the PR when the trigger was a PR review/comment), adds the `needs-info` label, and **exits without running implement**.
32-
- **Comment body from implement (no change or need clarification):** The assess step said **implement**. The **implement** step ran (Claude Code CLI with full repo context). Claude **chose not to make code changes** — e.g. the feedback is a question, the current approach is preferred, or it needs clarification. It writes `.comment_body` with the text to post on the PR (one or two sentences). The workflow posts that on the **PR** (review iteration path). Use for: (a) no-change scenarios (thank the reviewer, briefly explain), or (b) when more information is requested (e.g. "Could you clarify whether you want X or Y?").
32+
- **Comment body from implement (no change or need clarification):** The assess step said **implement**. The **implement** step ran (Claude Code CLI with full repo context). When Claude **chose not to make code changes** — e.g. the feedback is a question, the current approach is preferred, or it needs clarification — it **must** write `.comment_body` with the text to post on the PR (one or two sentences). The workflow posts that on the **PR** (review iteration path). If `.comment_body` is missing, the workflow falls back to a generic message. The implement prompt requires Claude to always write `.comment_body` when making no code changes so reviewers get a useful reply. Use for: (a) no-change scenarios (thank the reviewer, briefly explain), or (b) when more information is requested (e.g. "Could you clarify whether you want X or Y?").
3333

3434
If a reviewer's comment is ambiguous, assess might still return **implement** (optimistic). Then implement runs; Claude can either make a best-effort change, or write `.comment_body` asking for clarification. That clarification is posted on the PR.
3535

.github/actions/issue-auto-implement/assess/src/implement.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function buildClaudeCliPrompt(
7676
` 3. ${metaDir}/.pr_body — markdown body: brief problem summary, then "How it was solved" or "Solution". Do NOT include "Closes #N" (it will be appended).`,
7777
` These files are workflow-only inputs (consumed by the action to create the commit and PR). Do NOT add or commit them to the repository.`,
7878
'',
79-
`- When you decide NOT to make any code changes, do NOT write .commit_msg. Instead write the PR comment body to ${metaDir}/.comment_body — one or two sentences. Use this for: (a) no-change scenarios (e.g. the feedback is a question or the current approach is preferred; thank the reviewer and briefly explain), or (b) when more information is needed (e.g. "Could you clarify whether you want X or Y?"). This file will be posted on the PR.`,
79+
`- When you decide NOT to make any code changes, you MUST NOT write .commit_msg, .pr_title, or .pr_body. You MUST write ${metaDir}/.comment_body instead — one or two sentences that will be posted on the PR. Required for: (a) no-change scenarios (e.g. the feedback is a question or the current approach is preferred; thank the reviewer and briefly explain why no change), or (b) when more information is needed (e.g. "Could you clarify whether you want X or Y?"). Without .comment_body the workflow posts a generic fallback; always write it when you make no code changes so the reviewer gets a useful reply.`,
8080
'',
8181
'Issue title:',
8282
issueTitle,
@@ -102,7 +102,7 @@ function buildClaudeCliPrompt(
102102
if (contextBlock) {
103103
parts.push('', contextBlock);
104104
}
105-
parts.push('', 'After implementing, write the appropriate files: .commit_msg, .pr_title, and .pr_body if you made code changes; or .comment_body if you made no code changes (no-change rationale or request for clarification).');
105+
parts.push('', 'After implementing, write exactly one of: (A) .commit_msg, .pr_title, and .pr_body if you made code changes; or (B) .comment_body only if you made no code changes. When you make no code changes, writing .comment_body is required so the PR gets a specific reply instead of a generic one.');
106106
return parts.join('\n');
107107
}
108108

0 commit comments

Comments
 (0)