Files
openspec-shcema/README.md

81 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# OpenSpec Schema
当前项目用于开发 OpenSpec 工具的自定义 schema 流程。
## 项目结构
```
openspec-schema/
├── OpenSpec/ # OpenSpec 工具源码Git 子模块)
├── fast-drive/ # 自定义 workflow schema
│ ├── schema.yaml # workflow 定义文件
│ └── templates/ # artifact 模板
│ ├── design.md # 设计文档模板
│ └── tasks.md # 任务清单模板
├── .gitignore
└── .gitattributes
```
## 关于 OpenSpec
OpenSpec 是一款用于在 AI 编程工具中实践 SDDSpecification-Driven Development开发流程的工具。工具源码位于 `OpenSpec` 目录下(以 Git 子模块形式引用)。
## fast-drive Schema
`fast-drive` 是一个简化版的 OpenSpec workflow采用 **design → tasks → apply** 的精简流程:
### 特点
- **跳过 proposal 和 specs 阶段**:直接从 design.md 开始
- **中文支持**design.md 和 tasks.md 使用中文章节标题和正文
- **自包含设计**design.md 包含所有必要信息,即使跨会话也能继续执行
- **结构化任务管理**tasks.md 使用 checkbox 格式跟踪执行进度
### 工作流程
1. **design** - 创建 design.md记录变更的背景、需求、决策和执行计划
2. **tasks** - 从 design.md 派生可执行的任务清单
3. **apply** - 按依赖顺序执行任务并标记完成
### 使用方法
在 OpenSpec 项目中使用 fast-drive workflow
```bash
# 初始化 OpenSpec 项目(如果尚未初始化)
openspec init
# 使用 fast-drive workflow 创建新变更
/opsx:propose "your-change-description" --schema fast-drive
```
## 开发说明
### 添加新的自定义 Schema
1. 在项目根目录创建新的 schema 目录(如 `my-schema/`
2. 创建 `schema.yaml` 定义 workflow 结构
3.`templates/` 目录下添加 artifact 模板
4. 参考 `fast-drive/` 的结构和 OpenSpec 的 schema 规范
### 更新 OpenSpec 子模块
```bash
# 更新到最新版本
git submodule update --remote OpenSpec
# 或者进入子模块目录切换到特定版本
cd OpenSpec
git checkout <version-tag>
cd ..
```
## 相关链接
- [OpenSpec 官方文档](https://github.com/Fission-AI/OpenSpec)
- [OpenSpec Schema 规范](https://github.com/Fission-AI/OpenSpec/tree/main/docs/customization.md)
## License
MIT