用途:为 GitHub Copilot 初始化 Spec Kit(规范驱动开发)项目。该技能暴露 specify init 命令,由代理在 shell 中代为运行,实际脚手架由 CLI 完成。因为是 Copilot 插件,必须始终以 skills 模式搭建 Copilot。
主要能力:specify init 会生成模板、脚本、spec-kit 工作流、共享基础设施以及 Copilot 命令文件,并离线使用已安装 CLI 内置的资源。使用 --integration copilot --integration-options="--skills" 会把 spec-kit 命令(及后续添加的扩展)安装为 Copilot Agent Skills(.github/skills/speckit-<cmd>/SKILL.md),而非默认的 .github/agents/*.agent.md 布局。
前置条件:需要 specify CLI,先确认可用:specify --version。若命令未找到,先用 speckit-cli-setup 技能安装后再继续。
使用方式(始终 Copilot + skills 模式,按操作系统选择 --script,macOS/Linux 用 sh,Windows 用 ps): 新建项目目录:specify init <project-name> --integration copilot --integration-options="--skills" --script sh 在当前目录初始化:specify init . --integration copilot --integration-options="--skills" --script sh 或 specify init --here --integration copilot --integration-options="--skills" --script sh 当前目录非空时跳过确认:specify init --here --integration copilot --integration-options="--skills" --script sh --force 初始化时安装预设:specify init <project-name> --integration copilot --integration-options="--skills" --script sh --preset healthcare-compliance Windows 示例:specify init <project-name> --integration copilot --integration-options="--skills" --script ps
关键选项:--integration copilot(Copilot 插件中始终使用);--integration-options="--skills"(必需,生成 SKILL.md 而非 .agent.md);--script <sh|ps|py>(务必传入,否则在 TTY 下会弹出交互式脚本类型选择器而阻塞);--ignore-agent-tools(跳过代理 CLI 工具检查,Copilot 插件推荐);--here / .(在当前目录初始化);--force(非空目录跳过确认);--preset <id>(初始化时安装预设)。
限制与注意:优先使用非交互标志以免命令阻塞;务必传 --script,这是 specify init 看似卡住的最常见原因;务必同时传 --integration copilot 和 --integration-options="--skills"。初始化后,引导用户查看 .github/skills/ 下生成的技能和 .specify/ 目录;新生成的技能可在当前 Copilot 会话用 /skills reload 加载,下次会话启动时自动加载。建议用 specify check 验证环境。