pr
Use when opening a pull request for a jj revision, including pushing it first (/pr)
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 10
- Forks
- 0
01 前言 Front Matter
- name
- pr
- description
- Use when opening a pull request for a jj revision, including pushing it first (/pr)
- allowed-tools
- [ "Bash(jj diff *)", "Bash(jj log *)", "Bash(jj show *)", "Bash(jj bookmark list *)" ]
- argument-hint
- <revision> [ready|web]
03 SKILL.md 正文
Create Pull Request
Create a pull request using gh for a specified revision.
Arguments
$ARGUMENTS
The first word is the revision — a bookmark, change ID, revset, or commit hash. The second is optional:
ready: creates a ready-for-review PR instead of draftweb: opens a prepopulated PR in the browser for manual editing instead of creating it directly
When the argument is prose instead ("open a PR for the top two commits, ready for review"), read it as instructions and work out the revision yourself rather than treating its first word as one. Ask when that leaves the revision ambiguous.
A revision is required either way, and gets resolved to a bookmark for the
PR. Every <revision> below means the one you resolved here.
Process
- Gather context for the PR:
- Run
jj log -r '<revision>' --no-graphto check for existing bookmarks - Run
jj log -r trunk..<revision>to list commits between trunk and the revision - Run
jj diff --from trunk --to <revision> --statto review all changes
- Run
- Push revision and get bookmark name:
- If revision has a remote-tracked bookmark:
jj git push --bookmark <name> - If revision has a local-only bookmark (no
@origin): push withjj git push --named <name>=<revision>(pushes and auto-tracks) - If revision has no bookmark:
- Using all available context — the current session (what was discussed
and why), the full set of commits from trunk to the revision, and the
diff — generate a short kebab-case bookmark name that summarizes the
overall PR purpose:
- Prefix with
alpha/(e.g.,alpha/fix-widget-layout) - Lowercase, words joined by hyphens
- Max ~50 chars (excluding prefix), truncate at a word boundary
- Only alphanumeric and hyphens; no leading/trailing/double hyphens
- Prefix with
- If a good name was generated, check
jj bookmark listto ensure it's not taken (append-2etc. if it is), then push withjj git push --named <generated-name>=<revision> - If there isn't enough context to produce a meaningful name,
fall back to
jj git push -c <revision>
- Using all available context — the current session (what was discussed
and why), the full set of commits from trunk to the revision, and the
diff — generate a short kebab-case bookmark name that summarizes the
overall PR purpose:
- Retrieve the bookmark name from the output
- If revision has a remote-tracked bookmark:
- Consider whether the pending changes should be organized into smaller, easier
to review commits. If so, use
jj splitorjj squashto reorganize before proceeding. - Check for .github PR templates and follow them. For checklist items that do
not apply, use strikethrough:
- ~~Irrelevant item~~ - Invoke the
technical-writingskill before drafting any prose. - Generate a PR title summarizing all commits in the changeset (not just the most recent). The title reflects the overall change, not individual commits.
- Draft the PR summary: one to three sentences of prose on why the change
was made and its impact. Three is a ceiling, not a target — one sentence a
reviewer can't reconstruct from the diff beats three that pad around it. No
headers or bullet lists unless a repository template requires them. Include
only an "Assisted-by" footer for attribution, no "Generated with Claude
Code".
- Lead with user-facing impact and the tradeoff a reviewer would question.
- Say nothing a reader gets from the diff or the file list. No "added function X" or "modified file Y".
- Link related context found in the session — "Depends on #123", "Closes #456", a Slack permalink. Link lines don't count toward the budget.
- Never wrap commit SHAs or PR/issue numbers in backticks—GitHub
auto-links raw
a1b2c3dand#123but backticks prevent it - Do not hard-wrap prose with manual newlines; GitHub wraps Markdown itself, so they render as awkward mid-sentence breaks
- Delete pass before creating the PR: cut every sentence that summarizes the diff, restates the title, or exists to look thorough. If one sentence survives, ship one.
- Code review: Review the diff from trunk to the revision before opening the
PR. Fix anything that breaks correctness; note nits for later. Read
jj diff --git --from trunk --to <revision>rather than the working directory, which may be on a different revision.--gitgives a standard unified diff with@@hunk headers; the default color-words format prints two line-number columns (old, then new) and shows..in the old column for added lines, which is easy to misread when anchoringfile:line. - Create the PR:
gh pr create --head <bookmark-name> --title "<title>"using a HEREDOC to pass the body.- If
webwas specified: add--webflag (without--draft— they're incompatible) to open prepopulated PR in browser for manual editing, then stop (skip remaining steps) - If
readywas specified: create directly without--draft - Otherwise: add
--draftflag
- If
- If a Jira card is detected, transition it to "In Review":
- Check workspace name or bookmark for pattern like
PROJ-123(e.g.,LDE-488) - If found:
acli jira workitem transition --key <KEY> --status "In Review" - If not found, skip this step silently
- Check workspace name or bookmark for pattern like
- Return the PR URL
04 同仓库更多 Skills
zoekt
Use when searching code across repositories — prefer zoekt over grep/ripgrep for indexed code search. Covers indexing repos, search syntax, and query patterns.
writing-for-accessibility
Use when writing documentation, alt text, diagrams, or any content that should be accessible to people with disabilities. Covers alt text, color contrast, inclusive language, and accessible visuals. Also use when reviewing documents for accessibility.
writing-error-messages
Use when writing, reviewing, or improving error messages in code, CLI tools, APIs, or UIs. Covers identifying the cause, explaining the fix, and setting the right tone. Also use when error messages are vague, unactionable, or confusing.
working-in-the-open
Use when making design decisions during implementation — routes rationale to the right venue (commits, task comments, code comments, or documentation) based on how durable the context needs to be
web-standards
Use when writing or reviewing HTML, CSS, or browser JavaScript — covers semantic markup, native platform features over libraries, Baseline browser support, accessibility and APCA contrast, and optional validation with vnu, axe, and Lighthouse
web-design
Use when designing or building web UI, frontends, or styling — covers personal web design preferences, fluid layout, and Alpine.js