Skip to content

Add in an assign copilot prompt #572

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 24, 2025
Merged

Add in an assign copilot prompt #572

merged 2 commits into from
Jun 24, 2025

Conversation

SamMorrowDrums
Copy link
Collaborator

@SamMorrowDrums SamMorrowDrums commented Jun 24, 2025

This PR adds a prompt that assigns the Coding Agent to multiple tasks in a specified GitHub repository, validating first if they are clear enough to assign.

  • Adds first Prompt to the codebase
  • Adds Prompt support to toolsets.

Example

Rendered prompt

--SYSTEM
You are a personal assistant for GitHub the Copilot GitHub Coding Agent. Your task is to help the user assign tasks to the Coding Agent based on their open GitHub issues. You can use assign_copilot_to_issue tool to assign the Coding Agent to issues that are suitable for autonomous work, and search_issues tool to find issues that match the user's criteria. You can also use list_issues to get a list of issues in the repository.

--USER
Please go and get a list of the most recent 10 issues from the SamMorrowDrums/pigs-facts GitHub repository

--ASSISTANT
Sure! I will get a list of the 10 most recent issues for the repo SamMorrowDrums/pigs-facts.

--USER
For each issue, please check if it is a clearly defined coding task with acceptance criteria and a low to medium complexity to identify issues that are suitable for an AI Coding Agent to work on. Then assign each of the identified issues to Copilot.

--ASSISTANT
Certainly! Let me carefully check which ones are clearly scoped issues that are good to assign to the coding agent, and I will assign them now.

--USER
Great, if you are unsure if an issue is good to assign, ask me first, rather than assigning copilot. If you are certain the issue is clear and suitable you can assign it to Copilot without asking.

After listing issues, it proceeds to do exactly as hoped

image

image

@Copilot Copilot AI review requested due to automatic review settings June 24, 2025 08:20
@SamMorrowDrums SamMorrowDrums requested a review from a team as a code owner June 24, 2025 08:20
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 adds support for registering and handling a new “AssignCodingAgent” prompt alongside existing tools, enabling users to assign multiple GitHub issues to the Copilot Coding Agent in bulk.

  • Introduces ServerPrompt type and prompt registration methods in the toolset.
  • Registers the new prompt in the default GitHub “issues” toolset.
  • Implements the AssignCodingAgentPrompt function and its handler in issues.go.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
pkg/toolsets/toolsets.go Added ServerPrompt, NewServerPrompt, prompt storage, and registration methods.
pkg/github/tools.go Chained AddPrompts to include the new AssignCodingAgentPrompt.
pkg/github/issues.go Defined AssignCodingAgentPrompt with messages and handler logic.
Comments suppressed due to low confidence (6)

pkg/toolsets/toolsets.go:43

  • Add a Go doc comment above NewServerPrompt to describe its purpose and usage.
func NewServerPrompt(prompt mcp.Prompt, handler server.PromptHandlerFunc) ServerPrompt {

pkg/toolsets/toolsets.go:56

  • Add a Go doc comment for the ServerPrompt type to explain its fields and intended use.
// ServerPrompt represents a prompt that can be registered with the MCP server.

pkg/toolsets/toolsets.go:113

  • Add a Go doc comment for AddPrompts to clarify that it registers one or more prompts on the toolset.
func (t *Toolset) AddPrompts(prompts ...ServerPrompt) *Toolset {

pkg/toolsets/toolsets.go:138

  • Document RegisterPrompts, noting that it registers all added prompts on the MCP server when the toolset is enabled.
func (t *Toolset) RegisterPrompts(s *server.MCPServer) {

pkg/github/issues.go:936

  • [nitpick] The prompt ID AssignCodingAgent uses PascalCase; for consistency with snake_case tool IDs (e.g., assign_copilot_to_issue), consider using assign_coding_agent.
	return mcp.NewPrompt("AssignCodingAgent",

pkg/github/issues.go:935

  • There are no unit tests for the new AssignCodingAgentPrompt function or its handler; consider adding tests to verify the generated message sequence and parameter validation.
func AssignCodingAgentPrompt(t translations.TranslationHelperFunc) (tool mcp.Prompt, handler server.PromptHandlerFunc) {

SamMorrowDrums and others added 2 commits June 24, 2025 14:48
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@SamMorrowDrums SamMorrowDrums force-pushed the assign-copilot-prompt branch from ce77820 to a00617b Compare June 24, 2025 12:49
@JoannaaKL JoannaaKL merged commit 21389a4 into main Jun 24, 2025
16 checks passed
@JoannaaKL JoannaaKL deleted the assign-copilot-prompt branch June 24, 2025 12:52
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.

2 participants