# Laurigates Claude Plugins Git Commit

> Git Commit

- Skill: `tomevault-io/laurigates-claude-plugins-git-commit` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/laurigates-claude-plugins-git-commit`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/laurigates-claude-plugins-git-commit/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/laurigates-claude-plugins-git-commit

---


# Git Commit

Create local commits with proper conventional messages and issue references.

## When to Use

**Trigger phrases:**
- "commit" / "commit locally" / "commit these changes"
- "save changes" / "save my work"
- "stage and commit"
- "create a commit"

**Context signals:**
- User has made code changes
- `git status` shows modified/untracked files
- No mention of "push", "remote", or "PR"

## Workflow

### 1. Assess State

```bash
# Check branch and status
git branch --show-current
git status --porcelain=v2 --branch

# View changes
git diff --stat                    # Unstaged
git diff --cached --stat           # Already staged
```

### 2. Stage Changes

**Explicit staging** (preferred):
```bash
git add src/feature.ts
git add tests/feature.test.ts
git status --porcelain              # Verify
```

**Modified tracked files**:
```bash
git add -u                          # Stage all modified tracked files
```

### 3. Run Pre-commit Hooks

If `.pre-commit-config.yaml` exists:

```bash
pre-commit run --all-files

# If hooks modify files (formatters), re-stage:
git add -u
pre-commit run --all-files          # Should pass now
```

### 4. Detect Related Issues

Scan open issues for matches (see **github-issue-autodetect** skill):

```bash
gh issue list --state open --json number,title,labels --limit 30
```

**Match staged changes to issues** by:
- File paths mentioned in issue body (high confidence)
- Error messages or function names (high confidence)
- Directory/component matches (medium confidence)

### 5. Create Commit

**IMPORTANT:** Use HEREDOC directly in the git commit command.

```bash
git commit -m "$(cat <<'EOF'
type(scope): concise description

Optional body explaining the change.

Fixes #123
Refs #456

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
EOF
)"
```

For trailer conventions (Co-authored-by, Signed-off-by, BREAKING CHANGE, Release-As), see **git-commit-trailers** skill.

### Conventional Commit Types

| Type | Use Case | Version Bump |
|------|----------|--------------|
| `feat` | New feature | Minor |
| `fix` | Bug fix | Patch |
| `perf` | Performance improvement | Patch |
| `refactor` | Code restructuring | None |
| `docs` | Documentation | None |
| `test` | Adding tests | None |
| `chore` | Maintenance, deps | None |
| `ci` | CI/CD config | None |
| `build` | Build system, deps | None |

See [Conventional Commits Standards](../../.claude/rules/conventional-commits.md) for complete reference.

### Issue References

| Keyword | Effect |
|---------|--------|
| `Fixes #N` | Closes issue on merge (bug fixes) |
| `Closes #N` | Closes issue on merge (features) |
| `Refs #N` | Links without closing (partial work) |

## Output

On success, report:
```
Created commit: abc1234
Message: feat(auth): add OAuth2 support

Fixes #123
Refs #456

Ready for: push to remote, create PR, or continue working
```

## Composability

This skill creates **local commits only**. For remote operations:
- **git-push** skill: Push commits to remote
- **git-pr** skill: Create pull request

Common compositions:
- "commit" → git-commit only
- "commit and push" → git-commit → git-push
- "commit and create PR" → git-commit → git-push → git-pr

## Error Handling

**No changes to commit:**
```
Nothing to commit. Working tree clean.
```

**Pre-commit hook fails:**
```bash
# Fix the issue, then:
git add -u
pre-commit run --all-files
# Then commit
```

**Merge conflict markers:**
```
Cannot commit: unresolved merge conflicts in <file>
```

## Best Practices

1. **One logical change per commit** - Easier to review and revert
2. **Always reference issues** - Maintains traceability
3. **Run pre-commit before staging** - Avoids re-staging formatter changes
4. **Keep subject under 72 chars** - Better display in git log
5. **Use imperative mood** - "Add feature" not "Added feature"
6. **Add appropriate trailers** - Co-authored-by for pair/AI work, Signed-off-by for DCO projects, BREAKING CHANGE for major versions (see git-commit-trailers)

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/laurigates) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-11 -->

