Update PR Title Skill
Updates the current PR's title based on analysis of the changes.
Usage
Invoke with /update-pr-title or /update-pr-title <PR-number>.
Workflow
- •Get PR info: Run
gh pr viewto get the current PR (or specified PR number) - •Get diff: Run
gh pr diffto see the changes - •Analyze: Review the diff to understand what changed
- •Generate title: Create a conventional commit-style title:
- •
feat(scope): descriptionfor new features - •
fix(scope): descriptionfor bug fixes - •
refactor(scope): descriptionfor refactoring - •
docs(scope): descriptionfor documentation - •
chore(scope): descriptionfor maintenance
- •
- •Update: Run
gh pr edit --title "new title"to update the PR
Execution
Run autonomously without user confirmation. Execute all steps and report the result.
Step 1: Get PR Information
bash
gh pr view --json number,title,headRefName
If a PR number was provided as an argument, use:
bash
gh pr view <PR-number> --json number,title,headRefName
Step 2: Get the Diff
bash
gh pr diff
Step 3: Analyze and Update
After analyzing the diff:
- •Determine the primary type of change (feat/fix/refactor/docs/chore)
- •Identify the scope (affected area/package)
- •Write a concise description of the change
- •Update the PR:
bash
gh pr edit --title "type(scope): description"
Output
Report the old title and new title after updating.