Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 23, 2025

Summary

Adds MCP tool to create repositories from GitHub templates via the /repos/{owner}/{repo}/generate API endpoint.

Why

Creating repositories from templates is more common than creating empty repositories for bootstrapping projects with standard configurations.

What changed

  • Added CreateRepositoryFromTemplate function in repositories.go
  • Registered tool in AllTools list
  • Added 5 unit tests covering success and error paths
  • Generated toolsnap and documentation

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
  • New tool added

New tool create_repository_from_template with parameters:

  • Required: template_owner, template_repo, name
  • Optional: description, owner, private, include_all_branches

Prompts tested (tool changes only)

  • "Create a new repo called my-app from the template github/octocat-repo-template"
  • "Use template-owner/template-repo to create new-repo with all branches included"
  • "Make a private repository named test-proj from owner/template"

Security / limits

  • No security or limits impact
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

Uses existing auth flow. GitHub enforces template access permissions server-side.

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed
  • Updated (README / docs / examples)

README auto-generated with tool documentation.

Original prompt

This section details on the original issue you should resolve

<issue_title>allow users to create repositories from a repository template.</issue_title>
<issue_description>### Describe the feature or problem you’d like to solve

GitHub has a very usefull feature of repositroy template, creating a repositroy from a template is likely more usefull MCP tool than creating a repo from scratch.

Proposed solution

Add a tool that creates a repo from template

Additional context

https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template</issue_description>

Comments on the Issue (you are @copilot in this section)

@SamMorrowDrums There have been a number of attempts, and I'm curious to get something together. For now I'll assign this to copilot and see what it can drive from the prior attempts and current arch and see if there is a good version of this, I want to determine if a new tool is preferable to an additional arg when creating for example.

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 23, 2025 14:03
- Implement CreateRepositoryFromTemplate function using GitHub's template API
- Add comprehensive unit tests with 5 test cases
- Register tool in AllTools list
- Generate toolsnap and update documentation

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
- Only set owner and description if non-empty
- Prevents sending empty strings to GitHub API which could be misinterpreted
- All tests still pass

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Copilot AI changed the title [WIP] Add tool for creating repositories from templates Add create_repository_from_template tool Dec 23, 2025
Copilot AI requested a review from SamMorrowDrums December 23, 2025 14:11
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.

allow users to create repositories from a repository template.

2 participants