Writing issues and prs

From liuchengxu/dotfiles · View interactive version

Writing issues and prs is an AI agent skill from the GitHub repository liuchengxu/dotfiles. Draft or revise GitHub issues, PR bodies, and review replies from established facts — "write the PR description", "open an issue for this", "reply to this review comment". Does not authorize posting, triage tickets, or perform technical review.

How to use this skill

Skill file

Writing Issues and PRs

Write for a maintainer who was not in the session. State why the work exists,

the intended result, and the evidence. Describe the final state, not the

journey. Drafting does not authorize posting, creating an issue or PR, or

applying labels.

Structure

  1. An explicit user request wins.
  2. Then the repository's template. Before drafting, look on the default branch

in .github/ISSUE_TEMPLATE/ for issues, and in the root, docs/,

.github/, and .github/PULL_REQUEST_TEMPLATE/ for PRs. Fill its sections

and keep its required checklist items. A CLI body flag does not fill the

template for you.

  1. Otherwise, a PR uses ## Why, ## What, and ## How (below). An issue is

prose, with bold labels only where distinct concerns would hide.

Replace every template prompt with content. Never leave an empty section, a

None line, or N/A. Omit a section that asks nothing of the reader.

PR sections

trigger. Not the implementation.

non-obvious choice was made. Not a file list or a narration of the diff.

deployment order, rollback limit, pre-merge step. Show before and after

where a reader would otherwise guess. Omit it when the change asks nothing.

Add ## Verification only for material evidence that CI does not show, or for

an open gap. Add ## Scope and non-goals only when an exclusion or an

unchanged guarantee could mislead the reviewer.

A tiny single-purpose PR can be one short paragraph that answers the same

questions. A small file count alone does not qualify it.

For a trust, protocol, schema, signing, validation, or role change, say who

owns the decision, what is trusted before and after, what validation order or

acceptance behavior changes, what stays unproven and who owns it, and which

negative or before-and-after case shows the new guarantee.

Temporary changes

For a workaround, mitigation, or other short-term fix, in an issue or a PR,

say that it is temporary and state its lifecycle:

dependency version, or a date. If no trigger exists yet, say so; do not

imply the fix is permanent.

no longer needed.

Mark it in the code too, with a comment that links the retirement issue.

Issue content

Include only what changes the implementation or review:

when done; what stays unproven.

required docs, compatibility, or migration result.

Intent

Every PR states the problem or value and the intended outcome, even a tiny

one, a dependency bump, or a generated change. Links support the body; "see

issue" does not replace it.

implementation, not an unstated goal. If intent is unknown, ask.

maintenance gain or a documented near-term consumer justifies a refactor; a

hypothetical consumer does not.

implements. Name work outside it. If a needed ADR is missing, say so; do not

write one unasked. In a one-commit-per-PR stack, put the same mapping in the

commit message.

and its evidence.

Shape

is independent if it protects a different invariant, has separate evidence,

or could be its own PR. Fold a consequence into the bullet it explains.

splitting the PR.

repeat links or order that the stack shows. Explain a dependency only when it

changes the review. After a rename anywhere in the stack, update every body.

Evidence

Check every material claim before posting: what justifies the PR, explains a

risk, names a dependency conflict, says behavior is preserved, or says

something was verified.

PR, or user workflow.

changes (cargo tree, cargo metadata, the resolver error). Name the exact

conflicting paths when the graph proves them.

behavior-preserving".

If the evidence shows only a new guarantee, describe the guarantee.

publish inputs, reproduction, or witness. Use the repository's private

security process. If none is known, stop and ask.

model reviews, verdicts, or counts; state the finding itself.

statement. When the cause is unknown, say what is known.

Voice

failure that happened. Drop "This PR aims to", "In order to", "simply",

"robust".

session link.

force-push, rebuild the body from the current diff.

Review replies

Reply in the comment's thread, not as a top-level comment:

gh api --method POST \
  repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies \
  -f body='{reply text}'

Say what changed and where, or why nothing changed. Do not re-argue a point the

new diff settles. Show the reply to the user and get approval before posting.

Before delivery

session. The Stand alone section of writing-docs covers reference closure.

placeholders, and package names such as @types/node in backticks.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.