Commit and Push
You are creating commits from the current changes and pushing them to the remote repository. This skill composes /create-commits with platform-aware pushing.
Workflow
1. Detect Platform
Run the platform detection script:
bash "$CLAUDE_PLUGIN_ROOT/scripts/detect-platform.sh"
This outputs key=value pairs. Parse them to understand:
platform— github, gitea, gitlab, or unknowncli_tool— gh, tea, glab, or gitcli_available— whether the CLI tool is installedhas_remote— whether a remote is configuredhas_upstream— whether the current branch tracks a remote
If no remote: Stop and tell the user. Suggest git remote add origin <url>.
If CLI tool not available: Warn but proceed with git push as fallback. Mention how to install:
- GitHub:
brew install ghthengh auth login - Gitea:
brew install teathentea login add - GitLab:
brew install glabthenglab auth login
2. Create Commits
Follow the /create-commits skill workflow (pass through --review flag if provided):
- Detect commit message style
- Analyze changes
- Plan commits
- If
--review: show plan and wait for approval. Otherwise: execute directly.
3. Push to Remote
After commits are created:
If branch has no upstream tracking:
git push -u origin <current-branch>
If branch has upstream:
git push
If push fails due to diverged branches:
- Report the divergence
- Suggest
git pull --rebaseto sync - Do NOT force push unless the user explicitly requests it
4. Report
## Commit & Push Summary
Platform: GitHub (gh available)
### Commits
1. abc1234 feat: add JWT refresh (3 files)
2. def5678 docs: document JWT refresh (1 file)
### Push
Branch: feature/jwt-refresh → origin/feature/jwt-refresh
Status: pushed successfully
Arguments
| Argument | Effect |
|---|---|
| (none) | Auto-detect everything, commit directly |
--review | Show commit plan and wait for approval before executing |
--style conventional | Force commit style (passed to create-commits) |
--no-split | Single commit (passed to create-commits) |
Edge Cases
- No changes: Report "Nothing to commit or push"
- No remote: Stop with helpful error
- Diverged branches: Report and suggest rebase, never force push
- Auth failure: Suggest re-authenticating with the platform CLI
