Skip to content

/wbGit — Exhaustive Simulation () ​

/wbGit is the scribe — and the only command in the entire /wb* system that touches git. Every other command is read-only against the working tree. This is not a polite preference; it's a hard rule encoded in user memory ("never use git commands"), and /wbGit is the single, deliberate exception.

Read this if you want to know exactly which 10 flags exist, what each refuses to do, why the provenance header is mandatory, and what the agent will not do even when explicitly asked.


1. Role & target ​

AspectBehavior
RoleThe Scribe — produces commit message text; optionally executes git operations under explicit flags.
TargetThe current working tree (no argument), a specific patch file (-d), the active plan (-P), or recently modified files (-r).
Cell scopeNone directly. /wbGit may read plan rows (to enrich commit messages with Refs: plan_<...>.md) but never mutates plan cells.
Side effects allowed under explicit flagsgit add, git commit, git push, git commit --amend.
Side effects always forbiddengit push --force to a protected branch (refuses unconditionally); git commit --no-verify without explicit user override (warning + halt by default); modifying .git/config; running interactive rebases.

The "single exception" rule has a shape: /wbGit without an execution flag (default behavior) is read-only on git — it runs git status and git diff (both read-only) to compose a message, then prints the message. Execution requires an explicit -e/-p/-A flag, and even then the agent confirms before each separate git command.


2. Argument resolution matrix ​

FormExampleWhat /wbGit does
No argumentCommand: /wbGitReads git status + git diff. Produces a Conventional Commits message. Does not execute.
Free-text intentCommand: /wbGit "commit as mixed change"Parses intent (forces chore: prefix that acknowledges the mix). Still does not execute.
Free-text intent + flagCommand: /wbGit "commit and push" -e -pEquivalent to /wbGit -e -p. NL is interpreted as flag-equivalent.
Patch fileCommand: /wbGit -d="patch.diff"Reads the patch file instead of the working tree. Useful for reviewing pre-staged work.

3. The 10 flags ​

Three categories: information extraction (where the message comes from), architectural context (what metadata to embed), and execution (what git operations to actually run).

Information extraction ​

FlagShortcutPurpose
--from-plan-PReads today's plan_*.md and uses ✅ Done rows as the commit body source.
--scan-recent-rCross-references files modified in the last 2 hours; useful when no plan exists.
--diff-file="<path>"-dReads a specific patch file instead of the working tree.

These three shape content, not behavior. They can be composed (-P -r cross-references both); the agent merges into one coherent message.

Architectural context ​

FlagShortcutPurpose
--amend-Agit commit --amend instead of new commit. Refuses if the previous commit was already pushed (unless -F is also passed and the user confirms).

Execution ​

FlagShortcutPurpose
--execute-eRuns git add + git commit. Asks for confirmation before each.
--push-pRuns git push origin <current-branch>. Separate confirmation gate from -e.
--force-FForce push. Refuses on protected branches. Asks twice on others.
--no-verify-nSkip pre-commit hooks. Halts with explicit override required.

The four-stage gate (status/diff → add → commit → push) is the design center. Each gate is independently confirmable; the user can stop at any point. -F and -n are off by default even in execution chains — they require explicit, named override.


4. Pipelines (the agent-native scenarios) ​

📋/wbGit Exhaustive Simulation
The "Daily Sync" (the EOD habit)/wbGit -P -e -p
> /wbGit -P -e -p
[SYSTEM] Reading active plan: plan_<package>_<date>.md
[PLAN] 2 rows have Done=✅, Valid=✅: rows 1, 2.
[GENERATE] Drafting message from plan rows...
feat(<package>): close JWT handshake and renderString escape
<!-- wbGit
date: <date> <time>
model: claude-opus-4-7
session: claude
plan: reports/<date>/plans/plan_<package>_<date>.md
notes: —
-->
- Add JWT handshake with alg denylist in tierEnforcement.js (row 1)
- Add escape pass for <, >, & in renderString.js (row 2)
Refs plan_<package>_<date>.md.
[GATE 1: add] git add core2/packages/<package>/src/tierEnforcement.js
git add core2/packages/<package>/src/renderString.js
[y/N] > y
[GATE 2: commit] git commit -m "<message above>"
[y/N] > y
[OK] Commit a1b2c3d created.
[GATE 3: push] git push origin main
[y/N] > y
[OK] Pushed 1 commit to origin/main.

💠 Pipeline The "Daily Sync" (the EOD habit) ​

💠 Pipeline The mixed-change refusal that the user can override ​

💠 Pipeline The hooks-failed "do not skip" refusal ​


5. Edge cases & refusals ​

TriggerWhat /wbGit does
Empty diffHalt. ❌ No changes detected; nothing to commit.
Merge conflict in git statusHalt. Refuses to auto-resolve. Tells the user to resolve manually.
--force on a branch with the protected-branch flag (e.g., main, master, prod)Unconditional refuse. Even with override.
--force on a non-protected branchRefuse with two confirmations. The user must say y twice.
--no-verifyHalt + explicit override required. Records "user invoked --no-verify" in provenance notes.
--amend after the previous commit was pushedRefuse unless -F is also explicitly passed. Amending pushed commits rewrites public history.
Detached HEAD stateWarns; commits will not attach to a branch. Asks user to confirm.
--from-plan with no ✅ Done rows in the planHonest "no done rows; nothing to commit from plan." Suggests -r (scan-recent) instead.
Commit message exceeds the 72-char subject line limitTruncates the subject to 72 chars; preserves the full thought in the body.
User asks "delete the last commit" via NLRefuse. Destructive operations require explicit git knowledge from the user, not NL inference.

The pattern: /wbGit is the single git command, with multiple gates between intent and side effect. It refuses to do anything destructive without explicit override; refuses to bundle unrelated changes silently; refuses to amend pushed commits without -F; refuses to push to protected branches with force. Every gate is named, every refusal explained, every override recorded. The provenance header is the audit trail — without it, the closed-loop architecture (plan → work → validate → commit) loses its final link.