-
Notifications
You must be signed in to change notification settings - Fork 0
docs(git-and-github): plain-language-first PR/issue body templates #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c4e34c4
docs(git-and-github): plain-language-first PR body template
claude a9e7e05
docs(git-and-github): rename PR-body "Reproduction scenario" to "Scen…
claude 8ac15b3
docs(git-and-github): externalize PR/issue body templates, unify issu…
claude fc7623e
docs(git-and-github): add trailing "Prior work" section to both templ…
claude b9a8f17
style: ruff format test_pr_body_template.py, test_issue_body_template.py
claude a3378ca
Merge remote-tracking branch 'origin/main' into docs/pr-body-plain-la…
claude 70b301f
docs(git-and-github): clarify template copy scope, keep Attribution a…
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Issue Body Template | ||
|
|
||
| Canonical issue-body skeleton for `git-and-github` §Issues — same plain-language-first | ||
| shape as [`pr-body-template.md`](pr-body-template.md). Copy only the contents of the fenced | ||
| block below into the issue body — not this page's title or explanatory text. Drop whole | ||
| sections or sub-sections that don't apply, keep the section order. `TL;DR` / `User story` / | ||
| `Scenario` are plain-language and user-facing; `Detailed discussion` is technical, for | ||
| implementors and AI agents. | ||
|
|
||
| For a bug report, `Scenario` is the reproduction: `Base flow` gets there, `Actual behavior` | ||
| is the bug, `Expected behavior` is the fix target. For a feature request with nothing to | ||
| reproduce, drop `Scenario` and describe the gap in `User story` / `Detailed discussion` | ||
| instead. | ||
|
|
||
| ```markdown | ||
| **TL;DR:** <one plain-language sentence describing the problem or request> | ||
|
|
||
| ## User story | ||
| As a **<role>**, I want to <what-to-do>, to achieve <user-goal>. | ||
|
|
||
| ## Scenario | ||
| ### Base flow | ||
| <the ordinary steps that lead to this situation — plain narrative> | ||
|
|
||
| ### Actual behavior | ||
| <what happens today — the bug, gap, or missing capability> | ||
|
|
||
| ### Expected behavior | ||
| <what should happen, or become possible, once this is addressed> | ||
|
|
||
| ## Detailed discussion | ||
| <technical notes, proposed approach, logs, links> | ||
|
|
||
| ### Prior work | ||
| <links to possibly related or similar PRs/issues, each with a one-sentence summary of how it relates to this one; omit if none> | ||
|
|
||
| ### Attribution | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # PR Body Template | ||
|
|
||
| Canonical PR-body skeleton for `git-and-github` §Creating a PR. Copy only the contents of | ||
| the fenced block below into the PR body — not this page's title or explanatory text. Drop | ||
| whole sections or sub-sections that don't apply, keep the section order. `TL;DR` / | ||
| `User story` / `Scenario` are plain-language and user-facing; `Detailed discussion` is | ||
| technical, for implementors and AI agents. | ||
|
|
||
| ```markdown | ||
| **TL;DR:** <one plain-language sentence describing what this PR does> | ||
|
|
||
| ## User story | ||
| As a **<role>**, I want to <what-to-do>, to achieve <user-goal>. | ||
|
|
||
| ## Scenario | ||
| ### Base flow | ||
| <the ordinary steps that lead to this situation — plain narrative> | ||
|
|
||
| ### Actual behavior | ||
| <what happens today — the bug, gap, or missing capability> | ||
|
|
||
| ### Expected behavior | ||
| <what should happen, or become possible, after this PR> | ||
|
|
||
| ## Detailed discussion | ||
| ### What was done | ||
| <description of changes; add `Closes #<issue-number>` here if applicable> | ||
|
|
||
| ### Testing | ||
| ### Breaking changes | ||
| ### Checklist | ||
|
|
||
| ### Prior work | ||
| <links to possibly related or similar PRs/issues, each with a one-sentence summary of how it relates to this one; omit if none> | ||
|
|
||
| ### Attribution | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| """Regression guard: the canonical issue-body template lives in one external file. | ||
|
|
||
| Mirrors `test_pr_body_template.py`: the literal skeleton lives ONLY in | ||
| `skills/git-and-github/references/issue-body-template.md`; `git-and-github/SKILL.md` | ||
| must reference it (§Issues), not inline a duplicate. Pins the template's heading | ||
| set/ordering — same plain-language-first shape as the PR-body template. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import re | ||
| from pathlib import Path | ||
|
|
||
| REPO_ROOT = Path(__file__).resolve().parent.parent | ||
| GIT_GITHUB = REPO_ROOT / "skills" / "git-and-github" / "SKILL.md" | ||
| TEMPLATE = ( | ||
| REPO_ROOT / "skills" / "git-and-github" / "references" / "issue-body-template.md" | ||
| ) | ||
|
|
||
| USER_STORY = "## User story" | ||
| SCENARIO = "## Scenario" | ||
| DETAILED = "## Detailed discussion" | ||
|
|
||
| SKELETON_HEADINGS = ( | ||
| "**TL;DR:**", | ||
| USER_STORY, | ||
| SCENARIO, | ||
| "### Base flow", | ||
| "### Actual behavior", | ||
| "### Expected behavior", | ||
| DETAILED, | ||
| "### Attribution", | ||
| "### Prior work", | ||
| ) | ||
|
|
||
|
|
||
| def test_template_has_required_headings() -> None: | ||
| text = TEMPLATE.read_text(encoding="utf-8") | ||
| for heading in SKELETON_HEADINGS: | ||
| assert heading in text, f"{TEMPLATE}: missing '{heading}'" | ||
|
|
||
|
|
||
| def test_template_sections_are_ordered() -> None: | ||
| text = TEMPLATE.read_text(encoding="utf-8") | ||
| tldr = text.index("**TL;DR:**") | ||
| user_story = text.index(USER_STORY) | ||
| scenario = text.index(SCENARIO) | ||
| base_flow = text.index("### Base flow") | ||
| actual = text.index("### Actual behavior") | ||
| expected = text.index("### Expected behavior") | ||
| detailed = text.index(DETAILED) | ||
| attribution = text.index("### Attribution") | ||
| prior_work = text.index("### Prior work") | ||
| assert tldr < user_story < scenario < detailed, ( | ||
| f"{TEMPLATE}: sections must appear in order TL;DR -> User story -> Scenario -> Detailed discussion" | ||
| ) | ||
| assert scenario < base_flow < actual < expected < detailed, ( | ||
| f"{TEMPLATE}: 'Scenario' sub-sections must appear in order " | ||
| "Base flow -> Actual behavior -> Expected behavior, before 'Detailed discussion'" | ||
| ) | ||
| assert detailed < prior_work < attribution, ( | ||
| f"{TEMPLATE}: 'Prior work' must sit between 'Detailed discussion' and 'Attribution'" | ||
| ) | ||
| assert attribution == max(text.index(h) for h in SKELETON_HEADINGS), ( | ||
| f"{TEMPLATE}: 'Attribution' (the mandatory footer) must be the last section in the skeleton" | ||
| ) | ||
|
|
||
|
|
||
| def test_skill_references_template_without_inlining_it() -> None: | ||
| text = GIT_GITHUB.read_text(encoding="utf-8") | ||
| assert "references/issue-body-template.md" in text, ( | ||
| f"{GIT_GITHUB}: §Issues must link to references/issue-body-template.md" | ||
| ) | ||
|
|
||
|
|
||
| def test_skill_issues_section_scoped_to_shared_template() -> None: | ||
| """§Issues should point at the shared skeleton, not restate a bespoke one.""" | ||
| text = GIT_GITHUB.read_text(encoding="utf-8") | ||
| issues_heading = text.index("### Issues") | ||
| issues_section = text[issues_heading:] | ||
| for heading in SKELETON_HEADINGS: | ||
| assert ( | ||
| re.search(r"^" + re.escape(heading), issues_section, re.MULTILINE) is None | ||
| ), ( | ||
| f"{GIT_GITHUB}: §Issues must not inline a duplicate '{heading}' heading — delegate to issue-body-template.md" | ||
| ) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.