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
Copy file name to clipboardExpand all lines: .cursor/commands/pr-address.md
+14-4Lines changed: 14 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,23 +12,33 @@
12
12
<ruleid="resolution-source-of-truth">Only explicitly resolved threads (`isResolved: true`) or `<!-- addressed:... -->` markers count as resolved. Recency (commits after a comment) does NOT mean resolved.</rule>
13
13
</rules>
14
14
15
-
<stepid="1"name="Fetch all unresolved feedback">
16
-
Always fetch live from GitHub. The script returns all unresolved feedback — no recency filtering.
15
+
<stepid="1"name="Fetch all unresolved feedback and PR body">
16
+
Always fetch live from GitHub. Run both in parallel:
If the script exits code 2 with `PROMPT_GH_AUTH`, prompt: "`gh` CLI is not authenticated. Please run: `gh auth login`"
26
+
If either script exits code 2 with `PROMPT_GH_AUTH`, prompt: "`gh` CLI is not authenticated. Please run: `gh auth login`"
23
27
24
-
The output contains:
28
+
The `fetch`output contains:
25
29
-**prAuthor**: The PR author's GitHub username
26
30
-**currentUser**: Your GitHub username (the authenticated `gh` user)
27
31
-**hasHumanReviewers**: `true` if any external human reviewer (not `currentUser`, not bots) has commented — used for autosquash decision
28
32
-**humanReviewers**: List of external human reviewer usernames
29
33
-**threads**: All unresolved inline review threads (includes comments from `currentUser` for context)
30
34
-**reviewBodies**: Latest review body per non-author reviewer (excludes `prAuthor` and bots)
31
35
-**topLevel**: Top-level comments (excludes `prAuthor` and bots)
36
+
37
+
The `fetch-pr-body` call writes the current PR body to `/tmp/pr-body.md`. This file is available for editing throughout the session. If you need to update the PR body (e.g. to revise the description after addressing feedback), edit `/tmp/pr-body.md` via the Write tool and push it back:
38
+
39
+
```bash
40
+
gh pr edit <NUMBER> --body-file /tmp/pr-body.md
41
+
```
32
42
</step>
33
43
34
44
<stepid="2"name="Process all unresolved feedback">
Copy file name to clipboardExpand all lines: .cursor/commands/pr-create.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,7 @@ Run full verification before creating the PR:
72
72
73
73
Where `<upstream-ref>` is `origin/develop` for `edge-react-gui` or `origin/master` for other repos. Set `block_until_ms: 120000`.
74
74
75
-
**CHANGELOG check:** Before running verification, confirm a CHANGELOG entry exists on this branch: `git diff origin/$DEFAULT_BRANCH..HEAD -- CHANGELOG.md`. If empty, add one now (see `im.md` CHANGELOG placement rules).
75
+
**CHANGELOG check:** Before running verification, read the top ~50 lines of `CHANGELOG.md` and confirm that entries exist which reflect the branch's changes. If no matching entries exist, add them now (see `im.md` CHANGELOG placement rules).
76
76
77
77
If verification fails, fix the issue, amend or fixup the relevant commit, push again, then continue.
@@ -142,14 +139,14 @@ If Asana context was fetched:
142
139
143
140
-**Title**: Align the PR title with the task name if it's descriptive.
144
141
-**Dependencies**: Cross-reference with linked PRs mentioned in task comments.
145
-
-**Context subsection**: Add a `#### Context` subsection at the **beginning** of the Description section — what the task is, why it matters, key decisions from comments. Wrap file paths, function names, and code references in backticks.
142
+
-**Context subsection**: Add a `#### Context` subsection at the **beginning** of the Description section — what the task is, why it matters, key decisions from comments. Wrap file paths, function names, and code references in backticks. The Asana link itself is injected by `pr-create.sh` via `--asana-task` — do not duplicate it here.
146
143
147
144
Example:
148
145
149
146
```markdown
150
147
#### Context
151
148
152
-
Asana: "gui: Token list not updating after add" (P2). The `useTokenList` hook
149
+
"gui: Token list not updating after add" (P2). The `useTokenList` hook
153
150
caches stale data because `useSyncEffect` doesn't re-trigger on `currencyConfig` changes.
154
151
155
152
#### Changes
@@ -167,13 +164,16 @@ caches stale data because `useSyncEffect` doesn't re-trigger on `currencyConfig`
167
164
<stepid="7"name="Create PR">
168
165
Create the PR immediately — do not ask for confirmation.
169
166
170
-
1.**Write the body to a temp file** using the Write tool (NOT a shell command):
167
+
1.**Write the body to a temp file** using the **Write tool** (NOT ApplyPatch, NOT a shell command):
171
168
- Path: `/tmp/pr-body.md`
172
169
- Content: the full PR body built in step 6
170
+
- The Write tool **overwrites** the file. ApplyPatch `Add File` may append to an existing file, causing stale content from a prior PR to bleed through. **Always use Write.**
- Pass `--asana-task <task_gid>` when an Asana task is available. The script injects a clickable Asana link into the PR body if one isn't already present. This is **required** for downstream `/pr-land` to extract the task GID.
176
+
- The script cleans up `/tmp/pr-body.md` after use to prevent cross-PR contamination. It will be re-populated from GitHub if needed during `/pr-address`.
177
177
178
178
Using `--body-file` avoids shell escaping issues with multi-line content. Do NOT use `--body` with inline content.
Copy file name to clipboardExpand all lines: .cursor/rules/fix-workflow-first.mdc
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
description: When a workflow issue is identified in a command or skill, fix the command/skill definition first before fixing the downstream misbehavior.
3
-
alwaysApply: true
3
+
alwaysApply: false
4
4
---
5
5
6
6
<goal>Ensure workflow definitions are fixed at the source before any workarounds are applied.</goal>
@@ -19,4 +19,4 @@ alwaysApply: true
19
19
5. **Resume the original task** only after the command/skill is updated.
20
20
</sequence>
21
21
22
-
<scope>This applies to all workflow issues — missed steps, incorrect output, wrong tool usage, formatting problems, etc. The command/skill is the source of truth; patching around it creates drift.</scope>
22
+
<scope>This applies to all workflow issues — missed steps, incorrect output, wrong tool usage, shell failures, formatting problems, etc. The command/skill is the source of truth; patching around it creates drift.</scope>
description: Halt on workflow errors and detect slash-command invocations in user messages
3
+
alwaysApply: true
4
+
---
5
+
6
+
<rules description="Non-negotiable constraints.">
7
+
8
+
<rule id="halt-on-error">When ANY shell command fails (non-zero exit code) during a workflow:
9
+
1. **STOP** — do not retry, work around, substitute, or continue the workflow.
10
+
2. **Report** — show the user the exact command, exit code, and error output.
11
+
3. **Diagnose** — classify the failure: missing tool (`command not found`), wrong path, permissions, or logic error.
12
+
4. **Evaluate workflow** — if the failure reveals a gap in a command/skill definition, read `~/.cursor/rules/fix-workflow-first.mdc` and follow it.
13
+
5. **Wait** — do not resume until the user responds.
14
+
</rule>
15
+
16
+
<rule id="no-silent-substitution">Do NOT silently substitute an alternative tool or approach when a command fails. If `rg` is not found, do not fall back to `grep`. If a script exits non-zero, do not manually replicate what the script does. The failure is the signal — report it.</rule>
17
+
18
+
</rules>
19
+
20
+
<slash-command-detection description="Detect /command invocations in user messages, analogous to answer-questions-first.mdc for '?' characters.">
21
+
22
+
Scan the user's message for `/word` tokens. A token is a **command invocation** when ALL of:
23
+
- `/word` is preceded by whitespace, a newline, or is at the start of the message
24
+
- `word` contains only lowercase letters and hyphens (e.g., `/im`, `/pr-create`, `/author`)
25
+
- `/word` is NOT inside a file path, URL, or code block
26
+
27
+
When detected:
28
+
1. Read `~/.cursor/commands/<word>.md` and follow it immediately.
29
+
2. If the file does not exist, inform the user: "Command `/<word>` not found in `~/.cursor/commands/`."
0 commit comments