Skip to content

Commit a82ee67

Browse files
docs: add PR template, title conventions, and prepare-pr workflow (#793)
## Summary - Add a GitHub PR template (`.github/pull_request_template.md`) with standardized sections: Summary, Verification, Visual Changes, and Reviewer Notes. - Add `AGENTS.md` with PR title conventions, draft-PR rules, and instructions for AI agents to follow the PR template. - Add a Kilo workflow (`.kilocode/workflows/prepare-pr.md`) that automates generating PR descriptions from branch context. - Remove the `pr-title` CI workflow — title validation is now handled by convention via `AGENTS.md` rather than a GitHub Action. ## Verification - Reviewed diff of all 4 commits on the branch to confirm correctness. - No runtime code changed; these are documentation and CI config files only. ## Visual Changes N/A ## Reviewer Notes The pr-title GitHub Action was added and then removed within this branch. Net effect on main is: no pr-title workflow, but the title conventions are documented in `AGENTS.md` for AI agents to follow.
2 parents dcfb53b + 23b9e40 commit a82ee67

3 files changed

Lines changed: 129 additions & 0 deletions

File tree

‎.github/pull_request_template.md‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!-- PR title format: type(scope): description — e.g., feat(auth): add SSO login -->
2+
<!-- Keep the title under 72 characters, use imperative mood, no trailing period. -->
3+
4+
## Summary
5+
6+
<!-- What changed and why? Keep this brief and outcome-focused. -->
7+
<!-- Include any architectural changes and enough context for a reviewer unfamiliar with this code area. -->
8+
9+
## Verification
10+
11+
<!-- List the checks you ran and what passed. Add command output notes when useful. -->
12+
13+
- [ ]
14+
15+
## Visual Changes
16+
17+
<!-- If UI/visual behavior changed, add before/after screenshots in the table below. -->
18+
<!-- If there are no visual changes, replace the table with: N/A -->
19+
20+
| Before | After |
21+
| ------ | ----- |
22+
| | |
23+
24+
## Reviewer Notes
25+
26+
<!-- Optional: reviewer focus areas, edge cases, or context that helps review quickly. -->

‎.kilocode/workflows/prepare-pr.md‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Prepare PR
2+
3+
Prepare a pull request description using this repository's PR template and then create or update the PR.
4+
5+
## Required source of truth
6+
7+
- Read and use `/.github/pull_request_template.md` from this repository.
8+
- Preserve section headings and order exactly as they appear in the template.
9+
- Do not add sections that are not present in the template.
10+
11+
## PR title
12+
13+
- Use the format `type(scope): <description>` (e.g., `feat(auth): add SSO login`).
14+
- Common types: `feat`, `fix`, `refactor`, `docs`, `test`, `chore`, `ci`, `style`, `perf`.
15+
- Keep the title under 72 characters, use imperative mood, and do not end with a period.
16+
17+
## Build the PR description
18+
19+
1. Collect branch context.
20+
- Run git commands to understand all changes that will be included in the PR.
21+
- Include all commits since branch divergence, not just the latest commit.
22+
23+
2. Prefill `## Summary`.
24+
- Describe what changed and why.
25+
- Explicitly call out any architectural changes.
26+
- Include enough context for a reviewer unfamiliar with this code area.
27+
- Keep it concise and reviewer-friendly.
28+
29+
3. Prefill `## Verification` from this session.
30+
- Capture verification already performed in this session (tests, typecheck, lint, builds, manual checks).
31+
- Include command names and short pass/fail outcomes when available.
32+
- Add a final placeholder bullet for extra user-provided verification details.
33+
34+
4. Prepare `## Visual Changes`.
35+
- Detect likely visual/UI changes from changed files (for example: `*.tsx`, `*.jsx`, CSS, Tailwind config, component/page/view files).
36+
- If visual/UI changes are likely, keep the before/after screenshot table and add meaningful row labels/placeholders.
37+
- If no visual/UI changes are likely, replace the section content with `N/A`.
38+
39+
5. Prefill `## Reviewer Notes`.
40+
- Add concise context that helps reviewer efficiency (risk areas, tricky logic, rollout notes).
41+
- Keep this section brief.
42+
43+
## Confirm with the user
44+
45+
- Print the full generated PR description in markdown.
46+
- Ask for confirmation and any edits.
47+
- Apply edits and show the final version before writing it to GitHub.
48+
49+
## Create or update PR
50+
51+
1. Check whether a PR already exists for the current branch.
52+
2. If a PR exists, update the PR body using `gh pr edit --body`.
53+
3. If a PR does not exist, create it as a **draft** using `gh pr create --draft` with the generated title and body.
54+
4. Return the PR URL.

‎AGENTS.md‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# AGENTS.md
2+
3+
## Pull Request Titles
4+
5+
- Use the format: `type(scope): <description>`
6+
- Common types: `feat`, `fix`, `refactor`, `docs`, `test`, `chore`, `ci`, `style`, `perf`
7+
- Scope is optional but encouraged (e.g., `feat(auth): add SSO login`)
8+
- Use imperative mood (e.g., "Add feature", not "Added feature").
9+
- Keep titles under 72 characters.
10+
- Do not end the title with a period.
11+
12+
## Draft PRs
13+
14+
When creating a pull request, **always create it as a draft** (`gh pr create --draft`). Let the author mark it ready for review.
15+
16+
## Pull Request Descriptions
17+
18+
When creating or updating a pull request, you **must** follow the PR template in `.github/pull_request_template.md`. Every PR description must include these four sections in order:
19+
20+
### `## Summary`
21+
22+
- Describe what changed and why. Be outcome-focused.
23+
- Call out architectural changes explicitly.
24+
- Include enough context for a reviewer unfamiliar with this code area.
25+
- Keep it concise. Do not pad with generic filler.
26+
27+
### `## Verification`
28+
29+
- List the checks you actually ran during development (tests, typecheck, lint, build, manual checks).
30+
- Include command names and pass/fail outcomes where available.
31+
- **Do not fabricate verification steps.** Only list testing you actually performed. Reviewers rely on this section to assess risk — dishonest verification is worse than none.
32+
33+
### `## Visual Changes`
34+
35+
- If UI or visual behavior changed, include a before/after screenshot table.
36+
- If there are no visual changes, replace the section content with `N/A`.
37+
38+
### `## Reviewer Notes`
39+
40+
- Add concise context that helps reviewer efficiency: risk areas, tricky logic, rollout notes, or edge cases.
41+
- If there is nothing noteworthy, keep this section brief or write `N/A`.
42+
43+
### General rules
44+
45+
- Preserve section headings and order exactly as they appear in the template.
46+
- Do not add sections that are not in the template.
47+
- Do not leave HTML comments from the template in the final description — replace them with actual content.
48+
- PR descriptions must be accurate and valuable to reviewers. Generic or boilerplate descriptions waste reviewer time.
49+
- Review all commits on the branch (not just the latest) when writing the summary.

0 commit comments

Comments
 (0)