Skip to content

Commit b63be8e

Browse files
authored
Merge pull request #4 from raychrisgdp/docs-links-guard
chore(docs): add documentation links and improve code formatting
2 parents a73711f + 5b7388e commit b63be8e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+519
-662
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."
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Review Implement Command (personal-todo)
2+
3+
Read a validated review report and implement actionable findings, prioritizing Critical and High severity items with clear implementation paths.
4+
5+
---
6+
7+
The user input to you can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
8+
9+
User input:
10+
11+
$ARGUMENTS
12+
13+
## Goal
14+
15+
After a review has been validated via `/review-validate`, implement the remaining actionable findings from the review report. Focus on Critical and High priority items that have clear implementation paths, and update the review file so it reflects the current state using the same format as `.cursor/commands/review.md`.
16+
17+
**Note**: This command can be used alongside manual fixes. The author may choose to fix issues manually or use this command to automate implementation.
18+
19+
## Execution Steps
20+
21+
1. **Select Target Review File**
22+
- If the user supplies a path, use it.
23+
- Otherwise, pick the most recent `reviews/REVIEW_*.md` file. **Hard error**: If no review file found, fail with clear error message.
24+
25+
2. **Parse & Filter Findings**
26+
- Read the review file and extract: Review Summary, Metrics, and Findings grouped by severity.
27+
- **Include**: Critical and High severity findings with `file:line` references and explicit "Change:" recommendations.
28+
- **Exclude**: Findings marked as "Out of scope", "Deferred", or requiring external clarification ("NEEDS CLARIFICATION").
29+
- **Exclude**: Findings related to `PR_DESCRIPTION.md` (this file is for PR authoring and should not be modified).
30+
- **User Override**: If `$ARGUMENTS` contains specific finding IDs (e.g., `--findings Spec-1`), implement only those.
31+
32+
3. **Prioritize & Implement**
33+
- **Order**: Phase 1 (Critical: security, correctness), Phase 2 (High: maintainability, performance), Phase 3 (Medium: if requested).
34+
- **Execution**: For each actionable finding:
35+
- Read target file + context (10 lines before/after).
36+
- Apply change exactly as recommended (No over-engineering).
37+
- Follow project conventions (FastAPI, SQLAlchemy, Pydantic).
38+
- Validate using finding's "Validate:" clause.
39+
- Update review file immediately to track progress.
40+
41+
4. **Run Global Validation**
42+
- After implementations:
43+
- Run spec validation: `uv run python scripts/check_docs.py` (if specs touched).
44+
- Run linting: `uv run ruff check` on modified files.
45+
- Run tests: Execute relevant `pytest` commands.
46+
47+
5. **Generate Summary**
48+
- Output summary of implemented findings, skipped findings, and modified files.
49+
50+
## Implementation Directives
51+
52+
**Directive I: Standard Adherence**
53+
- **Follow Conventions**: Use existing code style, absolute imports, and naming conventions.
54+
- **Preserve Behavior**: Only modify code explicitly specified in the "Change:" recommendation.
55+
- **No Over-Engineering**: Implement exactly what is recommended, no more.
56+
57+
**Directive II: Incremental Verification**
58+
- **Atomic Progress**: Remove resolved findings immediately after successful implementation.
59+
- **Verification**: Run all validation commands mentioned in the finding's "Validate:" clause.
60+
- **Documentation**: Update docstrings/comments if the change affects public APIs.
61+
62+
## Finding Format Parsing
63+
64+
Parse findings using the same format as `/review`:
65+
66+
```
67+
[ID][Severity][Tag] file:line – description
68+
69+
**Current Implementation:** (code snippet)
70+
71+
**Problem:** explanation
72+
73+
**Change:** recommendation with code example
74+
75+
**Validate:** test file or command
76+
```
77+
78+
Extract:
79+
- Finding ID (e.g., `Spec-1`, `Quality-2`)
80+
- Severity (Critical, High, Medium, Low)
81+
- File path and line number
82+
- Change recommendation (code example or clear steps)
83+
- Validation command (if provided)
84+
85+
## Output Format
86+
87+
After implementation, display:
88+
```markdown
89+
## Implementation Summary
90+
✅ Implemented: N findings ([Spec-1], [Quality-2])
91+
⏭️ Skipped: M findings (Reason)
92+
❌ Failed: K findings (Error: message)
93+
📝 Files Modified: file1.py, file2.py
94+
🔍 Validation: Spec [Passed], Linting [Passed], Tests [Failed (Notes)]
95+
```
96+
97+
## Integration with Review Workflow
98+
99+
This command is used after `/post-review` when author chooses to automate fixes.
100+
101+
Context: $ARGUMENTS
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Review Validate Command (personal-todo)
2+
3+
Validate current specs after a review and refresh the existing review report to match the current state.
4+
5+
---
6+
7+
The user input to you can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
8+
9+
User input:
10+
11+
$ARGUMENTS
12+
13+
## Goal
14+
15+
After a review report exists in `reviews/`, re-check the current state, validate specs, and update that review file using the same format defined in `.cursor/commands/review.md`.
16+
17+
## Execution Steps
18+
19+
1. **Select Target Review File**
20+
- If the user supplies a path, use it.
21+
- Otherwise, pick the most recent `reviews/REVIEW_*.md`.
22+
2. **Capture Baseline**
23+
- **Ensure `main` is up-to-date**: `git fetch origin main:main` (if exists) or `git fetch origin main`.
24+
- Record `git branch --show-current`, `git rev-parse main`, `git merge-base main HEAD`, and `git diff --stat main...HEAD`.
25+
3. **Validate State**
26+
- Run `uv run python scripts/check_docs.py` for spec integrity.
27+
- If validation fails, capture errors as new findings.
28+
4. **Re-evaluate Findings**
29+
- Compare the current repo state to the review file contents.
30+
- Remove or downgrade findings that no longer apply.
31+
- Add new findings based on the current diff/state, using deterministic IDs that continue existing sequences.
32+
- **Ignore `PR_DESCRIPTION.md`**: Do not flag issues in `PR_DESCRIPTION.md`; it is for PR authoring purposes only.
33+
5. **Update Review Report**
34+
- Keep the same template and formatting as `.cursor/commands/review.md`.
35+
- Update **Executive Summary**, **Findings**, **Strengths**, **Testing Results**, and **Metrics Summary**.
36+
- If no findings remain, set Decision to approve and Key Recommendations to “None”.
37+
- Keep deterministic IDs (`[Spec-1]`, `[Quality-2]`, etc.).
38+
6. **Write Changes In-Place**
39+
- Update the existing `reviews/REVIEW_*.md` file only; do not create a new review report.
40+
41+
## Output Directives (CRITICAL)
42+
43+
**Directive I: Report Integrity**
44+
- **Clean Output**: Never include "[N tools called]" lines or internal implementation details.
45+
- **Actual Commands**: The Testing Results section must show the actual commands run (e.g., `uv run ruff check .`) and their output.
46+
- **Explicit Skips**: List any skipped validations with reasons (e.g., "⏭️ Skipped: [command] - Reason: [reason]").
47+
48+
**Directive II: Structural Stability**
49+
- **Template Compliance**: Do not add extra sections beyond the review template; keep the report layout stable.
50+
- **No Tool Names**: Do not reference any tool names in the report; keep the output consistent with existing review files.
51+
52+
## Integration with Review Workflow
53+
54+
This command runs after `/review` (both initial and re-reviews) to validate findings before posting to GitHub.

0 commit comments

Comments
 (0)