submit-pr
Submits PRs with integrated quality gate checks and branch validation.
Install
mkdir -p .claude/skills/submit-pr && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/18107" && unzip -o skill.zip -d .claude/skills/submit-pr && rm skill.zipInstalls to .claude/skills/submit-pr
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Submit the current branch as a PR.Key capabilities
- →Parse arguments for issue number and run ID
- →Detect the target repository
- →Verify the current branch belongs to a specific issue
- →Run code quality checks
- →Review the diff for secrets and debug logs
- →Submit the current branch as a PR
How it works
The skill validates the branch, checks code quality, reviews changes, and then submits the current branch as a pull request to GitHub.
Inputs & outputs
When to use submit-pr
- →Submitting a new PR
- →Checking PR readiness
- →Validating issue-branch linking
About this skill
Wrap up a branch: commit, push, create PR, record trace.
Mandatory reads — do this first
Run:
devwatch --repo "$REPO" doc-read --skill submit-pr --display
The output contains every doc you must read; treat it as if you opened each file directly. Do not proceed with the skill body until done.
Parse arguments
Extract issue number and optional run ID from $ARGUMENTS:
$ARGUMENTS=""→ ISSUE=(none), RUN_ID=(none)$ARGUMENTS="42"→ ISSUE=42, RUN_ID=(none)$ARGUMENTS="42 --run 7"→ ISSUE=42, RUN_ID=7$ARGUMENTS="--run 7"→ ISSUE=(none), RUN_ID=7
If RUN_ID is present, forward it as --run-id to the devwatch submit-pr call.
Detect repo
Determine the target repository from the current working directory:
REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)
Pass --repo "$REPO" to every devwatch command to ensure the correct repo is targeted.
Checkout the correct branch
If ISSUE is present, verify the current branch belongs to that issue:
git branch --show-current
The branch name must start with fix/<ISSUE>-, feat/<ISSUE>-, refactor/<ISSUE>-, chore/<ISSUE>-, docs/<ISSUE>-, or ci-fix/<ISSUE>-.
If the current branch does not match, find and checkout the correct branch:
git branch -a | grep -E "(fix|feat|ci-fix)/<ISSUE>-"
Checkout the matching branch. If no matching branch exists, stop — tell the user no branch exists for issue #ISSUE.
If ISSUE is not present, stay on the current branch.
Prerequisites
Run /check-code-quality if not already done. Do not submit a PR that hasn't passed the quality gate.
Check the issue history for context (run devwatch issue-history --help for all options):
devwatch --repo "$REPO" issue-history <ISSUE>
Intelligence (what you decide)
-
Review the diff:
git diff --statandgit diff. Check: no secrets, no debug logs. -
Write a commit message: conventional prefix, explains the WHY.
-
Write a PR summary: what changed and how to verify.
-
Fold in the workflow's reviewer notes (PR body). Resolve the workflow id and read its accumulated step notes:
WORKFLOW_ID=$(devwatch --repo "$REPO" workflow-get --issue <ISSUE> | jq -r '.id') devwatch --repo "$REPO" get-report --workflow "$WORKFLOW_ID"get-reportprints a category-grouped digest (### Risks/### Decisions/### Follow-ups) assembled from the notes earlier agents recorded, or nothing when there are no notes. When the digest is non-empty and this issue opens a standalone PR (no epic ancestor — an epic member merges into the integration branch with no PR; see Member behaviour below), append it to your--summaryunder a## Reviewer notesheading so it lands in the PR body. Omit the section entirely when the digest is empty, and skip it on the epic-member merge path — the workflow ship PR carries the digest via/submit-epic-pr. The digest is earlier agents' prose, so the GitHub-writing rules in Execution below apply to it: strip banned tokens and personal data before embedding. -
Choose labels: area labels (
area:backend,area:frontend, etc.). Labels are best-effort — the CLI retries without them if they don't exist in the target repo.
Execution
-
Apply the GitHub-writing rules from the mandatory-reads block (banned tokens, no personal data, per-artifact skeletons) to every title, body, and comment below.
-
Emit the run report (advisory — a failed post must never fail the step). Write the fixed JSON skeleton, filling
noteswith PR facts reviewers should follow up on (follow_up) and any risk in this PR to watch (risk). Use an empty array ([]) when there is nothing worth recording. Post it beforesubmit-prbelow so the report exists when completion hooks fire.
cat > /tmp/devwatch-report-<ISSUE>.json <<'JSON'
{
"schema_version": 1,
"notes": [
{"category": "follow_up", "text": "<anything reviewers should follow up after merge>"},
{"category": "risk", "text": "<a risk in this PR reviewers should watch>"}
]
}
JSON
devwatch --repo "$REPO" agent-report \
--run-id <RUN_ID> \
--file /tmp/devwatch-report-<ISSUE>.json \
|| echo " agent-report failed (advisory) — continuing"
Fall back to --issue <ISSUE> --branch "$(git branch --show-current)" if RUN_ID is unavailable.
- Submit the PR:
devwatch --repo "$REPO" submit-pr \
--message "<your commit message>" \
--summary "<your PR summary>" \
--label "<label1>" --label "<label2>" \
--run-id <RUN_ID>
Omit --run-id if no RUN_ID was parsed from arguments.
The CLI handles everything deterministically: branch detection, commit, push, PR creation, sync.
PR body auto-close contract
The CLI prepends Closes #<issue> as the first line of the rendered PR body so GitHub auto-closes the linked issue on merge. Do not put Closes #N (or Fixes / Resolves variants) in --message — that lands in the PR title, where GitHub ignores it. Keep the magic word in the body, where the CLI puts it.
Workflow-rooted ship
When the current issue is the root of a workflow (i.e. the workflow's root_issue_number equals this issue), the dashboard's Submit Workflow button and the submit-workflow-pr action route to the ship-PR backend (devwatch submit-epic-pr <root> --workflow-id <id>), not a per-member PR. The routing is driven by workflows.root_issue_number on the backend — there is no "step 1 is the epic" heuristic, and the root need not carry the epic label: a one-member plain-issue workflow ships the same way as a multi-member epic (#2666). For a member of a workflow, /submit-pr performs the local merge into the integration branch as described in the framework's pipeline; only the final ship PR goes through submit-epic-pr.
Member behaviour
Every workflow runs the one integration-branch path (#2666): the member branch is merged locally into epic/<root>-<slug> and the member issue is closed immediately (short comment linking the merge commit). No per-member GitHub PR is opened. The ship PR runs CI once, for the whole integration branch.
This path skips gh pr create — only the ship PR opens later via submit-epic-pr (one PR from epic/<root>-<slug> to the base branch).
Boundary
This command does NOT merge the PR. Report the PR URL and stop.
When not to use it
- →When the PR is already merged
- →When code quality gates have not passed
- →When the branch name does not follow the specified pattern
Limitations
- →Does not merge the PR
- →Requires the branch name to follow a specific pattern
- →Requires code quality gates to pass
How it compares
This skill automates the PR submission process with integrated checks and contextual information, unlike manual PR creation that requires separate steps for validation and reporting.
Compared to similar skills
submit-pr side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| submit-pr (this skill) | 0 | 28d | Review | Intermediate |
| github-workflow-automation | 11 | 2mo | Review | Advanced |
| testing-workflow | 16 | 9mo | Review | Intermediate |
| github-actions-templates | 7 | 3mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
github-workflow-automation
ruvnet
Advanced GitHub Actions workflow automation with AI swarm coordination, intelligent CI/CD pipelines, and comprehensive repository management
testing-workflow
amo-tech-ai
Comprehensive testing workflow for E2E, integration, and unit tests. Use when testing applications layer-by-layer, validating user journeys, or running test suites.
github-actions-templates
wshobson
Create production-ready GitHub Actions workflows for automated testing, building, and deploying applications. Use when setting up CI/CD with GitHub Actions, automating development workflows, or creating reusable workflow templates.
glab
NikiforovAll
Expert guidance for using the GitLab CLI (glab) to manage GitLab issues, merge requests, CI/CD pipelines, repositories, and other GitLab operations from the command line. Use this skill when the user needs to interact with GitLab resources or perform GitLab workflows.
create-pr
n8n-io
Creates GitHub pull requests with properly formatted titles that pass the check-pr-title CI validation. Use when creating PRs, submitting changes for review, or when the user says /pr or asks to create a pull request.
gh-fix-ci
openai
Use when a user asks to debug or fix failing GitHub PR checks that run in GitHub Actions; use `gh` to inspect checks and logs, summarize failure context, draft a fix plan, and implement only after explicit approval. Treat external providers (for example Buildkite) as out of scope and report only the details URL.