Create a pull request with a structured description linking to the GitHub issue. Use when ready to push and open a PR -- auto-detects changed services/layers and generates a structured PR body with test plan.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Create Pr?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/makigjuro-create-pr)
---
name: create-pr
description: Create a pull request with a structured description linking to the GitHub issue. Use when ready to push and open a PR -- auto-detects changed services/layers and generates a structured PR body with test plan.
allowed-tools: Bash, Read, Glob, Grep, mcp__github-mcp-server__create_pull_request
user-invocable: true
argument-hint: "[issue-number]"
---
# Create Pull Request
Create a pull request for the current branch with a structured description.
## Configuration
Read `blueprint.json` from the project root at the start of execution. Extract relevant fields:
- `SOLUTION` = `backend.solutionPath` (default: find `*.sln`)
- `FRONTEND_PATH` = `frontend.path` (default: `web`)
- `CHARTS_PATH` = `infrastructure.chartsPath` (default: `deploy/charts`)
- `TF_PATH` = `infrastructure.terraformPath` (default: `infra/terraform/modules`)
If `blueprint.json` does not exist, auto-detect by scanning the project structure. The `gh` CLI infers the repository from the git remote -- no owner/repo configuration is needed.
## Arguments
- `{issue}` -- GitHub issue number to link (optional). If not provided, attempt to extract from the branch name.
## Prerequisites
- You must be on a feature branch (not main)
- All changes should be committed (warn if working tree is dirty)
- Branch should have at least one commit ahead of main
## Process
1. **Gather context:**
- `git status` -- check for uncommitted changes, warn if dirty.
- `git log origin/main..HEAD --oneline` -- list all commits on this branch.
- `git diff origin/main...HEAD --stat` -- summary of changed files.
- Extract issue number from branch name or argument.
2. **Analyze changes:**
- Identify which layers were modified (Domain, Application, Infrastructure, Host, Frontend, Tests).
- Detect affected services by checking paths against known service directories:
```bash
git diff origin/main...HEAD --name-only | sed -nE 's#^src/([^/]+)/.*#\1#p' | sort -u
```
- Detect what was added vs changed vs removed from the diff stat.
- Check if documentation may need updating (new endpoints, entities, or events).
3. **Push and create PR:**
- Push the branch to origin with `-u` flag.
- Create the PR with `gh pr create`.
## PR Body Format
```markdown
## Summary
{1-3 bullet points describing what this PR does}
Closes #{issue-number}
## Affected Services
{List only services that were actually modified}
## Changes
- **Domain:** {changes or "No changes"}
- **Application:** {changes or "No changes"}
- **Infrastructure:** {changes or "No changes"}
- **Endpoints:** {changes or "No changes"}
- **Frontend:** {changes or "No changes"}
- **Tests:** {changes or "No changes"}
## Test Plan
{Include only the tracks matching what changed, with the concrete commands rendered from Configuration values:}
- [ ] Unit tests pass -- `dotnet test {SOLUTION} --filter "Category!=Integration"`
- [ ] Integration tests pass -- `dotnet test {SOLUTION} --filter "Category=Integration"` (requires Docker)
- [ ] Frontend lint + type-check clean -- `cd {FRONTEND_PATH} && npm run lint && npm run type-check`
- [ ] Helm charts lint clean -- `for c in {CHARTS_PATH}/*/; do helm lint "$c"; done`
- [ ] Terraform validates -- `terraform -chdir={TF_PATH} validate && terraform fmt -check -recursive {TF_PATH}`
- [ ] Architecture check passes -- `/dotnet-architect:check-architecture`
- [ ] {Any feature-specific manual verification steps}
Generated with [Claude Code](https://claude.com/claude-code)
```
## Commands
```bash
# Push branch
git push -u origin HEAD
# Create the PR (gh infers owner/repo from the git remote)
gh pr create --title "{title}" --body "{body}" --base main
```
If the GitHub MCP server is available in this session, you may use `mcp__github-mcp-server__create_pull_request` instead -- it returns typed JSON without output parsing.
## Error Handling
- **No commits ahead of main:** Warn the user -- there's nothing to PR.
- **Push fails (no upstream):** Use `git push -u origin HEAD` to set the upstream.
- **PR already exists:** Check with `gh pr list --head {branch}` and report the existing PR URL instead of creating a duplicate.
## Guidelines
- Keep the PR title under 70 characters: lowercase imperative, matching the primary commit ("add user group assignments", not "Added user group assignments").
- Use `Closes #{issue}` to auto-close the linked issue on merge.
- Report the PR URL when done.