Quick Ref / Command

Engineer Kit

/ak:git

Isolated Git operations

Git operations through isolated git-manager workflows for commits, pushes, PRs, merges, merge-PR CI watches, and GitHub native stacked PRs.

01

Select Operation

02

Delegate Git Manager

03

Stage + Analyze

04

Security Check

Rule 01

Git operations run through git-manager for isolation and concise reporting.

Rule 02

Security scan happens before commit, and secrets stop the workflow.

Rule 03

Commit split follows type, scope, dependency/config boundaries, and unrelated-file count.

Rule 04

Stacked PR history rewrites and multi-PR merges are user-gated.

Rule 05

Report only what command output proves.

Execution Map

Core lanes from input to output, aligned with the command's real execution path.

01

Start

Input, scope, route

  1. 1 Select Operation If no arguments are supplied, ask the user to choose cm, cp, pr, merge, merge-pr, or stack.
  2. 2 Delegate Git Manager Execute git workflows via the git-manager subagent to isolate verbose output and pass concision/context-engineering rules.
  3. 3 Stage + Analyze Stage changes, inspect cached stat and file list, then understand scope before creating commits or PRs.
02

Work

Agent / skill execution

  1. 4 Security Check Scan staged diff for api keys, tokens, passwords, secrets, and credentials; if found, stop and warn the user.
  2. 5 Decide Split Split when types, scopes, config/deps, or many unrelated files are mixed; keep single when same type/scope and small.
  3. 6 Commit Conventionally Use type(scope): description and only feat, fix, or perf prefixes for .claude directory changes.
03

Verify

Gate, review, validation

  1. 7 Push or PR For cp and pr, push or create the PR using the target/source branch semantics and linked issue evidence.
  2. 8 Merge or Stack For merge-pr, refuse conflicts/red CI/CHANGES_REQUESTED and watch post-merge CI; for stack, use gh stack lifecycle with gated history rewrites.
  3. 9 Report Status Return staged counts, security result, commit hash/message, and push status in the documented compact output format.

Syntax, arguments, subcommands

How to invoke the skill: syntax, positional arguments, shared options, then each subcommand with its own syntax and outcome.

Syntax

/ak:git [cm|cp|pr|merge|merge-pr|stack] [args]

Arguments

[operation]

Git operation

Choose cm, cp, pr, merge, merge-pr, or stack. Omit it to open the operation chooser before any Git action.

/ak:git cm

Subcommands

cm Commit
/ak:git cm

Stage the repository, inspect the staged diff, scan for possible secrets, split mixed work when needed, and create conventional commits.

Outcome: One or more commit hashes and messages; no push by default.

/ak:git cm
cp Commit and push
/ak:git cp

Run the commit workflow, then push the current branch after the safety checks pass.

Outcome: Commit hashes, pushed branch, pushed commit, or a reported push rejection.

/ak:git cp
pr Create pull request
/ak:git pr [to-branch] [from-branch]

Compare remote branches, push the source branch when needed, and create a GitHub pull request. Target defaults to main; source defaults to the current branch.

[to-branch]
Branch the PR should merge into. Defaults to main.
[from-branch]
Branch used as the PR source. Defaults to the current branch.

Outcome: Pull request URL with a remote comparison, title, summary, and test plan.

/ak:git pr main feature/auth-cleanup
merge Merge branch
/ak:git merge [to-branch] [from-branch]

Update the target branch, merge the pushed remote source branch with a merge commit, and push the target branch.

[to-branch]
Branch that receives the merge. Defaults to main.
[from-branch]
Remote branch to merge from. Defaults to the current branch.

Outcome: Source branch, target branch, merge commit, pushed target status, or reported conflicts.

/ak:git merge main feature/auth-cleanup
merge-pr Merge pull request
/ak:git merge-pr <pr-ref>

Check that the GitHub PR is open, mergeable, not blocked by requested changes, and free of red CI before merging or enabling auto-merge.

<pr-ref>
GitHub pull request number or URL. Required.

Outcome: PR URL, merge method, merge SHA, watched target-branch CI result, and any follow-up fix status.

/ak:git merge-pr 42
stack Stacked pull requests
/ak:git stack

Drive GitHub native stacked pull requests through the gh stack extension; history-rewriting and multi-PR merge steps require explicit user approval.

Outcome: gh stack lifecycle state from init/add through submit, sync or rebase, and merge, with guarded rewrite or multi-PR steps reported.

/ak:git stack

Modes / Routes

cm

Commit

Research:
workflow-commit
Review:
Secret scan + split decision
Validate:
Commit hash
cp

Commit + push

Research:
workflow-push
Review:
Push rejection handling
Validate:
Remote push output
pr

Pull request

Research:
workflow-pr
Review:
Remote diff + issue links
Validate:
PR URL
merge

Branch merge

Research:
workflow-merge
Review:
Conflict handling
Validate:
Merge result
merge-pr

Merge PR + CI

Research:
workflow-merge-pr
Review:
Conflicts/red CI/review state
Validate:
Post-merge CI green
stack

Stacked PRs

Research:
workflow-stacked-prs
Review:
User-gated rewrites
Validate:
gh stack lifecycle state

Sample Prompt

Concrete invocations for each flag, subcommand, mode, or route available in the live workflow.

Choose a Git operation
/ak:git
Use when:
You want AgentKit to present the available git workflows before acting.
Expected:
Presents the Git Operation chooser for cm, cp, pr, merge, merge-pr, or stack, then delegates the selected workflow through git-manager with context-engineering rules.
Stage and commit Recommended
/ak:git cm
Use when:
Local changes need a conventional commit after safety checks and split analysis.
Expected:
Stages all changes, reports cached stat/name-only scope, scans the staged diff for secrets, splits mixed work when needed, and returns the commit hash/message.
Commit and push
/ak:git cp
Use when:
Changes should be committed and pushed after the standard git safety workflow.
Expected:
Runs the commit workflow first, including secret blocking and split decisions, then pushes and reports whether the remote accepted or rejected the update.
Open PR to main
/ak:git pr main feature/auth-cleanup
Use when:
A source branch needs a pull request into a target branch.
Expected:
Creates a PR using the documented to-branch/from-branch order, analyzes the remote diff, searches related GitHub issues for the body, and returns the PR URL.
Merge ready PR
/ak:git merge-pr 42
Use when:
A GitHub PR should merge only after readiness checks pass.
Expected:
Refuses conflicts, red CI, or CHANGES_REQUESTED, uses gh merge or --auto for pending checks, then watches post-merge CI until green and verifies.
Run stacked PR lifecycle
/ak:git stack
Use when:
Work should use GitHub native stacked PRs through the gh stack extension.
Expected:
Drives the gh stack lifecycle from init/add through submit --auto, sync or rebase, and merge, while gating history-rewriting and multi-PR merge steps with the user.
Merge branches
/ak:git merge main feature/auth-cleanup
Use when:
A local feature branch should merge into a target branch through the git-manager workflow.
Expected:
Runs the merge workflow with conflict and secret checks, then reports whether the merge completed or stopped on an unresolved conflict.

Handled Scope

  • Staging, conventional commits, and split-commit decisions
  • Commit plus push workflows
  • Pull request creation with remote diff and issue linking
  • Branch merge and PR merge with CI readiness/watch
  • GitHub native stacked PRs through gh stack

Artifacts Produced

Compact Git Status

Pattern

✓ staged / ✓ security / ✓ commit / ✓ pushed

Documents staged file count and line delta, secret-scan result, commit hash and message, and push status.

Related skills

Next