agentleFS
manastalukdarmanastalukdar/ai-devstudio/skills/commit/SKILL.md

commit

Skill1 starsChanged 7 months agoMITView on GitHub

Analyze changes and create meaningful conventional commits with pre-commit quality checks

188 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use validate-plan, act-on-feedback and 10 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.
  • shawn-dumasSkill

    validate-plan

    Validate an orchestration plan after pre-flight certification. Runs adversarial review, deep review (verify prompt data against codebase), and PoC gate for risky approaches. Auto-invoked by orchestrate-* skills at Step 8.

    Also in 5 projects that use this

  • MicrosoftSkill

    act-on-feedback

    Act on user feedback attached to the current session. Use when the user submits feedback on the session's changes via the Submit Feedback button.

    Also in 3 projects that use this

  • decocmsSkill

    add-mcp-tools

    Guide for adding new MCP tools with consistent patterns for schemas, tool definitions, registry updates, and Better Auth integration

    Also in 3 projects that use this

  • MicrosoftSkill

    generate-run-commands

    Generate or modify run commands for the current session. Use when the user wants to set up or update run commands that appear in the session's Run button.

    Also in 3 projects that use this

  • mitsuhikoSkill

    oebb-scotty

    Austrian rail travel planner (ÖBB Scotty). Use when planning train journeys in Austria, checking departures/arrivals at stations, or looking for service disruptions. Covers ÖBB trains, S-Bahn, regional trains, and connections to neighboring countries.

    Also in 3 projects that use this

  • mitsuhikoSkill

    pi-share

    Load and parse session transcripts from shittycodingagent.ai/buildwithpi.ai/buildwithpi.com/pi.dev (pi-share) URLs. Fetches gists, decodes embedded session data, and extracts conversation history.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 168 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Pre-Commit Quality Checks: Before committing, verify build, tests, and linter pass (if commands exist in the project).

    line 22

“Common” is measured: kept by at least 6 in 10 of the 168 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

Smart Git Commit

Absolute Credential Rules

NEVER violate these — no exceptions:

  • NEVER run git config user.name or git config user.email — do not touch git identity settings
  • NEVER use --author to inject any name or email
  • NEVER add a Co-Authored-By: trailer to any commit message
  • NEVER add Co-Authored-By: Claude, Co-Authored-By: Claude Sonnet, or any variant with noreply@anthropic.com
  • NEVER include "Generated with Claude Code", "AI-generated", or any AI attribution in the commit message or body
  • NEVER modify .git/config or any git credential file

The commit must use only the developer's own git credentials as already configured in their environment.

Pre-Commit Quality Checks: Before committing, verify build, tests, and linter pass (if commands exist in the project).

# Verify we're in a git repository
if ! git rev-parse --git-dir > /dev/null 2>&1; then
    echo "Error: Not a git repository"
    exit 1
fi

# Early exit if nothing to commit
if git diff --cached --quiet && git diff --quiet; then
    echo "No changes to commit"
    exit 0
fi

echo "Changes detected:"
git status --short
git diff --cached --stat
git diff --stat
# Check for cached commit conventions
CACHE_FILE=".claude/cache/commit/conventions.json"

if [ -f "$CACHE_FILE" ]; then
    LAST_MODIFIED=$(stat -c %Y "$CACHE_FILE" 2>/dev/null || stat -f %m "$CACHE_FILE" 2>/dev/null)
    CURRENT_TIME=$(date +%s)
    AGE=$((CURRENT_TIME - LAST_MODIFIED))
    if [ $AGE -lt 604800 ]; then
        echo "Using cached commit conventions"
    fi
fi
# If nothing is staged, stage modified tracked files
if git diff --cached --quiet; then
    echo "No files staged. Staging modified files..."
    git add -u
fi

git diff --cached --name-status

# Detect commit type from file patterns (cheap grep, no file reads)
CHANGED_FILES=$(git diff --cached --name-only)

if echo "$CHANGED_FILES" | grep -q "test"; then
    TYPE_HINT="test"
elif echo "$CHANGED_FILES" | grep -q "\.md$"; then
    TYPE_HINT="docs"
elif git diff --cached | grep -q "^+.*function\|^+.*class"; then
    TYPE_HINT="feat"
elif git diff --cached | grep -q "^+.*fix\|^+.*bug"; then
    TYPE_HINT="fix"
else
    TYPE_HINT="chore"
fi

# Extract scope from file path (e.g., src/auth/login.ts → auth)
SCOPE=$(echo "$CHANGED_FILES" | head -1 | cut -d'/' -f2)

Based on the analysis, create a conventional commit message:

  • Type: feat|fix|docs|style|refactor|test|chore (detected via grep patterns)
  • Scope: component or area affected (extracted from file paths)
  • Subject: clear description in present tense, ≤72 characters, imperative mood, no period
# Create the commit
# Example: git commit -m "fix(auth): resolve login timeout issue"

# Cache conventions for future commits
mkdir -p .claude/cache/commit
cat > .claude/cache/commit/conventions.json <<EOF
{
  "timestamp": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
  "common_scopes": ["$SCOPE"],
  "last_type": "$TYPE_HINT",
  "project_patterns": "analyzed"
}
EOF

The commit uses only your existing git user configuration. No AI attribution. No emoji.

Token Optimization

Expected range: 300–800 tokens (initial), 200–500 tokens (cache hit), 20–50 tokens (early exit)

Early exit: Exits before any analysis if no staged or unstaged changes — 95% savings.

Caching: Caches commit conventions (common scopes, preferred types) in .claude/cache/commit/conventions.json with a 7-day TTL. Invalidated when package.json changes.

Patterns used: Bash-based git operations instead of file reads; grep pattern detection for commit type; git diff scope limited to staged changes only; progressive disclosure (stat summary by default, full diff on --verbose).

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.