|
| 1 | +--- |
| 2 | +name: pr-description |
| 3 | +description: Use when drafting, proposing, creating, or editing prose for a dotnet/fsharp GitHub PR or issue — body, title, comment, review summary, edits — including bare asks like "open a PR", "ship this", "write up what I did", "summarise the change", "reply on the PR", "edit the issue body", "gh pr create", "gh pr comment", "gh pr edit --body", "gh issue comment", "gh pr review --body". Primary use case is PR descriptions; same rules apply to PR/issue comments and review summaries. Not for labels, reviewers, merging, or code-review findings (just the prose write-up of them). |
| 4 | +--- |
| 5 | + |
| 6 | +# Authoring GitHub Prose for dotnet/fsharp |
| 7 | + |
| 8 | +Reviewers can already see the Files tab, the commit log, and the issue thread. Say what behavior changed and why, in as few words as possible. |
| 9 | + |
| 10 | +## Rules |
| 11 | + |
| 12 | +Rules 1, 2, 4, 5 are defaults; if the user insists, push back once then comply. Rule 3 is non-negotiable — `-b "..."` ships broken markdown (see PR #19866). |
| 13 | + |
| 14 | +1. **No change inventory.** No file/module/method/test lists. No `## Changes`/`## Implementation` section. Mention an identifier only when it *is* the user-visible behavior. Whatever the reader already has (Files tab for PRs, commit log for follow-up comments, issue history for issue edits) — don't re-list it. |
| 15 | +2. **No LLM slop, no justification scaffolding.** No emoji headers, no "TL;DR" above a 3-line body, no Motivation/Background/Approach/Testing sections, no re-stating the title or the comment you're replying to. No "matching the X norm", no "preventing the Y failure (PR #ZZZZ)", no stats, no links to past PRs as proof. The diff is the proof. |
| 16 | +3. **Body via `--body-file`, built without shell expansion.** Write the file with your file-creation/edit tool (it writes bytes verbatim — no `$`/backtick evaluation, no delimiter collisions, OS-agnostic). Never `-b "..."` / `--body "..."` — backticks and `$` get shell-evaluated and the render breaks. If you build the file in a shell, use a pwsh verbatim here-string `@'...'@` (cross-platform; single-quoted is mandatory). Applies to `gh pr create/edit/comment/review`, `gh issue create/edit/comment`. |
| 17 | +4. **`Fixes #N` to close issues.** Use only when the PR actually closes #N (auto-closes on merge). It is the highest-value line in most PR bodies — never omit it when valid. No "Related to" / speculative links. Preserve existing trailers (`Co-authored-by:`, `Signed-off-by:`, `Reverts #N`); don't invent them. |
| 18 | +5. **Title:** imperative, ≤72 chars, no trailing period, no `fix:`/`feat:` prefix. Name the behavior, not the file. A specific title lets the body shrink to `Fixes #N` + one sentence. |
| 19 | + |
| 20 | +## PR-body shapes (pick the smallest that carries the signal) |
| 21 | + |
| 22 | +**One-liner** for bumps / mechanical fixes: |
| 23 | +~~~ |
| 24 | +Update .NET SDK from 10.0.202 to 10.0.204. |
| 25 | +~~~ |
| 26 | + |
| 27 | +**Title carries the construct + issue link** — preferred when the title is specific: |
| 28 | +~~~ |
| 29 | +Fixes #18009 |
| 30 | +
|
| 31 | +Wrong colorization when a qualified type name with generic parameters |
| 32 | +is used in a static member access expression. |
| 33 | +~~~ |
| 34 | + |
| 35 | +**Issue link + 1-sentence why** — the most common non-trivial shape: |
| 36 | +~~~ |
| 37 | +Fixes #19751 |
| 38 | +
|
| 39 | +`--refout` MVIDs were unstable because hashing relied on per-process |
| 40 | +string randomization. Switched to a deterministic hash. |
| 41 | +~~~ |
| 42 | + |
| 43 | +**Before/After code block** — when prose loses information; ≤15 lines, language tag: |
| 44 | +~~~markdown |
| 45 | +Fixes #15803 |
| 46 | + |
| 47 | +```fsharp |
| 48 | +let f (x: int) = x <- 1 |
| 49 | +// before: FS0027 suggested `let mutable x = expression` (illegal for parameters) |
| 50 | +// after: FS0027 suggests `let mutable x = x` shadow or `byref<_>` |
| 51 | +``` |
| 52 | +~~~ |
| 53 | + |
| 54 | +**Behavior-changes bullet list** — for genuinely multi-behavior PRs. 3–5 bullets naming *behaviors*, never files/modules; if bullets map 1:1 to files, collapse to prose or split the PR: |
| 55 | +~~~ |
| 56 | +Fixes #19710 |
| 57 | +Fixes #19720 |
| 58 | +
|
| 59 | +- `match x with null` now preserves type aliases. |
| 60 | +- FS0027 on parameters suggests `let mutable x = x` shadow / `byref<_>`. |
| 61 | +- `let _ = &expr` compiles like `let x = &expr`. |
| 62 | +~~~ |
| 63 | + |
| 64 | +Prefer inline backticks for short identifiers over a fenced block. Fenced blocks are the exception — use only when prose loses information. |
| 65 | + |
| 66 | +**Comments / review summaries:** same rules, no title. Usually 1–3 sentences. Quote-reply only the line you're responding to; don't restate it. |
| 67 | + |
| 68 | +## Workflow |
| 69 | + |
| 70 | +Show the title + body (or comment text) in chat first. **Do not run `gh` until the user approves.** Then: |
| 71 | + |
| 72 | +1. **Write the body to a file** with your file-creation tool (bytes verbatim, OS-agnostic, avoids every shell-quoting trap). Or in pwsh: |
| 73 | + |
| 74 | + ```powershell |
| 75 | + @' |
| 76 | + Fix false-positive FS3261 when nullness narrowing leaks across iterations |
| 77 | + of seq/list/array comprehensions. |
| 78 | +
|
| 79 | + Fixes #19644 |
| 80 | + '@ | Set-Content -NoNewline pr-body.md |
| 81 | + ``` |
| 82 | + |
| 83 | +2. **Post** with exactly one: |
| 84 | + |
| 85 | + ``` |
| 86 | + gh pr create --title "<imperative title>" --body-file pr-body.md |
| 87 | + gh pr edit <N> --body-file pr-body.md # REPLACES body — read first if extending |
| 88 | + gh pr comment <N> --body-file pr-body.md |
| 89 | + gh pr review <N> --body-file pr-body.md --comment # or --approve / --request-changes |
| 90 | + gh issue create --title "<t>" --body-file pr-body.md |
| 91 | + gh issue edit <N> --body-file pr-body.md |
| 92 | + gh issue comment <N> --body-file pr-body.md |
| 93 | + ``` |
| 94 | + |
| 95 | + To extend without losing the existing body: |
| 96 | + `gh pr view <N> --json body -q .body > pr-body.md` → edit → `gh pr edit <N> --body-file pr-body.md`. |
| 97 | + |
| 98 | +3. **Verify** the live render — fetch the body and compare to the file with your view/diff tool. Fail loudly if `gh` fetch errors (a piped failure prints an "all-deleted" diff that misreads as "GitHub mangled it"). |
0 commit comments