Commit
Stage and commit changes with Linear issue tracking.
Workflow
- •
Gather context (run in parallel):
- •
git status— check for changes; if none, inform user and stop - •
git diff(staged + unstaged) — review changes for commit message and issue matching - •
git log --oneline -5— match recent commit style
- •
- •
Resolve Linear issue:
- •If issue ID provided as argument (e.g.,
/commit RES-81), use it directly - •Otherwise, fetch issues in parallel via
list_issuesMCP tool:- •
assignee: "me",state: "In Progress",limit: 10 - •
assignee: "me",state: "Todo",limit: 10
- •
- •Match diff against issue titles/descriptions, pick up to 2 most relevant (prioritize In Progress)
- •Use
AskUserQuestionwith matched issues as options (format: "RES-81: Title"). Always include "None" as final option
- •If issue ID provided as argument (e.g.,
- •
Stage and commit:
- •Stage specific files related to the changes (avoid
git add -Aunless user requests it) - •Generate commit message using conventional commits format
- •If a Linear issue was selected, add
Closes ISSUE-IDfooter - •Use HEREDOC for commit message to preserve formatting
- •Stage specific files related to the changes (avoid
- •
Push (ask first):
- •Use
AskUserQuestion: "Push to remote?" with "Yes" and "No" options - •Push only if confirmed
- •Use
Commit Message Convention
code
<type>: <short description> <optional body> Closes <ISSUE-ID>
Example — /commit RES-81 produces:
code
feat: add user authentication flow Implement OAuth2 login with Google and GitHub providers. Closes RES-81
Edge Cases
- •Pre-commit hook failure: Fix the issue, re-stage, create a NEW commit (never amend)
- •Nothing to commit: Inform the user and stop
- •Secrets detected (.env, credentials.json, etc.): Warn and exclude from staging