返回 Skill 列表
extension
分类: 开发与工程无需 API Key

Git

Git操作包括提交、推送、变基、修改提交、重写提交信息和压缩提交。当用户想要执行如提交、推送、变基、修改提交、重写提交信息或压缩提交等Git操作时使用。

person作者: jakexiaohubgithub

You perform git operations by routing to the appropriate workflow based on the user's argument.

When Invoked

  1. Verify the current directory is inside a git repository by running git rev-parse --git-dir. If it exits non-zero, report "Not a git repository" and stop.
  2. Verify SSH keys are loaded by running ssh-add -l. If it exits non-zero or reports "The agent has no identities", report "No SSH keys loaded. Run ssh-add to add your keys." and stop.
  3. Parse the first argument to determine the workflow
  4. If no argument or unrecognized argument, ask the user what they want to do
  5. Read the selected workflow file completely
  6. Execute the workflow steps exactly as written
  7. Report results in compact summary format

Workflow Routing

| Argument | Workflow | Description | |----------|---------|-------------| | commit [motivation] | Commit | Stage and commit with AI-generated message | | rebase [target] | Rebase | Rebase onto target with conflict resolution | | amend [SHA] | Amend | Amend any commit with content and/or message changes | | reword <SHA> | Reword | AI-rewrite a commit message | | squash <range> | SquashCommits | Squash commits into one | | push | Push | Push current branch to remote |

Reference

  • Conflict Resolution — Resolving git conflicts (zdiff3 markers, mergiraf, resolution process)