You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: update Dependabot handling instructions and add prompt
Enhanced the instructions for handling Dependabot pull requests, emphasizing mandatory reading and execution of steps. Updated the comment posting process to require the use of GitHub CLI commands. Added a new prompt for guiding users through the Dependabot PR handling workflow, ensuring clarity and adherence to the updated rules. Removed outdated prompts related to planning and specification generation.
Signed-off-by: Odin Thomas Rochmann <[email protected]>
Full Dependabot review workflow (research, tests, comments, merge).
49
+
**⚠️ MANDATORY**: When handling ANY Dependabot PR, you MUST read this entire instruction file first. It contains mandatory steps including posting comments using `gh pr comment -F <file>.md`. Do not skip steps.
50
50
51
51
Each instruction file declares an `applyTo` glob so tools like Copilot/Cursor can automatically apply the right rules for the files you are editing.
Copy file name to clipboardExpand all lines: .github/instructions/dependabot-pr.instructions.md
+59-26Lines changed: 59 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,26 @@
1
1
---
2
2
description: Rules for reviewing and handling Dependabot pull requests
3
3
name: Dependabot PR Review Rules
4
+
applyTo:
5
+
- "**/dependabot.yml"
6
+
- ".github/workflows/dependabot.yml"
7
+
- ".github/dependabot.yml"
8
+
alwaysApply: true
4
9
---
5
10
6
11
# Dependabot PR Review Rules
7
12
13
+
**⚠️ CRITICAL: AI AGENTS MUST READ THIS ENTIRE FILE WHEN HANDLING DEPENDABOT PRs**
14
+
15
+
This instruction file contains **mandatory steps** that MUST be executed in order. Do not skip steps. Do not proceed without reading the full workflow below.
16
+
8
17
## TL;DR (for AI agents)
9
18
19
+
-**MANDATORY READING**: You MUST read this entire instruction file before handling any Dependabot PR. This is not optional.
10
20
-**Consent**: Never post comments, generate changesets, push commits, close PRs, or merge without explicit user approval.
11
21
-**Flow**: Rebase (if needed) → research dependency changes → install with `pnpm` → build → test → lint → (optionally) generate changeset → push → summarize → (optionally) merge.
12
22
-**Safety**: Stop immediately on build/test/lint/security failures or user timeout; do not auto-resolve complex conflicts.
13
-
-**Comments**: Use the provided research/results templates and always show content to the user for approval before posting.
23
+
-**Comments**: Use the provided research/results templates, create temporary markdown files, show content to the user for approval, then execute `gh pr comment <PR_NUMBER> -F <comment-file>.md` to post. Always clean up temporary files.
14
24
-**History**: Maintain linear history (force-with-lease after rebase) and clean up worktrees when done.
15
25
16
26
## Overview
@@ -76,8 +86,10 @@ Execute rebase analysis against base branch (default: `main`).
76
86
- Continue to Step 4
77
87
78
88
**B: Version Conflict (Auto-Close)**
79
-
- Post redundancy explanation comment
80
-
- Close PR with explanation
89
+
- Create temporary comment file: `gh-comment-version-conflict.md` with redundancy explanation
**CRITICAL**: You MUST execute the `gh pr comment` command when approved. Do not just say you will post it - actually run the command.
181
209
182
210
### 13. Squash Merge PR
183
211
@@ -230,16 +258,21 @@ All PR comments must use the provided templates:
230
258
231
259
## AI Agent Rules
232
260
261
+
**⚠️ MANDATORY: Read this entire section before handling Dependabot PRs**
262
+
233
263
When handling Dependabot PRs:
234
264
235
-
1.**Always get user consent** before posting comments or merging
236
-
2.**Follow all steps sequentially** - never skip steps
237
-
3.**Use provided templates** for all PR comments
238
-
4.**Validate thoroughly** - build, test, lint before approval
239
-
5.**Generate changesets** when required (follow [changeset rules](changesets.instructions.md))
240
-
6.**Maintain linear history** - use force-with-lease after rebase
241
-
7.**Clean up properly** - remove worktrees and temp directories
242
-
8.**Stop execution** on any critical failure or user timeout
265
+
1.**READ THIS FILE FIRST** - You must read and understand all steps before starting
266
+
2.**Always get user consent** before posting comments or merging
267
+
3.**Follow all steps sequentially** - never skip steps, especially Steps 5 and 12 (comment posting)
268
+
4.**Use provided templates** for all PR comments
269
+
5.**POST COMMENTS USING GITHUB CLI**: When approved, you MUST execute `gh pr comment <PR_NUMBER> -F <comment-file>.md`. Do not just say you will post - actually run the command. See [GitHub CLI file-based bodies rule](../.cursor/rules/github-cli-file-bodies.mdc)
270
+
6.**Clean up comment files**: Always remove temporary comment files (`gh-comment-*.md`) after posting or if declined
271
+
7.**Validate thoroughly** - build, test, lint before approval
272
+
8.**Generate changesets** when required (follow [changeset rules](changesets.instructions.md))
273
+
9.**Maintain linear history** - use force-with-lease after rebase
274
+
10.**Clean up properly** - remove worktrees and temp directories
275
+
11.**Stop execution** on any critical failure or user timeout
description: Prompt for handling Dependabot pull requests
3
+
name: Dependabot PR Handler Prompt
4
+
---
5
+
6
+
# Dependabot PR Handler Prompt
7
+
8
+
You are handling a Dependabot pull request. Follow the instructions in `.github/instructions/dependabot-pr.instructions.md`**completely and in order**.
9
+
10
+
## Initial Step: Identify the PR
11
+
12
+
### If PR URL is provided:
13
+
- Extract PR details: repository owner, repository name, PR number, and branch name
14
+
- Store these details for use throughout the workflow
15
+
- Proceed to Step 2: Create Git Worktree for PR
16
+
17
+
### If NO PR URL is provided:
18
+
You MUST do the following:
19
+
20
+
1.**List Dependabot PRs** (always do this first):
21
+
- Execute: `gh pr list --author "app/dependabot" --state open --json number,title`
22
+
- Display the list of open Dependabot PRs to the user in a formatted way:
23
+
```
24
+
Open Dependabot PRs:
25
+
26
+
#<number> - <title>
27
+
28
+
[Repeat for each PR]
29
+
```
30
+
- Categorize PRs by update type (MAJOR/MINOR/PATCH) if possible from the title or labels
31
+
- Group by update type if multiple PRs exist
32
+
33
+
2. **Ask user to select PR**:
34
+
- Prompt: "Please provide the Dependabot PR number (e.g., 1234) or PR URL from the list above"
35
+
- Wait for user response
36
+
- Parse the response to extract PR number or URL
37
+
- If PR number provided: Use `gh pr view <PR_NUMBER>` to get full PR details
**CRITICAL**: Never auto-select a PR. The user MUST explicitly choose which PR to handle.
42
+
43
+
## After PR Selection
44
+
45
+
Once the PR is identified (either from URL, ID, or user selection from list), continue with the full workflow from `.github/instructions/dependabot-pr.instructions.md`:
46
+
47
+
1. ✅ Select PR (completed above)
48
+
2. Create Git Worktree for PR
49
+
3. Rebase Branch
50
+
4. Research Dependencies
51
+
5. Post Research Comment (MANDATORY - use `gh pr comment <PR_NUMBER> -F <file>.md`)
-**⚠️ MANDATORY**: When handling ANY Dependabot PR, you MUST read `.github/instructions/dependabot-pr.instructions.md` in its entirety before starting.
91
+
- The instruction file contains mandatory workflow steps that MUST be executed in order.
92
+
- When posting comments, you MUST execute `gh pr comment <PR_NUMBER> -F <comment-file>.md` - do not just say you will post it.
91
93
- Do not post PR comments, push commits, or merge without user confirmation.
92
94
93
95
When unsure, **stop and ask the user** instead of guessing.
0 commit comments