用途:该技能用于提交代码、管理分支、推送到远程、创建拉取请求等版本控制操作,核心是“智能提交流程”(smart commit)。
主要能力:提供 git.status、git.stage_all、git.commit、git.smart_commit、git.push、git.log 等命令,命令通过保留的工具运行时以 git.command_name 形式暴露,可运行函数位于 scripts/.py。stage_and_scan 在暂存全部文件后执行安全扫描,检测 .env、.pem、.key、.secret、.credentials*、id_rsa*、id_ed25519*、*.priv、secrets.yml、credentials.yml 等敏感文件并自动取消暂存,随后运行 Lefthook 预提交钩子,并对格式化工具修改过的文件重新暂存,返回暂存文件、diff、安全问题与 lefthook 输出。
使用方式:智能提交流程为 stage_and_scan → route_prepare → format_review → re_stage → interrupt → commit。先调用 git.smart_commit(action="start") 获取 workflow_id 与 diff 预览,经 LLM 分析与用户批准后,调用 git.smart_commit(action="approve", workflow_id="xxx", message="feat: description") 完成提交。读操作(git status、git diff、git log --oneline 等)使用原生 bash,写操作使用工具运行时调用。
适用场景:需要人工确认的安全提交、防止敏感信息误提交、统一预提交检查的仓库。
限制:资料未提供分支管理、拉取请求创建的具体命令细节,也未说明平台、收费或效果信息。