Skip to content

Commit bb87361

Browse files
committed
docs: update PR description format and finding parsing guidelines
- Revised the structure of `PR_DESCRIPTION.md` to include the title as a markdown heading (`# Title`) followed by a summary section (`## Summary`). - Clarified the process for extracting the title and description when updating GitHub PRs. - Added a new section in `review-implement.md` detailing the format for parsing findings, including extraction of key components such as ID, severity, and change recommendations. These updates aim to improve the clarity and usability of PR descriptions and enhance the documentation for implementing review findings.
1 parent 5e71993 commit bb87361

File tree

2 files changed

+38
-17
lines changed

2 files changed

+38
-17
lines changed

.cursor/commands/pr-desc.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Generate or update `PR_DESCRIPTION.md` so it reflects the current diff against t
66

77
For combined work across the backend API, CLI, and data models—call out each surface area's feature set, integration touchpoints, and manual verification steps independently so reviewers understand the scope split.
88

9-
**IMPORTANT - Title vs Description Separation**:
10-
- The PR **title** is stored separately and used for the GitHub PR `title` field (Conventional Commit format: `type(scope): description`)
11-
- The PR **description** body starts with `## Summary` (NOT `# Title`) and is used for the GitHub PR `body` field
12-
- When updating GitHub PRs, ensure the title does NOT appear as a markdown heading in the description body to avoid duplication
9+
**IMPORTANT - Title Format**:
10+
- The PR **title** is included as a `# Title` heading at the top of `PR_DESCRIPTION.md` (Conventional Commit format: `type(scope): description`)
11+
- The PR **description** body starts with `## Summary` after the title heading
12+
- When updating GitHub PRs, extract the title from the first line (`# Title`) and use it for the PR `title` field, and use the rest of the content (starting from `## Summary`) for the PR `body` field
1313

1414
**GitHub PR Sync**:
1515
- After generating/updating `PR_DESCRIPTION.md` locally, the command will detect if there's an open PR for the current branch
@@ -184,18 +184,18 @@ Based on the file analysis from Step 2, automatically determine which testing ap
184184
- Custom notes under **Additional Notes** are preserved unless clearly obsolete.
185185
- Previous manual edits provided via $ARGUMENTS are respected.
186186
3. Overwrite (or create) `PR_DESCRIPTION.md` with the following sections, in template order, incorporating any human-provided clarification answers into the relevant sections and removing resolved `Clarification Needed` items.
187-
- **CRITICAL**: The file should start with `## Summary` (not `# Title`). The title is stored separately and should NOT appear as a markdown heading in the description body.
188-
- When updating GitHub PRs, use the title for the PR `title` field and the description content (starting from `## Summary`) for the PR `body` field.
187+
- **CRITICAL**: The file should start with `# Title` as a markdown heading, followed by `## Summary`. The title is included as the first line of the file.
188+
- When updating GitHub PRs, extract the title from the first line (`# Title`) and use it for the PR `title` field, and use the rest of the content (starting from `## Summary`) for the PR `body` field.
189189

190190
### Title
191191

