github-pr-body
Skill1 starsChanged 8 days agoApache-2.0View on GitHub
Update PR body content with deterministic baseline sections and optional full-body completion. Use after a PR exists to fill or regenerate its body from the repository PR template.
In this repository56 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .apm/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- .github/workflows/CLAUDE.mdCLAUDE.md
- .cursor/rules/agent-skills.mdcCursor rule
- .cursor/rules/bats.mdcCursor rule
- .cursor/rules/github-actions-workflow.mdcCursor rule
- .cursor/rules/go.mdcCursor rule
- .cursor/rules/go-test.mdcCursor rule
- .cursor/rules/instructions.mdcCursor rule
- .cursor/rules/markdown.mdcCursor rule
- .cursor/rules/shell-script.mdcCursor rule
- .cursor/rules/terraform.mdcCursor rule
- agent-skills-reviewSkill
- changelogSkill
- ci-sweeperSkill
- docs-creatorSkill
- docs-updaterSkill
- github-actions-reviewSkill
- github-actions-validationSkill
- github-issue-autofixSkill
- github-issue-triageSkill
- github-pr-reviewSkill
- github-pr-reviseSkill
- go-reviewSkill
- go-validationSkill
- instructions-reviewSkill
- loop-verifierSkill
- markdown-validationSkill
- refactorSkill
- shell-script-reviewSkill
- shell-script-validationSkill
- tech-debtSkill
- test-gapSkill
- agent-skills-reviewSkill
- changelogSkill
- ci-sweeperSkill
- docs-creatorSkill
- docs-updaterSkill
- github-actions-reviewSkill
- github-actions-validationSkill
- github-issue-autofixSkill
- github-issue-triageSkill
- github-pr-bodySkill
- github-pr-reviewSkill
- github-pr-reviseSkill
- go-reviewSkill
- go-validationSkill
- instructions-reviewSkill
- loop-verifierSkill
- markdown-validationSkill
- refactorSkill
- shell-script-reviewSkill
- shell-script-validationSkill
- tech-debtSkill
- test-gapSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 44
create commits or modify source files
- Distinctive: line 88
Read category-pr-body-guidelines.md.
- Very specific: line 89
Read .github/PULL_REQUEST_TEMPLATE.md from the repository — the only template location pr_body.sh reads (root, docs/, and multi-template …
- Very specific: line 91
If the section comment contains an Example: block, follow that structure to generate visible content.
- Distinctive: line 92
If the section comment contains checkbox guidance, generate or update checkbox lines in the same format.
- Distinctive: line 93
If the section has no guidance, preserve the section heading and template comment without inventing content.
- Very specific: line 95
Write the complete PR body (all sections) to a temporary file (e.g., /tmp/completed_pr_body.md).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Input
- PR number and
owner/repo(required) - Existing PR template/body context (required)
- Authenticated
ghenvironment (required)
Output Specification
Return structured Markdown in accordance with references/common-output-format.md.
Structured PR output:
- Baseline mode: update
## Overviewand## Changes. - Full-body mode: apply complete body via
--body-file. ## Changesis script-generated: files grouped by Config/Docs/Feature/Test/Other with line counts.- Report selected mode and reason.
Execution Scope
- Always use
scripts/pr_body.shorscripts/pr_fetch.shto read and write the PR body. Do not run otherghcommands, except read-onlygh pr viewfor verification (Step 6). pr_body.shis deterministic and idempotent.scripts/pr_comment.sh(PR overview comment) is not part of this workflow; do not use it to deliver the PR body.
USE FOR:
- generate deterministic baseline PR body sections
- regenerate PR body from template sections after code updates
- fill remaining sections in full-body mode from validated context
DO NOT USE FOR:
- post review comments or resolve review threads
- create commits or modify source files
- replace issue triage workflows
Reference Files Guide
- common-checklist.md (always read)
- common-output-format.md (always read)
- common-troubleshooting.md (read on failure)
- category-pr-body-guidelines.md (read when full-body mode)
- category-template-mapping.md (read when full-body mode)
- category-change-classification.md (read when the template has a Type of Change section in full-body mode)
- category-command-reference.md (read on debugging)
- category-implementation-details.md (read on debugging)
- category-agent-workflows.md (read on debugging)
Workflow
Fetch PR metadata:
scripts/pr_fetch.sh <PR_NUMBER> --repo <OWNER/REPO>Parse JSON output to obtain: title, body, file list, additions/deletions, headRefName, baseRefName.
Generate deterministic baseline (
## Overview,## Changes):scripts/pr_body.sh <PR_NUMBER> --repo <OWNER/REPO> --dry-runReview dry-run output. If acceptable, apply:
scripts/pr_body.sh <PR_NUMBER> --repo <OWNER/REPO>Select mode:
- Baseline mode: request scope is summary refresh only → skip to Step 6.
- Full-body mode: request explicitly asks to populate all template sections → continue to Step 4.
Generate AI-completed content (full-body mode only):
- Read category-pr-body-guidelines.md. Read category-template-mapping.md when template comment guidance is ambiguous.
- Read
.github/PULL_REQUEST_TEMPLATE.mdfrom the repository — the only template locationpr_body.shreads (root,docs/, and multi-template directories are not read). - For each H2 section in the template:
- If the section comment contains an
Example:block, follow that structure to generate visible content. - If the section comment contains checkbox guidance, generate or update checkbox lines in the same format.
- If the section has no guidance, preserve the section heading and template comment without inventing content.
- If the section comment contains an
- Replace the metadata-only
## Overviewfrom Step 2 with a narrative Overview in the format of category-pr-body-guidelines.md § Overview Format (2–4 sentence paragraph plusCore Fixes:,Scope:, andRisk / Deployment Note:bullets); keep## Changesfrom Step 2 output. - Write the complete PR body (all sections) to a temporary file (e.g.,
/tmp/completed_pr_body.md).
Apply full body (full-body mode only):
scripts/pr_body.sh <PR_NUMBER> --repo <OWNER/REPO> --body-file /tmp/completed_pr_body.md- Verify success:
Confirmgh pr view <PR_NUMBER> --repo <OWNER/REPO> --json body --jq '.body'## Overviewand## Changessections are present and non-empty. In full-body mode, confirm every template H2 that carries guidance comments or examples contains visible content (e.g.## Testing,## Checklist).
Error Handling
| Condition | Severity | Action |
gh not authenticated | Fatal | Stop; instruct gh auth login |
| PR not found (404) | Fatal | Verify PR number and owner/repo |
| Access denied (403) | Fatal | Verify repo write scope |
pr_fetch.sh or pr_body.sh missing | Fatal | Stop; report missing script |
.github/PULL_REQUEST_TEMPLATE.md missing | Fatal | Stop; the baseline run (Step 2, which both modes start with) exits with "Template file not found" — report it; --body-file alone does not read the template |
| Body exceeds GitHub size limit (422) | Recoverable | Truncate or split content; report in output |
| Rate limit exceeded (429) | Recoverable | Defer update; note retry window in report |
| Dry-run output unacceptable | Info | Do not apply; report diff issues and stop |
Examples
- Prompt:
Generate PR body for PR #42 - Result: PR body updated via
scripts/pr_body.sh; report mode and reason per references/common-output-format.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

