Skip to content
Back to skills

Commit

ASecurity

Analyze staged changes and write a conventional commit message. Use when staged changes are ready to commit or a message needs wording.

  • 8 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 3, 2026
ai-agentsgobashgitapi

Works with

  • api

Security analysis

A100/100

Scanned October 2, 2026

npx -y skills add edjchapman/claude-code-config --skill commit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Commit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Commit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/edjchapman-commit/badge)](https://www.skillsdirectory.com/skills/edjchapman-commit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: commit
description: Analyze staged changes and write a conventional commit message. Use when staged changes are ready to commit or a message needs wording.
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, skip
linking and use a bare ticket reference.

- **Common ticket patterns**: `[A-Z]+-\d+` (e.g. `ABC-123`, `PROJ-456`)

## Steps

1. **Check staged changes**:

   ```bash
   git diff --cached --stat
   git diff --cached
   ```

2. **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?

3. **Review recent commit style**:

   ```bash
   git log --oneline -10
   ```

4. **Extract Jira ticket from branch name** (skip if `--no-ticket`):

   ```bash
   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 a ticket ID is found:**

   - Include ticket reference in commit message

5. **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)`

6. **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.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…