plan-flow-skill 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/.claude/commands/create-contract.md +468 -0
  2. package/.claude/commands/create-plan.md +512 -0
  3. package/.claude/commands/discovery-plan.md +561 -0
  4. package/.claude/commands/execute-plan.md +682 -0
  5. package/.claude/commands/review-code.md +459 -0
  6. package/.claude/commands/review-pr.md +651 -0
  7. package/.claude/commands/setup.md +1609 -0
  8. package/.claude/commands/write-tests.md +543 -0
  9. package/.claude/rules/core/allowed-patterns.md +175 -0
  10. package/.claude/rules/core/complexity-scoring.md +225 -0
  11. package/.claude/rules/core/forbidden-patterns.md +253 -0
  12. package/.claude/rules/languages/python-patterns.md +6 -0
  13. package/.claude/rules/languages/typescript-patterns.md +7 -0
  14. package/.claude/rules/patterns/contract-patterns.md +332 -0
  15. package/.claude/rules/patterns/discovery-patterns.md +342 -0
  16. package/.claude/rules/patterns/discovery-templates.md +319 -0
  17. package/.claude/rules/patterns/jest-patterns.md +482 -0
  18. package/.claude/rules/patterns/plans-patterns.md +225 -0
  19. package/.claude/rules/patterns/plans-templates.md +227 -0
  20. package/.claude/rules/patterns/pytest-patterns.md +457 -0
  21. package/.claude/rules/patterns/review-code-templates.md +305 -0
  22. package/.claude/rules/patterns/review-pr-patterns.md +360 -0
  23. package/.claude/rules/tools/auth-pr-tool.md +30 -0
  24. package/.claude/rules/tools/interactive-questions-tool.md +235 -0
  25. package/.claude/rules/tools/jest-testing-tool.md +73 -0
  26. package/.claude/rules/tools/plan-mode-tool.md +164 -0
  27. package/.claude/rules/tools/pytest-testing-tool.md +121 -0
  28. package/.claude/rules/tools/reference-expansion-tool.md +326 -0
  29. package/LICENSE +21 -0
  30. package/README.md +167 -0
  31. package/dist/cli/commands/init.d.ts +6 -0
  32. package/dist/cli/commands/init.d.ts.map +1 -0
  33. package/dist/cli/commands/init.js +139 -0
  34. package/dist/cli/commands/init.js.map +1 -0
  35. package/dist/cli/handlers/claude.d.ts +9 -0
  36. package/dist/cli/handlers/claude.d.ts.map +1 -0
  37. package/dist/cli/handlers/claude.js +119 -0
  38. package/dist/cli/handlers/claude.js.map +1 -0
  39. package/dist/cli/handlers/codex.d.ts +9 -0
  40. package/dist/cli/handlers/codex.d.ts.map +1 -0
  41. package/dist/cli/handlers/codex.js +100 -0
  42. package/dist/cli/handlers/codex.js.map +1 -0
  43. package/dist/cli/handlers/cursor.d.ts +8 -0
  44. package/dist/cli/handlers/cursor.d.ts.map +1 -0
  45. package/dist/cli/handlers/cursor.js +34 -0
  46. package/dist/cli/handlers/cursor.js.map +1 -0
  47. package/dist/cli/handlers/openclaw.d.ts +8 -0
  48. package/dist/cli/handlers/openclaw.d.ts.map +1 -0
  49. package/dist/cli/handlers/openclaw.js +34 -0
  50. package/dist/cli/handlers/openclaw.js.map +1 -0
  51. package/dist/cli/handlers/shared.d.ts +9 -0
  52. package/dist/cli/handlers/shared.d.ts.map +1 -0
  53. package/dist/cli/handlers/shared.js +44 -0
  54. package/dist/cli/handlers/shared.js.map +1 -0
  55. package/dist/cli/index.d.ts +8 -0
  56. package/dist/cli/index.d.ts.map +1 -0
  57. package/dist/cli/index.js +43 -0
  58. package/dist/cli/index.js.map +1 -0
  59. package/dist/cli/types.d.ts +26 -0
  60. package/dist/cli/types.d.ts.map +1 -0
  61. package/dist/cli/types.js +5 -0
  62. package/dist/cli/types.js.map +1 -0
  63. package/dist/cli/utils/files.d.ts +37 -0
  64. package/dist/cli/utils/files.d.ts.map +1 -0
  65. package/dist/cli/utils/files.js +122 -0
  66. package/dist/cli/utils/files.js.map +1 -0
  67. package/dist/cli/utils/logger.d.ts +11 -0
  68. package/dist/cli/utils/logger.d.ts.map +1 -0
  69. package/dist/cli/utils/logger.js +34 -0
  70. package/dist/cli/utils/logger.js.map +1 -0
  71. package/dist/cli/utils/prompts.d.ts +10 -0
  72. package/dist/cli/utils/prompts.d.ts.map +1 -0
  73. package/dist/cli/utils/prompts.js +65 -0
  74. package/dist/cli/utils/prompts.js.map +1 -0
  75. package/dist/test/setup.d.ts +5 -0
  76. package/dist/test/setup.d.ts.map +1 -0
  77. package/dist/test/setup.js +7 -0
  78. package/dist/test/setup.js.map +1 -0
  79. package/package.json +63 -0
  80. package/rules/core/_index.mdc +89 -0
  81. package/rules/core/allowed-patterns.mdc +185 -0
  82. package/rules/core/complexity-scoring.mdc +235 -0
  83. package/rules/core/forbidden-patterns.mdc +263 -0
  84. package/rules/languages/_index.mdc +80 -0
  85. package/rules/languages/python-patterns.mdc +188 -0
  86. package/rules/languages/typescript-patterns.mdc +128 -0
  87. package/rules/patterns/_index.mdc +185 -0
  88. package/rules/patterns/contract-patterns.mdc +344 -0
  89. package/rules/patterns/discovery-patterns.mdc +354 -0
  90. package/rules/patterns/discovery-templates.mdc +329 -0
  91. package/rules/patterns/jest-patterns.mdc +492 -0
  92. package/rules/patterns/plans-patterns.mdc +237 -0
  93. package/rules/patterns/plans-templates.mdc +237 -0
  94. package/rules/patterns/pytest-patterns.mdc +467 -0
  95. package/rules/patterns/review-code-templates.mdc +315 -0
  96. package/rules/patterns/review-pr-patterns.mdc +370 -0
  97. package/rules/skills/_index.mdc +174 -0
  98. package/rules/skills/create-contract-skill.mdc +239 -0
  99. package/rules/skills/create-plan-skill.mdc +271 -0
  100. package/rules/skills/discovery-skill.mdc +295 -0
  101. package/rules/skills/execute-plan-skill.mdc +388 -0
  102. package/rules/skills/review-code-skill.mdc +308 -0
  103. package/rules/skills/review-pr-skill.mdc +496 -0
  104. package/rules/skills/setup-skill.mdc +923 -0
  105. package/rules/skills/write-tests-skill.mdc +294 -0
  106. package/rules/templates/index-template.mdc +126 -0
  107. package/rules/tools/_index.mdc +114 -0
  108. package/rules/tools/auth-pr-tool.mdc +362 -0
  109. package/rules/tools/interactive-questions-tool.mdc +337 -0
  110. package/rules/tools/jest-testing-tool.mdc +96 -0
  111. package/rules/tools/plan-mode-tool.mdc +229 -0
  112. package/rules/tools/pytest-testing-tool.mdc +144 -0
  113. package/rules/tools/reference-expansion-tool.mdc +338 -0
  114. package/skills/plan-flow/SKILL.md +109 -0
  115. package/skills/plan-flow/create-contract/SKILL.md +139 -0
  116. package/skills/plan-flow/create-plan/SKILL.md +93 -0
  117. package/skills/plan-flow/discovery/SKILL.md +85 -0
  118. package/skills/plan-flow/execute-plan/SKILL.md +89 -0
  119. package/skills/plan-flow/review-code/SKILL.md +100 -0
  120. package/skills/plan-flow/review-pr/SKILL.md +122 -0
  121. package/skills/plan-flow/setup/SKILL.md +73 -0
  122. package/skills/plan-flow/write-tests/SKILL.md +115 -0
  123. package/templates/shared/AGENTS.md.template +60 -0
  124. package/templates/shared/CLAUDE.md.template +62 -0
