---
alwaysApply: false
description: Graphite CLI with Linear Integration Workflow
---
filters:
- type: content
pattern: "(gt create|gt submit|linear|lkfl-)"
actions:
- type: suggest
message: |
1. Detect the Linear key from the current Git branch or latest commit message (case-insensitive), e.g. `feature/agw-328-something` → `AGW-328`.
2. Use Linear MCP to resolve the issue ID, then fetch full details:
- list issues by key: `list_issues(query: "AGW-328", includeArchived: true)`
- pick the item whose `identifier === "AGW-328"` and read its `id`
- get the issue: `get_issue(id: "<resolved-id>")`
3. Treat the issue’s description as the single source of truth for tasks and acceptance criteria.
4. If no issue is found, pause and request clarification with the appropriate stop-line.
- Example sequence:
- `# Extract key from branch: feature/agw-328-minor-fixes-on-organization → AGW-328
list_issues(query: "AGW-328", includeArchived: true)
→ pick result.id where result.identifier === "AGW-328"
get_issue(id: "67376fd6-4f78-46e6-bc53-1074b0e6907e")
`
- `# 1. IMPORTANT: Check working directory and add ONLY relevant files
git status # Review what files are changed
git add src/specific-file.ts # Add ONLY files related to this feature
git add src/another-file.tsx # DO NOT use -a or --all
# 2. Create feature branch (from current active branch)
gt create "feature/lkfl-219-add-trigger-ai-telemetry" -m "feat: add trigger AI telemetry"
# 3. Submit the PR automatically
gt ss --no-edit --publish
# 4. If changes needed after AI review (CodeRabbit, Diamond, etc.)
# Make your changes, then:
git add path/to/changed-file.ts # Add specific files only
gt modify # Amend the commit with staged changes
gt ss --no-edit --publish # Re-submit
`
- **NEVER use **`gt create -a`** or **`gt modify -a` when working in a workspace with multiple ongoing changes.
- `# ❌ WRONG - This adds ALL files
gt create "feature/lkfl-123-feature" -am "feat: add feature"
# ✅ CORRECT - Add files selectively first
git add src/components/new-feature.tsx
git add src/api/new-endpoint.ts
gt create "feature/lkfl-123-feature" -m "feat: add feature"
`
- When addressing feedback from AI reviewers (CodeRabbit, Diamond, etc.):
- `# 1. Make the requested changes in your code
# 2. Stage ONLY the files related to the review feedback
git add src/file-with-fixes.ts
git add tests/updated-test.spec.ts
# 3. Amend the existing commit
gt modify # Amends with staged changes only
# 4. Push the updated PR
gt ss --no-edit --publish
`
- `# Standard format: feature/issue-XXX-description
git add src/components/user-profile.tsx
git add src/api/user-endpoints.ts
gt create "feature/lkfl-123-implement-user-authentication" -m "feat: implement user authentication"
gt ss --no-edit --publish
`
- **CRITICAL**: Always stage files selectively to avoid mixing different features:
- `# Before creating any branch or modifying commits:
git status # Always check what's changed
# Stage files one by one or by pattern
git add src/components/specific-component.tsx
git add src/api/specific-endpoint.ts
git add "src/features/current-feature/**/*.ts" # Pattern for feature folder
# NEVER use these in a mixed workspace:
# ❌ git add .
# ❌ git add -A
# ❌ gt create -a
# ❌ gt modify -a
`
1. **Branch Naming Convention**:
2. `feature/lkfl-[issue-number]-[brief-description]
Example: feature/lkfl-789-fix-login-redirect
`
3. **Always use automated submission**:
4. `gt ss --no-edit --publish # This is the only submission command you need
`
5. **Stack Organization**:
- One Linear issue per logical feature
- Break down large issues into sub-branches
- Keep PRs small and focused
examples:
- input: |
- output: |
- git add components/user-settings.tsx
git add api/settings-api.ts
gt create "feature/lkfl-234-user-settings" -m "feat: implement user settings page"
gt ss --no-edit --publish
- input: |
- output: |
- git add api/settings-api.ts
- gt modify
- gt ss --no-edit --publish
- input: |
- output: |
- git status # Check all changes
git add feature-one.ts # Add ONLY current feature file
gt create "feature/lkfl-567-add-payment-flow" -m "feat: add payment flow"
gt ss --no-edit --publish
metadata:
priority: high
version: 1.2
linear_docs: https://linear.app/docs/github-integration#branch-naming
graphite_docs: https://graphite.dev/docs/graphite-integration
</rule>
version: 1.2
linear_docs: https://linear.app/docs/github-integration#branch-naming
graphite_docs: https://graphite.dev/docs/graphite-integration
</rule>