SuperAPI AI 工具集

speckit-git-remote

编程与开发

查看项目

更新于 10-16 03:44

技能介绍

用途:检测当前工作目录的 Git 远程仓库 URL,供与 GitHub 服务(例如创建 issue)集成使用。

主要能力:先通过 git rev-parse --is-inside-work-tree 2>/dev/null 判断 Git 是否可用;若不可用则输出警告“[specify] Warning: Git repository not detected; cannot determine remote URL”并返回空。随后执行 git config --get remote.origin.url 获取远程 URL,并解析出仓库所有者(如 https://github.com/github/spec-kit.git 中的 github)、仓库名(如 spec-kit)以及是否指向 GitHub。支持的 URL 格式包括 HTTPS:https://github.com/<owner>/<repo>.git 和 SSH:git@github.com:<owner>/<repo>.git。

使用方式:在需要 GitHub 集成的流程中调用该技能,它会自动完成检测与解析。

限制与降级:仅当远程 URL 确实指向 github.com 时才报告为 GitHub 仓库,不得仅凭格式假设。若 Git 未安装、目录不是 Git 仓库或未配置远程,则返回空结果且不报错,以便其他工作流继续运行。