@@ -0,0 +1,496 @@
1
+ ---
2
+ description: "Include when /review-pr is invoked or PR analysis from GitHub/Azure DevOps is needed"
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # Review PR Skill
7
+
8
+ ## Purpose
9
+
10
+ Perform a comprehensive **read-only analysis** of a Pull Request using established patterns and guidelines, then generate a structured review document.
11
+
12
+ This skill **only produces a markdown file** with findings. It does NOT:
13
+
14
+ - Run any build or test commands
15
+ - Modify any code
16
+ - Execute any scripts
17
+ - Make changes to the codebase
18
+
19
+ ---
20
+
21
+ ## Restrictions - READ ONLY
22
+
23
+ This skill is **strictly read-only analysis**. The review process:
24
+
25
+ 1. **Reads** the PR diff and files
26
+ 2. **Analyzes** against patterns and guidelines
27
+ 3. **Generates** a markdown file with findings
28
+
29
+ **No code execution, no code modification, no builds.**
30
+
31
+ ### NEVER Do These Actions
32
+
33
+ | Forbidden Action | Reason |
34
+ | ---------------------------------------- | ---------------------------------------------- |
35
+ | `npm run build` | No build commands - analysis only |
36
+ | `npm run test` | No test commands - analysis only |
37
+ | `npm install` | No dependency installation |
38
+ | Edit/modify any source code | No code changes - review produces findings |
39
+ | Create/edit files outside `flow/` | Only write to `flow/reviewed-pr/` |
40
+ | `git commit` | No commits to any repository |
41
+ | `git push` | No pushing to remote repositories |
42
+ | `git checkout` | No branch switching on external repos |
43
+ | `gh pr merge` | No merging pull requests |
44
+ | `gh pr close` | No closing pull requests |
45
+ | `gh pr review --approve` | No approving PRs directly via CLI |
46
+ | `gh pr review --request-changes` | No requesting changes directly via CLI |
47
+ | `gh pr comment` | No posting comments directly to the PR |
48
+ | Any write operation to the external repo | All output goes to local markdown only |
49
+ | Any shell command that modifies code | This is a read-only analysis, not an execution |
50
+
51
+ ### Allowed Actions
52
+
53
+ #### GitHub Commands
54
+
55
+ | Allowed Action | Purpose |
56
+ | ---------------------------- | -------------------------------------------- |
57
+ | `gh auth status` | Check authentication status |
58
+ | `gh auth login --with-token` | Authenticate using PAT from `.plan.flow.env` |
59
+ | `gh pr view` | Read PR information |
60
+ | `gh pr diff` | Read PR diff/changes |
61
+ | `gh pr files` | List files changed in PR |
62
+ | `gh api` (GET requests only) | Fetch additional PR data |
63
+
64
+ #### Azure DevOps Commands
65
+
66
+ | Allowed Action | Purpose |
67
+ | ----------------------------------------------------- | --------------------------------------- |
68
+ | `az devops configure` | Configure Azure DevOps defaults |
69
+ | `az devops invoke --area git --resource pullRequests` | Fetch PR details |
70
+ | `az devops invoke --area git --resource blobs` | Fetch file contents |
71
+ | `az devops invoke --area git --resource diffs` | Fetch PR diff |
72
+ | `az devops invoke --area git --resource commits` | Fetch commit information |
73
+ | `az repos pr show` | Show PR details |
74
+ | `az repos pr list` | List PRs (for finding existing reviews) |
75
+ | `curl` with GET + PAT auth | Direct API calls to Azure DevOps |
76
+
77
+ #### Local Operations
78
+
79
+ | Allowed Action | Purpose |
80
+ | -------------------------------- | ------------------------------------- |
81
+ | Write to `flow/reviewed-pr/` | Save review notes locally |
82
+ | Write to `/tmp/` | Temporary file storage for processing |
83
+ | Read project rule files | Load patterns for analysis |
84
+ | `source .plan.flow.env` | Load environment credentials |
85
+
86
+ > **Important**: The ONLY writable location is `flow/reviewed-pr/`. No source code, configuration files, or any other project files should be modified.
87
+
88
+ ### Allowed Command Examples
89
+
90
+ ```bash
91
+ # Fetch file content from Azure DevOps
92
+ az devops invoke \
93
+ --area git \
94
+ --resource blobs \
95
+ --route-parameters project={project} repositoryId={repo} sha1={sha} \
96
+ --query-parameters '$format=text' \
97
+ --api-version 7.0 \
98
+ --out-file /tmp/{filename} \
99
+ && cat /tmp/{filename}
100
+
101
+ # Fetch PR details from Azure DevOps
102
+ az devops invoke \
103
+ --area git \
104
+ --resource pullRequests \
105
+ --route-parameters project={project} repositoryId={repo} pullRequestId={pr_id} \
106
+ --api-version 7.0
107
+
108
+ # Fetch PR diff/changes
109
+ az devops invoke \
110
+ --area git \
111
+ --resource diffs \
112
+ --route-parameters project={project} repositoryId={repo} \
113
+ --query-parameters 'baseVersion={base}&targetVersion={target}' \
114
+ --api-version 7.0
115
+
116
+ # Direct API call with PAT
117
+ curl -s -u ":$AZURE_DEVOPS_PAT" \
118
+ "https://dev.azure.com/{org}/{project}/_apis/git/pullrequests/{pr_id}?api-version=7.0"
119
+ ```
120
+
121
+ > 📝 **Output**: All findings, comments, and suggestions are saved to a local markdown file in `flow/reviewed-pr/`. The user can then manually copy comments to the PR if desired.
122
+
123
+ ---
124
+
125
+ ## Inputs
126
+
127
+ | Input | Required | Description |
128
+ | ---------- | -------- | ------------------------------------------------ |
129
+ | `pr_link` | Yes | The URL of the Pull Request to review |
130
+ | `language` | Optional | Primary language (auto-detected if not provided) |
131
+
132
+ ---
133
+
134
+ ## Workflow
135
+
136
+ ### Step 0: Authenticate for PR Access
137
+
138
+ Use the **[PR Authentication Tool](../tools/auth-pr-tool.mdc)** to authenticate and verify access to the PR.
139
+
140
+ **What the tool does**:
141
+
142
+ 1. Detects platform from PR URL (GitHub or Azure DevOps)
143
+ 2. Loads credentials from `.plan.flow.env`
144
+ 3. Authenticates using the appropriate method for the platform
145
+ 4. Verifies access by fetching the PR
146
+
147
+ **Usage**:
148
+
149
+ ```markdown
150
+ Use the auth-pr tool with the PR URL: {pr_link}
151
+
152
+ The tool will:
153
+ - Detect platform (GitHub/Azure DevOps)
154
+ - Load credentials from .plan.flow.env
155
+ - Authenticate and verify access
156
+ - Return authentication status
157
+ ```
158
+
159
+ After successful authentication, proceed to fetch PR information.
160
+
161
+ ---
162
+
163
+ ### Step 1: Fetch PR Information
164
+
165
+ 1. Use the provided PR link to fetch the Pull Request details
166
+ 2. Extract the PR title, description, and list of changed files
167
+ 3. Identify the primary language(s) used in the PR
168
+
169
+ ### Step 2: Load Review Patterns
170
+
171
+ 1. Read `.cursor/rules/patterns/review-pr-patterns.mdc` for general review guidelines
172
+ 2. Based on the detected language(s), load the appropriate pattern file:
173
+ - **TypeScript/JavaScript**: Load `.cursor/rules/languages/typescript-patterns.mdc`
174
+ - **Python**: Load `.cursor/rules/languages/python-patterns.mdc`
175
+ 3. Cross-reference with `.cursor/rules/core/forbidden-patterns.mdc` for anti-patterns to flag
176
+ 4. Cross-reference with `.cursor/rules/core/allowed-patterns.mdc` for best practices to encourage
177
+ 5. Use the [`complexity-scoring` pattern](../core/complexity-scoring.mdc) for fix complexity scoring
178
+
179
+ ### Step 3: Analyze Code Changes
180
+
181
+ For each file in the PR:
182
+
183
+ 1. Review the diff/changes
184
+ 2. Check for violations of forbidden patterns
185
+ 3. Verify adherence to allowed patterns
186
+ 4. Apply language-specific checks
187
+ 5. Identify security, performance, and maintainability concerns
188
+
189
+ ### Step 4: Generate or Update Review Document
190
+
191
+ **Check for existing review file** in `flow/reviewed-pr/` before creating a new one.
192
+
193
+ #### If reviewing the same PR again:
194
+
195
+ 1. **Find the existing file** matching the PR (by PR number or title)
196
+ 2. **Update the existing file** with the new review findings
197
+ 3. **Add a review history entry** showing when each review was performed
198
+ 4. **Mark resolved findings** from previous reviews if they've been fixed
199
+ 5. **Add new findings** discovered in the updated PR
200
+
201
+ #### If this is a new PR:
202
+
203
+ Create a markdown file in `flow/reviewed-pr/` with the naming convention:
204
+
205
+ ```
206
+ pr-notes-{sanitized-pr-title}.md
207
+ ```
208
+
209
+ **Example**: For a PR titled "Add user authentication flow", create:
210
+
211
+ ```
212
+ flow/reviewed-pr/pr-notes-add-user-authentication-flow.md
213
+ ```
214
+
215
+ > 💡 **Tip**: Use the PR number in the filename for easier matching on re-reviews (e.g., `pr-notes-123-add-user-authentication-flow.md`)
216
+
217
+ ---
218
+
219
+ ## Output Format
220
+
221
+ The generated review document should follow this structure:
222
+
223
+ ```markdown
224
+ # PR Review: {PR Title}
225
+
226
+ ## PR Information
227
+
228
+ | Field | Value |
229
+ | ----------- | -------------------- |
230
+ | PR Link | {pr_link} |
231
+ | PR Number | {pr_number} |
232
+ | PR Title | {pr_title} |
233
+ | Author | {author} |
234
+ | Branch | {branch} |
235
+ | Files | {number_of_files} |
236
+ | Language(s) | {detected_languages} |
237
+
238
+ ---
239
+
240
+ ## Review History
241
+
242
+ | Review # | Date | Findings | Resolved | New |
243
+ | -------- | -------------- | -------- | -------- | ----- |
244
+ | 1 | {initial_date} | {count} | - | - |
245
+ | 2 | {update_date} | {count} | {fixed} | {new} |
246
+
247
+ > Update this table each time the PR is re-reviewed.
248
+
249
+ ---
250
+
251
+ ## Review Summary
252
+
253
+ | Metric | Value |
254
+ | -------------------- | ------------------ |
255
+ | **Total Findings** | {count} |
256
+ | Critical 🔴 | {critical_count} |
257
+ | Major 🟠 | {major_count} |
258
+ | Minor 🟡 | {minor_count} |
259
+ | Suggestion 🔵 | {suggestion_count} |
260
+ | **Total Fix Effort** | {sum_of_scores}/X |
261
+
262
+ > **Total Fix Effort**: Sum of all fix complexity scores. Use this to estimate the overall effort needed to address all findings.
263
+
264
+ ---
265
+
266
+ ## Findings
267
+
268
+ ### Finding 1: {Finding Name}
269
+
270
+ | Field | Value |
271
+ | -------------- | -------------------------------------------------- |
272
+ | File | `{file_path}` |
273
+ | Line | {line_number} |
274
+ | **Link** | **[View in PR]({direct_url_to_line})** ⬅️ REQUIRED |
275
+ | Severity | {Critical \| Major \| Minor \| Suggestion} |
276
+ | Fix Complexity | {X/10} - {Level} |
277
+ | Status | {Open \| Resolved} |
278
+ | Pattern | {Reference to pattern from rules, if applicable} |
279
+
280
+ > ⚠️ **Important**: The Link field is REQUIRED. Always include a clickable link to the exact line in the PR.
281
+ > 📊 **Fix Complexity**: Use the [`complexity-scoring` pattern](../core/complexity-scoring.mdc) to calculate the effort required to fix this finding.
282
+
283
+ **Description**:
284
+ {Detailed explanation of the issue found}
285
+
286
+ **PR Comment** (for manual use):
287
+
288
+ > {Short, polished message ready to copy/paste into the PR comment section}
289
+
290
+ **Suggested Fix**:
291
+ \`\`\`{language}
292
+ // Suggested code improvement
293
+ \`\`\`
294
+
295
+ ---
296
+
297
+ ### Finding 2: {Finding Name}
298
+
299
+ ... (repeat structure for each finding)
300
+
301
+ ---
302
+
303
+ ## Positive Highlights
304
+
305
+ List any particularly well-written code or good practices observed:
306
+
307
+ - {Highlight 1}
308
+ - {Highlight 2}
309
+
310
+ ---
311
+
312
+ ## Approval Recommendation
313
+
314
+ | Status | {Approve \| Request Changes \| Needs Discussion} |
315
+ | ------ | ------------------------------------------------ |
316
+ | Reason | {Brief explanation of the recommendation} |
317
+ ```
318
+
319
+ ---
320
+
321
+ ## Severity Levels
322
+
323
+ | Level | Icon | Description |
324
+ | ---------- | ---- | -------------------------------------------------------- |
325
+ | Critical | 🔴 | Security vulnerabilities, data loss risks, blocking bugs |
326
+ | Major | 🟠 | Significant issues affecting functionality or quality |
327
+ | Minor | 🟡 | Code style, minor improvements, non-critical concerns |
328
+ | Suggestion | 🔵 | Nice-to-have improvements, optional enhancements |
329
+
330
+ ---
331
+
332
+ ## Fix Complexity Scoring
333
+
334
+ Use the [`complexity-scoring` pattern](../core/complexity-scoring.mdc) to calculate the effort required to fix each finding. This helps prioritize which issues to address first.
335
+
336
+ ### Complexity Scale
337
+
338
+ | Score | Level | Description | Example Fix |
339
+ | ----- | --------- | -------------------------------- | ---------------------------------------------- |
340
+ | 0-2 | Trivial | Simple, quick fix | Adding a missing import, renaming a variable |
341
+ | 3-4 | Low | Straightforward fix | Adding error logging, fixing a type annotation |
342
+ | 5-6 | Medium | Moderate effort, some decisions | Refactoring a function, adding validation |
343
+ | 7-8 | High | Complex fix, multiple files | Restructuring state management, adding tests |
344
+ | 9-10 | Very High | Significant refactoring required | Architecture changes, multi-file refactoring |
345
+
346
+ ### Scoring Modifiers
347
+
348
+ Apply these modifiers to calculate the fix complexity:
349
+
350
+ | Modifier | Points |
351
+ | ------------------------------------- | ------ |
352
+ | Each file that needs to be modified | +1 |
353
+ | Requires adding new tests | +1 |
354
+ | Involves state management changes | +1 |
355
+ | Requires API/interface changes | +1 |
356
+ | Simple code addition (no refactoring) | -1 |
357
+ | Fix follows existing pattern exactly | -1 |
358
+
359
+ ### Example Calculations
360
+
361
+ | Finding | Calculation | Score |
362
+ | -------------------------------- | ------------------------------------- | ----- |
363
+ | Missing error logging | 1 file, simple addition = 2 - 1 | 1/10 |
364
+ | Type annotation fix | 1 file, follows pattern = 1 - 1 | 0/10 |
365
+ | Add input validation with Zod | 1 file + new schema = 2 + 1 | 3/10 |
366
+ | Refactor to view/logic split | 2 files + pattern + state = 2 + 1 + 1 | 4/10 |
367
+ | Fix silent error swallowing | 1 file + error handling = 1 + 2 | 3/10 |
368
+ | Add comprehensive error handling | Multiple files + tests = 3 + 1 + 2 | 6/10 |
369
+
370
+ ---
371
+
372
+ ## Link Format
373
+
374
+ Generate direct links to the specific line in the PR. The format depends on the platform:
375
+
376
+ ### GitHub
377
+
378
+ **For branch blob view (preferred)**:
379
+
380
+ ```
381
+ https://github.com/{owner}/{repo}/blob/{branch_name}/{file_path}#L{line_number}
382
+ ```
383
+
384
+ **For PR file view**:
385
+
386
+ ```
387
+ https://github.com/{owner}/{repo}/pull/{pr_number}/files#diff-{file_path_hash}R{line_number}
388
+ ```
389
+
390
+ ### Azure DevOps
391
+
392
+ **For PR file view with line (CORRECT FORMAT)**:
393
+
394
+ ```
395
+ https://dev.azure.com/{org}/{project}/_git/{repo}/pullrequest/{pr_id}?_a=files&path={file_path}&line={line_number}&lineEnd={line_number}&lineStartColumn=1&lineEndColumn=1000&lineStyle=plain
396
+ ```
397
+
398
+ > ⚠️ **Critical Parameters**:
399
+ >
400
+ > - `_a=files` - Required to navigate to the Files tab
401
+ > - `lineStyle=plain` - Ensures line highlighting works
402
+ > - `lineEndColumn=1000` - Use a large number to highlight the full line
403
+
404
+ **For branch file view (alternative)**:
405
+
406
+ ```
407
+ https://dev.azure.com/{org}/{project}/_git/{repo}?path={file_path}&version=GB{branch_name}&line={line_number}&lineEnd={line_number}&lineStartColumn=1&lineEndColumn=1000&lineStyle=plain&_a=contents
408
+ ```
409
+
410
+ ### Examples
411
+
412
+ | Platform | Type | URL Example |
413
+ | ------------ | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
414
+ | GitHub | Blob View | `https://github.com/acme/webapp/blob/feature-auth/src/services/userService.ts#L45` |
415
+ | GitHub | PR Files | `https://github.com/acme/webapp/pull/123/files#diff-abc123R45` |
416
+ | Azure DevOps | PR Files | `https://dev.azure.com/org/project/_git/repo/pullrequest/123?_a=files&path=/src/api/route.ts&line=45&lineEnd=45&lineStartColumn=1&lineEndColumn=1000&lineStyle=plain` |
417
+ | Azure DevOps | Branch | `https://dev.azure.com/org/project/_git/repo?path=/src/api/route.ts&version=GBfeature-branch&line=45&lineEnd=45&_a=contents` |
418
+
419
+ > ⚠️ **REQUIRED**: Every finding MUST include a clickable link. This allows reviewers to quickly navigate to the exact location of the issue.
420
+
421
+ ---
422
+
423
+ ## Example Finding
424
+
425
+ ### Finding 1: Silent Error Swallowing
426
+
427
+ | Field | Value |
428
+ | -------------- | ------------------------------------------------------------------------------------------------- |
429
+ | File | `src/services/userService.ts` |
430
+ | Line | 45 |
431
+ | **Link** | **[View in PR](https://github.com/org/repo/blob/feature-branch/src/services/userService.ts#L45)** |
432
+ | Severity | Major 🟠 |
433
+ | Fix Complexity | 3/10 - Low |
434
+ | Status | Open |
435
+ | Pattern | `forbidden-patterns.mdc` - DON'T Swallow Errors |
436
+
437
+ > **Azure DevOps example link**: `[View in PR](https://dev.azure.com/org/project/_git/repo/pullrequest/123?_a=files&path=/src/services/userService.ts&line=45&lineEnd=45&lineStartColumn=1&lineEndColumn=1000&lineStyle=plain)`
438
+
439
+ **Description**:
440
+ The catch block on line 45 catches an error but does not log it or provide user feedback. This makes debugging production issues extremely difficult and leaves users unaware that their action failed.
441
+
442
+ **PR Comment** (for manual use):
443
+
444
+ > This error is being caught but not logged or handled. Consider adding proper error logging and user feedback. See our team guidelines in `forbidden-patterns.mdc` for error handling best practices.
445
+
446
+ **Suggested Fix**:
447
+
448
+ ```typescript
449
+ try {
450
+ await saveUserData(userData);
451
+ } catch (error) {
452
+ logger.error("Failed to save user data", { error, userId: userData.id });
453
+ throw new UserFacingError("Unable to save your changes. Please try again.");
454
+ }
455
+ ```
456
+
457
+ ---
458
+
459
+ ## Quick Reference Commands
460
+
461
+ ```bash
462
+ # Review a GitHub PR
463
+ review-pr https://github.com/org/repo/pull/123
464
+
465
+ # Review with explicit language
466
+ review-pr https://github.com/org/repo/pull/123 --language typescript
467
+ ```
468
+
469
+ ---
470
+
471
+ ## Related Files
472
+
473
+ | File | Purpose |
474
+ | ------------------------------------------ | ------------------------------------ |
475
+ | `.cursor/rules/patterns/review-pr-patterns.mdc` | Main review checklist and guidelines |
476
+ | `.cursor/rules/core/forbidden-patterns.mdc` | Anti-patterns to flag |
477
+ | `.cursor/rules/core/allowed-patterns.mdc` | Best practices to encourage |
478
+ | `.cursor/rules/languages/typescript-patterns.mdc` | TypeScript-specific checks |
479
+ | `.cursor/rules/languages/python-patterns.mdc` | Python-specific checks |
480
+ | `.cursor/rules/core/complexity-scoring.mdc` | Fix complexity scoring system |
481
+ | `tools/auth-pr-tool.mdc` | PR authentication tool |
482
+ | `flow/reviewed-pr/` | Output folder for review documents |
483
+ | `.plan.flow.env` | Authentication tokens (gitignored) |
484
+ | `.example.plan.flow.env` | Example env file template |
485
+
486
+ ---
487
+
488
+ ## Authentication
489
+
490
+ Authentication is handled by the **[PR Authentication Tool](../tools/auth-pr-tool.mdc)**. See that tool for:
491
+
492
+ - Credential configuration
493
+ - Platform detection
494
+ - Authentication methods
495
+ - Error handling
496
+ - Security notes