AgentSkillsCN

pr-desc

根据当前分支上下文更新 PR 描述

SKILL.md
--- frontmatter
name: pr-desc
description: Update PR description from current branch context
disable-model-invocation: true
allowed-tools:
  - Bash(git *)
  - Bash(gh *)
  - Bash(python *)

Update PR Description

!read references/usage.md

Arguments

This skill accepts an optional argument with additional instructions for the description.

Example: /pr-desc include a ## Usage section showing how to use each skill

If provided, incorporate these instructions into the description format below.

Gather Context

Run the gather script:

bash
python /Users/salim/.claude/skills/pr-desc/scripts/gather_context.py

Preconditions

Check these in the JSON output BEFORE proceeding:

  1. PR must exist: If pr_number is null, STOP and say: "Error: No PR exists for this branch. Use /pr to create one first."

Execution

Update the PR body:

bash
python /Users/salim/.claude/skills/pr-desc/scripts/update_description.py --body "<new body>"

Body Format

Use this structure as a base:

code
## Summary

- <bullet 1: main change, start with verb>
- <bullet 2: supporting change or context>
- <optional bullet 3-4 if needed>

If user provided additional instructions, add the requested sections after ## Summary.

Rules:

  • 2-4 bullets only
  • Each bullet starts with a verb (Add, Fix, Update, Remove, etc.)
  • Focus on WHAT and WHY, not HOW
  • No file paths unless the file itself is the feature
  • No implementation details
  • Derive content from commits and diff, not the old body
  • If user requested additional sections, add them after Summary
  • User instructions override the default format when they conflict

Output

After updating, output:

code
Updated PR #<number> description
<url>