← 返回
内容创作 中文

OpenSpec

Spec-driven development with OpenSpec CLI. Use when building features, migrations, refactors, or any structured development work. Manages proposal → specs → design → tasks → implementation workflows. Supports custom schemas (TDD, rapid, etc.). Trigger on requests involving feature planning, spec writing, change management, or when /opsx commands are mentioned.
基于 OpenSpec CLI 的规范驱动开发工具。适用于构建功能、迁移、重构或任何结构化开发工作。管理从提案、规格、设计、任务到实现的完整工作流。支持自定义模式(如 TDD、快速开发等)。在涉及功能规划、规格编写、变更管理或提及 /opsx 命令时触发。
jcorrego
内容创作 clawhub v1.0.0 1 版本 99930 Key: 无需
★ 3
Stars
📥 4,223
下载
💾 16
安装
1
版本
#latest

概述

OpenSpec — Spec-Driven Development

OpenSpec structures AI-assisted development into trackable changes with artifacts (proposal, specs, design, tasks) that guide implementation.

Setup

# Install globally
npm install -g @fission-ai/openspec@latest

# Initialize in a project
cd /path/to/project
openspec init --tools claude

# Update after CLI upgrade
openspec update

Core Workflow

Each change follows: new → plan → apply → verify → archive

1. Start a Change

# Create change folder with default schema
openspec new change <name>

# With specific schema
openspec new change <name> --schema tdd-driven

2. Plan (Create Artifacts)

Use the CLI instructions command to get enriched prompts for each artifact:

# Get instructions for next artifact
openspec instructions --change <name> --json

# Check progress
openspec status --change <name> --json

Artifact sequence (spec-driven schema):

  1. proposal.md — Why and what (intent, scope, approach)
  2. specs/ — Requirements + scenarios (Given/When/Then)
  3. design.md — Technical approach and architecture decisions
  4. tasks.md — Implementation checklist with checkboxes

3. Implement

Read tasks.md and work through items, marking [x] as complete.

4. Verify

openspec validate --change <name> --json

Checks completeness, correctness, and coherence.

5. Archive

openspec archive <name> --yes

Merges delta specs into main openspec/specs/ and moves change to archive.

Agent Workflow (How to Use as an AI Agent)

When the user asks to build/migrate/refactor something with OpenSpec:

  1. Check project state:

```bash

openspec list --json # Active changes

openspec list --specs --json # Current specs

openspec schemas --json # Available schemas

```

  1. Create the change:

```bash

openspec new change [--schema ]

```

  1. For each artifact, get instructions and create the file:

```bash

openspec instructions --change --json

openspec status --change --json

```

Then write the artifact file to openspec/changes//.

  1. Implement tasks from tasks.md.
  1. Validate and archive:

```bash

openspec validate --json

openspec archive --yes

```

CLI Quick Reference

CommandPurpose
------------------
openspec list [--specs] [--json]List changes or specs
openspec show [--json]Show change/spec details
openspec status --change [--json]Artifact completion status
openspec instructions [artifact] --change [--json]Get enriched creation instructions
openspec validate [name] [--all] [--json]Validate changes/specs
openspec archive [--yes]Archive completed change
openspec schemas [--json]List available schemas
openspec templates [--json]Show template paths
openspec configView/modify settings

Always use --json for programmatic/agent use.

Custom Schemas

Schemas define artifact sequences. Create custom ones for different workflows:

# Fork built-in schema
openspec schema fork spec-driven my-workflow

# Create from scratch
openspec schema init my-workflow

# Validate
openspec schema validate my-workflow

Schema files live in openspec/schemas//schema.yaml with templates in templates/.

For schema structure details, see references/schemas.md.

Project Structure

project/
├── openspec/
│   ├── config.yaml          # Project config (default schema, context, rules)
│   ├── specs/               # Source of truth — current system behavior
│   ├── changes/             # Active changes (one folder each)
│   │   └── <change-name>/
│   │       ├── .openspec.yaml
│   │       ├── proposal.md
│   │       ├── specs/       # Delta specs (what's changing)
│   │       ├── design.md
│   │       └── tasks.md
│   └── schemas/             # Custom schemas
└── .claude/skills/          # Auto-generated Claude integration

Spec Format

Specs use RFC 2119 keywords (SHALL/MUST/SHOULD/MAY) with Given/When/Then scenarios:

### Requirement: User Authentication
The system SHALL issue a JWT token upon successful login.

#### Scenario: Valid credentials
- GIVEN a user with valid credentials
- WHEN the user submits login form
- THEN a JWT token is returned

Delta Specs

Changes don't rewrite specs — they describe deltas (ADDED/MODIFIED/REMOVED) that merge into main specs on archive.

Config

openspec/config.yaml sets defaults:

schema: spec-driven      # or tdd-driven, rapid, custom
context: |
  Tech stack: TypeScript, React, Node.js
  Testing: Jest
rules:
  proposal:
    - Include rollback plan
  specs:
    - Use Given/When/Then format

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-28 11:02 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 861 📥 200,186
content-creation

Baidu Wenku AIPPT

ide-rea
使用百度文库 AI 智能生成 PPT,自动根据内容选择模板。
★ 66 📥 46,246
content-creation

AdMapix

fly0pants
广告情报与应用数据分析助手,支持搜索广告素材、分析应用排名、下载量、收入及市场洞察,用于广告素材和竞品分析。
★ 295 📥 136,546