Git Commit
Purpose
Produce reviewable commits: a clear subject line and a body that explains
what changed and why. Staging is whole-tree by default so one commit
reflects everything currently pending on the branch, not a cherry-pick of what
this session edited.
Authority
git commit allowed when the user explicitly asks you to commit, or a
checked-in workflow skill (for example execute-plan) authorizes commits as
part of its procedure.
- Message text only when the user wants a commit message but did not
ask you to run Git: use the subject and body rules below, optionally after
git status / git diff for context. Do not git add or git commit.
- If committing would be a surprise—no explicit commit request and no
workflow granting commit authority—stop before
git commit and confirm
intent.
Use When
- A commit with a strong message is requested or workflow-authorized.
- The user wants help composing commit message text (with or without you
running
git commit—see Authority).
Do Not Use When
- Git writes are forbidden by context and nothing overrides that.
Staging scope
- Default (this skill alone): Stage all changes in the working tree that
Git will track—modified, deleted, and untracked files—typically
git add -A at the repo root. That includes edits made by other agents,
the user, or tooling. .gitignore still applies (do not fight it to force
secrets into the commit).
- Parent workflow override: If the active procedure explicitly limits
what may be staged (for example
execute-plan phase commits: only files for
the completed phase), follow that staging scope and still use the message
rules below.
- If
git status shows something surprising (unexpected paths, credentials,
huge artifacts), surface it before committing; do not silently drop
co-workers’ changes to keep the commit “tidy.”
Procedure
- Inspect full
git status and git diff (and git diff --staged if
anything is already staged). Understand everything that will be included.
- Stage per Staging scope above.
- Subject line (about 50 characters target, 72 hard cap):
- Imperative mood: "Add", "Fix", "Refactor" — not past tense ("Added",
"Fixed") or third-person singular ("Adds", "Fixes") as the subject.
- The body may include issue closers such as
Fixes #123 when that is the
project convention.
- Be specific about area or behavior, not "Update code" or "WIP".
- Body (one blank line after the subject; wrap near 72 columns):
- What: bullets or short paragraphs covering all substantive areas in
this commit (not only the files you touched this turn).
- Why: motivation, tradeoffs, what was broken or awkward, or why this
approach over alternatives.
- Context (optional): issue links, plan paths, or follow-ups when they
help the next reader.
- Commit (commit path only), for example in bash or zsh:
git commit -m "subject" -m $'paragraph...\n\n- bullet'
- or
git commit with an editor when the body is long.
- Verify (commit path only):
git show --stat HEAD matches intent (entire
staged set landed).
- Post-commit audit (commit path only): after the commit succeeds, follow
Post-commit audit. Run
pytest at the repo root
when pytest is installed; then scan only the HEAD diff for bug risks,
god modules, needless complexity, and duplication (lightweight—see
What this is not).
Tell the user about findings in the same turn (paths,
severity, next step if obvious)—as heads-up, not scolding. The commit is
already done; do not delay the commit, imply it was a mistake, or push
amend/revert unless the user asks. Do not silently “fix” findings unless
the user asked; surfacing is the goal. If everything passes and nothing
worrisome stands out in the diff, you may omit commentary.
On the message-only path, perform step 1 as needed for context, skip
staging and steps 5–7, and output the subject and body (use the template
below).
Message template
Add/improve/fix <behavior> in <area>
What:
- ...
Why:
- ...
Post-commit audit
Run this only after git commit completes successfully (same repo, same
branch).
Intent (non-blocking)
- Commit always wins. Nothing here vetoes, reorders, or shames a commit that
already landed. People should keep committing; this step is extra awareness
for the author, not policy for the team.
- Alerts, not gates. Test or review findings are heads-up so you can fix
forward (
pytest failed after commit—here is the output) or choose to ignore.
Do not treat red tests as “the commit was wrong.”
- Optional follow-up. Suggest a fix commit or local cleanup only when helpful;
never pressure amend/revert unless the user explicitly wants that.
- Deeper review: For lint + full test matrix, A–F grades, optional
multi-agent passes, and broader scope, the user should invoke the
audit
skill (message contains audit)—do not inflate post-commit into a full audit.
What this is not
Stay narrow so commits stay fast:
- Do run
pytest (when available) and read git show -p HEAD (this commit only).
- Do not run exhaustive export suites or multi-step smoke tests here by
default—those belong to
audit, deploy, or the user’s task unless
already requested.
Python checks
From the repository root, when pytest is on the path:
- Run
pytest (or python -m pytest if that is how the environment is set up).
If pytest is missing, no tests exist, or the run fails, report the relevant
output with neutral framing (“Heads-up: pytest failed after your commit”).
The commit stays; the user can fix in a follow-up. Do not hide failures.
Diff scope
Use the committed change as the source of truth—e.g. git show HEAD or
git show -p HEAD, and the paths touched:
git diff-tree --no-commit-id --name-only -r HEAD.
Bug scan
Re-read the change as a quick self-review on changed lines only. Flag likely
problems for the user (this is not a substitute for CI, audit, or the full
test suite unless already part of the task):
- Logic errors, wrong conditions, off-by-one, incorrect defaults.
- Missing or broken error handling / early returns where failures are plausible.
- Obvious regressions: removed guards, weakened validation, race or stale-state
risks introduced by the new code.
- API or type mismatches, impossible states, or changes that contradict the
commit message.
- Async discipline (spot-check): missing
await, fire-and-forget promises,
or ambiguous error propagation in the diff—borrowed from audit charter,
but only what you see in this patch.
- Workers / queues / webhooks / cron (spot-check): if the diff touches those,
glance for obvious at-least-once hazards (duplicate side effects without
idempotency)—one-line flag, not a full reliability audit.
- Security / privacy (glance): obvious secrets or PII logged in the diff; if
it needs auth review, nudge toward
audit instead of digging here.
- Anything that would make you say “wait, that can’t be right” on a PR.
God module scan
Align with repo philosophy: clear separation of concerns, no dumping
unrelated responsibilities into one place.
Flag when this commit creates or substantially grows a module that looks
like a grab-bag “does everything” file—for example:
- Size: one file approaches or exceeds the project’s per-file size guidance
(this repo aims for well under ~1000 LOC per file—use judgment near that
band).
- Scope creep: unrelated domains, layers, or features fused into a single
module (many disparate exports, orchestration + persistence + UI helpers in
one file, etc.).
- Fan-in smell: a change that makes one file the obvious choke point for
unrelated call sites when a split would be natural.
When in doubt, flag lightly with reasoning; avoid crying wolf, but do not
skip obvious smells to avoid bothering the user.
Needless complexity and duplication
- Needless complexity: extra layers, over-abstraction, clever patterns where
a straight line would do, new dependencies or infrastructure for trivial
wins, configuration explosions, or branching that obscures the actual
behavior—especially when it violates simpler is better for this repo.
- Duplication: copy-pasted blocks, parallel implementations of the same rule
or transform, near-identical helpers that should be one function, or “another
copy” of logic that already exists elsewhere—when unifying would obviously
reduce drift risk.
Flag when this commit introduces or worsens these; cite paths and why it
matters.
What to output
- pytest: pass/fail; if fail, enough output to act on, framed as post-commit
awareness—not a blocked workflow.
- If other issues: short summary, bullet list with file paths, what you
saw, and whether it looks like a definite bug vs. a risk vs. a maintainability
smell.
- If clean: say nothing or one line—no boilerplate required.
Anti-patterns
- One-word subjects ("fix", "wip", "updates").
- A body that only repeats the subject.
- Cherry-staging only the files you personally edited when the user asked
for a commit and no narrower workflow override applies—other agents’ work
must ship too.
- Claiming a “single logical change” while omitting co-present dirty files
without explicit user direction.
- Skipping the post-commit audit after a successful commit when this skill’s
commit path ran—especially omitting
pytest when available or staying silent
when it fails or the diff clearly introduces risk.
- Skipping pytest when it is installed and the repo has tests; hiding failures
instead of showing them.
- Turning post-commit into a full audit: running full export smoke, multi-agent
Task delegation, or A–F grades here—use the audit skill when the
user says audit.
- Blocking mindset: implying the user should not have committed, or urging
amend/revert, because of post-commit findings—unless they asked for that.
Related skills
audit: user message includes audit; optional full tests, optional
multi-agent, A–F grades, broader scope.
deploy: what “ship” means for this repo (no Cloudflare scripts); see that skill.
1---2name: git-commit3description: Produces comprehensive Git commit messages (what and why) and, when authorized, stages and commits. By default stages the entire working tree (all pending changes), including work from other agents or earlier sessions—not only files the current agent touched. After a successful commit (non-blocking), runs `pytest` at the repo root when available and a **lightweight** read of **HEAD** only (bug risks, god-module smells, needless complexity, duplication)—not a full **audit** (no lint gate, no grades, no multi-agent); for that, the user invokes the **`audit`** skill. Surfacing findings as optional heads-up, never as a reason to block or unwind the commit unless the user asks. No automatic fixes. Message-only requests use the same template without running git until commit is explicitly requested. Also use inside authorized workflows (for example execute-plan phase commits). Do not use for read-only review, hypothetical history, or when git writes are not authorized.4---56# Git Commit78## Purpose910Produce **reviewable commits**: a clear subject line and a body that explains11**what** changed and **why**. **Staging is whole-tree by default** so one commit12reflects everything currently pending on the branch, not a cherry-pick of what13this session edited.1415## Authority1617- **`git commit` allowed when** the user explicitly asks you to commit, or a18 checked-in workflow skill (for example `execute-plan`) authorizes commits as19 part of its procedure.20- **Message text only** when the user wants a commit message but did **not**21 ask you to run Git: use the subject and body rules below, optionally after22 `git status` / `git diff` for context. Do **not** `git add` or `git commit`.23- If committing would be a surprise—no explicit commit request and no24 workflow granting commit authority—**stop** before `git commit` and confirm25 intent.2627## Use When2829- A commit with a strong message is requested or workflow-authorized.30- The user wants help composing commit message text (with or without you31 running `git commit`—see Authority).3233## Do Not Use When3435- Git writes are forbidden by context and nothing overrides that.3637## Staging scope3839- **Default (this skill alone):** Stage **all** changes in the working tree that40 Git will track—modified, deleted, and **untracked** files—typically41 `git add -A` at the repo root. That includes edits made by **other agents**,42 the user, or tooling. `.gitignore` still applies (do not fight it to force43 secrets into the commit).44- **Parent workflow override:** If the active procedure **explicitly** limits45 what may be staged (for example `execute-plan` phase commits: only files for46 the completed phase), **follow that staging scope** and still use the message47 rules below.48- If `git status` shows something surprising (unexpected paths, credentials,49 huge artifacts), **surface it** before committing; do not silently drop50 co-workers’ changes to keep the commit “tidy.”5152## Procedure53541. **Inspect** full `git status` and `git diff` (and `git diff --staged` if55 anything is already staged). Understand **everything** that will be included.562. **Stage** per [Staging scope](#staging-scope) above.573. **Subject line** (about 50 characters target, 72 hard cap):58 - Imperative mood: "Add", "Fix", "Refactor" — not past tense ("Added",59 "Fixed") or third-person singular ("Adds", "Fixes") as the **subject**.60 - The **body** may include issue closers such as `Fixes #123` when that is the61 project convention.62 - Be specific about area or behavior, not "Update code" or "WIP".634. **Body** (one blank line after the subject; wrap near 72 columns):64 - **What**: bullets or short paragraphs covering **all** substantive areas in65 this commit (not only the files you touched this turn).66 - **Why**: motivation, tradeoffs, what was broken or awkward, or why this67 approach over alternatives.68 - **Context** (optional): issue links, plan paths, or follow-ups when they69 help the next reader.705. **Commit** (commit path only), for example in bash or zsh:71 - `git commit -m "subject" -m $'paragraph...\n\n- bullet'`72 - or `git commit` with an editor when the body is long.736. **Verify** (commit path only): `git show --stat HEAD` matches intent (entire74 staged set landed).757. **Post-commit audit** (commit path only): after the commit succeeds, follow76 [Post-commit audit](#post-commit-audit). Run **`pytest`** at the repo root77 when pytest is installed; then scan **only** the `HEAD` diff for bug risks,78 god modules, needless complexity, and duplication (**lightweight**—see79 [What this is not](#what-this-is-not)).80 **Tell the user** about findings in the same turn (paths,81 severity, next step if obvious)—as **heads-up**, not scolding. The commit is82 already done; do **not** delay the commit, imply it was a mistake, or push83 amend/revert unless the user asks. Do **not** silently “fix” findings unless84 the user asked; surfacing is the goal. If everything passes and nothing85 worrisome stands out in the diff, you may omit commentary.8687On the **message-only** path, perform step 1 as needed for context, skip88staging and steps 5–7, and output the subject and body (use the template89below).9091## Message template9293```text94Add/improve/fix <behavior> in <area>9596What:97- ...9899Why:100- ...101```102103## Post-commit audit104105Run this **only after** `git commit` completes successfully (same repo, same106branch).107108### Intent (non-blocking)109110- **Commit always wins.** Nothing here vetoes, reorders, or shames a commit that111 already landed. People should keep committing; this step is **extra awareness**112 for the author, not policy for the team.113- **Alerts, not gates.** Test or review findings are **heads-up** so you can fix114 forward (`pytest` failed after commit—here is the output) or choose to ignore.115 Do not treat red tests as “the commit was wrong.”116- **Optional follow-up.** Suggest a fix commit or local cleanup only when helpful;117 never pressure amend/revert unless the user explicitly wants that.118- **Deeper review:** For **lint + full test matrix**, **A–F grades**, optional119 **multi-agent** passes, and broader scope, the user should invoke the **`audit`**120 skill (message contains **`audit`**)—do not inflate post-commit into a full audit.121122### What this is not123124Stay **narrow** so commits stay fast:125126- **Do** run **`pytest`** (when available) and read **`git show -p HEAD`** (this commit only).127- **Do not** run exhaustive export suites or multi-step smoke tests here by128 default—those belong to **`audit`**, **`deploy`**, or the user’s task unless129 already requested.130131### Python checks132133From the **repository root**, when `pytest` is on the path:134135- Run **`pytest`** (or **`python -m pytest`** if that is how the environment is set up).136137If pytest is missing, no tests exist, or the run fails, **report the relevant138output** with neutral framing (“Heads-up: `pytest` failed after your commit”).139The commit stays; the user can fix in a follow-up. Do not hide failures.140141### Diff scope142143Use the committed change as the source of truth—e.g. `git show HEAD` or144`git show -p HEAD`, and the paths touched:145`git diff-tree --no-commit-id --name-only -r HEAD`.146147### Bug scan148149Re-read the change as a quick self-review **on changed lines only**. Flag **likely**150problems for the user (this is not a substitute for CI, **`audit`**, or the full151test suite unless already part of the task):152153- Logic errors, wrong conditions, off-by-one, incorrect defaults.154- Missing or broken error handling / early returns where failures are plausible.155- Obvious regressions: removed guards, weakened validation, race or stale-state156 risks introduced by the new code.157- API or type mismatches, impossible states, or changes that contradict the158 commit message.159- **Async discipline (spot-check):** missing `await`, fire-and-forget promises,160 or ambiguous error propagation in the diff—borrowed from **`audit`** charter,161 but **only** what you see in this patch.162- **Workers / queues / webhooks / cron (spot-check):** if the diff touches those,163 glance for obvious at-least-once hazards (duplicate side effects without164 idempotency)—**one-line flag**, not a full reliability audit.165- **Security / privacy (glance):** obvious secrets or PII logged in the diff; if166 it needs auth review, nudge toward **`audit`** instead of digging here.167- Anything that would make you say “wait, that can’t be right” on a PR.168169### God module scan170171Align with repo philosophy: **clear separation of concerns**, no dumping172unrelated responsibilities into one place.173174Flag when this commit **creates or substantially grows** a module that looks175like a grab-bag “does everything” file—for example:176177- **Size**: one file approaches or exceeds the project’s per-file size guidance178 (this repo aims for well under ~1000 LOC per file—use judgment near that179 band).180- **Scope creep**: unrelated domains, layers, or features fused into a single181 module (many disparate exports, orchestration + persistence + UI helpers in182 one file, etc.).183- **Fan-in smell**: a change that makes one file the obvious choke point for184 unrelated call sites when a split would be natural.185186When in doubt, **flag lightly** with reasoning; avoid crying wolf, but do not187skip obvious smells to avoid bothering the user.188189### Needless complexity and duplication190191- **Needless complexity**: extra layers, over-abstraction, clever patterns where192 a straight line would do, new dependencies or infrastructure for trivial193 wins, configuration explosions, or branching that obscures the actual194 behavior—especially when it violates **simpler is better** for this repo.195- **Duplication**: copy-pasted blocks, parallel implementations of the same rule196 or transform, near-identical helpers that should be one function, or “another197 copy” of logic that already exists elsewhere—when unifying would obviously198 reduce drift risk.199200Flag when this commit **introduces or worsens** these; cite paths and why it201matters.202203### What to output204205- **pytest**: pass/fail; if fail, enough output to act on, framed as post-commit206 awareness—not a blocked workflow.207- **If other issues**: short summary, bullet list with **file paths**, what you208 saw, and whether it looks like a definite bug vs. a risk vs. a maintainability209 smell.210- **If clean**: say nothing or one line—no boilerplate required.211212## Anti-patterns213214- One-word subjects ("fix", "wip", "updates").215- A body that only repeats the subject.216- **Cherry-staging** only the files you personally edited when the user asked217 for a commit and no narrower workflow override applies—other agents’ work218 must ship too.219- Claiming a “single logical change” while omitting co-present dirty files220 without explicit user direction.221- **Skipping the post-commit audit** after a successful commit when this skill’s222 commit path ran—especially omitting **`pytest`** when available or staying silent223 when it fails or the diff clearly introduces risk.224- **Skipping pytest** when it is installed and the repo has tests; hiding failures225 instead of showing them.226- **Turning post-commit into a full audit:** running full export smoke, multi-agent227 **`Task`** delegation, or **A–F grades** here—use the **`audit`** skill when the228 user says **`audit`**.229- **Blocking mindset:** implying the user should not have committed, or urging230 amend/revert, because of post-commit findings—unless they asked for that.231232## Related skills233234- **`audit`:** user message includes **`audit`**; optional full tests, optional235 multi-agent, **A–F** grades, broader scope.236- **`deploy`:** what “ship” means for this repo (no Cloudflare scripts); see that skill.