192-
- **IMPORTANT**: The title is separate from the description body. Generate ONLY the title text (no markdown heading, no `#` prefix).
192+
- **IMPORTANT**: The title is included as a `# Title` markdown heading at the top of `PR_DESCRIPTION.md`.
193193
- Provide a Conventional Commit-style title (`type(scope): description`) following the [Conventional Commits v1.0.0](https://www.conventionalcommits.org/en/v1.0.0/) specification. Derive the subject from the current diff and `.github/pull_request_template.md`, not from any previously generated `PR_DESCRIPTION.md`.
194194
- **Analyze the diff to determine the primary change type**: Use the file changes and modifications to identify if this is a `feat`, `fix`, `refactor`, `test`, `docs`, etc.
195195
- **Scope identification**: Look at which components were most heavily modified to determine the scope (e.g., `api`, `cli`, `models`, `services`, `docs`).
196196
- **Description synthesis**: Based on the actual changes observed in the diff, create a concise description that captures the essence of what was modified.
197197
- **User clarification**: If the primary purpose isn't clear from the diff analysis, ask the user to clarify the main objective of these changes.
198-
- **Store separately**: Save the title as a separate variable/field. When updating GitHub PRs, use the title for the `title` parameter and the description body (without title heading) for the `body` parameter.
198+
- **Format**: Write the title as `# type(scope): description` at the very beginning of `PR_DESCRIPTION.md`, followed by a blank line, then `## Summary`.
199199

200200
### Summary
201201

@@ -298,10 +298,10 @@ Based on the file analysis from Step 2, automatically determine which testing ap
298298
- Merge new review areas/testing steps with existing ones, de-duplicating while keeping stable ordering (stable = by file path).
299299
- Retain any user-edited checklist states unless contradicted by automated checks.
300300
3. Save the file at the repository root: `$REPO_ROOT/PR_DESCRIPTION.md`.
301-
- **File format**: The file should start directly with `## Summary` (no title heading). Store the title separately.
301+
- **File format**: The file should start with `# Title` as a markdown heading, followed by a blank line, then `## Summary`.
302302
- **GitHub PR updates**: When updating GitHub PRs via API, use:
303-
- `title`: The Conventional Commit-style title (e.g., `docs: restructure documentation and improve code quality`)
304-
- `body`: The full content from `PR_DESCRIPTION.md` starting from `## Summary` (do NOT include the title as a heading)
303+
- `title`: Extract the title from the first line of `PR_DESCRIPTION.md` by removing the `# ` prefix (e.g., if file starts with `# docs: restructure documentation`, use `docs: restructure documentation`)
304+
- `body`: The full content from `PR_DESCRIPTION.md` starting from `## Summary` (do NOT include the title heading)
305305
4. Print (or log) a short status summary for the user including: title string, number of files changed, and whether the checklist sync item is checked.
306306

307307
5. **GitHub PR Sync (Optional)**:
@@ -312,16 +312,14 @@ Based on the file analysis from Step 2, automatically determine which testing ap
312312
- Find a PR where the head branch matches the current branch (check `head.ref` field)
313313
- **Prompt user**: If an open PR is found, ask the user: "Found open PR #X for branch 'Y'. Would you like to update the PR title and description on GitHub with the generated content? (yes/no)"
314314
- **Update PR if confirmed**: If the user confirms "yes" (or if `$ARGUMENTS` contains `--sync` or `--update-pr`):
315-
- **Extract title**:
316-
- First, check if `PR_TITLE.txt` exists and read from it
317-
- If not, generate the title using the same logic from step 3 (Conventional Commit format based on diff analysis)
318-
- **Extract description**: Read the full content from `PR_DESCRIPTION.md` (it should start with `## Summary`, not `# Title`)
315+
- **Extract title**: Read the first line of `PR_DESCRIPTION.md` (should be `# type(scope): description`) and remove the `# ` prefix to get the title
316+
- **Extract description**: Read the full content from `PR_DESCRIPTION.md` starting from `## Summary` (skip the title heading and blank line)
319317
- **Update PR**: Use GitHub MCP `update_pull_request` tool with:
320318
- `owner`: Repository owner
321319
- `repo`: Repository name
322320
- `pullNumber`: The PR number found
323-
- `title`: The Conventional Commit-style title (without markdown formatting)
324-
- `body`: The full content from `PR_DESCRIPTION.md` (starting from `## Summary`, ensuring no title heading is included)
321+
- `title`: The Conventional Commit-style title extracted from the first line (without the `# ` markdown heading prefix)
322+
- `body`: The full content from `PR_DESCRIPTION.md` starting from `## Summary` (do NOT include the title heading)
325323
- **Print confirmation**: "✓ Updated PR #X on GitHub: title and description synced"
326324
- **Skip if no PR found**: If no open PR is found, print: "No open PR found for current branch. PR description saved locally in `PR_DESCRIPTION.md`. You can create a PR or update manually later."
327325
- **Skip if user declines**: If user declines or answers "no", print: "PR description saved locally in `PR_DESCRIPTION.md`. You can update the PR manually when ready."

.cursor/commands/review-implement.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,29 @@ After a review has been validated via `/review-validate`, implement the remainin
5858
- **Verification**: Run all validation commands mentioned in the finding's "Validate:" clause.
5959
- **Documentation**: Update docstrings/comments if the change affects public APIs.
6060

61+
## Finding Format Parsing
62+
63+
Parse findings using the same format as `/review`:
64+
65+
```
66+
[ID][Severity][Tag] file:line – description
67+
68+
**Current Implementation:** (code snippet)
69+
70+
**Problem:** explanation
71+
72+
**Change:** recommendation with code example
73+
74+
**Validate:** test file or command
75+
```
76+
77+
Extract:
78+
- Finding ID (e.g., `Spec-1`, `Quality-2`)
79+
- Severity (Critical, High, Medium, Low)
80+
- File path and line number
81+
- Change recommendation (code example or clear steps)
82+
- Validation command (if provided)
83+
6184
## Output Format
6285

6386
After implementation, display:

0 commit comments

Comments
 (0)