Generate pull request descriptions by comparing current branch with parent branch. Creates semantic commit-style PR titles and fills PR templates. Use when the user asks to generate PR description, prepare pull request, or create merge request description.
Generate a concise pull request description by analyzing git changes and using the project's PR template.
Language: Always generate PR titles and descriptions in English, regardless of the user's language or the language of commit messages.
Identify parent branch
git branch --show-currentmain; if absent, master (git show-ref --verify --quiet refs/heads/main || echo master)Analyze changes
git diff --stat <parent-branch>..HEADgit log --oneline <parent-branch>..HEADgit diff --name-status <parent-branch>..HEADGenerate semantic commit title
feat: - New featuresfix: - Bug fixesdocs: - Documentation changesstyle: - Code style changes (formatting, no logic change)refactor: - Code refactoringperf: - Performance improvementstest: - Adding or updating testschore: - Maintenance tasks (deps, config, etc.)<type>(<scope>): <short description>Load PR template
.github/pull_request_template.md first.gitlab/merge_request_template.mdtemplates/pull_request_template.md (relative to the skill directory)Build the change hierarchy — follow these rules strictly
Step A — Extract raw changes List every meaningful change from the diff and commit log (files modified, features added, bugs fixed, etc.). Do not group yet.
Step B — Group into themes
Assign each raw change to a theme. A theme maps to a functional area or concern, for example: Auth, API, UI, Tests, Config, Docs, DB, CI. One change belongs to exactly one theme. Use at most 6 themes; merge minor themes into the closest major one.
Step C — Decide the hierarchy level for each theme Apply the rule below to each theme independently:
| Number of distinct sub-changes in the theme | Structure to use | |---|---| | 1 (single, simple change) | Level-1 bullet only — no sub-bullets | | 2 or more distinct sub-changes | Level-1 bullet (theme label) + one Level-2 sub-bullet per distinct sub-change |
A "distinct sub-change" is a change that affects a different component, file group, or behavior within the same theme. Two commits that both touch the same component count as one sub-change.
Step D — Write the bullets
- **ThemeLabel:** one-line summary of what changed in this theme. - Sub-change description (one line).Step E — Validate before writing Re-read your draft and check:
Fill template
.md detected in the diff).*.test.* or *.spec.*, or paths under test/, __tests__/, tests/, or similar directories.Related tickets
PROJ-123, PROJ-456). Leave empty if none."tickets: NN-123, TB-456 or inline (e.g. NN-123, TB-456). Normalize to a trimmed list.getJiraIssue in the workspace MCP descriptors). If it is not available, tell the user explicitly that the Atlassian/Jira MCP is not connected and they should install and enable it if they want ticket rows with fetched summaries and correct Jira URLs. Still proceed with the rest of the PR; for "Related Issue(s)" use plain text keys only (e.g. - PROJ-123) or - 🚫 if they confirm there are no tickets.getJiraIssue with the appropriate cloudId and issueIdOrKey; resolve cloudId via MCP resources or tools such as getAccessibleAtlassianResources when needed, following each tool’s schema in the MCP folder).fullTicketUrl from the MCP response or the known Jira browse URL pattern for that site (must be a complete URL, not shortened).{label}.- [summary](fullTicketUrl).[label](url), never a bare URL or plain key.- PROJ-123, or a single line listing keys—do not invent browse URLs.- 🚫.Enforce 1000 character limit
Write file, confirm, execute
pr-description.md: line 1 = semantic title, line 2 = blank, line 3+ = the filled template body. This exact shape is required — the commands below split the file on it (head -1 for title, tail -n +3 for body).gh and jq are available: gh --version / jq --version. If either is missing, tell the user to install it and stop — both are required, there is no fallback.gh auth has sufficient scope: run gh auth status.
GITHUB_TOKEN (or GH_TOKEN) environment variable silently overrides gh's stored credentials, even when a properly-scoped account is already logged in. Check whether one is set (env | grep -i _TOKEN=); if so, also run env -u GITHUB_TOKEN -u GH_TOKEN gh auth status and compare.repo (shown as Token scopes: ... per account in the output). If the active account is missing it but another logged-in account has it, prefix every gh command for the rest of this step (existing-PR check, PATCH, POST) with env -u GITHUB_TOKEN -u GH_TOKEN.repo scope, tell the user to run gh auth refresh -h github.com -s repo (or log in with a token that has it) and stop.GraphQL: Could not resolve to a Repository with the name '...' (or a 403) from gh pr view / gh api is very often an auth/scope problem, not a wrong repo path — check gh auth status and env var overrides before assuming the owner/repo values are wrong.gh api? [Y/n]" — default Y, empty input proceeds.env -u ... from step 3 if one was needed): gh pr view --json number --jq .number 2>/dev/null
jq -n \
--rawfile body <(tail -n +3 pr-description.md) \
--arg title "$(head -1 pr-description.md)" \
'{title: $title, body: $body}' \
| gh api repos/{owner}/{repo}/pulls/<number> -X PATCH --input -
jq -n \
--rawfile body <(tail -n +3 pr-description.md) \
--arg title "$(head -1 pr-description.md)" \
--arg head "$(git branch --show-current)" \
--arg base "<parent-branch>" \
'{title: $title, body: $body, head: $head, base: $base}' \
| gh api repos/{owner}/{repo}/pulls -X POST --input -
{owner}/{repo} are literal — gh api resolves them from the repo detected in the current directory. PATCH cannot create a PR; POST cannot update an existing one — never substitute one for the other..html_url.pr-description.md.open <url>xdg-open <url>start <url>pr-description.md in place, report the error.See examples/checkout-flow.md (relative to this skill directory) for a fully worked example covering Steps A–E with a realistic multi-theme PR.
npx skills add Lichens-Innovation/generate-pr-description下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer