Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 10, 2025

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>
@Copilot Copilot AI changed the title [WIP] Tool for creating pull request should instruct LLMs to follow PULL_REQUEST_TEMPLATE.md Add PULL_REQUEST_TEMPLATE.md guidance to create_pull_request tool description Sep 10, 2025
@Copilot Copilot AI requested a review from digitarald September 10, 2025 19:28
Copilot finished work on behalf of digitarald September 10, 2025 19:28
@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 owner September 10, 2025 21:46
@Copilot Copilot AI review requested due to automatic review settings September 10, 2025 21:46
Copy link
Contributor

@Copilot Copilot AI left a comment

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.

File Description
pkg/github/pullrequests.go Enhanced tool description to include guidance about using PULL_REQUEST_TEMPLATE.md files
pkg/github/toolsnaps/create_pull_request.snap Updated 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.

@@ -86,7 +86,7 @@ func GetPullRequest(getClient GetClientFn, t translations.TranslationHelperFunc)
// CreatePullRequest creates a tool to create a new pull request.
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.")),
Copy link
Preview

Copilot AI Sep 10, 2025

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.

Sign up for free to 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
2 participants