This skill should be used when the user asks to "commit changes", "smart commit", "resolve conflicts", "review changes", or needs Git workflow assistance with intelligent commit messages.
Smart Git operations with intelligent commit messages, change analysis, and PR creation with adaptive descriptions.
Default: Always uses intelligent commit message generation. Defaults to commit operation.
Parse arguments: $ARGUMENTS
All arguments use -- prefix:
| Argument | Operation |
|----------|-----------|
| --commit | Smart commit with scope-based messaging (default if no argument given) |
| --review | Pre-commit code review of staged changes |
| --resolve | Merge conflict resolution with context |
| --pr or --ship | Commit → Push → Create PR/MR in one flow |
| --push | Push after commit |
| --force-push | Force push with lease after commit |
Before executing, analyze change scope:
git status --porcelain
git diff --stat
| Scope | Criteria | Workflow | |-------|----------|----------| | Small | < 3 files, single logical change | Direct commit, concise message | | Medium | 3-10 files, related changes | Smart commit with detailed analysis | | Large | 10+ files OR unrelated features | Suggest splitting into atomic commits |
Extract ticket/issue identifier from the current branch name:
git branch --show-current
ABC-1234, fix/ABC-1234, feature/FOO-99_description, FOO-123_description, etc.[A-Z][A-Z0-9]+-[0-9]+ from branch nameIf a ticket is found, detect the commit style already used on this branch:
MERGE_BASE=$(git merge-base origin/HEAD HEAD 2>/dev/null \
|| git merge-base origin/main HEAD 2>/dev/null \
|| git merge-base origin/master HEAD 2>/dev/null)
if [ -n "$MERGE_BASE" ]; then
git log --format="%s" "${MERGE_BASE}..HEAD"
else
git log --format="%s" -10
fi
^\[<ticket-id>\] (e.g., [FOO-1] feat: ...) →
use bracket style: [ABC-1234] type(scope): descriptionABC-1234 type(scope): descriptionPass the detected ticket and style to the git-workflow-specialist.
Use Task tool with subagent_type="git-workflow-specialist": "Execute Git '$operation':
IMPORTANT: NEVER include Co-Authored-By lines in commit messages.
[ABC-1234] feat(config): add featureABC-1234 feat(config): add featureFocus:
Full flow from working tree to open PR/MR in one step.
commit operation first (see above)git rev-parse --abbrev-ref origin/HEAD 2>/dev/null (strip origin/ prefix)git push -u origin HEADGet the full picture of what the PR will contain — not just the last commit:
MERGE_BASE=$(git merge-base origin/<default-branch> HEAD)
git log --oneline $MERGE_BASE..HEAD
git diff $MERGE_BASE...HEAD --stat
Classify each commit on the branch into two categories:
Only feature commits inform the PR title and description.
Scale the description depth to the complexity of the change:
| Change Profile | Description Approach | |---|---| | Small + simple (typo, config, dep bump) | 1-2 sentences, no headers | | Small + non-trivial (targeted bugfix) | Short "Problem / Fix" narrative, 3-5 sentences | | Medium feature or refactor | Summary paragraph + what changed and why, call out design decisions | | Large or architecturally significant | Full narrative: problem context, approach, key decisions, migration notes |
Writing principles:
Auto-detect the Git provider from the remote URL and use the appropriate CLI:
git remote get-url origin
| Remote URL contains | Provider | CLI | Command |
|---|---|---|---|
| github.com | GitHub | gh | gh pr create --title "..." --body "..." |
| gitlab.com or self-hosted GitLab | GitLab | glab | glab mr create --title "..." --description "..." |
| Other | Unknown | — | Print push URL, instruct user to create PR/MR manually |
If the CLI is not installed, print the PR/MR URL pattern and suggest the user create it manually or install the CLI.
If a PR/MR already exists for this branch, report the URL and ask whether to update the description.
When updating an existing PR/MR description:
After completing operations, provide:
## Commit Summary
**Scope**: [Small/Medium/Large] ([X] files changed)
**Commits created:**
- `abc1234` - ABC-1234 feat: description (or `[ABC-1234]` bracket style if detected)
**Files affected:**
- path/to/file (modified/added/deleted)
**Next steps:**
- [ ] Push to remote: `git push`
- [ ] Create PR: `gh pr create` / `glab mr create`
If --push was used: confirm push success with remote branch info.
If --force-push was used: execute git push --force-with-lease and confirm push success with remote branch info.
If pr / ship was used: report the PR/MR URL.
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer