From c2f55a96b6f79d55ac91f81b0949dc4bfac7322b Mon Sep 17 00:00:00 2001 From: xmtp-coder-agent <> Date: Thu, 23 Apr 2026 00:17:09 +0000 Subject: [PATCH] refactor(messages): delegate comment handling to /receiving-feedback skill Replace the multi-paragraph [INSTRUCTIONS] block in formatPRCommentMessage and formatIssueCommentMessage with a single directive pointing the agent at its /receiving-feedback skill. Keeps decision logic in one place (the skill) instead of duplicated across the message template. Co-Authored-By: Claude Opus 4.7 --- src/actions/messages.test.ts | 18 ++++++++++++------ src/actions/messages.ts | 18 ++---------------- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/src/actions/messages.test.ts b/src/actions/messages.test.ts index 797ce3b..836efc3 100644 --- a/src/actions/messages.test.ts +++ b/src/actions/messages.test.ts @@ -38,15 +38,18 @@ describe("formatPRCommentMessage", () => { expect(instrIdx).toBeLessThan(commentIdx); }); - test("instructs agent to react with 👍 for automated non-actionable comments", () => { + test("delegates handling to the /receiving-feedback skill", () => { const msg = formatPRCommentMessage({ commentUrl: "https://github.com/org/repo/pull/1#comment-1", commenter: "bot", timestamp: "2026-03-17T12:00:00Z", body: "Approvability check passed", }); - expect(msg).toContain("👍"); - expect(msg).toContain("automated"); + expect(msg).toContain( + "Use the /receiving-feedback skill to handle the following comment.", + ); + expect(msg).not.toContain("👍"); + expect(msg).not.toContain("automated"); }); test("includes file path and line number for review comments", () => { @@ -114,15 +117,18 @@ describe("formatIssueCommentMessage", () => { expect(instrIdx).toBeLessThan(commentIdx); }); - test("instructs agent to react with 👍 for automated non-actionable comments", () => { + test("delegates handling to the /receiving-feedback skill", () => { const msg = formatIssueCommentMessage({ commentUrl: "https://github.com/org/repo/issues/42#comment-1", commenter: "github-actions", timestamp: "2026-03-17T12:00:00Z", body: "Task created: https://coder.example.com/tasks/123", }); - expect(msg).toContain("👍"); - expect(msg).toContain("automated"); + expect(msg).toContain( + "Use the /receiving-feedback skill to handle the following comment.", + ); + expect(msg).not.toContain("👍"); + expect(msg).not.toContain("automated"); }); }); diff --git a/src/actions/messages.ts b/src/actions/messages.ts index 5d06239..8970996 100644 --- a/src/actions/messages.ts +++ b/src/actions/messages.ts @@ -27,15 +27,7 @@ Commenter: ${params.commenter} Timestamp: ${params.timestamp}${locationLine} [INSTRUCTIONS] -First, determine whether this comment requires action. - -If the comment is automated and does not require code changes or a reply — for example: bot status updates, approvability checks, CI notifications, merge conflict warnings, or other non-human automated comments — react to the comment with a 👍 emoji and take no further action. - -If the comment contains valid suggestions or feedback from a human reviewer, implement them, ensure the branch is still in a healthy state (all lint and tests continue to pass), then commit and push. Reply to the comment with a succinct and clear explanation of the changes you made. - -If you have questions or need clarification, ask them directly in the comment thread and wait for further feedback. - -If no changes are needed or the comment is invalid feedback, reply to the comment with a succinct and clear explanation why no action was taken. +Use the /receiving-feedback skill to handle the following comment. [END INSTRUCTIONS] [COMMENT] @@ -51,13 +43,7 @@ Commenter: ${params.commenter} Timestamp: ${params.timestamp} [INSTRUCTIONS] -First, determine whether this comment requires action. - -If the comment is automated and does not contain actionable information — for example: bot status updates, CI notifications, task tracking comments, or other non-human automated comments — react to the comment with a 👍 emoji and take no further action. - -If the comment contains new requirements, clarifications, or feedback that affects your current work, adjust your approach accordingly. - -If the comment asks a question, reply directly on the issue. +Use the /receiving-feedback skill to handle the following comment. [END INSTRUCTIONS] [COMMENT]