@mallardbay/cursor-rules 1.0.34 → 1.1.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.
- package/.cursor/frontend/rules/ui.mdc +0 -3
- package/.cursor/frontend-mobile/rules/{mobile-ui.mdc → ui.mdc} +0 -1
- package/.cursor/shared/rules/code-review.mdc +1 -1
- package/.cursor/shared/skills/address-pr-feedback/SKILL.md +1 -28
- package/.cursor/shared/skills/check-and-fix-ci/SKILL.md +0 -22
- package/.cursor/shared/skills/commit-and-pr/SKILL.md +76 -83
- package/.cursor/shared/skills/commit-and-push/SKILL.md +9 -7
- package/.cursor/shared/skills/prep-for-pr/SKILL.md +1 -32
- package/.cursor/shared/skills/review-pr/SKILL.md +5 -29
- package/.cursor/shared/skills/should-we-merge/SKILL.md +1 -24
- package/.cursor/skills/prep-for-pr/SKILL.md +1 -1
- package/.cursor/skills/review-pr/SKILL.md +1 -1
- package/bin/setup-cursor.sh +0 -0
- package/package.json +3 -2
- package/.cursor/frontend-mobile/rules/react-native.mdc +0 -92
- package/.cursor/rules/code-quality.mdc +0 -55
- package/.cursor/rules/code-review.mdc +0 -46
- package/.cursor/rules/error-handling.mdc +0 -48
- package/.cursor/rules/general-best-practices.mdc +0 -190
- package/.cursor/rules/mallardbay.mdc +0 -23
- package/.cursor/rules/performance.mdc +0 -45
- package/.cursor/rules/testing.mdc +0 -72
- package/.cursor/rules/typescript.mdc +0 -29
- package/.cursor/rules/ui.mdc +0 -91
|
@@ -48,9 +48,6 @@ Maintain clean and consistent component structure:
|
|
|
48
48
|
|
|
49
49
|
- Use existing components in @mallardbay/lib-react-components, @mallardbay/lib-react-components is based off Crakra UI v2
|
|
50
50
|
- If no component available in @mallardbay/lib-react-components, create one using Crakra UI and place it under src/components/shared/todo-lib-react-components/ to me moved later
|
|
51
|
-
- **Do not import directly from `@chakra-ui/react`**—always import components, hooks, and utilities from `@mallardbay/lib-react-components` instead
|
|
52
|
-
- This ensures a consistent design system, proper theming, and easier future migrations
|
|
53
|
-
- If something you need is not re-exported by `@mallardbay/lib-react-components`, add it there first rather than importing from `@chakra-ui/react` directly
|
|
54
51
|
|
|
55
52
|
## Responsive Design
|
|
56
53
|
|
|
@@ -87,7 +87,6 @@ Maintain clean and consistent component structure:
|
|
|
87
87
|
### React Native Specifics
|
|
88
88
|
|
|
89
89
|
- Use `StyleSheet.create` or NativeBase style props — avoid inline object styles
|
|
90
|
-
- **`StyleSheet.create` must be placed at the bottom of the file** — never at the top. See [react-native.mdc](mdc:react-native.mdc) for full file ordering and the `useStyles` hook pattern
|
|
91
90
|
- Prefer `FlatList` / `SectionList` over mapping arrays for long lists
|
|
92
91
|
- Use platform-specific extensions (`.ios.tsx`, `.android.tsx`) only when behavior genuinely diverges
|
|
93
92
|
- Test on both iOS and Android
|
|
@@ -139,34 +139,7 @@ gh pr comment <number> --body "@reviewer Ready for another look! ✅"
|
|
|
139
139
|
|
|
140
140
|
## Output Format
|
|
141
141
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
```markdown
|
|
145
|
-
**PR Link:** <pr-url>
|
|
146
|
-
**Branch Preview:** <preview-url> ← include only if detected; omit entirely otherwise
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
Then provide: PR status (conflicts & checks), summary of feedback addressed, changes made, conversations resolved, remaining items, next steps.
|
|
150
|
-
|
|
151
|
-
### Detecting the Branch Preview URL
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
|
-
PR_NUMBER=<pr-number>
|
|
155
|
-
|
|
156
|
-
PREVIEW_URL=$(gh pr view "$PR_NUMBER" --json statusCheckRollup \
|
|
157
|
-
--jq '[.statusCheckRollup[]? | (.targetUrl // .detailsUrl // "")]
|
|
158
|
-
| map(select(test("vercel\\.app|netlify\\.app|pages\\.dev|onrender\\.com|preview"; "i")))
|
|
159
|
-
| .[0] // ""')
|
|
160
|
-
|
|
161
|
-
if [ -z "$PREVIEW_URL" ]; then
|
|
162
|
-
PREVIEW_URL=$(gh pr view "$PR_NUMBER" --json comments \
|
|
163
|
-
--jq '.comments[]?.body' \
|
|
164
|
-
| grep -oE 'https?://[a-zA-Z0-9.-]+\.(vercel\.app|netlify\.app|pages\.dev|onrender\.com)[^ )>"]*' \
|
|
165
|
-
| head -1)
|
|
166
|
-
fi
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
Do not use a placeholder such as "n/a" when no preview URL is found—omit the line.
|
|
142
|
+
Provide: PR status (conflicts & checks), summary of feedback addressed, changes made, conversations resolved, remaining items, next steps.
|
|
170
143
|
|
|
171
144
|
## Notes
|
|
172
145
|
|
|
@@ -120,8 +120,6 @@ gh run watch
|
|
|
120
120
|
```markdown
|
|
121
121
|
## CI Check Results
|
|
122
122
|
|
|
123
|
-
**PR Link:** <pr-url>
|
|
124
|
-
**Branch Preview:** <preview-url> ← include only if detected; omit entirely otherwise
|
|
125
123
|
**PR:** #<number> - <title>
|
|
126
124
|
**Branch:** <branch>
|
|
127
125
|
|
|
@@ -144,26 +142,6 @@ gh run watch
|
|
|
144
142
|
- <if any remain>
|
|
145
143
|
```
|
|
146
144
|
|
|
147
|
-
### Detecting the Branch Preview URL
|
|
148
|
-
|
|
149
|
-
```bash
|
|
150
|
-
PR_NUMBER=<pr-number>
|
|
151
|
-
|
|
152
|
-
PREVIEW_URL=$(gh pr view "$PR_NUMBER" --json statusCheckRollup \
|
|
153
|
-
--jq '[.statusCheckRollup[]? | (.targetUrl // .detailsUrl // "")]
|
|
154
|
-
| map(select(test("vercel\\.app|netlify\\.app|pages\\.dev|onrender\\.com|preview"; "i")))
|
|
155
|
-
| .[0] // ""')
|
|
156
|
-
|
|
157
|
-
if [ -z "$PREVIEW_URL" ]; then
|
|
158
|
-
PREVIEW_URL=$(gh pr view "$PR_NUMBER" --json comments \
|
|
159
|
-
--jq '.comments[]?.body' \
|
|
160
|
-
| grep -oE 'https?://[a-zA-Z0-9.-]+\.(vercel\.app|netlify\.app|pages\.dev|onrender\.com)[^ )>"]*' \
|
|
161
|
-
| head -1)
|
|
162
|
-
fi
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
Omit the Branch Preview line entirely when no preview URL is detected—do not use a placeholder.
|
|
166
|
-
|
|
167
145
|
## Notes
|
|
168
146
|
|
|
169
147
|
- Prioritize fixing non-transient issues; don't waste time on flaky/timeout failures
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: commit-and-pr
|
|
3
|
-
description: Add untracked files, commit changes using yarn commit (if available) with prefilled answers, and create a PR using the Mallard Bay template.
|
|
3
|
+
description: Add untracked files, commit changes using yarn commit (if available) with prefilled answers, and create a PR using the Mallard Bay template. GitHub issue number can be provided in the message (e.g., "/commit-and-pr 123" or "/commit-and-pr #123") or will be extracted from commit or asked if needed.
|
|
4
4
|
version: 1.0.0
|
|
5
5
|
tags:
|
|
6
6
|
- pr
|
|
@@ -11,7 +11,7 @@ tags:
|
|
|
11
11
|
|
|
12
12
|
# Commit and Create PR
|
|
13
13
|
|
|
14
|
-
Automates the workflow of staging untracked files, committing changes, and creating a pull request. Uses `yarn commit` (commitizen) if available with prefilled answers.
|
|
14
|
+
Automates the workflow of staging untracked files, committing changes, and creating a pull request. Uses `yarn commit` (commitizen) if available with prefilled answers. The GitHub issue number can be provided when invoking the skill (e.g., `/commit-and-pr 123` or `/commit-and-pr #123`), extracted from existing commit messages, or will be requested if not found.
|
|
15
15
|
|
|
16
16
|
## When to Use
|
|
17
17
|
|
|
@@ -22,12 +22,17 @@ Automates the workflow of staging untracked files, committing changes, and creat
|
|
|
22
22
|
|
|
23
23
|
## Usage Examples
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
-
|
|
25
|
+
You can invoke this skill with a GitHub issue number:
|
|
26
|
+
- `/commit-and-pr 123` - Commit and create PR for issue #123
|
|
27
|
+
- `/commit-and-pr #123` - Commit and create PR for issue #123 (with # prefix)
|
|
28
|
+
- `commit and create PR for issue 456` - Extract issue number from message
|
|
29
|
+
- `commit-and-pr` - Will extract issue number from commit or ask for it
|
|
30
|
+
|
|
31
|
+
The issue number can be provided in various formats: `123`, `#123`, `issue 123`, `ticket 123`, etc.
|
|
27
32
|
|
|
28
33
|
## Instructions
|
|
29
34
|
|
|
30
|
-
**Important:**
|
|
35
|
+
**Important:** When this skill is invoked, check the user's message for a GitHub issue number first. Users can provide the issue number when invoking the skill (e.g., `/commit-and-pr 123` or `/commit-and-pr #123` or "commit and create PR for issue 123"). Extract it from their message before asking for it.
|
|
31
36
|
|
|
32
37
|
### Step 1: Check Git Status and Branch
|
|
33
38
|
|
|
@@ -90,7 +95,29 @@ Verify what was added:
|
|
|
90
95
|
git status
|
|
91
96
|
```
|
|
92
97
|
|
|
93
|
-
### Step 3:
|
|
98
|
+
### Step 3: Get GitHub Issue Number
|
|
99
|
+
|
|
100
|
+
**Priority order for finding GitHub issue number:**
|
|
101
|
+
|
|
102
|
+
1. **Check user's message** (if skill was invoked with issue number):
|
|
103
|
+
- Look for GitHub issue number patterns in the user's message when invoking the skill
|
|
104
|
+
- Common patterns: `#123`, `123`, `issue 123`, `ticket 123`, `[#123]`, `(#123)`, `Closes #123`, `Closes 123`
|
|
105
|
+
- Examples: User says "/commit-and-pr 123" or "/commit-and-pr #123" or "commit and create PR for issue 123"
|
|
106
|
+
- Extract the issue number from the message if present (remove # prefix if present, store as plain number)
|
|
107
|
+
|
|
108
|
+
2. **If already committed** (and issue number not in user message):
|
|
109
|
+
- Extract issue number from the most recent commit message
|
|
110
|
+
- Use `git log -1 --pretty=%B` to get the last commit message
|
|
111
|
+
- Look for issue patterns like: `#123`, `Closes #123`, `Closes 123`, `[#123]`, `(#123)`, `issue 123`, or just numbers
|
|
112
|
+
- If issue number is found in commit, use it (extract number, ignore # prefix)
|
|
113
|
+
|
|
114
|
+
3. **If not found** (and not already committed):
|
|
115
|
+
- Ask the developer for the GitHub issue number (e.g., "123" or "#123")
|
|
116
|
+
- Store this as a plain number (without # prefix) for use in commit and PR
|
|
117
|
+
|
|
118
|
+
**Note:** When a user invokes this skill with an issue number (e.g., `/commit-and-pr 123` or `/commit-and-pr #123` or "commit and create PR for issue 123"), extract the issue number from their message rather than asking for it. Store issue numbers as plain numbers (e.g., `123`) for consistency, even if user provides `#123`.
|
|
119
|
+
|
|
120
|
+
### Step 4: Analyze Changes for Commit Message
|
|
94
121
|
|
|
95
122
|
Before committing, analyze the changes to infer commit type and description:
|
|
96
123
|
|
|
@@ -117,7 +144,7 @@ git diff --cached --stat
|
|
|
117
144
|
- Create a concise, descriptive summary
|
|
118
145
|
- Use present tense, imperative mood (e.g., "Add feature" not "Added feature")
|
|
119
146
|
|
|
120
|
-
### Step
|
|
147
|
+
### Step 5: Commit Changes
|
|
121
148
|
|
|
122
149
|
**Prepare commit message:**
|
|
123
150
|
|
|
@@ -125,8 +152,12 @@ Create a commit message using the inferred type and description from Step 4:
|
|
|
125
152
|
|
|
126
153
|
```bash
|
|
127
154
|
# Format: <type>: <description>
|
|
155
|
+
#
|
|
156
|
+
# Closes #<issue-number>
|
|
128
157
|
```
|
|
129
158
|
|
|
159
|
+
Where `<issue-number>` is the GitHub issue number from Step 3 (use `#` prefix in commit message for GitHub to link it).
|
|
160
|
+
|
|
130
161
|
**If `yarn commit` is available:**
|
|
131
162
|
|
|
132
163
|
Check if `yarn commit` script exists:
|
|
@@ -150,6 +181,8 @@ Create a commit message file and use it:
|
|
|
150
181
|
# Create commit message file
|
|
151
182
|
cat > /tmp/commit-msg.txt <<EOF
|
|
152
183
|
<type>: <description>
|
|
184
|
+
|
|
185
|
+
Closes #<issue-number>
|
|
153
186
|
EOF
|
|
154
187
|
|
|
155
188
|
# Use git commit directly (bypasses commitizen but uses same format)
|
|
@@ -163,6 +196,7 @@ If commitizen requires interactive input, inform the developer they'll need to:
|
|
|
163
196
|
- Confirm scope (if applicable, leave blank or suggest based on changed files)
|
|
164
197
|
- Confirm short description (suggest: `<inferred-description>`)
|
|
165
198
|
- Skip long description (unless needed)
|
|
199
|
+
- Enter GitHub issue number when prompted: `#<issue-number>` (include # prefix for GitHub linking)
|
|
166
200
|
|
|
167
201
|
Then run: `yarn commit`
|
|
168
202
|
|
|
@@ -170,36 +204,18 @@ Then run: `yarn commit`
|
|
|
170
204
|
|
|
171
205
|
Use standard git commit with conventional commit format:
|
|
172
206
|
```bash
|
|
173
|
-
git commit -m "<type>: <description>
|
|
207
|
+
git commit -m "<type>: <description>
|
|
208
|
+
|
|
209
|
+
Closes #<issue-number>"
|
|
174
210
|
```
|
|
175
211
|
|
|
176
212
|
Where:
|
|
177
213
|
- `<type>` is the inferred commit type from Step 4 (e.g., `feat`, `fix`, `docs`)
|
|
178
214
|
- `<description>` is the inferred description from Step 4 (concise, present tense)
|
|
215
|
+
- `<issue-number>` is the GitHub issue number from Step 3 (use `#` prefix for GitHub to automatically link the issue)
|
|
179
216
|
|
|
180
217
|
**Important:** Always ensure the commit message follows conventional commit format. If commitizen interaction fails or is not available, use standard git commit with a properly formatted message.
|
|
181
218
|
|
|
182
|
-
### Step 5: Lint and Test Before Pushing
|
|
183
|
-
|
|
184
|
-
**This is a hard gate—do not push until lint and tests are clean.**
|
|
185
|
-
|
|
186
|
-
**Lint the entire project:**
|
|
187
|
-
```bash
|
|
188
|
-
yarn lint:quiet:slow
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
- Fix all lint errors before proceeding. Your changes may introduce lint errors in files you didn't directly edit (e.g. unused exports, circular dependencies, type mismatches).
|
|
192
|
-
- Do not disable eslint rules to make errors go away—fix the underlying issues.
|
|
193
|
-
|
|
194
|
-
**Run related tests:**
|
|
195
|
-
```bash
|
|
196
|
-
# Identify test files related to your changes and run them
|
|
197
|
-
# If unsure which tests are related, err on the side of running more
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
- Ensure all related tests pass before pushing.
|
|
201
|
-
- If any tests fail, fix the failures before proceeding.
|
|
202
|
-
|
|
203
219
|
### Step 6: Push Branch
|
|
204
220
|
|
|
205
221
|
**Before pushing, verify branch protection one more time:**
|
|
@@ -238,8 +254,9 @@ Gather information needed for PR:
|
|
|
238
254
|
|
|
239
255
|
1. **Branch name:** `git branch --show-current`
|
|
240
256
|
2. **Base branch:** Usually `main` or `master` (check with `git remote show origin`)
|
|
241
|
-
3. **
|
|
242
|
-
4. **
|
|
257
|
+
3. **GitHub issue number:** From Step 3
|
|
258
|
+
4. **Commit messages:** Use `git log origin/main..HEAD --oneline` to get commit messages since base branch
|
|
259
|
+
5. **Changed files:** Use `git diff --name-status origin/main...HEAD` to see what changed
|
|
243
260
|
|
|
244
261
|
### Step 8: Create PR Description
|
|
245
262
|
|
|
@@ -253,9 +270,9 @@ Use the Mallard Bay PR template from: https://github.com/mallardbay/.github/blob
|
|
|
253
270
|
|
|
254
271
|
- [Generate from commit messages and changed files]
|
|
255
272
|
|
|
256
|
-
**2.
|
|
273
|
+
**2. What ticket does this PR address?**
|
|
257
274
|
|
|
258
|
-
-
|
|
275
|
+
- #<issue-number>
|
|
259
276
|
|
|
260
277
|
**3. Screenshots, clips, demo links etc**
|
|
261
278
|
|
|
@@ -286,7 +303,7 @@ Use the Mallard Bay PR template from: https://github.com/mallardbay/.github/blob
|
|
|
286
303
|
- Analyze commit messages to understand what the PR does
|
|
287
304
|
- List key changes from `git diff --name-status`
|
|
288
305
|
- Fill in section 1 with a summary based on commits and changes
|
|
289
|
-
- Fill in section 2 with
|
|
306
|
+
- Fill in section 2 with the GitHub issue number (format as `#123`)
|
|
290
307
|
- Leave sections 3 and 4 as TODO for the developer to fill
|
|
291
308
|
|
|
292
309
|
### Step 9: Check for Existing PR
|
|
@@ -303,12 +320,11 @@ EXIT_CODE=$?
|
|
|
303
320
|
```
|
|
304
321
|
|
|
305
322
|
**If PR already exists** (exit code 0 and PR_INFO contains data):
|
|
306
|
-
- Extract the PR URL, number, and title from the JSON output
|
|
307
|
-
- Also attempt to capture a `PREVIEW_URL` using the detection snippet in Step 10 (preview URL fetch)
|
|
323
|
+
- Extract the PR URL, number, and title from the JSON output
|
|
308
324
|
- Display a message: "PR already exists for this branch"
|
|
309
325
|
- Show the PR link: Use the `url` field from JSON (e.g., `https://github.com/<owner>/<repo>/pull/<number>`)
|
|
310
326
|
- Show PR number and title
|
|
311
|
-
- Skip PR creation and proceed to Step 11 with the existing PR information
|
|
327
|
+
- Skip PR creation and proceed to Step 11 with the existing PR information
|
|
312
328
|
|
|
313
329
|
**If PR does not exist** (exit code non-zero or empty PR_INFO):
|
|
314
330
|
- Continue to create a new PR (proceed to Step 10)
|
|
@@ -353,12 +369,14 @@ fi
|
|
|
353
369
|
```bash
|
|
354
370
|
BRANCH_NAME=$(git branch --show-current)
|
|
355
371
|
gh pr create \
|
|
356
|
-
--title "<type>: <description>" \
|
|
372
|
+
--title "<type>: <description> - #<issue-number>" \
|
|
357
373
|
--body "<PR description from Step 8>" \
|
|
358
374
|
--base "$BASE_BRANCH" \
|
|
359
375
|
--head "$BRANCH_NAME"
|
|
360
376
|
```
|
|
361
377
|
|
|
378
|
+
Where `<issue-number>` is the GitHub issue number from Step 3 (include `#` prefix in title for GitHub linking).
|
|
379
|
+
|
|
362
380
|
**Capture PR URL and details:**
|
|
363
381
|
```bash
|
|
364
382
|
# Get the PR URL and number after creation
|
|
@@ -371,73 +389,42 @@ PR_TITLE=$(gh pr view "$BRANCH_NAME" --json title --jq '.title')
|
|
|
371
389
|
# Store these for use in Step 11
|
|
372
390
|
```
|
|
373
391
|
|
|
374
|
-
**Capture branch preview URL (if available):**
|
|
375
|
-
|
|
376
|
-
Many projects have a preview deployment (Vercel, Netlify, Cloudflare Pages, Render, etc.) that exposes a per-branch URL via a status check or a bot-posted PR comment. Attempt to detect it:
|
|
377
|
-
|
|
378
|
-
```bash
|
|
379
|
-
# Prefer status checks - deployment providers usually expose a targetUrl/detailsUrl
|
|
380
|
-
PREVIEW_URL=$(gh pr view "$PR_NUMBER" --json statusCheckRollup \
|
|
381
|
-
--jq '[.statusCheckRollup[]? | (.targetUrl // .detailsUrl // "")]
|
|
382
|
-
| map(select(test("vercel\\.app|netlify\\.app|pages\\.dev|onrender\\.com|preview"; "i")))
|
|
383
|
-
| .[0] // ""')
|
|
384
|
-
|
|
385
|
-
# Fallback: scan PR comments for preview URLs posted by deployment bots
|
|
386
|
-
if [ -z "$PREVIEW_URL" ]; then
|
|
387
|
-
PREVIEW_URL=$(gh pr view "$PR_NUMBER" --json comments \
|
|
388
|
-
--jq '.comments[]?.body' \
|
|
389
|
-
| grep -oE 'https?://[a-zA-Z0-9.-]+\.(vercel\.app|netlify\.app|pages\.dev|onrender\.com)[^ )>"]*' \
|
|
390
|
-
| head -1)
|
|
391
|
-
fi
|
|
392
|
-
```
|
|
393
|
-
|
|
394
|
-
Preview checks may take a few seconds to appear after pushing. If `PREVIEW_URL` is empty, it's fine—omit the preview line from the final summary rather than showing a placeholder.
|
|
395
|
-
|
|
396
392
|
**Handle errors:**
|
|
397
393
|
- If authentication fails, prompt user to authenticate
|
|
398
394
|
- If branch conflicts, inform user
|
|
399
395
|
- If creation fails for other reasons, provide clear error message
|
|
400
396
|
|
|
401
|
-
### Step 11: Provide Summary
|
|
402
|
-
|
|
403
|
-
**Always display the PR link and, when available, the branch preview URL prominently at the end.**
|
|
397
|
+
### Step 11: Provide Summary and PR Link
|
|
404
398
|
|
|
405
|
-
|
|
406
|
-
- `PR_URL` — the pull request URL
|
|
407
|
-
- `PR_NUMBER` — the pull request number
|
|
408
|
-
- `PR_TITLE` — the pull request title
|
|
409
|
-
- `PREVIEW_URL` — the branch preview deployment URL (may be empty)
|
|
399
|
+
**Always display the PR link prominently at the end:**
|
|
410
400
|
|
|
411
|
-
If PR already existed (from Step 9
|
|
412
|
-
- **PR Link:** `
|
|
413
|
-
- **Branch Preview:** `PREVIEW_URL` (include only if non-empty)
|
|
401
|
+
If PR already existed (from Step 9):
|
|
402
|
+
- **PR Link:** `https://github.com/<owner>/<repo>/pull/<number>`
|
|
414
403
|
- Message: "PR already exists for this branch"
|
|
415
404
|
- PR number and title
|
|
416
405
|
|
|
417
|
-
If PR was just created (from Step 10
|
|
418
|
-
- **PR Link:** `PR_URL
|
|
419
|
-
-
|
|
406
|
+
If PR was just created (from Step 10):
|
|
407
|
+
- **PR Link:** `https://github.com/<owner>/<repo>/pull/<number>` (from captured PR_URL)
|
|
408
|
+
- PR number (from captured PR_NUMBER)
|
|
420
409
|
- Success message: "PR created successfully"
|
|
421
410
|
|
|
422
411
|
**Additional summary information:**
|
|
423
412
|
- Summary of what was committed
|
|
424
413
|
- Branch name
|
|
425
414
|
- Base branch
|
|
415
|
+
- GitHub issue number used (format as `#123`)
|
|
426
416
|
- Reminder to fill in TODO sections in PR description (sections 3 and 4)
|
|
427
417
|
- Next steps (e.g., request reviewers, add labels, fill in screenshots/demo links)
|
|
428
418
|
|
|
429
419
|
**Format the final output clearly:**
|
|
430
420
|
```markdown
|
|
431
|
-
✅ PR Link:
|
|
432
|
-
🔗 Branch Preview: <PREVIEW_URL> ← omit this line entirely if no preview URL was found
|
|
421
|
+
✅ PR Link: https://github.com/<owner>/<repo>/pull/<number>
|
|
433
422
|
📋 PR #<number>: <title>
|
|
423
|
+
🎫 Issue: #<issue-number>
|
|
434
424
|
🌿 Branch: <branch-name> → <base-branch>
|
|
435
425
|
```
|
|
436
426
|
|
|
437
|
-
**CRITICAL:**
|
|
438
|
-
- Always display the PR link prominently at the very end of your response. Make it the most visible element—use markdown formatting so it stands out and is clickable.
|
|
439
|
-
- Always include the branch preview URL when one was detected. It is the second most important output for visual/QA review.
|
|
440
|
-
- If no preview URL was detected, do NOT show a placeholder like "n/a" or "none"—simply omit the Branch Preview line.
|
|
427
|
+
**CRITICAL:** Always display the PR link prominently at the very end of your response. Make it the most visible element - use markdown formatting to make it stand out, and ensure it's clickable. The PR link is the most important output of this skill.
|
|
441
428
|
|
|
442
429
|
## Error Handling
|
|
443
430
|
|
|
@@ -445,10 +432,14 @@ If PR was just created (from Step 10 creation):
|
|
|
445
432
|
- Fall back to standard `git commit`
|
|
446
433
|
- Inform user that commitizen wasn't used
|
|
447
434
|
|
|
435
|
+
**If GitHub issue number not found:**
|
|
436
|
+
- Ask user for GitHub issue number explicitly
|
|
437
|
+
- If user doesn't provide, create PR without issue number (they can add later or link manually)
|
|
438
|
+
|
|
448
439
|
**If PR creation fails:**
|
|
449
|
-
- Verify branch is pushed (should already be done in Step
|
|
450
|
-
- Check authentication status (should already be verified in Step
|
|
451
|
-
- If PR already exists, this should have been caught in Step
|
|
440
|
+
- Verify branch is pushed (should already be done in Step 6)
|
|
441
|
+
- Check authentication status (should already be verified in Step 10)
|
|
442
|
+
- If PR already exists, this should have been caught in Step 9 - double-check with `gh pr view`
|
|
452
443
|
- Provide clear error message and next steps
|
|
453
444
|
- Still attempt to show PR link if one exists
|
|
454
445
|
|
|
@@ -461,11 +452,13 @@ If PR was just created (from Step 10 creation):
|
|
|
461
452
|
- **CRITICAL: Never push directly to protected branches** (`main`, `development`, `production`)
|
|
462
453
|
- **Always use semantic release prefixes** for branch names (`feat/`, `fix/`, `test/`, `docs/`, `refactor/`, `chore/`, `perf/`, `style/`)
|
|
463
454
|
- This skill assumes conventional commit format (feat, fix, docs, etc.)
|
|
455
|
+
- GitHub issue numbers are plain numbers (e.g., `123`) but should be formatted with `#` prefix in commit messages and PR titles for GitHub linking
|
|
464
456
|
- PR template TODOs should be filled by developer after PR creation
|
|
465
457
|
- Always verify git status and branch name before making changes
|
|
466
458
|
- Use GitHub CLI (`gh`) for PR creation - it's the most reliable method
|
|
467
459
|
- If commitizen config is non-standard, may need to adapt the commit step
|
|
468
460
|
- Consider running `prep-for-pr` skill before this one to ensure code quality
|
|
461
|
+
- When extracting issue numbers, remove `#` prefix for storage but add it back when using in commits/PRs for GitHub linking
|
|
469
462
|
- If on a protected branch, create a feature branch first before committing
|
|
470
463
|
|
|
471
464
|
## Authentication
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: commit-and-push
|
|
3
|
-
description: Alias for commit-and-pr skill. Commits changes and pushes to remote. If PR exists, shows link; if not, creates PR.
|
|
3
|
+
description: Alias for commit-and-pr skill. Commits changes and pushes to remote. If PR exists, shows link; if not, creates PR. GitHub issue number can be provided (e.g., "/commit-and-push 123").
|
|
4
4
|
version: 1.0.0
|
|
5
5
|
tags:
|
|
6
6
|
- commit
|
|
@@ -26,20 +26,22 @@ This is an alias skill that uses the same functionality as `commit-and-pr`. It c
|
|
|
26
26
|
|
|
27
27
|
1. **Check Git Status** - Understand what needs to be committed
|
|
28
28
|
2. **Add Untracked Files** - Stage all untracked files with `git add .`
|
|
29
|
-
3. **
|
|
30
|
-
4. **
|
|
31
|
-
5. **
|
|
29
|
+
3. **Get GitHub Issue Number** - Extract from user message, existing commit, or ask
|
|
30
|
+
4. **Analyze Changes** - Infer commit type and description from changes
|
|
31
|
+
5. **Commit Changes** - Use `yarn commit` if available, or standard git commit with conventional format
|
|
32
32
|
6. **Push Branch** - Push to remote, set upstream if needed
|
|
33
33
|
7. **Check for Existing PR** - If PR exists, show link and skip creation
|
|
34
34
|
8. **Create PR** - If no PR exists, create one using Mallard Bay template
|
|
35
|
-
9. **Show PR Link
|
|
35
|
+
9. **Show PR Link** - Always display PR link prominently at the end
|
|
36
36
|
|
|
37
37
|
**Reference:** See `.cursor/shared/skills/commit-and-pr/SKILL.md` for complete detailed instructions. This alias uses identical logic and behavior.
|
|
38
38
|
|
|
39
39
|
## Usage Examples
|
|
40
40
|
|
|
41
|
-
- `/commit-and-push` - Commit and push
|
|
42
|
-
-
|
|
41
|
+
- `/commit-and-push 123` - Commit and push for issue #123
|
|
42
|
+
- `/commit-and-push #123` - Commit and push for issue #123 (with # prefix)
|
|
43
|
+
- `/commit-and-push` - Extract issue number from commit or ask
|
|
44
|
+
- `commit and push changes` - Extract issue number from commit or ask
|
|
43
45
|
|
|
44
46
|
## Notes
|
|
45
47
|
|
|
@@ -34,7 +34,7 @@ Systematically check the new work on this branch and fix issues as you find them
|
|
|
34
34
|
### Code Quality Checks
|
|
35
35
|
|
|
36
36
|
**Feature Gaps**
|
|
37
|
-
- [ ] Are all requirements from the issue addressed?
|
|
37
|
+
- [ ] Are all requirements from the ticket/issue addressed?
|
|
38
38
|
- [ ] Are edge cases handled appropriately?
|
|
39
39
|
- [ ] Is error handling comprehensive?
|
|
40
40
|
- [ ] Are user-facing features complete (no TODOs or placeholders)?
|
|
@@ -149,37 +149,6 @@ After preparing the branch, provide:
|
|
|
149
149
|
2. **Issues Fixed**: List of specific issues that were addressed
|
|
150
150
|
3. **Remaining Items**: Any items that need attention but couldn't be fixed automatically
|
|
151
151
|
4. **Readiness Status**: Whether the branch is ready for PR creation
|
|
152
|
-
5. **PR Link and Branch Preview URL**: If a PR already exists for this branch, include:
|
|
153
|
-
- **PR Link:** the pull request URL
|
|
154
|
-
- **Branch Preview:** the preview deployment URL (if one is detected)
|
|
155
|
-
|
|
156
|
-
If no PR exists yet (this skill commonly runs before PR creation), clearly note "No PR yet—run `/commit-and-pr` to create one" instead of fabricating a link.
|
|
157
|
-
|
|
158
|
-
### Detecting PR and Preview URL
|
|
159
|
-
|
|
160
|
-
```bash
|
|
161
|
-
BRANCH=$(git branch --show-current)
|
|
162
|
-
PR_JSON=$(gh pr view "$BRANCH" --json url,number 2>/dev/null)
|
|
163
|
-
|
|
164
|
-
if [ -n "$PR_JSON" ]; then
|
|
165
|
-
PR_URL=$(echo "$PR_JSON" | jq -r '.url')
|
|
166
|
-
PR_NUMBER=$(echo "$PR_JSON" | jq -r '.number')
|
|
167
|
-
|
|
168
|
-
PREVIEW_URL=$(gh pr view "$PR_NUMBER" --json statusCheckRollup \
|
|
169
|
-
--jq '[.statusCheckRollup[]? | (.targetUrl // .detailsUrl // "")]
|
|
170
|
-
| map(select(test("vercel\\.app|netlify\\.app|pages\\.dev|onrender\\.com|preview"; "i")))
|
|
171
|
-
| .[0] // ""')
|
|
172
|
-
|
|
173
|
-
if [ -z "$PREVIEW_URL" ]; then
|
|
174
|
-
PREVIEW_URL=$(gh pr view "$PR_NUMBER" --json comments \
|
|
175
|
-
--jq '.comments[]?.body' \
|
|
176
|
-
| grep -oE 'https?://[a-zA-Z0-9.-]+\.(vercel\.app|netlify\.app|pages\.dev|onrender\.com)[^ )>"]*' \
|
|
177
|
-
| head -1)
|
|
178
|
-
fi
|
|
179
|
-
fi
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
Omit the Branch Preview line entirely if no preview URL is detected—do not show a placeholder.
|
|
183
152
|
|
|
184
153
|
## Notes
|
|
185
154
|
|
|
@@ -45,7 +45,7 @@ gh pr list --head <branch-name> --json number,title,url
|
|
|
45
45
|
|
|
46
46
|
- [ ] PR size is reasonable (see [code-review.mdc](mdc:.cursor/rules/code-review.mdc) - max 400 lines)
|
|
47
47
|
- [ ] PR description is clear and explains purpose
|
|
48
|
-
- [ ] Related issues are referenced
|
|
48
|
+
- [ ] Related issues/tickets are referenced
|
|
49
49
|
- [ ] Changes align with PR description
|
|
50
50
|
- [ ] No unrelated changes included
|
|
51
51
|
|
|
@@ -232,47 +232,23 @@ gh pr review <pr-number> --comment --body "Review summary"
|
|
|
232
232
|
|
|
233
233
|
Provide:
|
|
234
234
|
|
|
235
|
-
1. **
|
|
236
|
-
- **PR Link:** the pull request URL
|
|
237
|
-
- **Branch Preview:** the preview deployment URL (include only when detected)
|
|
238
|
-
|
|
239
|
-
2. **Review Summary:**
|
|
235
|
+
1. **Review Summary:**
|
|
240
236
|
- Overall assessment
|
|
241
237
|
- Number of blocking/important/suggestion comments
|
|
242
238
|
- Key findings
|
|
243
239
|
|
|
244
|
-
|
|
240
|
+
2. **Comments Posted:**
|
|
245
241
|
- List of comments with file:line references
|
|
246
242
|
- Categorization (blocking/important/suggestion)
|
|
247
243
|
|
|
248
|
-
|
|
244
|
+
3. **Review Decision:**
|
|
249
245
|
- Approve / Request Changes / Comment
|
|
250
246
|
- Rationale
|
|
251
247
|
|
|
252
|
-
|
|
248
|
+
4. **Positive Feedback:**
|
|
253
249
|
- What was done well
|
|
254
250
|
- Appreciate good patterns or solutions
|
|
255
251
|
|
|
256
|
-
### Detecting the Branch Preview URL
|
|
257
|
-
|
|
258
|
-
```bash
|
|
259
|
-
PR_NUMBER=<pr-number>
|
|
260
|
-
|
|
261
|
-
PREVIEW_URL=$(gh pr view "$PR_NUMBER" --json statusCheckRollup \
|
|
262
|
-
--jq '[.statusCheckRollup[]? | (.targetUrl // .detailsUrl // "")]
|
|
263
|
-
| map(select(test("vercel\\.app|netlify\\.app|pages\\.dev|onrender\\.com|preview"; "i")))
|
|
264
|
-
| .[0] // ""')
|
|
265
|
-
|
|
266
|
-
if [ -z "$PREVIEW_URL" ]; then
|
|
267
|
-
PREVIEW_URL=$(gh pr view "$PR_NUMBER" --json comments \
|
|
268
|
-
--jq '.comments[]?.body' \
|
|
269
|
-
| grep -oE 'https?://[a-zA-Z0-9.-]+\.(vercel\.app|netlify\.app|pages\.dev|onrender\.com)[^ )>"]*' \
|
|
270
|
-
| head -1)
|
|
271
|
-
fi
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
Omit the Branch Preview line entirely if no preview URL is detected—do not show a placeholder like "n/a".
|
|
275
|
-
|
|
276
252
|
## Notes
|
|
277
253
|
|
|
278
254
|
- **Read every line** of changed code
|
|
@@ -104,7 +104,7 @@ Review the PR against project standards. **Assign every finding to exactly one s
|
|
|
104
104
|
|
|
105
105
|
**PR hygiene:**
|
|
106
106
|
- [ ] PR description explains purpose
|
|
107
|
-
- [ ] Related issues referenced
|
|
107
|
+
- [ ] Related issues/tickets referenced
|
|
108
108
|
- [ ] No unrelated changes
|
|
109
109
|
- [ ] Commit messages are descriptive
|
|
110
110
|
|
|
@@ -115,9 +115,6 @@ Use this output format:
|
|
|
115
115
|
```markdown
|
|
116
116
|
## Should We Merge? [YES / NO / CONDITIONAL]
|
|
117
117
|
|
|
118
|
-
**PR Link:** <pr-url>
|
|
119
|
-
**Branch Preview:** <preview-url> ← include only if detected; omit entirely otherwise
|
|
120
|
-
|
|
121
118
|
**Summary:** [1–2 sentence verdict]
|
|
122
119
|
|
|
123
120
|
---
|
|
@@ -143,26 +140,6 @@ Use this output format:
|
|
|
143
140
|
- [Rules/standards cited]
|
|
144
141
|
```
|
|
145
142
|
|
|
146
|
-
### Detecting the Branch Preview URL
|
|
147
|
-
|
|
148
|
-
```bash
|
|
149
|
-
PR_NUMBER=<pr-number>
|
|
150
|
-
|
|
151
|
-
PREVIEW_URL=$(gh pr view "$PR_NUMBER" --json statusCheckRollup \
|
|
152
|
-
--jq '[.statusCheckRollup[]? | (.targetUrl // .detailsUrl // "")]
|
|
153
|
-
| map(select(test("vercel\\.app|netlify\\.app|pages\\.dev|onrender\\.com|preview"; "i")))
|
|
154
|
-
| .[0] // ""')
|
|
155
|
-
|
|
156
|
-
if [ -z "$PREVIEW_URL" ]; then
|
|
157
|
-
PREVIEW_URL=$(gh pr view "$PR_NUMBER" --json comments \
|
|
158
|
-
--jq '.comments[]?.body' \
|
|
159
|
-
| grep -oE 'https?://[a-zA-Z0-9.-]+\.(vercel\.app|netlify\.app|pages\.dev|onrender\.com)[^ )>"]*' \
|
|
160
|
-
| head -1)
|
|
161
|
-
fi
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
Omit the Branch Preview line entirely when no preview URL is detected—do not use a placeholder like "n/a".
|
|
165
|
-
|
|
166
143
|
**Merge decision logic:**
|
|
167
144
|
- **YES** — No P0 issues; P1 issues are minimal or acceptable to merge with follow-up
|
|
168
145
|
- **NO** — Any P0 issues
|
|
@@ -34,7 +34,7 @@ Systematically check the new work on this branch and fix issues as you find them
|
|
|
34
34
|
### Code Quality Checks
|
|
35
35
|
|
|
36
36
|
**Feature Gaps**
|
|
37
|
-
- [ ] Are all requirements from the issue addressed?
|
|
37
|
+
- [ ] Are all requirements from the ticket/issue addressed?
|
|
38
38
|
- [ ] Are edge cases handled appropriately?
|
|
39
39
|
- [ ] Is error handling comprehensive?
|
|
40
40
|
- [ ] Are user-facing features complete (no TODOs or placeholders)?
|
|
@@ -45,7 +45,7 @@ gh pr list --head <branch-name> --json number,title,url
|
|
|
45
45
|
|
|
46
46
|
- [ ] PR size is reasonable (see [code-review.mdc](mdc:.cursor/rules/code-review.mdc) - max 400 lines)
|
|
47
47
|
- [ ] PR description is clear and explains purpose
|
|
48
|
-
- [ ] Related issues are referenced
|
|
48
|
+
- [ ] Related issues/tickets are referenced
|
|
49
49
|
- [ ] Changes align with PR description
|
|
50
50
|
- [ ] No unrelated changes included
|
|
51
51
|
|
package/bin/setup-cursor.sh
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mallardbay/cursor-rules",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Mallard Bay shared cursor rules",
|
|
5
5
|
"main": "bin/setup-cursor.sh",
|
|
6
6
|
"repository": "git@github.com:mallardbay/cursor-rules.git",
|
|
@@ -29,5 +29,6 @@
|
|
|
29
29
|
},
|
|
30
30
|
"bin": {
|
|
31
31
|
"cursor-rules": "bin/setup-cursor.sh"
|
|
32
|
-
}
|
|
32
|
+
},
|
|
33
|
+
"packageManager": "yarn@4.13.0"
|
|
33
34
|
}
|