pr-workflow
Use this skill when asked to create or update a pull request (PR). It ensures all PRs follow the repository's established templates and standards. Handles both new PR creation and updating existing PRs with new commits, title changes, or description updates.
- License 许可
- MIT
- 最近更新
- 2026-09-20
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- pr-workflow
- description
- Use this skill when asked to create or update a pull request (PR). It ensures all PRs follow the repository's established templates and standards. Handles both new PR creation and updating existing PRs with new commits, title changes, or description updates.
03 SKILL.md 正文
PR Workflow
This skill guides the creation and maintenance of high-quality Pull Requests that adhere to the repository's standards. Use it to create new PRs or update existing ones with new commits, title changes, or description updates.
CRITICAL: Tool Requirements
ALWAYS use gh (GitHub CLI) for ALL GitHub operations.
- Use
gh pr create,gh pr edit,gh pr list,gh pr view - Use
gh apifor custom GitHub API calls - NEVER use
gitcommands for GitHub-specific operations (creating PRs, managing PRs)
The gh CLI is the official GitHub tool and provides the best integration, error handling, and user experience.
Workflow
Follow these steps to create a Pull Request:
1. Branch Management
CRITICAL: Do NOT work on master.
git branch --show-current
If current branch is master, create and switch:
git checkout -b <new-branch-name>
2. Commit Changes
Ensure all changes are committed.
git status
If there are uncommitted changes:
- Use the
commit-workflowskill. - Ensure proper conventional commit format with
WHYin the message.
3. Locate and Read PR Template
Search for:
.github/pull_request_template.md.github/PULL_REQUEST_TEMPLATE.md.github/PULL_REQUEST_TEMPLATE/
If multiple templates exist, select the most appropriate one (or ask the user).
Read the template content.
4. Draft PR Description
Strictly follow the template structure.
- Headings: Keep all headings.
- Checklists: Review each item. Mark with
[x]if completed. If an item is not applicable, leave it unchecked or mark as[ ](depending on the template's instructions) or remove it if the template allows flexibility (but prefer keeping it unchecked for transparency). - Content: Fill in the sections with clear, concise summaries of your changes. Remove the sections that are not relevant instead of leaving them blank, unless the template specifies otherwise.
- Related Issues: Link any issues fixed or related to this PR (e.g.,
Fixes #123). - JIRA Tickets: When available, include full links in the form
https://<yourorg>.atlassian.net/browse/<ticket code>.
5. Push Branch
CRITICAL: Verify branch is NOT master.
Push the current branch to the remote repository.
git branch --show-current
git push -u origin HEAD
6. Create or Update PR
First, check if a PR already exists for the current branch:
gh pr list --head "$(git branch --show-current)" --state open
- If an open PR exists for this branch, update it (push commits + edit title/body if needed).
- If no PR exists, create a new one.
6a. Title Rules
If a Jira ticket exists, the PR title MUST be: <TICKET-CODE>: <short summary>
Example: PROJ-225: add FetchButton with multi-provider support
Ticket code rules:
- Must match
^[A-Z]+-\d+$(uppercase project key, hyphen, number). - If the branch contains a ticket in lowercase (e.g.
proj-44), usePROJ-44in the PR title.
Short summary rules:
- 3–8 words (aim for ~50 chars max).
- Start with an imperative verb: Add, Fix, Update, Refactor, Remove, Document.
- Describe the net change, not the process.
- Do not include extra metadata like
docs(...), branch name, “analysis”, “plan”, etc. - Do not list multiple items separated by commas - pick the primary outcome.
If no ticket exists, fall back to Conventional Commits: <type>(<scope>): <short summary>
Example: docs(menu): Add specs and rollout notes
6b. How to get a good title
- Get the ticket code from the branch name:
git branch --show-current
- Review all commits on the branch relative to the base branch and write a short title for the combined intent:
git log --oneline --no-merges origin/master..HEAD
6c. Creating a New PR
Write description to a temporary file, then:
gh pr create \
--title "<TICKET-CODE>: <short summary>" \
--body-file <temp_file_path>
6d. Updating an Existing PR
Identify the PR number (from gh pr list or gh pr view) and run:
gh pr edit <pr-number> \
--title "<TICKET-CODE>: <short summary>" \
--body-file <temp_file_path>
Afterwards, remove the temporary file:
rm <temp_file_path>
Principles
- Compliance: Never ignore the PR template. It exists for a reason.
- Completeness: Fill out all relevant sections.
- Accuracy: Don't check boxes for tasks you haven't done.
- Idempotence: Prefer updating an existing PR for the same branch over creating a new one.
04 同仓库更多 Skills
yes-no
Answer the user's question with a yes or no, optionally followed by a short explanation when the model sees fit. Use when the user types "/yes-no", asks a yes/no question and wants a decisive answer, or says "just yes or no".
sonar-workflow
Fix SonarQube code quality issues for a pull request. Auto-fixes trivial issues (formatting, unused imports) and requests approval for complex issues (security, bugs). Integrates with commit-workflow and pr-workflow skills.
short-answer
Answer the user's question as concisely as possible, a direct, to-the-point response with no preamble, filler, or unnecessary elaboration. Use when the user types "/short-answer", asks for a brief/short/concise/TL;DR answer, or says "just the answer".
redash
Query a Redash instance over its REST API , list data sources and saved queries, read a saved query's SQL, run it, or run ad-hoc read-only SQL and get the rows back. Use when the user asks about Redash, a Redash query/dashboard/link, "run that query", "what does query 1234 return", or wants numbers out of an analytics data source rather than the application DB.
prod-db-postgres
暂无简介
prod-db-mysql-bastion
暂无简介