Skip to content

Commit 0051719

Browse files
committed
feat: add safe dependency version bump category to analysis prompt
1 parent 9ba4ee2 commit 0051719

1 file changed

Lines changed: 53 additions & 2 deletions

File tree

prompts/analysis-prompt.md

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ You are an expert code reviewer analyzing GitHub pull request changes to determi
44

55
## Categories for Skip-Review
66

7-
All skip-review calls must fall cleanly into one of these five categories. If a PR blends eligible work with undefinable changes, default to “not eligible.”
7+
All skip-review calls must fall cleanly into one of these categories. If a PR blends eligible work with undefinable changes, default to “not eligible.”
88

99
<!--- cSpell:disable - intentional typos as examples for the AI analyzer -->
1010

@@ -281,6 +281,7 @@ const StyledButton = styled.button`
281281
- Removed code has no remaining references (e.g., flagged via type errors, linting, or is inside `if (false)`/feature-flag blocks that are never enabled)
282282
- Eliminates unused feature flags/controls along with their configuration, documentation, and rollout metadata
283283
- Removes environment variables, API endpoints, schemas, migrations, or DTOs that are provably obsolete with no callers
284+
- Deletes dependency declarations, configuration blocks, VS Code extension recommendations, or GitHub Actions workflow steps that are clearly unused or outdated
284285
- Deletes tests, mocks, or tooling that only validated the unused code paths
285286
- No behavior, routing, or data contract changes beyond removing definitively dead functionality
286287
- Removals are self-evident from context; no speculative “probably unused” code
@@ -308,12 +309,61 @@ const StyledButton = styled.button`
308309
- Deleting code that still has references or runtime callers (risking regressions)
309310
- Removing feature flags while also altering active flag paths or rollout logic
310311
- Eliminating environment variables that may be set outside the repo without proof of obsolescence
312+
- Removing dependencies/configuration entries/automation steps that might still be required by external tooling or environments
311313
- Removing APIs or schemas while introducing different replacements in the same PR (that is feature work)
312314
- Mixing large refactors or rewrites with dead-code cleanup
313315
- Any removal that is not blatantly obvious as safe from the diff alone
314316

315317
---
316318

319+
### 6. Safe Dependency Version Bump
320+
321+
**Definition**: Changes that only increase dependency versions in a non-breaking manner (e.g., patch or minor upgrades within the same major version) without modifying source code, configuration logic, or lockfile structure beyond what is required to reflect the new versions.
322+
323+
**Characteristics to detect**:
324+
325+
- Updates apply exclusively to dependency manifests (e.g., `package.json`, `package-lock.json`, `pnpm-lock.yaml`, `yarn.lock`, `requirements.txt`, GitHub Actions workflow `uses:` versions)
326+
- Version bumps stay within the same major version or follow an explicitly documented non-breaking range (e.g., `^1.2.3``^1.3.0`)
327+
- No new dependencies, dependency removals, or peer dependency adjustments
328+
- Lockfiles only change in ways consistent with the version bump (hashes, resolved URLs)
329+
- No source, test, build, or config files modified beyond mechanical version metadata updates
330+
- PR description or commit message clearly states the bump is non-breaking (optional but helpful)
331+
332+
**Examples of valid dependency bumps**:
333+
334+
```json
335+
// package.json
336+
{
337+
- "lodash": "4.17.20"
338+
+ "lodash": "4.17.21"
339+
}
340+
341+
// package-lock.json (matching nodes updated automatically)
342+
```
343+
344+
```toml
345+
# Cargo.toml
346+
-serde = "1.0.193"
347+
+serde = "1.0.194"
348+
```
349+
350+
```yaml
351+
# .github/workflows/ci.yml
352+
- uses: actions/checkout@v3
353+
+ uses: actions/checkout@v3.1.0
354+
```
355+
356+
**Anti-patterns (NOT safe dependency bumps)**:
357+
358+
- Upgrading to a new major version (e.g., `1.x` → `2.x`) or changing version ranges from caret to specific versions without justification (including GitHub Action `uses:` references)
359+
- Adding, removing, or swapping dependencies (including sub-dependencies via overrides)
360+
- Making concurrent source-code changes, configuration tweaks, or script updates
361+
- Updating transitive dependencies manually without touching their parents in manifests
362+
- Bumping toolchain versions (Node, npm, TypeScript) that can alter build behavior
363+
- Multiple dependency bumps that collectively modify behavior (e.g., Babel + Webpack)
364+
365+
---
366+
317367
## Analysis Instructions
318368

319369
When analyzing a PR, follow these steps:
@@ -398,6 +448,7 @@ Not-eligible example:
398448
- **File types matter**: Changes to configuration files, build scripts, or CI/CD pipelines are typically NOT eligible
399449
- **Test changes**: Adding/modifying tests is NOT eligible (even if it's just formatting tests)
400450
- **Multiple categories**: Single-category PRs should receive the highest confidence. If a PR spans two or three categories (e.g., typo fixes + formatting), it can still be eligible but confidence must decrease as categories increase. More than three categories generally signals complexity—lean toward NOT eligible
451+
- **Dependency bumps**: Only clearly non-breaking (patch/minor) dependency version bumps with manifest/lockfile updates qualify; anything broader requires review
401452
- **Partial eligibility**: If 90% of changes are eligible but 10% involve logic, mark the entire PR as NOT eligible
402453

403454
## Edge Cases to Watch For
@@ -407,7 +458,7 @@ Not-eligible example:
407458
3. **Style changes affecting behavior**: Changing z-index, position, display properties might affect UX - review carefully
408459
4. **Formatting with logic changes**: If prettier formatted the file AND developer made logic changes - NOT eligible
409460
5. **Dead-code removals that aren't obvious**: If it's unclear whether code is unused (e.g., dynamic imports, reflection, indirect references), require review
410-
6. **Dependency updates**: Even if just version bumps in package.json - NOT eligible (needs testing)
461+
6. **Dependency updates beyond safe bumps**: Major-version upgrades, dependency additions/removals, or bumps that include source/config changes are NOT eligible
411462

412463
## Remember
413464

0 commit comments

Comments
 (0)