add--commit — Smart Commit
<!-- uses:
- command: /add-build (conditional)
- mention: /add-done
- mention: /add-pull-request
- script: converge-gates.cjs
- skill: add--doc-schemas
-->
When to Use
- Mid-workflow commits during feature development
- Saving progress checkpoints before risky changes
- Any
git commitwith automatic message generation - Quick commits with optional
--pushin one step
When NOT to Use
- Finalizing a branch → use
/add-doneinstead - Creating or updating a PR → use
/add-pull-request - Force push, rebase, or amend → out of scope
- Specific file staging → stage manually first, then use the command
Adaptive Message Logic
The message format adapts to changeset size:
≤ 3 files changed — single-line message:
type(scope): objective description in present tense
> 3 files changed — list format:
type: general summary
- context/module: what changed
- context/module: what changed
- context/module: what changed
Conventional Commits Type Detection
Infer the type from the diff content:
| Type | When to use |
|------|-------------|
| feat | New feature, new functionality |
| fix | Bug fix, error correction |
| refactor | Code restructure without behavior change |
| chore | Config, deps, scripts, tooling |
| docs | Documentation only |
| test | Test files only |
| style | Formatting, whitespace, lint fixes |
When ambiguous, show the inferred type and ask the user to confirm.
Staging Rules
A code commit stages code only. Docs live on the codeadd-docs branch, a separate worktree the code branch ignores, so a doc can never enter a code commit and is saved by the end-of-command rule in add--doc-schemas → Docs Branch, never by staging.
git add -A
Checkpoint Receipt (epic checkpoints only)
A commit made by {{cmd:add-build}}'s Checkpoint Sequence at a subfeature
boundary carries the convergence result as a trailer, so the checkpoint says
why it was safe to stop there. The commit hash then points at the work AND at
the proof.
The commit carries the six gate lines — GATE_REVIEW, GATE_QA_BASELINE,
GATE_EPIC, GATE_COVERAGE, GATE_LEDGER, GATES_OK — copied verbatim from
converge-gates.cjs's output, as body lines below the Conventional Commits
body. The script emits more keys than these (REVIEW_PATH, BASELINE,
EPIC_PENDING, COVERAGE_UNCOVERED, QA_FEATURE_STATE); only the six above
belong in the message.
They are body lines, not git trailers. GATE_REVIEW=ok has no Key: value
colon, so git interpret-trailers will never parse it — calling them trailers
would promise tooling behaviour that does not exist. git log --grep=GATES_OK
works on body lines, which is the only retrieval this needs:
feat(0028F-SF02): persist receipt line total on duplicate
- backend: enforce RN03 on the duplicate path
- frontend: surface the persisted total in the header
GATE_REVIEW=ok
GATE_QA_BASELINE=ok
GATE_EPIC=ok
GATE_COVERAGE=ok
GATE_LEDGER=ok
GATES_OK=5/5
⛔ DO NOT reformat, summarise, or re-word the gate lines. They are copied, not
authored — a reformatted receipt is indistinguishable from an invented one, and
the whole point is that git log --grep=GATES_OK reconstructs which
subfeatures converged and on what evidence, using nothing but git.
⛔ DO NOT write these lines on a commit whose subfeature did not converge. That
commit does not exist: the checkpoint is gated on all five gates reading ok,
and the ABSENCE of a commit is itself the signal.
No new state file. The receipt lives in the commit message, so it adds no
state file — a commit message is not a second source of truth that can drift
from the tree, it is part of the object that carries the tree.
Examples
Few files (≤ 3):
feat(auth): add JWT refresh token endpoint
Many files (> 3):
refactor: extract service layer from controllers
- auth: move login/register logic to AuthService
- user: extract UserService from UserController
- order: decouple OrderService dependencies
- shared: add BaseService abstract class