Manage pull requests
Skill ThomasVitale/agents-skills-oci-artifacts-spec/examples/skills/manage-pull-requests
Standard method for packaging, distributing, signing, and tracking Agent Skills using OCI Artifacts.
npx -y skills add ThomasVitale/agents-skills-oci-artifacts-spec --skill manage-pull-requestsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 13 stars13 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.9 KB, as published. Nobody here has run it
Manage Pull Requests
Overview
This skill enables agents to automate pull request (PR) management in Forgejo repositories using the forgejo-cli tool. It supports common PR operations, making it ideal for CI/CD pipelines, code reviews, and team collaboration workflows.
Instructions
Prerequisites
forgejo-climust be installed and configured with Forgejo API credentials.- The agent must have access to the target repository.
Supported Actions
- List PRs: Fetch all open PRs for a repository.
- View PR: Retrieve details of a specific PR.
- Create PR: Open a new PR from a branch or fork.
- Merge PR: Merge an approved PR into the target branch.
- Close PR: Close a PR without merging.
- Comment on PR: Add or update comments on a PR.
Parameters
Input Format
All actions require a JSON object with the following structure:
{
"action": "<action>",
"repo": "<owner/repo>",
[ "pr_id": "<pr-id>", ]
[ "branch": "<source-branch>", ]
[ "target_branch": "<target-branch>", ]
[ "title": "<pr-title>", ]
[ "description": "<pr-description>", ]
[ "comment": "<comment-text>", ]
[ "force": <boolean> ]
}
Action-Specific Parameters
| Action | Required Parameters | Optional Parameters |
|---|---|---|
list | repo | — |
view | repo, pr_id | — |
create | repo, branch, title | target_branch, description |
merge | repo, pr_id | force |
close | repo, pr_id | — |
comment | repo, pr_id, comment | — |
Examples
1. List all open PRs
Input:
{
"action": "list",
"repo": "owner/repo"
}
Output: List of open PRs with their IDs, titles, and authors.
2. Create a new PR
Input:
{
"action": "create",
"repo": "owner/repo",
"branch": "feature/new-feature",
"target_branch": "main",
"title": "Add new feature",
"description": "This PR introduces a new feature."
}
Output: Confirmation of PR creation with PR ID.
3. Merge a PR
Input:
{
"action": "merge",
"repo": "owner/repo",
"pr_id": "123",
"force": false
}
Output: Confirmation of merge or error if PR cannot be merged.
4. Add a comment to a PR
Input:
{
"action": "comment",
"repo": "owner/repo",
"pr_id": "123",
"comment": "Please review the changes."
}
Output: Confirmation of comment added.
Error Handling
- If
forgejo-cliis not found:"Error: forgejo-cli is required but not installed. Install it from [forgejo-cli wiki](https://codeberg.org/forgejo-contrib/forgejo-cli/wiki/PRs)." - If the repository or PR ID is invalid:
"Error: Invalid repository or PR ID." - For CLI errors:
Return the raw error message from
forgejo-cli.