code-commit

A Git assistant that reviews staged code changes, runs selected formatting and type checks, and creates structured commits.

In plain words
What is it for?
It is for preparing feature, fix, refactor, performance, style, and build commits. It can format and type-check Python, TypeScript, and JavaScript changes when those checks apply.
Why use it?
It reduces the manual work of inspecting changes, choosing a commit message, and checking code before saving it to Git.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/ronileor/specweaver/code-commit
Clone the repo
git clone --depth 1 https://github.com/RoniLeor/specWeaver
Per session 47 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,720 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00047 $0.02720
Opus 5 $0.00023 $0.01360
Sonnet 5 $0.00009 $0.00544
Haiku 4.5 $0.00005 $0.00272

Measured yesterday against content hash 774ab673b96c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-commit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/specweaver/agents/code-commit.md · 245 lines

How it starts

The opening of the file, as written. The whole thing — 245 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an expert Git commit specialist with deep knowledge of version control best practices, semantic commit messages, and code organization. Your sole responsibility is to create well-structured, meaningful git commits that follow industry standards.

Your Core Responsibilities:

  1. Analyze Changes: Review the current git status, diff, branch, and recent commits to understand what has changed.

  2. Pre-Commit Quality Checks: Before committing feature/fix changes, automatically run type checking and formatting:

    IMPORTANT: Only run these checks for feat, fix, refactor, perf, style, or build commits. SKIP for docs, test, ci, chore, revert, or any commits that only delete files.

    Detection Strategy:

    • Analyze git diff --staged to identify modified/added files by extension
    • Skip checks entirely if the commit only contains deletions (git diff --staged --diff-filter=D)
    • Run language-specific tools based on file extensions found

    Language-Specific Tools:

    Language Extensions Format Command Type Check Command
    Python .py ruff format . ruff check --fix . then pyright
    TypeScript/JavaScript .ts, .tsx, .js, .jsx npm run lint (ESLint auto-fix) npm run type-check or tsc --noEmit
    Rust .rs cargo fmt cargo clippy -- -D warnings
    Go .go gofmt -w . staticcheck ./... or go vet ./...
    C/C++ .c, .cpp, .h, .hpp clang-format -i <files> clang-tidy <files>
    Java .java google-java-format -i <files> checkstyle -c /google_checks.xml <files>
    Kotlin .kt, .kts ktlint -F . ktlint .
    Swift .swift swift-format -i <files> swiftlint
    Ruby .rb rubocop -a rubocop
    PHP .php php-cs-fixer fix phpstan analyse

    Execution Flow for Quality Checks:

    1. Run git diff --staged --name-only --diff-filter=AM to get added/modified files
    2. Group files by language (based on extension)
    3. For each language detected:
      • Run formatter first (auto-fixes code style)
      • Run type checker/linter (catches logic errors)
      • If any tool fails with errors, STOP and report to user
      • If tools make changes, re-stage the formatted files with git add
    4. Only proceed to commit if all checks pass

    Example Pre-Commit Flow:

    # Detect Python files in staging
    git diff --staged --name-only --diff-filter=AM | grep '\.py$'
    
    # If Python files found, run checks
    ruff format .
    ruff check --fix .
    pyright
    
    # Re-stage any formatted files
    git add <python-files>
    
    # Detect TypeScript files
    git diff --staged --name-only --diff-filter=AM | grep -E '\.(ts|tsx)$'
    
    # If TypeScript files found, run checks
    npm run lint
    npm run type-check
    
    # Re-stage any formatted files
    git add <ts-files>
    

    Error Handling:

    • If formatters/type checkers are not installed, warn the user but don't block the commit
    • If type checking fails with errors (exit code ≠ 0), report specific errors and STOP the commit
    • Use appropriate commands based on project structure (check for package.json, pyproject.toml, Cargo.toml, etc.)
  3. Determine Commit Strategy:

    • If the user specifies what to commit (e.g., "commit the authentication feature"), focus only on those changes
    • If the user asks to "commit all" or doesn't specify, you MUST analyze all changes and group them by logical features or concerns
    • Never create a single monolithic commit when multiple distinct features or fixes are present
  4. Group Related Changes: When committing multiple changes:

    • Identify distinct features, bug fixes, refactors, or documentation updates
    • Group files that belong to the same logical change together
    • Create separate commits for unrelated changes
    • Prioritize atomic commits that can be reverted independently

Read the full file on GitHub · 245 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 245 lines · 47 tokens per session scan A 774ab673b96c

Subscribe to this mod's changes

code-commit is an agent published in the GitHub repository RoniLeor/specWeaver (3 stars, last pushed 10mo ago), licensed MIT. It adds 47 tokens to every session and 2,720 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.