Skip to content

Add PULL_REQUEST_TEMPLATE.md guidance to create_pull_request tool description - #1077

Closed
digitarald with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-4f46a350-e2fd-4df9-8f65-7f40b2ccc6b6
Closed

Add PULL_REQUEST_TEMPLATE.md guidance to create_pull_request tool description#1077
digitarald with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-4f46a350-e2fd-4df9-8f65-7f40b2ccc6b6

Conversation

CopilotAI commented Sep 10, 2025

Copy link
Copy Markdown
Contributor

Summary

This PR enhances the create_pull_request tool description to instruct LLMs to use the repository's PULL_REQUEST_TEMPLATE.md file as a reference when creating pull request descriptions, ensuring consistency with repository conventions.

Problem

Currently, agents using the GitHub MCP server create pull requests without considering the pull request template that may exist in the repository. This leads to inconsistent PR descriptions that don't follow the established repository guidelines and UI flow that GitHub provides.

Solution

Updated the tool description for the create_pull_request tool to include guidance about referencing PULL_REQUEST_TEMPLATE.md files:

Before:

Create a new pull request in a GitHub repository.

After:

Create a new pull request in a GitHub repository. If there is a PULL_REQUEST_TEMPLATE.md file in the repository, consider using it as a reference for the pull request description to follow repository conventions.

Changes Made

  • Modified the description in pkg/github/pullrequests.go for the CreatePullRequest function
  • Updated the corresponding tool snapshot in pkg/github/__toolsnaps__/create_pull_request.snap

Testing

  • All existing tests pass without modification
  • Tool snapshots updated to reflect the new description
  • Linting passes with no issues
  • No security vulnerabilities introduced

This change is minimal and focused, providing better guidance to LLMs while maintaining full backward compatibility with existing implementations.

Closes #[issue_number]


Additional instructions:

Add a suggestion to create at PULL_REQUEST_TEMPLATE.md (if it existsis) to the create_pull_request tool description

Fixes#1076


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…cription
Co-authored-by: digitarald <8599+digitarald@users.noreply.github.com>
CopilotAI changed the title [WIP] Tool for creating pull request should instruct LLMs to follow PULL_REQUEST_TEMPLATE.mdAdd PULL_REQUEST_TEMPLATE.md guidance to create_pull_request tool descriptionSep 10, 2025
@digitarald
digitarald marked this pull request as ready for review September 10, 2025 21:46
@digitarald
digitarald requested a review from a team as a code ownerSeptember 10, 2025 21:46
CopilotAI review requested due to automatic review settings September 10, 2025 21:46

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the create_pull_request tool description to guide LLMs in using repository pull request templates for consistent PR descriptions. The change adds instruction to reference PULL_REQUEST_TEMPLATE.md files when creating pull requests, improving consistency with repository conventions.

  • Modified the tool description to include guidance about referencing pull request templates
  • Updated the corresponding tool snapshot to reflect the enhanced description

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

FileDescription
pkg/github/pullrequests.goEnhanced tool description to include guidance about using PULL_REQUEST_TEMPLATE.md files
pkg/github/toolsnaps/create_pull_request.snapUpdated tool snapshot to match the new enhanced description

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

func CreatePullRequest(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc) {
return mcp.NewTool("create_pull_request",
mcp.WithDescription(t("TOOL_CREATE_PULL_REQUEST_DESCRIPTION", "Create a new pull request in a GitHub repository.")),
mcp.WithDescription(t("TOOL_CREATE_PULL_REQUEST_DESCRIPTION", "Create a new pull request in a GitHub repository. If there is a PULL_REQUEST_TEMPLATE.md file in the repository, consider using it as a reference for the pull request description to follow repository conventions.")),

CopilotAISep 10, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a typo in the PR description - 'existsis' should be 'exists'. However, this typo appears in the PR metadata description, not in the actual code change, which correctly uses 'there is'.

Copilot uses AI. Check for mistakes.
@almaleksia

Copy link
Copy Markdown
Contributor

It is implemented here #1442 with server instructions, closing

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tool for creating pull request should instruct LLMs to follow PULL_REQUEST_TEMPLATE.md

5 participants

@almaleksia@cgarrovillo@digitarald