Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

pr-design-doc

БесплатноБез исполняемых скриптовНе проверен

For a non-trivial pull request, write a self-contained HTML design doc under the temporary `.pr/` directory and link a visibility-appropriate preview in the…

OpenHandsот OpenHands★ 1 439 звёзд на GitHub

Об этом скилле

pr-design-doc - a reviewable design doc for a non-trivial PR

A diff shows what changed line by line. It does not show the design: the shape of the change, the API before and after, and why this approach. Reviewers reconstruct that by hand, slowly. The scarce resource is the maintainer's attention and trust budget - not the agent's effort. Spend extra effort to hand them one self-contained HTML page that conveys the big picture and the before → after core difference, with every claim clickable back to the real code, then link it from the PR description.

This is the same craft as a "show me this change" explainer, aimed at one job: making a non-trivial PR easy to review.

When to use it

  • Opening or updating a non-trivial PR: new/changed public API, a new module or subsystem, a behavior change in core logic, a migration, or anything a reviewer can't fully judge from the diff in a couple of minutes.
  • Skip it for trivial PRs - a typo, a one-line guard, a dependency bump, a docs tweak, a simple bug fix. A design doc adds more to review. Use judgment; if the diff is the explanation, don't add a page.

The .pr/ workflow

Use the temporary .pr/ directory for PR-only artifacts. Before relying on automatic cleanup, verify how the target repository removes .pr/ from main.

  • This repository: .pr/ stays on main after merge until the next release PR removes it (.github/workflows/prepare-release.yml). Do not open a separate cleanup PR.
  • Repository without verified cleanup automation: remove .pr/ manually before merge.

The design doc is a temporary review aid, not project documentation. Keep the essential design summary in the PR description: intent, important before/after behavior or API shape, compatibility, risk, and code references. Use commit-pinned document links so cleanup does not break access.

Workflow

  1. Check out and verify the PR head. Do not write or commit the design doc from the base branch or an unrelated checkout. Start with a clean worktree, then inspect and check out the PR:

    gh pr view <n> --json title,body,url,baseRefName,baseRefOid,headRefName,headRefOid,headRepository,headRepositoryOwner,isCrossRepository,files,additions,deletions
    gh pr checkout <n>
    git rev-parse HEAD
    gh pr view <n> --json headRefOid --jq .headRefOid
    

    The final two SHAs must match before you continue. If they do not, stop and fix the checkout. Compute the merge-base SHA with git merge-base <baseRefOid> <headRefOid>. Group changed files by area and keep both the merge-base SHA and head SHA for source links.

  2. Read both sides of each logical file. Compare git show <merge-base-sha>:<path> with the verified head. Capture the function-level behavioral difference - what the code did vs does now.

    • new file → no "before"; one "after" diagram + a line on the role it adds.
    • deleted file → "before" diagram + who/what takes over.
    • edited file → a before/after pair, with the delta highlighted.
  3. Classify each file. Logic change (behavior moved) → draw before/after. Mechanical change (rename, constant, config, import move) → a one-line before → after row, no diagram. Don't dilute the signal by drawing mechanical edits.

  4. If the change is an API change, lead with the API. Show the signature/schema/type before and after side by side (function signature, endpoint + payload, config field, event shape). Name the compatibility impact plainly: additive, breaking, or behind a flag.

  5. Find the cross-file story. If one call chain threads several files, draw a single overview before/after at the top; per-file cards drill in.

  6. Build the page per references/html-craft.md - one self-contained, offline, editorial HTML file with hand-drawn SVG figures. Save it to the repo's .pr/ directory, e.g. .pr/design.html (or .pr/<topic>.html). Before writing, reject a symlink at .pr or at the exact output path; never follow a branch-controlled symlink outside the worktree.

    test ! -L .pr && test ! -L .pr/design.html
    mkdir -p .pr
    
  7. Commit under .pr/, push to the verified PR head, and link it. Confirm that the push remote resolves to headRepository.nameWithOwner; never push the artifact to the base repository's default branch.

    git add .pr/design.html
    git commit -m "docs(.pr): design doc for <PR topic>"
    git push <head-repo-remote> HEAD:<headRefName>
    git rev-parse HEAD
    

    Use the resulting full SHA as <doc-commit-sha> in document links. Refresh the document and its link when substantive changes affect the design; a cleanup-only commit does not need a new link. Query the base repository's visibility before choosing the link:

    gh repo view <base-owner>/<base-repo> --json visibility,url
    
    • Public repository: add an
Полный SKILL.md на GitHub

Установить pr-design-doc в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/html-craft.md

FAQ

Что делает скилл pr-design-doc?

For a non-trivial pull request, write a self-contained HTML design doc under the temporary `.pr/` directory and link a visibility-appropriate preview in the PR description, so maintainers grasp the proposal at a glance - code/API design, and the before/after of the change, grounded to real code. Use when opening or updating a non-trivial PR, or when the user says "add a design doc", "document this PR for reviewers", "show the before/after", "make the design reviewable", or "write the .pr/ page".

Как установить скилл pr-design-doc?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл pr-design-doc запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить pr-design-doc с