Skip to content
Back to skills

Commit

ASecurity

Use when committing code changes. Enforces intentional file selection, conventional commits, and why-focused messages.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 6, 2026
toolsrustbashgit

Works with

  • cli

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned October 6, 2026

npx -y skills add ivy/dotfiles --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/ivy-commit/badge)](https://www.skillsdirectory.com/skills/ivy-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: Use when committing code changes. Enforces intentional file selection, conventional commits, and why-focused messages.
argument-hint: "[message | --amend | files...]"
allowed-tools:
  - Bash(git status:*)
  - Bash(git diff:*)
  - Bash(git log:*)
  - Bash(git show:*)
---

# Git Commit

**Autonomy:** model-invocable · acts autonomously — stages, commits, and amends unpushed commits without confirmation · has no push capability

## Arguments
```
$ARGUMENTS
```

## Constraints

**Never use `git -C <path>`** — always run git commands from the current working directory. The `-C` flag rewrites the command so it no longer matches the `allowed-tools` patterns, giving up their pre-approval. Plain `git status`, `git log`, etc. already operate on the repo you're in.

## Instructions

### 1. Assess Current State

Run in parallel:
- `git status` — see staged/unstaged/untracked files
- `git diff --cached` — see what's staged
- `git diff` — see unstaged changes
- `git log --oneline -5` — recent commit style reference

### 2. File Selection (CRITICAL)

**Never use `git add -A` or `git add .`** — be intentional about every file.

Decision tree:
- **Arguments include specific files** → stage those files
- **Files already staged** → verify they're the intended changes
- **Nothing staged** → infer from conversation context which files to stage

Use `git diff --name-only` to review changed files. Include only:
- Files modified during this conversation
- Files directly relevant to the logical change

Exclude:
- Unrelated changes (stage separately)
- Generated files (unless intentional)
- Sensitive files (.env, credentials)

### 3. Craft Commit Message

**Format:** Conventional Commits

```
<type>(<scope>): <subject>

[optional body explaining WHY]
```

**Types:** `feat`, `fix`, `chore`, `docs`, `refactor`, `test`, `style`

**Rules:**
- Subject line ≤72 characters (including mood emoji)
- Present tense ("add" not "added")
- Focus on WHY, not WHAT (the diff shows what)
- Body lines ≤80 characters

**Message source:**
- **Arguments provide message** → use it (adjust format if needed)
- **No message** → draft based on staged changes, explain reasoning

**Mood emoji:** End every subject line with a GitHub emoji that reflects the vibe of the conversation or task. Intuit mood from context — the ticket being worked on, the user's tone, frustration level, excitement, etc.

Palette (use these or any GitHub emoji that fits):

| Emoji | Shortcode | Mood |
|-------|-----------|------|
| :sparkles: | `:sparkles:` | excited about something new |
| :tada: | `:tada:` | celebration, milestone |
| :fire: | `:fire:` | on a roll, crushing it |
| :bug: | `:bug:` | squashing something annoying |
| :face_with_spiral_eyes: | `:face_with_spiral_eyes:` | confused, dizzy, "what even is this" |
| :rage: | `:rage:` | frustrated, fighting the tools |
| :relieved: | `:relieved:` | finally fixed, weight off shoulders |
| :broom: | `:broom:` | tidying up, chores |
| :thinking: | `:thinking:` | exploratory, not sure yet |
| :coffin: | `:coffin:` | killing dead code, removing things |
| :rocket: | `:rocket:` | shipping, deploying, launching |
| :nail_care: | `:nail_care:` | polish, aesthetics, making it pretty |

### 4. Execute Commit

```bash
git commit -m "$(cat <<'EOF'
type(scope): subject line here :emoji:

Optional body explaining why this change was made.
EOF
)"
```

### 5. Verify

Run `git status` to confirm clean state or show remaining changes.

## Amend Mode

If arguments include `--amend`:
1. Show current HEAD commit with `git show --stat HEAD`
2. Stage additional changes if specified
3. Run `git commit --amend`

**Warning:** Only amend unpushed commits.

## Examples

```
/commit                           → assess changes, draft message, commit
/commit fix login redirect        → stage relevant files, commit with message
/commit --amend                   → amend previous commit
/commit src/auth.ts src/login.ts  → stage specific files, draft message, commit
```

Example commit messages with mood:
```
feat(auth): add OAuth2 login flow :sparkles:
fix(auth): resolve login redirect loop :relieved:
chore(deps): bump mise tool versions :broom:
refactor(cli): remove dead argument parser :coffin:
```

Files in this skill

  • README.md2.3 KB
  • SKILL.md4.2 KB

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…