Stage, commit, and push changes. Drafts a commit message then commits and pushes with permission approval.
/commit [path] — path can be an absolute path or a repo name. If a repo name is given, resolve it to a full path by searching under ~/Documents/Projects/. Then prefix all git commands with git -C <resolved-path>.
git add -A or git add . -- always stage specific files by name--no-verify or --amend--force, --force-with-lease)main or master without explicitly warning the user first.env, credentials, *.key, *.pem, *.secret, tokens, passwordsRun in parallel: git status, git diff HEAD, git log --oneline -5.
If there are no changes, tell the user and stop.
If any files look like secrets (.env, credentials.*, *.key, *.pem, *.secret), warn the user and ask before continuing.
Check what is already staged:
git diff --cached --name-only
Then stage any remaining relevant files by name. If it's ambiguous which files to include, ask the user.
Run git diff --cached and draft a commit message:
Do not pause or ask for confirmation — proceed straight to commit.
Use -m for the summary and a second -m for the body. Never use a heredoc — it breaks permission matching.
git commit -m "Summary line" -m "Body paragraph."
Check the branch and upstream:
git rev-parse --abbrev-ref @{upstream} 2>/dev/null
If on main or master, warn the user. The permission system will prompt for push approval — do NOT use AskUserQuestion.
Push with git push, or git push -u origin <branch> if no upstream exists.
Report back with: the commit message, commit hash, branch, and push status.