Skip to content

Runtime Setup 指南

spec-runtime-setup 是当前唯一公开的 Runtime Setup 入口(Claude/Qoder 命令拼写 runtime-setup)。不提供任何历史兼容别名。官网主路径统一写 spec-runtime-setup

它负责准备 deterministic runtime facts,不负责证明代码理解结论。后续 plan、work、review、debug 仍要用 bounded direct source reads、rg、ast-grep、git diff、tests/logs 和用户证据确认任务结论。

使用方式

宿主当前入口宿主拼写 / 预览说明
Claude Codespec-runtime-setup命令拼写 runtime-setup/spec:runtime-setup 为 Claude 命令面)
Codexspec-runtime-setupskill 名 spec-runtime-setup$spec-runtime-setup 为 Codex skill 面)
Kirospec-runtime-setupopt-in preview,setup runtime surface 会 pin MCP_SETUP_HOST=kiro
Qoderspec-runtime-setup命令拼写 runtime-setup;opt-in preview,pin MCP_SETUP_HOST=qoder
Cursorspec-runtime-setupgenerated_runtime_preview,只证明 generated runtime,不证明 loader/user journey
OpenCodespec-runtime-setupgenerated_runtime_preview,只证明 generated runtime,不证明版本匹配的 loader/user journey;pin MCP_SETUP_HOST=opencode

先运行 package CLI 的 spec-first doctorspec-first init,重启宿主后再进入本 workflow。

执行逻辑图

text
用户运行 spec-runtime-setup
  |
  v
读取共置 setup-registry.json(source of truth)
  |
  v
检查 required baseline MCP servers、helper tools、host config、repo target
  |
  +-- 裸入口
  |     |
  |     v
  |   展示完整 baseline(含 CodeGraph / Graphify)计划并要求一次确认
  |
  +-- --check / --plan / --verify-only
  |     |
  |     v
  |   只读检查或刷新 setup facts,不安装 provider
  |
  +-- --only codegraph,graphify
        |
        v
      高级子集修复(仅修复所选 provider)
        |
        v
      写 .spec-first/config/* setup-owned facts

Required Baseline MCP Servers

当前 skills/spec-runtime-setup/setup-registry.json 声明的 required baseline MCP servers 是:

MCP server包 / 启动方式作用
Sequential Thinkingnpx -y @modelcontextprotocol/server-sequential-thinking@latest动态反思式问题拆解
Context7npx -y @upstash/context7-mcp@latest查询当前框架与库文档

这些 server 需要写入当前宿主的 host MCP config。setup 会按宿主路径、权限和 preview 成熟度输出 ready、blocked 或 degraded。

Required Helpers

完整 setup 还会检查 helper readiness:

Helper当前边界
ffmpegbaseline-blocking;缺失时完整 setup 不能报告 ready
ast-grep结构化搜索能力检查;下游可按结果选择 direct rg 降级
agent-browser保持 report-only / non-blocking;依赖可安装不等于 exact-origin 执行能力已验证

Full Setup 的 Provider Readiness

当前完整 spec-runtime-setup 的 required baseline 包括 Sequential Thinking、Context7、ffmpeg、CodeGraph 与 Graphify。裸入口会先展示完整计划并请求一次确认;--only codegraph--only graphify--only codegraph,graphify 只是高级子集修复,不代表完整 setup 已完成。

Provider安装来源主要写入边界
CodeGraph@colbymchenry/codegraph@1.5.0.codegraph/codegraph.db、host MCP config提供 impact / call graph candidates
GraphifyPyPI graphifyy@0.9.29(Python ≥3.10,uv/pipx)当前产物 graphify-out/;legacy .graphify/ 仅作迁移/旧证据提供 architecture map / path / explain candidates

spec-runtime-setup 会展示 provider、project/provider runtime writes、host config writes、first-generation commands、refresh hooks 和明确 non-actions,并要求用户对整批操作做一次确认。--only codegraph--only graphify--only codegraph,graphify 是 headless/subset apply 路径,不需要第二次确认;子集成功仍需用 --verify-only 检查完整 setup readiness。

产物边界

目录 / 文件作用
.spec-first/config/tool-facts.jsonsetup-owned tool/helper/provider readiness facts
.spec-first/config/runtime-capabilities.jsondirect evidence posture、host readiness pointer、fallback 能力
.spec-first/workspace/scenario-fingerprint-setup.jsonparent workspace 或复杂场景下的 advisory setup fingerprint
.codegraph/codegraph.dbCodeGraph provider-native local database
graphify-out/Graphify provider-native 当前项目图谱产物
.graphify/旧版 Graphify 适配目录(legacy;setup 会在它单独存在时迁移到 graphify-out/

这些 facts 和 provider outputs 都不是 source truth。它们帮助 workflow 决定证据是否充足;具体实现、影响面和风险仍要回到当前源码、diff、测试和日志。

常见失败

症状常见原因下一步
host config 写入失败Claude managed config 或 Codex user config 没有写权限按 setup 输出修复权限或切换 target
provider pack 未安装用户未确认,或只跑了 --check / --plan需要 provider 时显式运行 --only codegraph,graphify
Graphify first generation 失败workspace override 非法、CLI 缺失、hook 安装失败先看 setup 输出的 reason code,再回退到 direct evidence
helper 缺失本机未安装 agent-browser、ast-grep 等相关 workflow 标注 degraded;必要时按 setup next action 修复

下一步