You turn a GitHub pull request into one subsection appended to a page that already documents the area
it touches. You write no new page and you touch no other page's sidebar entry — the target page is
already in the sidebar, and staying there is the point.
This is the small half of "document this PR." The other half — a PR introducing a genuinely new
module, type, or feature, with nothing existing to extend — is a full new page: use the
docs-document-pr skill instead. Reach for this skill only when something already documents the area
the PR lands in.
What you do
Fetch the PR. gh infers the repo from the checkout, no --repo needed:
gh pr view <N> --json title,body,state,labels,commits,closingIssuesReferences | head -c 6000
For every issue in closingIssuesReferences, and any additional issue number the body mentions via
"closes/fixes/resolves/relates to/see #" that the JSON field missed:
gh issue view <N> --json title,body,labels | head -c 6000
The PR title becomes your subsection's context, the body and linked issues give you the motivation,
the commit list gives you what actually changed, and the labels are a tiebreaker in the next step.
Confirm this belongs on an existing page. It does when: the PR is an enhancement or fix to
something already documented, labels read enhancement/fix rather than feat/new-module, and
a page in docs/reference/ or docs/guides/ already covers the parent topic. Find that page by
matching the PR title and labels against the id in each candidate page's frontmatter — a
schema-* label points at docs/reference/schema.md if it exists, "Fix schema derivation" points
at the page whose id is schema, and so on.
If nothing matches — the PR is a new module, type, or substantial feature with no existing home —
stop. Say so, and name docs-document-pr as the right skill for it.
Write the subsection, appended near the end of the target page (after its last ## section,
before a trailing "Running the Examples" section if the page has one):
## <Feature Name>
<One or two sentences of context, drawn from the linked issue's motivation — what problem this
solves, not a changelog restatement of the commit list.>
### Changes in this PR
- <what changed, one bullet per material change>
### Example
<a prose sentence ending in `:`, then a runnable `mdoc:compile-only` block demonstrating the change>
### API Reference
<new types or methods, if any — link to their reference page with a relative path if one exists>
Drop "API Reference" entirely when the PR added no new public surface. Follow docs-writing-style for
the prose and docs-mdoc-conventions for the code block.
Insert it. Exactly one blank line above the new ## heading, exactly one blank line after its
last line of content. Nothing else on the page changes — no sidebar edit, because the page is
already there.
Verify. sbt "docs/mdoc --in <path> --out website/<path>" — never bare sbt docs/mdoc. Zero
[error] lines.
Commit. docs(<doc-stem>): document PR #<n> — <short feature name>.
When to stop without writing anything
- The request names no PR number. Ask, and stop.
- No existing page covers the PR's area. This is a new-page case — say so, name
docs-document-pr,
and stop rather than forcing a subsection onto an unrelated page.
- The PR is a dependency bump or internal refactor with nothing a reader would look up. Say so and
stop; not every merged PR earns documentation.
What you are not
You do not rewrite the rest of the target page, fix unrelated issues you notice on the way (note them
in your report instead), or touch sidebars.js — that file is for pages, and this PR did not add one.
Reporting
PR title, linked issues found, the target page, the subsection heading you wrote, and whether mdoc
compiled clean. If you stopped instead of writing, say which condition applied.
1---2name: docs-pr-subsection3description: Turn a GitHub pull request into one subsection appended to a page that already documents the area it touches — no new page, no sidebar edit. Use for a PR that only enhances or fixes something already documented, or when the docs-document-pr skill names this as the subsection case.4---56You turn a GitHub pull request into one subsection appended to a page that already documents the area7it touches. You write no new page and you touch no other page's sidebar entry — the target page is8already in the sidebar, and staying there is the point.910This is the small half of "document this PR." The other half — a PR introducing a genuinely new11module, type, or feature, with nothing existing to extend — is a full new page: use the12`docs-document-pr` skill instead. Reach for this skill only when something already documents the area13the PR lands in.1415## What you do16171. **Fetch the PR.** `gh` infers the repo from the checkout, no `--repo` needed:1819 ```bash20 gh pr view <N> --json title,body,state,labels,commits,closingIssuesReferences | head -c 600021 ```2223 For every issue in `closingIssuesReferences`, and any additional issue number the body mentions via24 "closes/fixes/resolves/relates to/see #" that the JSON field missed:2526 ```bash27 gh issue view <N> --json title,body,labels | head -c 600028 ```2930 The PR title becomes your subsection's context, the body and linked issues give you the motivation,31 the commit list gives you what actually changed, and the labels are a tiebreaker in the next step.32332. **Confirm this belongs on an existing page.** It does when: the PR is an enhancement or fix to34 something already documented, labels read `enhancement`/`fix` rather than `feat`/`new-module`, and35 a page in `docs/reference/` or `docs/guides/` already covers the parent topic. Find that page by36 matching the PR title and labels against the `id` in each candidate page's frontmatter — a37 `schema-*` label points at `docs/reference/schema.md` if it exists, "Fix schema derivation" points38 at the page whose `id` is `schema`, and so on.3940 If nothing matches — the PR is a new module, type, or substantial feature with no existing home —41 stop. Say so, and name `docs-document-pr` as the right skill for it.42433. **Write the subsection**, appended near the end of the target page (after its last `##` section,44 before a trailing "Running the Examples" section if the page has one):4546 ```markdown47 ## <Feature Name>4849 <One or two sentences of context, drawn from the linked issue's motivation — what problem this50 solves, not a changelog restatement of the commit list.>5152 ### Changes in this PR5354 - <what changed, one bullet per material change>5556 ### Example5758 <a prose sentence ending in `:`, then a runnable `mdoc:compile-only` block demonstrating the change>5960 ### API Reference6162 <new types or methods, if any — link to their reference page with a relative path if one exists>63 ```6465 Drop "API Reference" entirely when the PR added no new public surface. Follow `docs-writing-style` for66 the prose and `docs-mdoc-conventions` for the code block.67684. **Insert it.** Exactly one blank line above the new `##` heading, exactly one blank line after its69 last line of content. Nothing else on the page changes — no sidebar edit, because the page is70 already there.71725. **Verify.** `sbt "docs/mdoc --in <path> --out website/<path>"` — never bare `sbt docs/mdoc`. Zero73 `[error]` lines.74756. **Commit.** `docs(<doc-stem>): document PR #<n> — <short feature name>`.7677## When to stop without writing anything7879- **The request names no PR number.** Ask, and stop.80- **No existing page covers the PR's area.** This is a new-page case — say so, name `docs-document-pr`,81 and stop rather than forcing a subsection onto an unrelated page.82- **The PR is a dependency bump or internal refactor with nothing a reader would look up.** Say so and83 stop; not every merged PR earns documentation.8485## What you are not8687You do not rewrite the rest of the target page, fix unrelated issues you notice on the way (note them88in your report instead), or touch `sidebars.js` — that file is for pages, and this PR did not add one.8990## Reporting9192PR title, linked issues found, the target page, the subsection heading you wrote, and whether mdoc93compiled clean. If you stopped instead of writing, say which condition applied.