AGENT SKILL

pr

Write a pull request for the current branch: a title, a summary of what changed and why, how to test it, and the criteria of the item when there is one. Then ask the owner to open it now or to keep only the text. Use when the owner says pr, pull request, open a PR or send it for review.

License 许可
MIT
所属仓库
lamtran8401/nook
最近更新
2026-10-27
Stars
★ 0
Forks
0

01 前言 Front Matter

name
pr
description
Write a pull request for the current branch: a title, a summary of what changed and why, how to test it, and the criteria of the item when there is one. Then ask the owner to open it now or to keep only the text. Use when the owner says pr, pull request, open a PR or send it for review.
allowed-tools
Bash(git status *), Bash(git log *), Bash(git diff *), Bash(git branch *), Bash(git rev-parse *), Bash(gh pr view *), Bash(gh pr list *), Bash(gh pr checks *), Bash(gh repo view *), Bash(gh auth status*), Bash(nook *), Read
argument-hint
[item id]
disable-model-invocation
true

03 SKILL.md 正文

Goal: a pull request that a reviewer understands in two minutes, from the right branch to the right base. The owner picks who opens it.

Order

  1. Check the branch: git branch --show-current. A protected branch (main, master, develop) stops here: say to make a branch first. git status --short with changes that are not committed stops here too: say what is left, and commit only when the owner asks.
  2. Find the base: the protected branch that the branch came from, or gh repo view --json defaultBranchRef.
  3. Read the change: git log --oneline <base>..HEAD and git diff --stat <base>...HEAD. With an item id, read nook item brief <id>, nook item ac list <id> and the walkthrough when it exists. When the brief names a pr: link, the PR exists: the new commits are fixes for the comments of the team. Ask the owner with AskUserQuestion to push them, then push, and stop.
  4. Write the title, 70 characters or fewer, in the words of the change. Write the body:
    • Summary: what changed and why, in two or three lines.
    • Changes: one line for each part, in plain words.
    • How to test: the commands or the steps.
    • Criteria (with an item): each met criterion with its evidence.
  5. Show the title and the body in one fenced block, ready to copy.
  6. Ask the owner with AskUserQuestion: "Open the PR from <branch> to <base> now? Type draft for a draft PR."
    • "Open the PR (Recommended)": push the branch and open the PR for review.
    • "Only the text": the owner opens the PR from the block of step 5. Report, and stop. When the owner gives the link, run nook item pr <id> <link>. When a check fails, the first option is "Open as a draft (Recommended)". When the remote is not on GitHub, ask nothing: gh cannot open it. The owner opens it from the block, and gives you the link for nook item pr.
  7. Check the account: gh auth status. When the remote belongs to another account than the one logged in, stop and ask the owner.
  8. Push the branch: git push -u origin <branch>. The settings ask the owner first; a refusal stops here, and the text stays in the chat.
  9. Open the pull request: gh pr create --base <base> --title "<title>" --body "<body>", with --draft for a draft. The settings ask the owner first.
  10. With an item, record the link: nook item pr <id> <link>. Report the link and what is left, such as a check that failed.

Gotchas

  • The answer "Open the PR" is the request to push. With no answer, push nothing.
  • Never force a push and never push a protected branch.
  • The body holds no secret, no token and no inner link that the reviewer cannot open.
  • A failing check is not hidden: open the pull request as a draft and name the check.
  • With no item, the summary comes from the commits and the diff only. Do not invent criteria.

04 同仓库更多 Skills

lamtran8401
lamtran8401/nook

yolo

Run an item alone from its state to the owner's accept: the lead runs the phases, records each guess, passes the plan gate with proceed, and stops at a stop rule. Use when the owner types /yolo with an id, a prompt, or nothing.

★ 0
lamtran8401
lamtran8401/nook

write-walkthrough

Write walkthrough.md, the explanation of finished work: what works now in plain words, the changed files, where to start reading, the key code, the met criteria, how to try it, the risks. It is the source of the Walkthrough tab of the web app. Use after /qa, or for a question about the code.

★ 0
lamtran8401
lamtran8401/nook

wiki-tidy

Find what is wrong in the wiki: broken links, pages with no index line, lines too near the code, stale epic pages, topics with no source, two pages on one topic, adjectives with no example. Fix the mechanical part after one yes; list the rest. Use when the owner says tidy the wiki, or after many pages changed.

★ 0
lamtran8401
lamtran8401/nook

wiki-merge

Merge related wiki pages into one complete page: the pages of the features of one process or epic become one page with the flow from end to end. The old pages move to the archive after the owner's yes, and their links point at the new page. Use when the owner says merge these pages, or when wiki-tidy finds pages on one topic.

★ 0
lamtran8401
lamtran8401/nook

wiki-ask

Answer a question from the wiki: the index first, then only the pages whose line matches, an answer in a few lines with a link to each page. Use when the owner asks what the wiki says, or asks why or how about a known topic. Not to add a page: wiki-add.

★ 0
lamtran8401
lamtran8401/nook

wiki-add

Keep the lesson of a source in the wiki: a page in the shelf business/ or tech/ with its main points, a real example for each, the gotchas and the link of the source; written after the owner's yes. Use when the owner says add this to the wiki, keep this, or gives a PRD, a ticket, notes or an article to keep.

★ 0