add-commit-push

A Git command that checks the current branch and working tree, runs project checks, stages changes, creates a conventional commit, and pushes that commit to the current branch.

In plain words
What is it for?
Use it after making changes when you want to validate, commit, and push them with a supplied commit message.
Why use it?
It puts the safety checks and routine Git steps into one repeatable workflow, including stopping when there is nothing to commit or when the branch is protected.

Command for Codex

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 commands/kaelsensei/magicaibuilder/add-commit-push
Clone the repo
git clone --depth 1 https://github.com/KaelSensei/MagicAIBuilder

Made for: Codex.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 990 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.00000 $0.00990
Opus 5 $0.00000 $0.00495
Sonnet 5 $0.00000 $0.00198
Haiku 4.5 $0.00000 $0.00099

Measured 2d ago against content hash ec6680522191, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

add-commit-push 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 2d ago.

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.

.agents/commands/add-commit-push.md · 149 lines

How it starts

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

Git Command – Stage, Commit, and Push Current Changes

When /git [message] is invoked, immediately execute the following steps to stage changes, create a conventional commit, and push to the current branch.


Step 1: Load Project Context & Follow All Rules

  1. Assume the project root as the working directory
  2. Load and strictly follow ALL Cursor rules from .cursor/rules/*.mdc:
    • security.mdc - Security requirements
    • documentation.mdc - Documentation update requirements
    • version-management.mdc - Git workflow and commit conventions
    • general-principles.mdc - Project philosophy (keep it simple)
  3. Read relevant documentation if present:
    • README.md
    • Project progress / changelog docs (e.g., PROGRESS.md, CHANGELOG.md)

Step 2: Safety Checks (Mandatory)

  1. Check current branch:

    git branch --show-current
    
  2. Refuse to commit directly to protected branches:

    • If branch is main or master, stop and ask the user to create a feature branch first.
  3. Check working tree:

    git status
    
  4. If there is nothing to commit, report that and stop.


Step 3: Run Project Checks (Lint / Format / Tests)

Before committing, run the project's standard checks if they exist:

  1. Detect common check commands by looking for scripts and config files:

    • Node: package.json scripts like check, lint, format:check, test
    • Python: pyproject.toml, pytest.ini, ruff.toml
    • Go: go test ./..., golangci-lint run
    • Rust: cargo test, cargo fmt --check, cargo clippy
  2. Run the most relevant, fastest checks first (format check + lint).

  3. If checks fail:

    • Stop and report the failures
    • Fix if safe and straightforward
    • Re-run the checks until they pass

Note: if the repo has a pre-commit hook, it will also run automatically when committing.


Step 3.5: SonarCloud Quality Gate (Mandatory)

After the code is ready and the tests pass, run the Sonar scan and verify there are 0 open issues.

Read the full file on GitHub · 149 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. 2d ago First seen · 149 lines · 0 tokens per session scan A ec6680522191

Subscribe to this mod's changes

add-commit-push is a command published in the GitHub repository KaelSensei/MagicAIBuilder (2 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 990 tokens. 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.

Related

Other commands, from other repositories