Fission-AI / OpenSpec

Fission-AI / OpenSpec

The most loved spec framework. Our philosophy: → fluid not rigid → iterative not waterfall → easy not complex → built for brownfield not just greenfield → scalable from personal projects to enterprises. 最受欢迎的规范框架。我们的理念是:→ 流动而非僵化 → 迭代而非瀑布式 → 简单而非复杂 → 为现有项目(brownfield)而非仅为新项目(greenfield)构建 → 可从个人项目扩展至企业级应用。

Tip: New workflow now available! We’ve rebuilt OpenSpec with a new artifact-guided workflow. Run /opsx:propose "your idea" to get started. → Learn more here. Follow @0xTab on X for updates · Join the OpenSpec Discord for help and questions. 提示:全新工作流现已上线!我们通过全新的“工件引导(artifact-guided)”工作流重构了 OpenSpec。运行 /opsx:propose "your idea" 即可开始。→ 在此了解更多。关注 X 上的 @0xTab 获取更新 · 加入 OpenSpec Discord 获取帮助和提问。

See it in action

实际演示

You: /opsx:explore AI: What would you like to explore? You: I want dark mode but I’m not sure how to do it cleanly. AI: Let me look at your styling setup… Cleanest path here: CSS variables + a small theme context, with system-preference detection. No new dependencies. Scope it? You: Yes, let’s do it. 你: /opsx:explore AI: 你想探索什么? 你: 我想要深色模式,但不确定如何优雅地实现。 AI: 让我看看你的样式设置……最简洁的路径是:CSS 变量 + 一个小型主题上下文,并结合系统偏好检测。无需引入新依赖。要确定范围吗? 你: 是的,开始吧。

You: /opsx:propose add-dark-mode AI: Created openspec/changes/add-dark-mode/proposal.md — why we’re doing this, what’s changing ✓ specs/ — requirements and scenarios ✓ design.md — technical approach ✓ tasks.md — implementation checklist Ready for implementation! 你: /opsx:propose add-dark-mode AI: 已创建 openspec/changes/add-dark-mode/proposal.md — 为什么要做这个,以及变更内容 ✓ specs/ — 需求与场景 ✓ design.md — 技术方案 ✓ tasks.md — 实现清单 准备开始实现!

You: /opsx:apply AI: Implementing tasks… ✓ 1.1 Add theme context provider ✓ 1.2 Create toggle component ✓ 2.1 Add CSS variables ✓ 2.2 Wire up localStorage All tasks complete! 你: /opsx:apply AI: 正在执行任务…… ✓ 1.1 添加主题上下文提供者 ✓ 1.2 创建切换组件 ✓ 2.1 添加 CSS 变量 ✓ 2.2 关联 localStorage 所有任务完成!

You: /opsx:archive AI: Archived to openspec/changes/archive/2025-01-23-add-dark-mode/ Specs updated. Ready for the next feature. 你: /opsx:archive AI: 已归档至 openspec/changes/archive/2025-01-23-add-dark-mode/ 规范已更新。准备好进行下一个功能开发。

What do the specs actually look like?

规范到底长什么样?

Plain Markdown — requirements with concrete scenarios, no special syntax to learn. Here’s what goes in the specs/ folder created above: 纯 Markdown 格式——包含具体场景的需求,无需学习特殊语法。以下是上述创建的 specs/ 文件夹中的内容:

## ADDED Requirements
### Requirement: Theme selection
The app SHALL let users switch between light and dark themes, defaulting to the system preference.

#### Scenario: User toggles dark mode
- **WHEN** the user clicks the theme toggle
- **THEN** the app switches to dark mode and persists the choice

Your AI writes these; you review the plan before any code is written. OpenSpec is built with OpenSpec — browse this repo’s live specs and in-flight changes for real examples at scale. 这些内容由你的 AI 编写;在编写任何代码之前,你需要先审核计划。OpenSpec 本身就是用 OpenSpec 构建的——浏览本仓库的实时规范和进行中的变更,即可查看大规模应用下的真实示例。

Why teams adopt OpenSpec

为什么团队会采用 OpenSpec

Solo, OpenSpec keeps you and your AI honest on a single repo. On a team, the hard part moves: a feature spans the API server, the web app, and a shared library; requirements are owned by one team and consumed by others; planning starts before any code exists. 对于个人开发者,OpenSpec 能让你和你的 AI 在单个仓库中保持一致。对于团队而言,难点在于:一个功能可能跨越 API 服务器、Web 应用和共享库;需求由一个团队拥有并由其他团队使用;规划在代码存在之前就已经开始。

Stores are the answer — planning in a repo of its own. The same openspec/ shape you already know (specs and changes), shared by git push like anything else. One source of truth your whole team and every coding agent can read, across every repo. “Stores”是解决方案——在独立的仓库中进行规划。它拥有你所熟悉的 openspec/ 结构(规范和变更),像其他内容一样通过 git push 共享。它是整个团队和每个编码代理(coding agent)在所有仓库中都能读取的单一事实来源。

  • Cross-repo features — one change, one plan, even when the code lands in three repos.
  • Shared requirements — a platform team owns the specs; product teams reference them read-only, right where their coding agent can read them. No drifting wiki.
  • Plan before code — capture the plan in the store now; the code repos catch up later.
  • 跨仓库功能 — 一次变更,一个计划,即使代码分布在三个仓库中。
  • 共享需求 — 平台团队拥有规范;产品团队以只读方式引用它们,且位置就在编码代理可以直接读取的地方。不再有脱节的 Wiki。
  • 先规划后代码 — 现在就在 Store 中捕获计划;代码仓库随后跟进。

Stores are in beta. Start with the Stores User Guide. Stores 目前处于测试阶段。请从 Stores 用户指南 开始。

Quick Start

快速开始

Requires Node.js 20.19.0 or higher. Install OpenSpec globally: 需要 Node.js 20.19.0 或更高版本。全局安装 OpenSpec:

npm install -g @fission-ai/openspec@latest

Then navigate to your project directory and initialize: 然后进入你的项目目录并初始化:

cd your-project openspec init

Want your AI to do it? Paste the setup prompt into your coding assistant — it installs the CLI, runs openspec init, and verifies the result. 想让你的 AI 来做吗?将设置提示词粘贴到你的编码助手(coding assistant)中——它会自动安装 CLI、运行 openspec init 并验证结果。

Why OpenSpec?

为什么选择 OpenSpec?

AI coding assistants are powerful but unpredictable when requirements live only in chat history. OpenSpec adds a lightweight spec layer so you agree on what to build before any code is written. AI 编码助手功能强大,但当需求仅存在于聊天记录中时,它们往往不可预测。OpenSpec 增加了一个轻量级的规范层,让你在编写任何代码之前,就能就“构建什么”达成共识。

  • Agree before you build — human and AI align on specs before code gets written
  • Stay organized — each change gets its own folder with proposal, specs, design, and tasks
  • Work fluidly — update any artifact anytime, no rigid phase gates
  • Use your tools — works with 30+ AI assistants via slash commands
  • 构建前达成共识 — 在编写代码前,人类与 AI 在规范上保持一致
  • 保持条理 — 每次变更都有独立的文件夹,包含提案、规范、设计和任务
  • 灵活工作 — 随时更新任何工件,没有僵化的阶段门槛
  • 使用你的工具 — 通过斜杠命令与 30 多种 AI 助手协同工作