Skip to content

Commit 0dc339a

Browse files
committed
Update /pr skill to honor PR template on docs/ branches
The PR template's Lane 1 Technical edit checkbox is what stage-progression.yml watches to advance new-doc PRs from AI editor review to Director review. The skill previously always passed --body to gh pr create, which fully overrides the template, dropping the checkbox. The skill now forks on branch prefix: docs/ branches get the template structure with auto-filled Description and Affected documents sections; non-doc branches keep the existing bullet summary.
1 parent abbc319 commit 0dc339a

1 file changed

Lines changed: 29 additions & 11 deletions

File tree

.claude/skills/pr/SKILL.md

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,28 +68,46 @@ Read `.claude/skills/git-conventions.md` for PR conventions.
6868
- Derived from the **overall purpose** of all commits on the branch, not just the latest commit
6969
- Example: "Redesign homepage with product tile grid layout"
7070

71-
### Body
72-
Use this format — **Summary section only, no Test plan**:
71+
### Body — choose the format based on the branch prefix
7372

74-
```markdown
75-
## Summary
76-
- {1-3 bullet points describing the changes and their purpose}
77-
```
73+
**If the current branch starts with `docs/`** → use the **Template Style** (Step 5a). The repo's PR template at `.github/pull_request_template.md` contains a checklist for document authors, including the Lane 1 "Technical edit comments addressed" checkbox that the stage-progression workflow watches for. Passing `--body` to `gh pr create` overrides the template entirely, so the skill must reproduce the template structure with the auto-generated content filled in.
7874

79-
**Do NOT include:**
75+
**Otherwise (infrastructure, tooling, dependency, or any non-doc branch)** → use the **Summary Style** (Step 5b). These PRs are silently ignored by the review workflow and don't need the doc-author checklist.
76+
77+
In both styles, the summary content should be based on **ALL** commits on the branch, not just the most recent one. Read through all the commit messages and the diff to understand the full scope. If `$ARGUMENTS` was provided, use it to focus the title and description.
78+
79+
**Do NOT include in either style:**
8080
- A "Test plan" section
8181
- Any AI attribution, "Generated with Claude", or "Co-Authored-By" lines
8282

83-
If `$ARGUMENTS` was provided, use it to focus the title and description.
83+
### Step 5a: Template Style (for `docs/` branches)
84+
85+
1. Read [.github/pull_request_template.md](.github/pull_request_template.md). Use it as the structural skeleton.
86+
2. Compute the auto-generated summary: 1–3 bullets describing the changes.
87+
3. Compute the list of affected MDX documents: from `git diff --name-only main...HEAD`, keep entries matching `docs/**/*.mdx`. If the base is not `main`, use that instead.
88+
4. Build the PR body by transforming the template:
89+
- Under `## Description`, replace the `<!-- Briefly describe what this PR does and why. -->` comment with the summary bullets.
90+
- Under `## Affected documents`, replace the bare `- ` line with the list of affected MDX files. Format each as a markdown link relative to the repo root: `- [filename.mdx](docs/full/path/filename.mdx)`. If there are no changed MDX files, write `- _No MDX files changed in this PR._`
91+
- Leave the `## Related issue(s)` section's comment placeholder unchanged so the author can fill it in.
92+
- Leave **all checklist items unchecked**, including the Lane 1 Technical edit checkbox. The author checks them as they complete each item; the workflow specifically depends on the Technical edit checkbox being present and unchecked at PR open time.
93+
- Leave the `## Notes for reviewers` comment placeholder unchanged.
94+
95+
The result should be a complete copy of the template with the Description and Affected documents sections populated.
8496

85-
The summary should be based on ALL commits on the branch, not just the most recent one. Read through all the commit messages and the diff to understand the full scope.
97+
### Step 5b: Summary Style (for non-`docs/` branches)
98+
99+
Use this format — **Summary section only, no Test plan**:
100+
101+
```markdown
102+
## Summary
103+
- {1-3 bullet points describing the changes and their purpose}
104+
```
86105

87106
## Step 6: Create the PR
88107

89108
```bash
90109
gh pr create --title "{title}" --body "$(cat <<'EOF'
91-
## Summary
92-
{bullets}
110+
{body from Step 5a or Step 5b}
93111
EOF
94112
)"
95113
```

0 commit comments

Comments
 (0)