|
2 | 2 | description: Create a pull request following InstUI conventions |
3 | 3 | --- |
4 | 4 |
|
5 | | -Create a pull request following Instructure UI conventions: |
| 5 | +Open a PR for the current branch. |
6 | 6 |
|
7 | | -## PR Requirements |
| 7 | +## Steps |
8 | 8 |
|
9 | | -All PRs must include: |
| 9 | +1. `git status` — confirm branch + remote tracking. |
| 10 | +2. `git log master..HEAD` and `git diff master...HEAD` — review **all** commits in the branch, not just the latest. |
| 11 | +3. If not pushed: `git push -u origin <branch>`. |
| 12 | +4. Create the PR (see invocation below). |
| 13 | +5. Return the PR URL. |
10 | 14 |
|
11 | | -1. **Summary**: Brief description of changes (1-3 bullet points) |
12 | | -2. **Test Plan**: Clear steps for reviewers to test the changes |
13 | | -3. **Jira Reference**: Include relevant Jira ticket number if applicable (e.g., `Fixes INST-1234`) |
14 | | -4. **AI Disclosure**: Must clearly indicate this was created with AI assistance |
| 15 | +If the branch name or any commit references a Jira ticket (e.g. `INST-1234`), include it. If you can't find one, ask the user once before opening — don't invent one. |
15 | 16 |
|
16 | | -## Draft vs Ready |
| 17 | +## gh invocation |
17 | 18 |
|
18 | | -- Open as **draft** when work is in progress or not ready for review |
19 | | -- Mark as **ready for review** only when complete and all requirements met |
| 19 | +Use `--body-file -` with a heredoc on stdin. This avoids shell-quoting issues and is the form supported by current `gh` versions. If unsure about flags, run `gh pr create --help` first — do **not** fall back to older forms like `gh pr create -t ... -b ...` with inline `-b`. |
20 | 20 |
|
21 | | -## Process |
22 | | - |
23 | | -1. Run `git status` to check current branch and remote tracking |
24 | | -2. Run `git log master..HEAD` to see all commits that will be in the PR |
25 | | -3. Run `git diff master...HEAD` to see full diff from base branch |
26 | | -4. Analyze changes across ALL commits (not just latest) |
27 | | -5. Draft PR summary covering all changes |
28 | | -6. **If Jira ticket number is unknown, ask the user for it before creating the PR** |
29 | | -7. Push to remote if needed: `git push -u origin <branch>` |
30 | | -8. Create PR with `gh pr create --title "title" --body "$(cat <<'EOF' |
| 21 | +```bash |
| 22 | +gh pr create --title "<title>" --body-file - <<'EOF' |
| 23 | +<body> |
| 24 | +EOF |
| 25 | +``` |
31 | 26 |
|
32 | | -## Summary |
| 27 | +Open as draft (`--draft`) if the work is in progress. |
33 | 28 |
|
34 | | -- Bullet point 1 |
35 | | -- Bullet point 2 |
| 29 | +## Body format |
36 | 30 |
|
37 | | -## Test Plan |
| 31 | +Keep it **short**. No preamble, no restating the title, no "this PR does X" filler. |
38 | 32 |
|
39 | | -- [ ] Step 1 |
40 | | -- [ ] Step 2 |
| 33 | +``` |
| 34 | +## Summary |
| 35 | +- <one line per logically distinct change; 1–4 bullets total> |
41 | 36 |
|
42 | | -## Jira Reference |
| 37 | +## Test Plan |
| 38 | +- <only manual / non-CI checks a reviewer should do> |
43 | 39 |
|
44 | | -Fixes INST-XXXX (or omit this section if not applicable) |
| 40 | +Fixes INST-XXXX |
45 | 41 |
|
46 | 42 | 🤖 Generated with [Claude Code](https://claude.com/claude-code) |
47 | | -EOF |
48 | | -)"` 9. Return the PR URL |
| 43 | +``` |
49 | 44 |
|
50 | | -**Important**: |
| 45 | +Rules: |
51 | 46 |
|
52 | | -- Base branch is usually `master` (not main) |
53 | | -- Analyze ALL commits in the branch, not just the latest one |
54 | | -- Use markdown checklists for test plan |
55 | | -- Include AI attribution footer |
56 | | -- Always confirm Jira ticket number with user if not found in commits or branch name |
| 47 | +- **Summary**: terse bullets. Each bullet is one change, not a paragraph. Skip context the diff already shows. |
| 48 | +- **Test Plan**: only what CI **doesn't** cover — manual UI checks, RTL, a11y spot-checks, visual regression cases to look at, edge cases worth poking. Never include "tests pass", "lint passes", "types check", "build succeeds" — CI runs those. |
| 49 | +- If there's genuinely nothing to manually verify (e.g. pure refactor with full test coverage), write `- No manual verification needed; covered by existing tests.` and move on. |
| 50 | +- Omit the `Fixes` line entirely if no ticket applies. Don't write `Fixes INST-XXXX (or omit if not applicable)`. |
| 51 | +- Keep the Claude Code footer. |
0 commit comments