# Jj Update Pr

> Updates existing GitHub pull request descriptions with AI-generated content based on the current diff. Use when the user wants to update a PR description, refresh PR content, or sync PR with latest changes.

- **Type:** Skill
- **Install:** `agentstack add skill-hotthoughts-jj-skills-jj-update-pr`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [HotThoughts](https://agentstack.voostack.com/s/hotthoughts)
- **Installs:** 0
- **Category:** [Developer Tools](https://agentstack.voostack.com/c/developer-tools)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [HotThoughts](https://github.com/HotThoughts)
- **Source:** https://github.com/HotThoughts/jj-skills/tree/main/skills/jj-update-pr

## Install

```sh
agentstack add skill-hotthoughts-jj-skills-jj-update-pr
```

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

## About

# Update GitHub PR Description

This skill enables updating existing pull request descriptions with fresh AI-generated content based on the current state of the change.

## Permission Requirements

**CRITICAL**: This workflow requires `jj` and `gh` CLI access with authentication. Always use:

```
required_permissions: ["all"]
```

## Workflow

When the user asks to update a PR description (e.g., "update the PR", "refresh PR description", "sync PR with changes"):

### Step 1: Identify the Change

Default to `@-` (parent of working copy) unless the user specifies a different change.

### Step 2: Get the Branch Name

```bash
jj log -r  -T 'bookmarks' --no-graph
```

### Step 3: Verify PR Exists

```bash
gh pr view 
```

If no PR exists, suggest using the `jj-create-pr` workflow instead.

### Step 4: Get Updated Title

Extract the first line of the change's description:

```bash
jj log -r  -T description --no-graph | head -1
```

If the description is empty, run the **Description Check Protocol** (see `jj-workflow` skill) to generate a conventional commit description from the diff, then re-extract the title:

1. Check `jj status` — if `@` is a placeholder (no modified files), evaluate `@-` carefully: verify it has a non-empty diff AND no trunk bookmarks (`main`, `master`, `main@origin`) before targeting it. If `@-` carries a trunk bookmark, ask the user which change to use.
2. Analyze `jj diff -r ` to understand what changed
3. Determine the conventional commit type (feat/fix/refactor/perf/docs/chore/test) from the diff
4. Set the description: `jj describe -r  -m "type: concise description"` (or use `--stdin` if preserving an existing body — see jj-workflow protocol)
5. Re-run the title extraction command to get the exact first line

### Step 5: Analyze the Current Diff

```bash
jj diff -r 
```

### Step 6: Generate Updated PR Description

Based on the diff, write a fresh PR description:

- **Summary**: One sentence describing the overall change
- **Changes**: Bullet points of key modifications
- Keep it brief and focused on "what" and "why"

Example format:
```markdown
## Summary
Brief description of what this PR accomplishes.

## Changes
- Added X to handle Y
- Refactored Z for better performance
- Fixed bug where A caused B
```

### Step 7: Update the PR

Update both title and body:

```bash
gh pr edit  --title "" --body ""
```

Or update body only:

```bash
gh pr edit  --body ""
```

## Complete Example

User: "Update the PR for @-"

```bash
# 1. Get branch name
jj log -r @- -T 'bookmarks' --no-graph
# Output: "push-abc123"

# 2. Verify PR exists
gh pr view push-abc123
# (shows PR details)

# 3. Get updated title (generates one from diff if description is empty — see Step 4)
jj log -r @- -T description --no-graph | head -1
# Output: "feat: add user authentication"
# If empty: run the Description Check Protocol to generate one, then re-extract

# 4. Get current diff
jj diff -r @-
# (analyze the output)

# 5. Update PR with new description
gh pr edit push-abc123 \
  --title "feat: add user authentication" \
  --body "## Summary
Adds JWT-based user authentication to the API.

## Changes
- Added auth middleware for token validation
- Created login and register endpoints
- Added user model with password hashing
- Updated API documentation"
```

## When to Use

- After making additional changes to a commit that already has a PR
- When the original PR description is outdated or incomplete
- After rebasing or squashing changes
- When the user asks to "refresh" or "update" the PR

## Error Handling

- If no bookmark/branch exists on the change, the PR may not be findable—ask user for PR number
- If PR doesn't exist, suggest creating one with `jj-create-pr` workflow
- If update fails, show the error and suggest checking PR status with `gh pr view`

## Source & license

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

- **Author:** [HotThoughts](https://github.com/HotThoughts)
- **Source:** [HotThoughts/jj-skills](https://github.com/HotThoughts/jj-skills)
- **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-hotthoughts-jj-skills-jj-update-pr
- Seller: https://agentstack.voostack.com/s/hotthoughts
- 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%.
