agentleFS
myths-labsmyths-labs/muse/skills/toolkit/git-commit/SKILL.md

git-commit

Skill35 starsChanged 8 months agoMITView on GitHub

Creates git commits following Conventional Commits format with type/scope/subject. Use when user wants to commit changes, create commit, save work, or stage and commit. Handles regular branch commits (development) and merge commits (PR closure). Enforces project-specific conventions from CLAUDE.md.

  • Reads credentials
  • Commits and pushes

109 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use git-pr, github-pr-create and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • CarpeWuSkill

    git-pr

    Prepares Pull Request content by analyzing branch differences. Use when creating PRs, when the user needs help writing PR descriptions, or mentions pull request.

    Also in 7 projects that use this

  • mpagotSkill

    github-pr-create

    Creates a GitHub pull request from staged git changes, handling commit, push, and PR creation in one workflow. Activate when the user asks to "create PR", "open pull request", "push and create PR", "submit PR", or wants to send their changes upstream to os-autoinst-distri-opensuse.

    Also in 3 projects that use this

  • CarpeWuSkill

    git-branch

    Creates Git branches following naming conventions. Use when creating feature, bugfix, hotfix, or release branches, or when the user asks to create a new branch.

    Also in 3 projects that use this

  • denghuinowSkill

    git-release

    Git 项目版本发布自动化工具。执行完整的发布流程:提交所有修改、更新版本号(若有)、 生成 CHANGELOG、创建 git tag 并推送到远程仓库。基于语义化版本 (major/minor/patch)。 支持有 package.json 的项目,也支持无 package.json 的项目(版本从最新 git tag 或 VERSION 等文件获取)。

    Also in 4 projects that use this

  • strantalisSkill

    gh-cli

    Standardize all GitHub interactions via the GitHub CLI (`gh`) instead of ad-hoc URLs, UI clicks, or direct REST API calls. Use when you need to read or change GitHub state (repos, issues, pull requests, reviews, check status, Actions workflows/runs, releases, labels, milestones, discussions, gists) and want deterministic output (prefer `--json` + `--jq`). Also use when the user provides a GitHub URL, including deep links like `https://github.com/OWNER/REPO/pull/123`, `.../issues/123`, `.../pull/123/files`, or comment permalinks like `#issuecomment-...`, and you need to fetch the underlying PR/issue/thread and reply. Fall back to `gh api` only when there is no first-class `gh NOUN VERB` command.

    Also in 4 projects that use this

  • gologo13Skill

    git-push

    Push current branch to origin and sync with remote updates; keywords: git, rebase. Use only on explicit request; before execution, review diffs and list impact scope.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 9 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 85 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    NO period at the end

    line 53
  2. Distinctive:

    If project specifies different format, USE PROJECT FORMAT.

    line 67
  3. Very specific:

    Place trailers at end of body after blank line.

    line 145
  4. Distinctive:

    When fixing review comments, use this format:

    line 191
  5. Distinctive:

    Before creating PR, ensure all commits follow this format.

    line 202
  6. Distinctive:

    ALWAYS: check project conventions (CLAUDE.md) before committing

    line 209
  7. Distinctive:

    ALWAYS: use project format if it differs from default

    line 210
  8. Distinctive:

    ALWAYS: use present tense imperative verb

    line 212
  9. Distinctive:

    NEVER: commit secrets or credentials

    line 214
  10. Distinctive:

    NEVER: use generic messages ("update code", "fix bug", "changes")

    line 215

“Common” is measured: kept by at least 6 in 10 of the 85 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Git Commit

Creates git commits following Conventional Commits format with proper type, scope, and subject.

Quick Start

# 1. Check for project-specific commit conventions
cat .claude/CLAUDE.md 2>/dev/null | grep -A 20 -i "commit"

# 2. Stage changes
git add <files>  # or: git add -A

# 3. Create commit (branch commit format)
git commit -m "type(scope): subject

Body explaining HOW and WHY.
Reference: Task X.Y, Req N"

Commit Types

Regular Branch Commits (During Development)

Format: type(scope): subject

TypePurpose
featNew feature or functionality
fixBug fix or issue resolution
refactorCode refactoring without behavior change
perfPerformance improvements
testTest additions or modifications
ciCI/CD configuration changes
docsDocumentation updates
choreMaintenance, dependencies, tooling
styleCode formatting, linting (non-functional)
securitySecurity vulnerability fixes or hardening

Scope (Required, kebab-case)

Examples: validation, auth, cookie-service, template, config, tests, api

Subject Line Rules

  • Max 50 characters after colon
  • Present tense imperative: add, implement, fix, improve, enhance, refactor, remove, prevent
  • NO period at the end
  • Specific and descriptive - state WHAT, not WHY

