# Create Pr Description

> Generate a PR description based on changes. If a repository/issue is provided, use its description to assess issue completeness.

- **Type:** Skill
- **Install:** `agentstack add skill-tomzx-agents-create-pr-description`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [tomzx](https://agentstack.voostack.com/s/tomzx)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [tomzx](https://github.com/tomzx)
- **Source:** https://github.com/tomzx/agents/tree/main/skills/create-pr-description

## Install

```sh
agentstack add skill-tomzx-agents-create-pr-description
```

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

## About

# Generate PR Description

Generates a structured PR description from the current branch's diff against its Graphite parent, optionally cross-referencing a GitHub issue to assess acceptance criteria coverage.

## Prerequisites

- `gt` (Graphite CLI) installed and authenticated in a git repository
- `gh` CLI authenticated (required only when `$1` and `$2` are provided)
- Current branch must have commits relative to its parent

> **Note:** This skill uses the Graphite CLI (`gt`) and diffs against the Graphite parent branch. For a `gh`-based workflow that diffs against the git merge base and creates the PR directly, use `/create-pr` instead.

### Skill attribution (GitHub)

Before returning the PR description, read [`github-post-attribution/SKILL.md`](../github-post-attribution/SKILL.md) and append the **Generated with** footer for `SKILL_DIR` = `create-pr-description` to the end of the description body. This footer travels with the description when the user posts it to GitHub via `gh pr create` or `gh pr edit`.

## Workflow

```
Compute diff (gt parent -> HEAD)
        |
        v
Issue provided? ($1 $2)
   /         \
 Yes           No
  |             |
  v             v
Fetch issue   Skip issue
details       lookup
  |             |
  v             |
Assess          |
acceptance      |
criteria        |
  |             |
  +------+------+
         |
         v
Generate PR description markdown
```

## Steps

1. Compute the diff:
   ```
   git diff $(gt parent)..HEAD
   ```
2. If `$1` (repository) and `$2` (issue number) are provided, fetch the issue:
   ```
   gt issue view $2 --repo $1
   ```
3. Resolve agents attribution per [`github-post-attribution/SKILL.md`](../github-post-attribution/SKILL.md): compute `SKILL_COMMIT`, `SKILL_SHORT_SHA`, `SKILL_FILE_URL`, and `{BASE}` for `SKILL_DIR` = `create-pr-description`.
4. Generate the PR description following the output format below, substituting the resolved `SKILL_FILE_URL` and `SKILL_SHORT_SHA` into the footer.
5. Return the result inside a markdown code block with each sentence on its own line. Do not line wrap the description; each paragraph/bullet should be a single long line.

## Output Format

```markdown
# What

# Why

# How to test

# Acceptance criteria covered

# References

- https://github.com/$1/issues/$2

---
Generated with [create-pr-description](SKILL_FILE_URL) (`SKILL_SHORT_SHA`)
```

Substitute `SKILL_FILE_URL` and `SKILL_SHORT_SHA` per [`github-post-attribution/SKILL.md`](../github-post-attribution/SKILL.md).

## Example Usage

**Scenario 1: PR without issue**
```
/create-pr-description
```
Diffs current branch vs parent, produces description with "To be filled by the user" in the References section.

**Scenario 2: PR linked to an issue**
```
/create-pr-description owner/myrepo 42
```
Fetches issue #42 from `owner/myrepo`, maps its acceptance criteria to the changes, and includes the issue link in References.

**Scenario 3: Partial implementation**
```
/create-pr-description owner/api-service 100
```
Issue has 5 acceptance criteria; this PR covers 3. "Acceptance criteria covered" lists only the 3 addressed and notes the remaining 2 are out of scope.

## Useful Commands Reference

| Command | Description |
|---|---|
| `git diff $(gt parent)..HEAD` | Diff current branch against its Graphite parent |
| `gt issue view  --repo ` | Fetch issue details via Graphite CLI |
| `gh issue view  --repo ` | Fetch issue details via gh CLI |

## Source & license

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

- **Author:** [tomzx](https://github.com/tomzx)
- **Source:** [tomzx/agents](https://github.com/tomzx/agents)
- **License:** MIT

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-tomzx-agents-create-pr-description
- Seller: https://agentstack.voostack.com/s/tomzx
- 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%.
