/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
| Aspect | Behavior |
|---|---|
| Role | The Scribe — produces commit message text; optionally executes git operations under explicit flags. |
| Target | The current working tree (no argument), a specific patch file (-d), the active plan (-P), or recently modified files (-r). |
| Cell scope | None directly. /wbGit may read plan rows (to enrich commit messages with Refs: plan_<...>.md) but never mutates plan cells. |
| Side effects allowed under explicit flags | git add, git commit, git push, git commit --amend. |
| Side effects always forbidden | git 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
| Form | Example | What /wbGit does |
|---|---|---|
| No argument | Command: /wbGit | Reads git status + git diff. Produces a Conventional Commits message. Does not execute. |
| Free-text intent | Command: /wbGit "commit as mixed change" | Parses intent (forces chore: prefix that acknowledges the mix). Still does not execute. |
| Free-text intent + flag | Command: /wbGit "commit and push" -e -p | Equivalent to /wbGit -e -p. NL is interpreted as flag-equivalent. |
| Patch file | Command: /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
| Flag | Shortcut | Purpose |
|---|---|---|
--from-plan | -P | Reads today's plan_*.md and uses ✅ Done rows as the commit body source. |
--scan-recent | -r | Cross-references files modified in the last 2 hours; useful when no plan exists. |
--diff-file="<path>" | -d | Reads 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
| Flag | Shortcut | Purpose |
|---|---|---|
--amend | -A | git commit --amend instead of new commit. Refuses if the previous commit was already pushed (unless -F is also passed and the user confirms). |
Execution
| Flag | Shortcut | Purpose |
|---|---|---|
--execute | -e | Runs git add + git commit. Asks for confirmation before each. |
--push | -p | Runs git push origin <current-branch>. Separate confirmation gate from -e. |
--force | -F | Force push. Refuses on protected branches. Asks twice on others. |
--no-verify | -n | Skip 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 -P -e -p> /wbGit -P -e -p💠 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
💠 Pipeline Graph link + issue ref
5. Edge cases & refusals
| Trigger | What /wbGit does |
|---|---|
| Empty diff | Halt. ❌ No changes detected; nothing to commit. |
Merge conflict in git status | Halt. 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 branch | Refuse with two confirmations. The user must say y twice. |
--no-verify | Halt + explicit override required. Records "user invoked --no-verify" in provenance notes. |
--amend after the previous commit was pushed | Refuse unless -F is also explicitly passed. Amending pushed commits rewrites public history. |
| Detached HEAD state | Warns; commits will not attach to a branch. Asks user to confirm. |
--from-plan with no ✅ Done rows in the plan | Honest "no done rows; nothing to commit from plan." Suggests -r (scan-recent) instead. |
| Commit message exceeds the 72-char subject line limit | Truncates the subject to 72 chars; preserves the full thought in the body. |
| User asks "delete the last commit" via NL | Refuse. 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.
