Git Commit Writer

Generates conventional commit messages from staged changes or a diff.

8 stars

Best use case

Git Commit Writer is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Generates conventional commit messages from staged changes or a diff.

Teams using Git Commit Writer should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/git-commit-writer/SKILL.md --create-dirs "https://raw.githubusercontent.com/Notysoty/openagentskills/main/skills/git-commit-writer/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/git-commit-writer/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How Git Commit Writer Compares

Feature / AgentGit Commit WriterStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Generates conventional commit messages from staged changes or a diff.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Git Commit Writer

## What this skill does

This skill directs the agent to read a git diff (or a plain description of changes) and produce a well-formed commit message following the [Conventional Commits](https://www.conventionalcommits.org/) specification. It chooses the right type (`feat`, `fix`, `chore`, `docs`, `refactor`, `test`, `style`, `perf`, `ci`), picks an appropriate scope, writes a concise subject line, and — when the change is large enough to warrant it — adds a descriptive body.

Use this when you want consistent, meaningful commit history without having to remember the format every time.

## How to use

### Claude Code / Cline

Copy this file to `.agents/skills/git-commit-writer/SKILL.md` in your project root.

Then ask the agent:
- *"Write a commit message for my staged changes using the Git Commit Writer skill."*
- *"Here's a diff. Use the Git Commit Writer skill to produce a commit message."*

For Claude Code, you can also run `git diff --staged` first and paste the output into the chat.

### Cursor

Add the contents of the "Prompt / Instructions" section below to your `.cursorrules` file, or paste it into the Cursor AI pane before asking for a commit message.

### Codex

Paste the diff into the Codex chat along with the instructions from the section below. Codex works best when you include the full diff rather than a summary.

## The Prompt / Instructions for the Agent

When asked to write a commit message, follow these steps:

1. **Read the diff.** If not provided, ask for `git diff --staged` output. Understand every file changed.

2. **Determine the commit type** using these rules:
   - `feat` — a new feature or behavior visible to users or callers
   - `fix` — a bug fix
   - `refactor` — code restructuring with no behavior change
   - `perf` — performance improvement
   - `test` — adding or fixing tests
   - `docs` — documentation only (README, comments, etc.)
   - `style` — formatting, whitespace, lint (no logic change)
   - `chore` — build scripts, dependencies, tooling
   - `ci` — CI/CD pipeline changes

3. **Choose a scope** (optional but recommended). The scope is the part of the codebase most affected, in lowercase: `auth`, `api`, `ui`, `db`, `parser`, etc. Use the folder name or module name if unsure.

4. **Write the subject line** (first line of the commit):
   - Format: `type(scope): short description`
   - Max 72 characters
   - Use the imperative mood: "add", "fix", "remove" — not "added", "fixing", "removes"
   - Do not capitalize the first word after the colon
   - Do not end with a period

5. **Write the body** if the change needs explanation:
   - Leave a blank line between subject and body
   - Explain *why* the change was made, not *what* (the diff shows what)
   - Wrap lines at 72 characters
   - Use bullet points for multiple distinct changes

6. **Add a footer** if applicable:
   - Breaking changes: `BREAKING CHANGE: description`
   - Issue references: `Closes #123` or `Fixes #456`

7. **Output format:**

```
type(scope): short imperative description

Optional body explaining the why behind the change.
Can be multiple paragraphs. Wrap at 72 chars.

Optional footer: Closes #123
```

If the diff contains multiple unrelated changes, flag this and suggest splitting into separate commits.

## Example

**Input to Agent:**
> "Here's my staged diff. Write a commit message using the Git Commit Writer skill.
>
> ```diff
> diff --git a/server/auth.ts b/server/auth.ts
> index 3a1b2c..9f4e5d 100644
> --- a/server/auth.ts
> +++ b/server/auth.ts
> @@ -42,6 +42,12 @@ export async function login(email: string, password: string) {
>    const user = await db.users.findOne({ email });
>    if (!user) throw new AuthError('User not found');
> +
> +  if (user.lockedUntil && user.lockedUntil > new Date()) {
> +    throw new AuthError('Account is temporarily locked. Try again later.');
> +  }
> +
>    const valid = await bcrypt.compare(password, user.passwordHash);
>    if (!valid) {
> +    await incrementFailedAttempts(user.id);
>      throw new AuthError('Invalid password');
>    }
> ```"

**Output from Agent:**
```
fix(auth): lock accounts after repeated failed login attempts

Adds a check for the `lockedUntil` field before attempting password
comparison. Also increments a failed-attempt counter on each bad
password so the locking mechanism has data to act on.
```

## Notes

- If you paste a large diff with changes spanning many files and concerns, the agent may suggest splitting it. That is intentional behavior — large atomic commits make history harder to read.
- The skill does not run `git commit` automatically. It only produces the message text for you to review and use.
- For monorepos, use the package or workspace name as the scope (e.g., `feat(api-gateway): ...`).

Related Skills

Unit Test Writer

8
from Notysoty/openagentskills

Generates comprehensive unit tests for any function or module with edge cases.

Technical Blog Post Writer

8
from Notysoty/openagentskills

Writes engaging, accurate technical blog posts targeted at developer audiences.

Social Post Thread Writer

8
from Notysoty/openagentskills

Converts a blog post, idea, or document into an engaging Twitter/X or LinkedIn thread with hooks and CTAs.

SDK Quickstart Writer

8
from Notysoty/openagentskills

Generates a concise, copy-paste-ready quickstart guide for any SDK or library.

README Writer

8
from Notysoty/openagentskills

Generates a professional, comprehensive README.md for any project from its codebase or description.

PR Description Writer

8
from Notysoty/openagentskills

Writes clear, thorough pull request descriptions from a diff or list of changes.

Newsletter Summary Writer

8
from Notysoty/openagentskills

Condenses long articles, threads, or documents into concise, engaging newsletter-ready summaries.

Migration Guide Writer

8
from Notysoty/openagentskills

Writes clear migration guides for library upgrades, breaking API changes, or framework version bumps.

Incident Postmortem Writer

8
from Notysoty/openagentskills

Writes a blameless incident postmortem document from an incident timeline or Slack thread.

AI Feature Spec Writer

8
from Notysoty/openagentskills

Writes a complete product spec for an AI-powered feature including user stories, model requirements, fallback behavior, and evaluation criteria.

Unit Test Improver

8
from Notysoty/openagentskills

Reviews existing unit tests for gaps, weak assertions, and missing edge cases, then rewrites them to be more robust.

Troubleshooting Guide Builder

8
from Notysoty/openagentskills

Builds a structured troubleshooting guide with symptom → cause → fix format for any tool or system.