两个 AI 原生开发框架的深度源码对比分析报告
规范驱动(Spec-Driven)的 AI 原生开发框架,核心思想是 Spec → Change → Delta 流水线。用 YAML Schema 定义工件依赖图,Zod 做运行时验证,支持 25+ 种 AI 工具(Claude Code, Cursor, Windsurf 等)。
技术栈: TypeScript + Zod + Commander.js + ESM
元提示词框架,通过 Markdown 工作流文件驱动专业化 Agent,在 Milestone → Phase → discuss→plan→execute 流水线中协调 13 种角色。支持 6 种运行时(Claude Code, OpenCode, Gemini, Codex, Copilot, Antigravity)。
技术栈: Node.js CJS + Markdown 工作流 + JSON 配置
OpenSpec 是规范驱动,用结构化 Schema 和变更提案组织开发;GSD 是工作流驱动,用 Markdown 流程文件协调多 Agent。两者抽象层次和设计哲学截然不同,但都服务于 AI 编程场景。
| 维度 | OpenSpec | Get Shit Done |
|---|---|---|
| 定位 | AI-native spec-driven development system | Meta-prompting, context engineering & spec-driven dev |
| 核心理念 | Spec(规范)→ Change(变更)→ Delta(具体改动) | Milestone → Phase, discuss→plan→execute 循环 |
| 仓库 | github.com/Fission-AI/OpenSpec | github.com/gsd-build/get-shit-done |
| 协议 | MIT | MIT |
| CLI 框架 | Commander.js(TypeScript) | Node.js CJS 脚本 + Markdown 命令文件 |
| Schema 验证 | Zod + YAML Schema | 自定义 frontmatter 解析 + JSON Schema |
| 状态存储 | YAML/JSON(openspec/ 目录) | Markdown frontmatter + JSON(.planning/ 目录) |
| 多运行时 | 25+ AI 工具 | 6 种运行时 |
| 测试框架 | Vitest(TypeScript) | Node.js assert + CJS 测试 |
| 功能 | OpenSpec | GSD |
|---|---|---|
| 需求定义 | Requirements + Scenarios (Zod Schema) | PROJECT.md + ROADMAP.md phase goals |
| 计划生成 | Artifact instruction templates | PLAN.md via gsd-planner agent |
| 执行驱动 | Skill templates → AI 执行 | gsd-executor + execute-plan workflow |
| 变更追踪 | Change proposals + Delta operations | Milestone/Phase 状态 + STATE.md |
| 验证机制 | validate command + Zod schema | gsd-verifier + verify-phase workflow |
| 上下文注入 | config.yaml context + skill templates | gsd-tools.cjs init + execution_context |
| 多工具支持 | AI_TOOLS config (25+ tools) | install.js 适配层(6 runtimes) |
| CLI 工具层 | Commander.js commands | gsd-tools.cjs (60+ 子命令) |
| 维度 | OpenSpec | GSD |
|---|---|---|
| 语言 | TypeScript(严格模式,ESM) | Node.js CJS(JavaScript) |
| CLI 框架 | Commander.js(src/cli/index.ts) | Markdown 命令文件 + Node.js 脚本 |
| Schema 验证 | Zod v3 + 自定义 YAML Schema 解析 | 自定义 frontmatter 解析 + JSON Schema |
| 构建工具 | tsc + bundler(package.json scripts) | 无构建,脚本直接执行 |
| 进度条 | Ora | 自定义 ASCII 帧 |
| 终端着色 | Chalk | ANSI 转义码直接拼接 |
OpenSpec/
src/
├── cli/index.ts # Commander.js CLI 入口
├── core/
│ ├── init.ts # 初始化
│ ├── config.ts # AI_TOOLS 配置(25+ 工具)
│ ├── config-schema.ts # GlobalConfig Zod Schema
│ ├── project-config.ts# ProjectConfig (config.yaml)
│ ├── available-tools.ts
│ ├── artifact-graph/
│ │ ├── schema.ts # YAML Schema 加载/验证/循环检测
│ │ └── types.ts # SchemaYaml, Artifact 类型
│ ├── schemas/ # Zod schemas
│ │ ├── base.schema.ts # Requirement/Scenario
│ │ ├── spec.schema.ts
│ │ └── change.schema.ts
│ └── templates/ # Skill template 生成
│ ├── skill-templates.ts
│ └── workflows/ # explore, new-change, apply...
├── commands/ # CLI 子命令
└── telemetry/
test/ # Vitest 测试
get-shit-done/
bin/
├── install.js # 安装器(~1800 行 CJS)
├── gsd-tools.cjs # CLI 工具(60+ 子命令)
└── lib/ # 工具库模块化
├── commands.cjs, config.cjs, core.cjs
├── frontmatter.cjs, init.cjs
├── milestone.cjs, phase.cjs
├── roadmap.cjs, state.cjs
└── template.cjs, verify.cjs
commands/gsd/ # Claude Code 命令(Markdown)
├── do.md, autonomous.md
├── discuss-phase.md, plan-phase.md
├── execute-phase.md, verify-phase.md
└── 40+ 个命令
agents/ # 专业 Agent(Markdown)
├── gsd-planner.md, gsd-executor.md
├── gsd-phase-researcher.md
├── gsd-verifier.md, gsd-debugger.md
└── 13 个 Agent
get-shit-done/
├── workflows/ # 工作流文件(Markdown)
│ ├── discuss-phase.md, plan-phase.md
│ ├── execute-phase.md, autonomous.md
│ └── 27 个工作流
└── references/ # 参考文档
├── model-profiles.md
└── planning-config.md
hooks/ # Claude hooks
├── gsd-context-monitor.js
├── gsd-statusline.js
└── gsd-check-update.js
tests/ # CJS 测试套件(20+ 文件)
所有命令通过 src/cli/index.ts 统一注册,程序化路由:
program
.command('init [path]')
.command('update [path]')
.command('list')
.command('view')
.command('change')
.command('archive')
.command('validate')
.command('show')
.command('feedback')
.command('completion')
.command('status')
.command('instructions')
.command('templates')
.command('schemas')
.command('new change')
所有命令经过统一的 preAction/postAction 处理遥测和色彩控制。
命令是 Markdown 文件,通过 Claude Code 的 /gsd:command 调用。每个命令通过 frontmatter 定义元数据,实际逻辑在 gsd-tools.cjs(60+ 子命令)中实现。
---
name: gsd:do
description: Route freeform text to the right GSD command
argument-hint: ""
allowed-tools:
- Read
- Bash
- AskUserQuestion
---
GSD 支持 --opencode, --gemini, --codex, --copilot, --antigravity 多运行时适配,通过 install.js 转换工具名称和路径。
SPEC (规范定义)
↓
CHANGE PROPOSAL (含 Requirements + Scenarios)
↓
DELTA (变更操作: add/modify/remove artifact)
↓
VALIDATE (Zod schema 验证)
↓
ARCHIVE (合并到主规范)
核心约束:Requirement 必须包含 "SHALL"/"MUST" 关键词(base.schema.ts)。每个 Requirement 包含多个 Scenario,Scenario 是验证的基本单元。
MILESTONE (里程碑 v1.0)
├── Phase 1: discuss → plan → execute → verify
├── Phase 2: discuss → plan → execute → verify
└── Phase 3: discuss → plan → execute → verify
↓
Milestone Complete → Audit → Archive
每 phase 内部:
discuss-phase → 捕获用户决策 → CONTEXT.md
plan-phase → gsd-planner 生成 PLAN.md
execute-phase → gsd-executor 执行计划
verify-phase → gsd-verifier 验证结果
支持 autonomous.md 模式:自动执行所有剩余 phase,无需人工介入。Phase 支持小数编号(如 2.1, 2.2)用于动态插入。
| 维度 | OpenSpec | Get Shit Done |
|---|---|---|
| Agent 格式 | TypeScript Skill Template(编译后) | Markdown + frontmatter |
| Agent 类型 | Skill-based(命令型),无独立 Agent 文件 | 13 个专业 Agent(planner, executor, researcher...) |
| 提示词加载 | Skill template 动态生成 + 注入 | Markdown 直接作为 system prompt |
| 模型分配 | 通过 AI_TOOLS 配置感知工具能力 | model-profiles.md 定义 quality/balanced/budget/inherit |
| 上下文注入 | config.yaml context + artifact instructions | gsd-tools.cjs init + <files_to_read> 块 |
| 子 Agent 通信 | Skill 命令 + 状态文件 | Task() API + 结构化输出标记 |
核心 Schema 定义在 src/core/schemas/:
// base.schema.ts
RequirementSchema = z.object({
text: z.string()
.refine(t => t.includes('SHALL') || t.includes('MUST'),
VALIDATION_MESSAGES.REQUIREMENT_NO_SHALL),
scenarios: z.array(ScenarioSchema).min(1)
})
// artifact-graph/schema.ts — 依赖验证
export function parseSchema(yamlContent: string): SchemaYaml {
const parsed = parseYaml(yamlContent);
const result = SchemaYamlSchema.safeParse(parsed);
validateNoCycles(schema.artifacts); // 循环依赖检测
validateRequiresReferences(schema.artifacts); // 依赖引用验证
}
OpenSpec 用 Zod 做运行时验证,用 YAML Schema 做工件依赖声明。Artifact 之间的 requires 引用有严格的循环检测。
配置 schema 定义在 get-shit-done/references/planning-config.md:
// config.json schema
{
"mode": "interactive",
"granularity": "standard",
"model_profile": "balanced",
"workflow": {
"research": true,
"plan_check": true,
"verifier": true,
"auto_advance": false
},
"parallelization": {
"enabled": true,
"max_concurrent_agents": 3
},
"gates": {
"confirm_project": true,
"confirm_phases": true,
"confirm_plan": true
}
}
GSD 的配置是 JSON 格式,workflow feature flags 遵循 "absent = enabled" 模式(缺少的 key 默认 true)。没有 Zod 那样的强类型验证。
| 维度 | OpenSpec | Get Shit Done |
|---|---|---|
| 状态目录 | openspec/ | .planning/ |
| 核心状态文件 | config.yaml, specs/*.md, changes/*.md | STATE.md, ROADMAP.md, PROJECT.md + phases/ |
| 状态格式 | YAML + Markdown | Markdown frontmatter + JSON |
| 变更历史 | Change proposals (archived/*.md) | Milestone archives + phase directories |
| 上下文持久化 | ProjectConfig context 字段(max 50KB) | gsd-tools.cjs init 命令加载 |
npm install -g openspec
openspec init [project-path]
通过 npm 全局安装,然后在项目目录运行 openspec init 初始化。在项目中创建 openspec/ 目录和配置文件。AI 工具检测通过扫描 .claude/, .cursor/ 等目录实现。
npx get-shit-done-cc [options]
# --claude, --opencode, --gemini, --codex, --copilot, --antigravity
# --global, --local
# --config-dir <path>
bin/install.js 是一个 ~1800 行的 CJS 脚本,处理 6 种运行时的安装路径映射、frontmatter 转换、config.toml 注入、hook 注册等。包含完整的反安装逻辑、本地补丁保存(gsd-local-patches/)、文件 manifest 生成和泄露路径检测。
| 维度 | OpenSpec | Get Shit Done |
|---|---|---|
| 测试框架 | Vitest(TypeScript) | Node.js assert(CJS) |
| 测试文件数 | 15+ test files | 20+ test files |
| 测试组织 | 按模块分类(parsers, completions, archive...) | 按功能分类(init, state, config, milestone...) |
| 测试覆盖 | core 模块全覆盖,包含 Zod schema 验证测试 | 核心逻辑覆盖(dispatcher, commands, frontmatter...) |
┌─────────────────────────────────────────────┐
│ CLI Layer (Commander.js) │
│ openspec init | change | validate | archive │
└──────────────────┬──────────────────────────┘
│
┌──────────────────▼──────────────────────────┐
│ Core Engine Layer │
│ • init.ts 初始化 + 工具检测 │
│ • config.ts AI_TOOLS 配置 (25+ 工具) │
│ • project-config.ts config.yaml 解析 │
│ • available-tools.ts 扫描 skillsDir │
│ • artifact-graph/ Schema 加载 + 循环检测 │
│ • schemas/ Zod 运行时验证 │
│ • migration.ts 版本迁移 │
└──────────────────┬──────────────────────────┘
│
┌──────────────────▼──────────────────────────┐
│ Template Generation Layer │
│ • skill-templates.ts 导出所有 skill 模板 │
│ • workflows/explore.ts explore skill │
│ • workflows/new-change.ts 新变更 skill │
│ • workflows/apply.ts 应用变更 skill │
└──────────────────┬──────────────────────────┘
│
┌──────────────────▼──────────────────────────┐
│ File System Layer │
│ openspec/ │
│ ├── config.yaml 项目配置 │
│ ├── specs/ 规范定义 │
│ ├── changes/ 变更提案 │
│ └── archives/ 已完成变更 │
└─────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────┐
│ COMMAND LAYER │
│ commands/gsd/*.md — Prompt-based command files │
│ (Claude Code custom commands / Codex skills) │
└─────────────────────┬────────────────────────────────┘
│
┌─────────────────────▼────────────────────────────────┐
│ WORKFLOW LAYER │
│ get-shit-done/workflows/*.md — Orchestration logic │
│ (Reads references, spawns agents, manages state) │
└──────┬──────────────┬─────────────────┬──────────────┘
│ │ │
┌──────▼──────┐ ┌─────▼─────┐ ┌────────▼───────┐
│ AGENT │ │ AGENT │ │ AGENT │
│ (fresh │ │ (fresh │ │ (fresh │
│ context) │ │ context)│ │ context) │
└──────┬──────┘ └─────┬─────┘ └────────┬───────┘
│ │ │
┌──────▼──────────────▼─────────────────▼──────────────┐
│ CLI TOOLS LAYER │
│ get-shit-done/bin/gsd-tools.cjs │
│ (State, config, phase, roadmap, verify, templates) │
└──────────────────────┬───────────────────────────────┘
│
┌──────────────────────▼────────────────────────────The GSD architecture follows a layered approach where:
- Command Layer: 40+ Markdown files in
commands/gsd/ define slash commands
- Workflow Layer: 27 Markdown files in
get-shit-done/workflows/ orchestrate multi-step processes
- Agent Layer: 13 specialized agents (gsd-planner, gsd-executor, gsd-phase-researcher, etc.)
- CLI Tools Layer:
gsd-tools.cjs with 60+ subcommands handles all state operations
- File System Layer:
.planning/ directory stores all state
核心流程对比
阶段 OpenSpec GSD
启动 openspec init → 扫描 AI 工具 → 生成 confignpx get-shit-done-cc → 安装 hooks → 注册命令
需求输入 编写 CHANGE.md 含 Requirements + Scenarios 运行 /gsd:new-milestone → 写入 PROJECT.md
计划生成 Artifact instruction templates 自动生成 /gsd:plan-phase N → gsd-planner agent → PLAN.md
执行 Skill templates 驱动 AI 执行变更 /gsd:execute-phase N → gsd-executor agent
验证 Zod schema 验证 + delta 操作检查 /gsd:verify-phase N → gsd-verifier agent
完成 变更归档到 archives/ Phase 完成 → milestone audit → 归档 phases/
🔍 关键源码证据
OpenSpec 核心源码证据
证据 1: Requirement Schema 强制 SHALL/MUST 约束
文件: OpenSpec/src/core/schemas/base.schema.ts
export const RequirementSchema = z.object({
text: z.string()
.min(1, VALIDATION_MESSAGES.REQUIREMENT_EMPTY)
.refine(
(text) => text.includes('SHALL') || text.includes('MUST'),
VALIDATION_MESSAGES.REQUIREMENT_NO_SHALL
),
scenarios: z.array(ScenarioSchema)
.min(1, VALIDATION_MESSAGES.REQUIREMENT_NO_SCENARIOS),
});
解读: OpenSpec 用 Zod 的 refine() 强制每个 Requirement 必须包含 "SHALL" 或 "MUST",这是 RFC 2119 规范风格的强制要求。
证据 2: Artifact Schema 循环依赖检测
文件: OpenSpec/src/core/artifact-graph/schema.ts
function validateNoCycles(artifacts: Artifact[]): void {
const artifactMap = new Map(artifacts.map(a => [a.id, a]));
const visited = new Set<string>();
const inStack = new Set<string>();
const parent = new Map<string, string>();
function dfs(id: string): string | null {
visited.add(id);
inStack.add(id);
for (const dep of artifactMap.get(id).requires) {
if (!visited.has(dep)) {
parent.set(dep, id);
const cycle = dfs(dep);
if (cycle) return cycle;
} else if (inStack.has(dep)) {
// Found cycle — reconstruct full path
const cyclePath = [dep];
let current = id;
while (current !== dep) {
cyclePath.unshift(current);
current = parent.get(current);
}
cyclePath.unshift(dep);
return cyclePath.join(' → ');
}
}
inStack.delete(id);
return null;
}
}
解读: OpenSpec 的 Artifact Graph 支持声明式依赖,用 DFS 检测循环依赖并报告完整路径。这是一种声明式编程思想。
证据 3: AI_TOOLS 25+ 工具配置
文件: OpenSpec/src/core/config.ts
export const AI_TOOLS: AIToolOption[] = [
{ name: 'Amazon Q Developer', value: 'amazon-q', available: true, successLabel: 'Amazon Q Developer', skillsDir: '.amazonq' },
{ name: 'Antigravity', value: 'antigravity', available: true, successLabel: 'Antigravity', skillsDir: '.agent' },
{ name: 'Claude Code', value: 'claude', available: true, successLabel: 'Claude Code', skillsDir: '.claude' },
{ name: 'Cursor', value: 'cursor', available: true, successLabel: 'Cursor', skillsDir: '.cursor' },
{ name: 'Gemini CLI', value: 'gemini', available: true, successLabel: 'Gemini CLI', skillsDir: '.gemini' },
{ name: 'GitHub Copilot', value: 'github-copilot', available: true, successLabel: 'GitHub Copilot', skillsDir: '.github' },
{ name: 'OpenCode', value: 'opencode', available: true, successLabel: 'OpenCode', skillsDir: '.opencode' },
{ name: 'Windsurf', value: 'windsurf', available: true, successLabel: 'Windsurf', skillsDir: '.windsurf' },
// ... 17 more tools
];
GSD 核心源码证据
证据 4: gsd-planner Agent 模型分配
文件: get-shit-done/get-shit-done/references/model-profiles.md
| Agent | quality | balanced | budget | inherit |
|-------|---------|----------|--------|---------|
| gsd-planner | opus | opus | sonnet | inherit |
| gsd-executor | opus | sonnet | sonnet | inherit |
| gsd-phase-researcher | opus | sonnet | haiku | inherit |
| gsd-verifier | sonnet | sonnet | haiku | inherit |
| gsd-plan-checker | sonnet | sonnet | haiku | inherit |
解读: GSD 有精细的模型分配策略,不同 Agent 根据任务复杂度使用不同档位模型。planning 类用 Opus,执行类用 Sonnet,验证类可用 Haiku。
证据 5: discuss-phase 工作流
文件: get-shit-done/get-shit-done/workflows/discuss-phase.md
<purpose>
Extract implementation decisions that downstream agents need.
Analyze the phase to identify gray areas, let the user choose
what to discuss, then deep-dive each selected area until satisfied.
You are a thinking partner, not an interviewer. The user is the
visionary — you are the builder.
</purpose>
<scope_guardrail>
CRITICAL: No scope creep.
The phase boundary comes from ROADMAP.md and is FIXED.
Discussion clarifies HOW to implement what's scoped, never WHETHER
to add new capabilities.
</scope_guardrail>
解读: discuss-phase 是 GSD 的用户交互入口,强调"用户是愿景者,AI 是建造者"。严格防止范围蔓延(scope creep),所有决策写入 CONTEXT.md 供后续 planner 使用。
证据 6: gsd-tools.cjs 60+ 子命令
文件: get-shit-done/get-shit-done/bin/gsd-tools.cjs
// 核心子命令列表(部分):
# Atomic Commands:
# state load | state json | state update | state get | state patch
# resolve-model | find-phase | commit | verify-summary
# generate-slug | current-timestamp | list-todos
# Phase Operations:
# phase next-decimal | phase add | phase insert | phase remove | phase complete
# Roadmap Operations:
# roadmap get-phase | roadmap analyze | roadmap update-plan-progress
# Verification Suite:
# verify plan-structure | verify phase-completeness | verify references
# verify commits | verify artifacts | verify key-links
# Template Fill:
# template fill summary | template fill plan | template fill verification
解读: gsd-tools.cjs 是 GSD 的瑞士军刀,60+ 子命令覆盖状态管理、phase 操作、roadmap 分析、验证套件和模板填充。比 OpenSpec 的 CLI 命令更细粒度。
证据 7: 上下文窗口监控 Hook
文件: get-shit-done/hooks/gsd-context-monitor.js
// Thresholds:
const WARNING_THRESHOLD = 35; // remaining_percentage <= 35%
const CRITICAL_THRESHOLD = 25; // remaining_percentage <= 25%
// Debounce: 5 tool uses between warnings to avoid spam
// 检查 /tmp/claude-ctx-{session_id}.json 的上下文使用情况
// WARNING → Agent 应该结束当前任务
// CRITICAL → Agent 立即停止并保存状态
const metrics = JSON.parse(fs.readFileSync(metricsPath, 'utf8'));
const remaining = metrics.remaining_percentage;
解读: GSD 有专门的上下文窗口监控 hook,通过 PostToolUse/AfterTool hook 在每次工具调用后检查上下文剩余量,防止上下文耗尽导致质量下降。
证据 8: 安装器多运行时适配
文件: get-shit-done/bin/install.js
// 工具名映射(Claude Code → 各运行时)
const claudeToGeminiTools = {
Read: 'read_file',
Write: 'write_file',
Edit: 'replace',
Bash: 'run_shell_command',
Glob: 'glob',
Grep: 'search_file_content',
WebSearch: 'google_web_search',
WebFetch: 'web_fetch',
};
const claudeToCopilotTools = {
Read: 'read',
Write: 'edit',
Bash: 'execute',
Grep: 'search',
Task: 'agent',
};
解读: install.js 包含完整的跨运行时工具名映射系统,将 Claude Code 的工具名转换为 Gemini、Copilot、Codex 等各自对应的工具名。这使得 GSD 能在 6 种不同运行时上运行相同的 workflow 文件。
🎯 选型建议
快速决策矩阵
场景 推荐 原因
需要严格规范验证 OpenSpec Zod Schema 强制 SHALL/MUST + 循环依赖检测
需要 autonomous 全自动执行 GSD autonomous.md 支持无人介入执行所有 phase
需要在多种 AI 工具间切换 OpenSpec 25+ AI 工具原生支持,skillsDir 检测
复杂前端项目需要 UI 验证 GSD UI auditor/checker/researcher 专业化分工
需要 phase 内并行执行 GSD parallelization 配置 + wave-based 执行
需要声明式工件依赖管理 OpenSpec Artifact Graph + YAML Schema 声明依赖
需要上下文窗口监控 GSD gsd-context-monitor.js hook 主动预警
TypeScript 开发者 OpenSpec 完整 TypeScript + Zod 类型推导
快速启动简单项目 GSD npx 一键安装,Markdown 工作流直观
团队需要量化模型成本 GSD model-profiles.md 精细化模型分配
详细场景建议
🏢 场景 1: 严格规范驱动的产品开发
推荐: OpenSpec
当项目需要严格的需求文档、变更历史追溯、Artifact 依赖管理时,OpenSpec 的 Zod Schema 和 YAML 工件系统能提供最强的规范保障。Requirements 必须包含 SHALL/MUST 关键词的设计强制团队写出可验证的需求。Artifact 之间的循环依赖检测防止架构腐化。
典型场景: 医疗设备软件、金融系统、 aerospace 等需要严格合规的开发流程。
🚀 场景 2: 快速迭代的初创项目
推荐: GSD
当团队需要快速推进、频繁讨论决策、phase 内并行执行时,GSD 的 discuss→plan→execute 循环更贴合实际开发节奏。autonomous 模式可以在深夜或周末自动跑完剩余 phases。模型分配策略(balanced/budget)帮助控制 API 成本。
典型场景: 互联网产品 MVP、内部工具、side projects 等需要快速交付的场景。
🛠️ 场景 3: 多 AI 工具混合使用
推荐: OpenSpec
OpenSpec 的 AI_TOOLS 配置原生支持 25+ 种 AI 编程工具,通过 skillsDir 检测自动识别项目中安装了哪些工具。如果团队需要在一个项目里同时用 Cursor 做编辑、Claude Code 做代码审查、Windsurf 做知识库查询,OpenSpec 的工具抽象层更完善。
🎨 场景 4: 前端 UI 密集型项目
推荐: GSD
GSD 有专门的 UI 审计师(gsd-ui-auditor)、UI 检查器(gsd-ui-checker)和 UI 研究员(gsd-ui-researcher)。UI phase 工作流包含完整的设计契约生成(UAT.md)、跨浏览器/设备验证。context monitor 防止长上下文中 UI 细节遗漏。
📐 场景 5: 需要声明式依赖管理的系统
推荐: OpenSpec
当系统有复杂的 Artifact 依赖关系(如前端组件 → API 接口 → 数据模型 → 数据库 schema),需要确保"先有 schema 才能有 API,先有 API 才能有前端调用"这种偏序约束时,OpenSpec 的 Artifact Graph + 循环检测提供了声明式的依赖管理系统。
🤖 场景 6: 需要 AI Agent 长时间自主工作
推荐: GSD
GSD 的 autonomous 模式专为"启动后不管"场景设计。自动执行所有剩余 phases,遇到用户决策点才暂停。context monitor hook 主动监控上下文窗口,在接近耗尽时预警。这对于需要 AI 长时间自主工作的场景(如深夜构建、周末跑通全流程)至关重要。
优缺点对比总结
OpenSpec 优点 OpenSpec 缺点 GSD 优点 GSD 缺点
规范性 Zod Schema 强验证,SHALL/MUST 强制 学习曲线陡,需理解 Schema 概念 灵活变通,适应不同团队节奏 规范约束较弱,依赖团队自律
自动化 Skill template 驱动,声明式 无 autonomous 模式,需人工介入 autonomous 全自动执行 高度自动化可能导致失控
工具支持 25+ AI 工具原生支持 工具映射较薄,跨运行时转换少 6 运行时完整适配,含 hook 系统 工具名映射复杂,维护成本高
状态管理 Zod 类型安全,YAML 可读性好 状态分散,变更历史追踪复杂 集中式 .planning/ 目录,结构清晰 Markdown frontmatter 解析脆弱
前端支持 通用框架,无专项支持 无 UI 专项 workflow 完整 UI 审计/检查/研究体系 专业但复杂,小项目可能过度设计
多 Agent Skill 命令驱动,间接协调 Agent 体系较薄,专业化不足 13 个专业 Agent,分工明确 Agent 协调复杂,调试困难
安装体验 npm 一键安装,简单 无多运行时适配 多运行时安装器,配置丰富 安装器 ~1800 行,复杂度高
📝 总体结论
核心差异总结
OpenSpec 是一个规范优先的框架,强调"在写代码之前,先用严格的 Schema 定义要做什么"。它的优势在于需求的正式化(SHALL/MUST 强制)、工件依赖的声明式管理、25+ AI 工具的广泛支持。适合需要高规范性、强可追溯性的团队。
GSD 是一个流程优先的框架,强调"在 AI 编程助手中建立结构化的工作流程"。它的优势在于 autonomous 全自动执行、专业化 Agent 分工、精细的模型成本控制、上下文窗口主动监控。适合需要高效率、强自动化的团队。
两者并非互斥——可以在项目中使用 OpenSpec 做规范定义,用 GSD 做执行编排。随着 AI 编程工具的成熟,这种规范层 + 执行层的组合可能是未来的主流方向。