Core Workflow

1. Check Project Conventions

ALWAYS check first - project may override defaults:

cat .claude/CLAUDE.md 2>/dev/null | grep -A 30 -i "commit"
cat .kiro/steering/*.md 2>/dev/null | grep -A 20 -i "commit"

If project specifies different format, USE PROJECT FORMAT.

2. Review Changes

git status
git diff --staged  # if already staged
git diff           # if not staged

3. Stage Files

git add <specific-files>  # preferred
# or
git add -A  # all changes

NEVER commit:

  • .env, .env.local, .env.prod*, .env.vercel*, credentials.json, secrets
  • .muse/, .agent/, .gemini/, memory/, convo/ — internal files
  • *.pem, *.p12, *.jks, *.key — private keys/certificates
  • Files containing sk-, AIzaSy, gsk_, sk_test_, eyJhbG — API keys/JWT
  • node_modules/, __pycache__/, .venv/
  • Large binary files without explicit approval

💡 See git-security-guard skill for comprehensive pre-commit security checks.

4. Create Commit

Simple change:

git commit -m "fix(auth): use hmac.compare_digest for secure comparison"

Complex change (with body):

git commit -m "$(cat <<'EOF'
feat(validation): add URLValidator with domain whitelist

Implement URLValidator class supporting:
- Domain whitelist enforcement (youtube.com, youtu.be)
- Dangerous scheme blocking (javascript, data, file)
- URL parsing with embedded credentials handling

Addresses Requirement 31: Input validation
Part of Task 5.1: Input Validation Utilities
EOF
)"

5. Verify Commit

git log -1 --format="%h %s"
git show --stat HEAD

Body Format (Recommended for Complex Changes)

<blank line>
Explain HOW and WHY the change was made.
- Use bullet points for multiple items
- Wrap at 72 characters

Reference: Task X.Y
Addresses: Req N

Git Trailers

TrailerPurpose
Fixes #NLinks and closes issue on merge
Closes #NSame as Fixes
Co-authored-by: Name <email>Credit co-contributors

Place trailers at end of body after blank line. See references/commit_examples.md for examples.

Breaking Changes

For incompatible API/behavior changes, use ! after scope OR BREAKING CHANGE: footer:

feat(api)!: change response format to JSON:API

BREAKING CHANGE: Response envelope changed from `{ data }` to `{ data: { type, id, attributes } }`.

Triggers major version bump in semantic-release.

Merge Commits (PR Closure)

For PRs, use extended description with sections:

gh pr create --title "feat(security): implement input validation (Task 5)" --body "$(cat <<'EOF'
## Summary
- Input validation utilities (URLValidator, FormatValidator)
- Secure template processor with path traversal prevention
- API key authentication middleware

## Task Breakdown
Task 5.1: Input Validation - URLValidator, FormatValidator
Task 5.2: Template Processing - Path traversal prevention
Task 5.3: API Key Auth - Multi-key support, excluded paths
Task 5.4: Security Tests - 102 path traversal tests

## Requirements Covered
Req 7, Req 9, Req 31, Req 33

## Test Coverage
- All 473 tests passing
- Coverage: 93%
- Pre-commit checks: passing
EOF
)"

Integration with Other Skills

From github-pr-review

When fixing review comments, use this format:

git commit -m "fix(scope): address review comment #ID

Brief explanation of what was wrong and how it's fixed.
Addresses review comment #123456789."

From github-pr-creation

Before creating PR, ensure all commits follow this format. The PR skill will:

  1. Analyze commits for proper format
  2. Extract types for PR labels
  3. Build PR description from commit bodies

Important Rules

  • ALWAYS check project conventions (CLAUDE.md) before committing
  • ALWAYS use project format if it differs from default
  • ALWAYS include scope in parentheses
  • ALWAYS use present tense imperative verb
  • NEVER end subject with period
  • NEVER commit secrets or credentials
  • NEVER use generic messages ("update code", "fix bug", "changes")
  • NEVER exceed 50 chars in subject line
  • Group related changes -> single focused commit

Examples

Good:

feat(validation): add URLValidator with domain whitelist
fix(auth): use hmac.compare_digest for secure key comparison
refactor(template): consolidate filename sanitization logic
test(security): add 102 path traversal prevention tests

Bad:

update validation code           # no type, no scope, vague
feat: add stuff                  # missing scope, too vague
fix(auth): fix bug               # circular, not specific
chore: make changes              # missing scope, vague
feat(security): improve things.  # has period, vague

References

  • references/commit_examples.md - Extended examples by type

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.