From 68df0f800016864cfcaa1d03ef9a738411072b3e Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 15 Dec 2025 20:07:15 +0000 Subject: [PATCH] feat: standardize PR creation instructions to match BashTool format Update PR creation instructions in generateDefaultPrompt and generateSimplePrompt to be consistent with the comprehensive BashTool PR workflow: - Add steps to run git log and git diff to understand full commit history - Require analyzing ALL commits, not just the latest - Enforce structured PR body format with ## Summary (1-3 bullet points) and ## Test plan (checklist) sections --- src/create-prompt/index.ts | 40 ++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/src/create-prompt/index.ts b/src/create-prompt/index.ts index 7a62e6e..0a0a6af 100644 --- a/src/create-prompt/index.ts +++ b/src/create-prompt/index.ts @@ -563,9 +563,22 @@ ${getCommitInstructions(eventData, githubData, context, useCommitSigning)} ${ eventData.claudeBranch ? ` -When done with changes, provide a PR link: +When done with changes: +1. Run git log origin/${eventData.baseBranch}..HEAD and git diff origin/${eventData.baseBranch}...HEAD to understand ALL commits +2. Draft a PR summary analyzing ALL changes (not just the latest commit) +3. Provide a PR link: [Create a PR](${GITHUB_SERVER_URL}/${context.repository}/compare/${eventData.baseBranch}...${eventData.claudeBranch}?quick_pull=1&title=&body=) -Use THREE dots (...) between branches. URL-encode all parameters.` +Use THREE dots (...) between branches. URL-encode all parameters. +PR body format: +## Summary +<1-3 bullet points> + +## Test plan + + +Fixes # + +Generated with [Claude Code](https://claude.ai/code)` : "" } @@ -743,8 +756,13 @@ ${eventData.eventName === "issue_comment" || eventData.eventName === "pull_reque - Mark each subtask as completed as you progress.${getCommitInstructions(eventData, githubData, context, useCommitSigning)} ${ eventData.claudeBranch - ? `- Provide a URL to create a PR manually in this format: - [Create a PR](${GITHUB_SERVER_URL}/${context.repository}/compare/${eventData.baseBranch}...?quick_pull=1&title=&body=) + ? `- When creating a pull request, follow these steps: + 1. Use git log and git diff to understand the full commit history for the current branch (from the time it diverged from the base branch): + - Run: git log origin/${eventData.baseBranch}..HEAD + - Run: git diff origin/${eventData.baseBranch}...HEAD + 2. Analyze ALL changes that will be included in the pull request, making sure to look at all relevant commits (NOT just the latest commit, but ALL commits that will be included in the pull request), and draft a pull request summary + 3. Provide a URL to create a PR manually in this format: + [Create a PR](${GITHUB_SERVER_URL}/${context.repository}/compare/${eventData.baseBranch}...?quick_pull=1&title=&body=) - IMPORTANT: Use THREE dots (...) between branch names, not two (..) Example: ${GITHUB_SERVER_URL}/${context.repository}/compare/main...feature-branch (correct) NOT: ${GITHUB_SERVER_URL}/${context.repository}/compare/main..feature-branch (incorrect) @@ -752,10 +770,16 @@ ${eventData.eventName === "issue_comment" || eventData.eventName === "pull_reque Example: Instead of "fix: update welcome message", use "fix%3A%20update%20welcome%20message" - The target-branch should be '${eventData.baseBranch}'. - The branch-name is the current branch: ${eventData.claudeBranch} - - The body should include: - - A clear description of the changes - - Reference to the original ${eventData.isPR ? "PR" : "issue"} - - The signature: "Generated with [Claude Code](https://claude.ai/code)" + - The PR body MUST follow this format: + ## Summary + <1-3 bullet points summarizing the changes> + + ## Test plan + + + Fixes # + + Generated with [Claude Code](https://claude.ai/code) - Just include the markdown link with text "Create a PR" - do not add explanatory text before it like "You can create a PR using this link"` : "" }