When origin/HEAD is unavailable (no remote, ref unset), fall back to
gh repo view to query the GitHub default branch before hard-coding
main. Covers repos using develop/trunk as their default.
Addresses PR review feedback (#386)
Piping into sed returns exit 0 even when the upstream git command
fails, so the "fall back to main" path never triggers. The agent
reads stdout/stderr directly and can strip the origin/ prefix and
detect failures itself.
Addresses PR review feedback (#386)
Add `git rev-parse --abbrev-ref origin/HEAD` to Step 1 so the guard
works for repos whose default branch is not main or master (e.g.
develop, trunk). Falls back to main if the remote HEAD is unset.
Addresses PR review feedback (#386)
The git-commit skill collected the current branch name but never
checked whether it was main/master. Add a guard that warns the user
and offers to create a feature branch before committing, matching the
protection already present in git-commit-push-pr.