# Create Pr

> 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.

- **Type:** Skill
- **Install:** `agentstack add skill-makigjuro-cloudstack-ai-plugins-create-pr`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [makigjuro](https://agentstack.voostack.com/s/makigjuro)
- **Installs:** 0
- **Category:** [Cloud & Infrastructure](https://agentstack.voostack.com/c/cloud-infrastructure)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [makigjuro](https://github.com/makigjuro)
- **Source:** https://github.com/makigjuro/cloudstack-ai-plugins/tree/main/plugins/dev-workflow/skills/create-pr
- **Website:** https://github.com/makigjuro/cloudstack-ai-plugins#quick-start

## Install

```sh
agentstack add skill-makigjuro-cloudstack-ai-plugins-create-pr
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Create Pull Request

Create a pull request for the current branch with a structured description.

## Configuration

Read `cloudstack.json` from the project root at the start of execution. Extract relevant fields:
- `REPO_OWNER` / `REPO_NAME` = `repository.owner` / `repository.name` (default: detect from `git remote -v`)
- `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 `cloudstack.json` does not exist, auto-detect by scanning the project structure and parsing the GitHub remote URL.

## 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 | grep -oP 'src/\K[^/]+' | 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 using MCP.

## 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
- [ ] Unit tests pass
- [ ] Integration tests pass (if applicable)
- [ ] Frontend lint clean (if applicable)
- [ ] Frontend type-check clean (if applicable)
- [ ] Helm lint clean (if applicable)
- [ ] Terraform validate clean (if applicable)
- [ ] Architecture check passes
- [ ] {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 using MCP for structured creation:

```
mcp__github-mcp-server__create_pull_request(
  owner: "{REPO_OWNER}",
  repo: "{REPO_NAME}",
  title: "{title}",
  body: "{body}",
  head: "{branch-name}",
  base: "main"
)
```

## 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, in imperative mood ("Add user group assignments", not "Added").
- Use `Closes #{issue}` to auto-close the linked issue on merge.
- If the branch has many commits, suggest the user consider squashing before creating the PR.
- Report the PR URL when done.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [makigjuro](https://github.com/makigjuro)
- **Source:** [makigjuro/cloudstack-ai-plugins](https://github.com/makigjuro/cloudstack-ai-plugins)
- **License:** MIT
- **Homepage:** https://github.com/makigjuro/cloudstack-ai-plugins#quick-start

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-makigjuro-cloudstack-ai-plugins-create-pr
- Seller: https://agentstack.voostack.com/s/makigjuro
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
