| name | commit |
| description | Analyze staged changes and write a conventional commit message. Use when the user has staged git changes and asks to commit, or wants help writing a commit message. |
| argument-hint | [scope hint] [--no-ticket] |
Analyze my staged changes and help me write a good commit message.
Arguments
$ARGUMENTS
- If provided, use as a hint for the commit message or scope
--no-ticket: Skip Jira ticket extraction and linking
- Examples:
/commit auth changes, /commit fix typo, /commit --no-ticket
Jira Configuration
Read Jira config from the project's CLAUDE.md if present (look for a
## Jira section with Base URL and Ticket Pattern). If absent, prefer
the mcp__claude_ai_Atlassian__* tools, or skip linking and use a bare
ticket reference.
- Common ticket patterns:
[A-Z]+-\d+ (e.g. ABC-123, PROJ-456)
Steps
-
Check staged changes:
git diff --cached --stat
git diff --cached
-
Analyze the changes:
- What files were modified?
- What is the nature of the change? (feature, fix, refactor, docs, test, chore)
- What is the scope/impact?
-
Review recent commit style:
git log --oneline -10
-
Extract Jira ticket from branch name (skip if --no-ticket):
git branch --show-current
Extract ticket ID from branch name patterns:
feature/BIL-123-description → BIL-123
fix/BIL-456-bug-fix → BIL-456
BIL-789/some-feature → BIL-789
- Common patterns:
[A-Z]+-[0-9]+ (e.g., ABC-123, PROJ-456)
If Jira MCP is available (mcp__plugin_atlassian_atlassian__getJiraIssue):
- Fetch ticket summary to validate and provide context
- Use ticket title to inform commit message scope
If Jira MCP is NOT available but ticket ID found:
- Include ticket reference in commit message
- Note: "Jira details not available - using ticket ID only"
-
Generate commit message following conventional commits format:
<type>(<scope>): <description>
- bullet point explaining a change
- another bullet point if needed
Refs: BIL-123
Types: feat, fix, docs, style, refactor, test, chore, ci, perf
Guidelines:
- First line: type(scope): description
- Type should be lowercase
- Scope is the area/module affected (e.g., auth, api, ui)
- Description should be concise, imperative mood, no period
- Keep first line under 72 characters
- Blank line after the first line
- Bullet points describe specific changes made
- Ticket reference: If ticket found and not
--no-ticket, add on separate line:
- Format:
Refs: TICKET-ID or Fixes: TICKET-ID (for bug fixes)
- Include the full URL only if a project CLAUDE.md
Jira section provides a base URL:
Refs: TICKET-ID (<base_url>/TICKET-ID)
-
Present options:
- Provide 2-3 commit message options if the changes are ambiguous
- Ask if they want to proceed with the commit
Output
Present the suggested commit message(s) and ask if the user wants to:
- Use one of the suggestions
- Modify a suggestion
- Provide their own message
Do NOT actually run git commit unless explicitly asked.