ak-git
Run Git staging, commits, pushes and merges with conventional commits, auto-split by type/scope, and secret scanning.
Files11
View on GitHubSKILL.md.claude/skills/ak-git/SKILL.md
GitHubGit Operations
Default (No Arguments)
If invoked without arguments, use ask_user capability to present available git operations:
| Operation | Description |
|---|---|
cm |
Stage files & create commits |
cp |
Stage files, create commits and push |
pr |
Create Pull Request |
merge |
Merge branches |
merge-pr |
Merge a GitHub PR + watch CI to green |
stack |
Drive GitHub native Stacked PRs (gh stack) |
Present as options via ask_user capability with header "Git Operation", question "What would you like to do?".
Execute simple scoped operations directly when supported. Delegate only when isolation or coordination benefits the task and delegation is permitted. Load context-engineering only for an actual context/budget problem.
IMPORTANT:
- Lead with the outcome. Keep reports short by being selective, not by compressing the writing into fragments or arrow chains; write complete sentences.
- Pass these rules to subagents.
Arguments
cm: Stage files & create commitscp: Stage files, create commits and pushpr: Create Pull Request [to-branch] [from-branch]to-branch: Target branch (default: main)from-branch: Source branch (default: current branch)
merge: Merge [to-branch] [from-branch]to-branch: Target branch (default: main)from-branch: Source branch (default: current branch)
merge-pr: Merge PR [pr-ref] viagh, then watch post-merge CI until green and verifypr-ref: PR number or URL (required)- Readiness-gated: refuses on conflicts, red CI, or
CHANGES_REQUESTED; uses--autowhen checks are pending
stack: Drive GitHub native Stacked PRs through thegh stackextension- Lifecycle:
init→add→submit --auto→sync/rebase→merge - Guardrail: history-rewriting and multi-PR merge steps are user-gated; force-push stays scoped to stack branches
- See
references/workflow-stacked-prs.mdfor the full command surface and exit-code stop conditions
- Lifecycle:
Quick Reference
| Task | Reference |
|---|---|
| Commit | references/workflow-commit.md |
| Push | references/workflow-push.md |
| Pull Request | references/workflow-pr.md |
| Merge | references/workflow-merge.md |
| Merge PR | references/workflow-merge-pr.md |
| Stacked PRs | references/workflow-stacked-prs.md |
| Standards | references/commit-standards.md |
| Safety | references/safety-protocols.md |
| Branches | references/branch-management.md |
| GitHub CLI | references/gh-cli-guide.md |
Core Workflow
Step 1: Stage + Analyze
git status --short
git diff -- <authorized-paths>
git add -- <authorized-paths>
git diff --cached --stat
git diff --cached --name-only
Step 2: Security Check
Scan for secrets before commit:
git diff --cached | grep -iE "(api[_-]?key|token|password|secret|credential)"
If secrets found: STOP, warn user, suggest .gitignore.
Step 3: Split Decision
NOTE:
- Search for related issues on GitHub and add to body.
- Choose commit type/scope from repository policy and actual change, including skill/docs edits. Preserve unrelated staged changes; verify staged scope before committing.
Split commits if:
- Different types mixed (feat + fix, code + docs)
- Multiple scopes (auth + payments)
- Config/deps + code mixed
- FILES > 10 unrelated
Single commit if:
- Same type/scope, FILES ≤ 3, LINES ≤ 50
Step 4: Commit
git commit -m "type(scope): description"
Output Format
✓ staged: N files (+X/-Y lines)
✓ security: passed
✓ commit: HASH type(scope): description
✓ pushed: yes/no
Error Handling
| Error | Action |
|---|---|
| Secrets detected | Block commit, show files |
| No changes | Exit cleanly |
| Push rejected | Suggest git pull --rebase |
| Merge conflicts | Suggest manual resolution |
References
references/workflow-commit.md- Commit workflow with split logicreferences/workflow-push.md- Push workflow with error handlingreferences/workflow-pr.md- PR creation with remote diff analysisreferences/workflow-merge.md- Branch merge workflowreferences/workflow-merge-pr.md- PR merge with post-merge CI watch and verificationreferences/workflow-stacked-prs.md- GitHub native Stacked PRs viagh stack(lifecycle + safety)references/commit-standards.md- Conventional commit format rulesreferences/safety-protocols.md- Secret detection, branch protectionreferences/branch-management.md- Naming, lifecycle, strategiesreferences/gh-cli-guide.md- GitHub CLI commands reference