Skip to content

Commit 1fbd1bb

Browse files
committed
chore: add Linear ticket workflow cursor rule
1 parent 92403c5 commit 1fbd1bb

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.cursor/rules/linear.mdc

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
description: Prompt to create a Linear ticket when working on code fixes without a Linear branch
3+
alwaysApply: true
4+
---
5+
6+
# Linear Ticket Workflow
7+
8+
When starting work on a code fix, bug fix, or feature implementation, check the current git branch name:
9+
10+
```bash
11+
git rev-parse --abbrev-ref HEAD
12+
```
13+
14+
If the branch name does **not** contain a Linear ticket ID (pattern: `<name>/SDK-<number>-<description>`), ask the user if they'd like to create a Linear ticket and switch to a Linear-linked branch.
15+
16+
## When to prompt
17+
18+
- You are about to make or are making code changes (fixes, features, refactors)
19+
- The current branch is `main`, `master`, or a branch without a ticket ID (e.g. `fadi/fix-something` instead of `fadi/SDK-1234-fix-something`)
20+
21+
## What to ask
22+
23+
Use the AskQuestion tool:
24+
- "Your current branch doesn't have a Linear ticket. Want me to create one and switch to the Linear branch?"
25+
- Options: "Yes, create a ticket" / "No, continue without one"
26+
27+
## If the user says yes
28+
29+
1. Create a Linear issue using the `save_issue` Linear MCP tool with a concise title describing the fix and assign it to `"me"`.
30+
2. Retrieve the created issue using the `get_issue` Linear MCP tool to get the git branch name from the response.
31+
3. Create and switch to the branch returned by Linear:
32+
```bash
33+
git checkout -b <branch-name-from-linear>
34+
```
35+
36+
## If the user says no
37+
38+
Continue working on the current branch without further prompts about this.

0 commit comments

Comments
 (0)