npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

oh-my-spec

v1.0.0

Published

AI-powered product delivery workflow management system

Readme

Oh My Spec

AI驱动的产品交付流程管理系统

Oh My Spec 是一个面向研发团队的AI自动化产品交付流程管理工具。它通过结构化的生命周期管理,结合AI编码工具(如Cursor),帮助团队高效完成从需求分析到代码实现的完整流程。

✨ 核心特性

  • 🎯 结构化生命周期:需求分析 → 用例设计 → 架构设计 → 详细设计 → 任务拆分 → 开发 → 完成
  • 🤖 AI驱动:通过Cursor Skills实现自然语言交互
  • 📝 文档自动化:基于模板自动生成规范化的设计文档
  • 🔄 状态管理:清晰的状态机,追踪每个Feature的进度
  • 🧠 背景知识管理:为AI提供业务和代码上下文
  • 🔗 Spec与Code分离:需求管理与代码实现解耦
  • 📊 可视化设计:使用Mermaid图表展示架构和流程
  • 🚀 开发模式:在代码项目中无缝对接任务清单

📦 安装

方式一:全局安装(推荐)

npm install -g oh-my-spec

安装后可以在任何目录使用 oms 命令。

方式二:使用 npx(无需安装)

npx oh-my-spec init spec

适合快速体验,无需全局安装。

方式三:项目本地安装

npm install oh-my-spec --save-dev

在 package.json 中配置脚本使用:

{
  "scripts": {
    "spec:init": "oms init spec",
    "spec:create": "oms feature create"
  }
}

版本要求

  • Node.js >= 18.0.0
  • npm >= 8.0.0

🔄 更新

一键更新

oms update

这个命令会:

  1. 检查并自动更新 oh-my-spec 到最新版本
  2. 自动更新所有已注册项目的 skills 和配置
  3. 自动同步到关联的 AI 工具(如 Cursor)

完全自动化,无需手动干预。

管理项目

# 查看所有已注册项目
oms projects list

# 清理无效项目(目录已删除)
oms projects clean

详细更新指南:参见 UPDATING.md

🚀 快速开始

1. 创建Spec项目(需求管理)

# 创建并初始化spec项目
mkdir my-product-spec
cd my-product-spec
oms init spec

# 输出:
# ✅ Spec Project initialized!
# 📁 Created directories:
#    - features/ (store all features)
#    - .oms/oms-skills/ (Oh My Spec Skills)
#    - .oms/ (configuration)
# ? Which AI coding tool are you using?
#   > Cursor
#     Not set up yet / Other
# 
# (如果选择 Cursor,会自动复制到 .cursor/skills)
# ✅ Skills linked to Cursor!
# 💡 You can now use /oms-feature-create in Cursor chat

2. 在Cursor中创建Feature

打开Cursor,在spec项目中:

You: @oms-feature-create.md

AI: 请输入Feature ID(例如:LOGIN-001)
You: LOGIN-001

AI: 请输入Feature名称
You: 用户登录功能

AI: 请简述功能
You: 实现用户登录、注册、找回密码功能

AI: ✅ Feature LOGIN-001 已创建
    💡 下一步:使用 @oms-context-add.md 添加背景知识

3. 添加背景知识(可选但推荐)

You: @oms-context-add.md

AI: 为哪个Feature添加背景?
You: LOGIN-001

AI: 选择添加方式:
    1) 文字输入
    2) 文件
    3) 目录扫描
    4) 链接

You: 1

AI: 请输入业务背景
You: 我们是一个SaaS平台,需要支持邮箱和手机号登录...

AI: ✅ 已添加到 features/LOGIN-001/context/business.md

4. 进行需求分析

You: @oms-feature-requirement.md

AI: [与用户多轮对话,收集需求信息]
    
AI: ✅ 需求文档已生成:
    - features/LOGIN-001/01-requirement/overview.md
    - features/LOGIN-001/01-requirement/functional.md
    - features/LOGIN-001/01-requirement/non-functional.md
    
    请review后使用 @oms-feature-commit.md 确认提交

5. 确认提交

You: @oms-feature-commit.md

AI: 将提交以下变更:
    Feature: LOGIN-001
    阶段: requirement
    确认提交?

You: 确认

AI: ✅ 已提交
    📝 下一步:@oms-feature-usecase.md

6. 继续后续阶段

按顺序完成各个阶段:

@oms-feature-usecase.md          # 用例设计
@oms-feature-architecture.md     # 架构设计
@oms-feature-detailed-design.md  # 详细设计
@oms-feature-tasks.md            # 任务拆分

7. 在Code项目中开发

# 创建前端code项目
mkdir my-product-frontend
cd my-product-frontend
oms init code

# 关联到spec项目
oms link ../my-product-spec

# 开始开发
oms dev start
# 选择LOGIN-001

# [在Cursor中进行开发...]

# 完成开发
oms dev complete

🏗️ 架构设计

设计思路

Oh My Spec 采用能力与引导分离的架构:

┌─────────────────────────────────────────────┐
│                   AI (Cursor)               │
│         读取Skills,理解如何使用工具          │
└─────────────────┬───────────────────────────┘
                  │ 引导
                  ↓
┌─────────────────────────────────────────────┐
│            Skills (引导层)                   │
│    templates/skills/*.md                    │
│    - 描述工作流程                            │
│    - 指导AI调用CLI/API                       │
│    - 提供最佳实践                            │
└─────────────────┬───────────────────────────┘
                  │ 调用
                  ↓
┌─────────────────────────────────────────────┐
│          CLI Commands (命令层)               │
│    src/cli/*.ts                             │
│    - oms init                               │
│    - oms feature                            │
│    - oms link                               │
│    - oms dev                                │
└─────────────────┬───────────────────────────┘
                  │ 使用
                  ↓
┌─────────────────────────────────────────────┐
│          Core Managers (能力层)              │
│    src/core/*.ts                            │
│    - feature-manager                        │
│    - spec-manager                           │
│    - code-manager                           │
│    - context-manager                        │
│    - template-engine                        │
│    - skill-manager                          │
└─────────────────────────────────────────────┘

核心原则

  • 代码层稳定:CLI和Core API提供稳定、可靠的核心能力
  • Skill层灵活:Skills可以更新、优化,引导AI更好地使用代码能力
  • 解耦设计:Skill不实现业务逻辑,只负责引导AI调用CLI/API

代码层能力清单

CLI命令(命令行接口)

| 命令分类 | 命令 | 说明 | 使用场景 | |---------|------|------|---------| | 初始化 | oms init spec | 初始化Spec项目 | 创建需求管理项目 | | | oms init code | 初始化Code项目 | 创建代码实现项目 | | Feature管理 | oms feature create [id] | 创建Feature | 开始新需求 | | | oms feature list | 列出所有Features | 查看项目进度 | | | oms feature status [id] | 查看Feature状态 | 检查详细进度 | | | oms feature delete <id> | 删除Feature | 清理不需要的需求 | | 项目关联 | oms link <spec-path> | 关联Spec项目 | Code项目连接到Spec | | Skill管理 | oms skill link-cursor | 链接Skills到Cursor | 让Cursor识别并支持/快捷调用 | | 开发模式 | oms dev start | 开始开发 | 选择Feature开始coding | | | oms dev status | 查看开发状态 | 检查任务完成情况 | | | oms dev complete | 完成开发 | 标记Feature完成 |

Core API(核心业务能力)

Feature管理器 (src/core/feature-manager.ts)

// 创建Feature
createFeature(projectPath, options): Promise<void>

// 获取Feature信息
getFeature(projectPath, featureId): Promise<FeatureState>

// 列出所有Features
listFeatures(projectPath): Promise<FeatureListItem[]>

// 更新Feature状态
updateFeatureState(projectPath, featureId, updates): Promise<void>

// 移动到下一阶段
moveToNextStage(projectPath, featureId, commitInfo): Promise<void>

// 更新阶段状态
updateStageStatus(projectPath, featureId, stage, status): Promise<void>

// 删除Feature
deleteFeature(projectPath, featureId): Promise<void>

Spec项目管理器 (src/core/spec-manager.ts)

// 初始化Spec项目
initSpecProject(projectPath, name): Promise<void>

// 检查是否为Spec项目
isSpecProject(projectPath): Promise<boolean>

// 获取Spec配置
getSpecConfig(projectPath): Promise<SpecConfig>

// 获取Features目录
getFeaturesDir(projectPath): string

// 获取所有Features
getFeatures(projectPath): Promise<FeatureListItem[]>

Code项目管理器 (src/core/code-manager.ts)

// 初始化Code项目
initCodeProject(projectPath, type, framework): Promise<void>

// 检查是否为Code项目
isCodeProject(projectPath): Promise<boolean>

// 关联到Spec项目
linkToSpec(codeProjectPath, specProjectPath): Promise<void>

// 获取关联的Spec项目
getLinkedSpecProject(codeProjectPath): Promise<string>

// 获取当前开发的Feature
getCurrentFeature(codeProjectPath): Promise<CurrentFeature | null>

// 设置当前Feature
setCurrentFeature(codeProjectPath, feature): Promise<void>

// 清空当前Feature
clearCurrentFeature(codeProjectPath): Promise<void>

背景知识管理器 (src/core/context-manager.ts)

// 添加文本到背景知识
addTextToContext(projectPath, featureId, type, content): Promise<void>

// 替换背景知识
replaceContext(projectPath, featureId, type, content): Promise<void>

// 添加参考文件
addReferenceFile(projectPath, featureId, sourceFilePath, targetFileName?): Promise<string>

// 添加参考链接
addReferenceLink(projectPath, featureId, title, url): Promise<void>

// 扫描代码目录
scanCodeDirectory(projectPath, featureId, codeDirPath, options): Promise<void>

// 读取背景知识
readContext(projectPath, featureId, type): Promise<string>

// 列出参考文件
listReferences(projectPath, featureId): Promise<string[]>

// 检查背景知识是否为空
isContextEmpty(projectPath, featureId, type?): Promise<boolean>

模板引擎 (src/core/template-engine.ts)

// 渲染单个模板
renderTemplate(templatePath, data): Promise<string>

// 渲染阶段所有模板
renderStageTemplates(stage, data): Promise<Map<string, string>>

// 注册自定义helpers
registerHelpers(): void

// 获取模板目录
getTemplatesDir(): string

生命周期管理 (src/core/lifecycle.ts)

// 获取下一阶段
getNextStage(currentStage): LifecycleStage | null

// 验证状态转换
validateTransition(from, to): LifecycleTransition

// 获取阶段目录名
getStageDirectoryName(stage): string

// 获取阶段显示名
getStageDisplayName(stage): string

// 计算进度百分比
calculateProgress(stage): number

Skill层引导机制

Skills是纯引导文件,不包含业务逻辑,只告诉AI:

| Skill的职责 | 说明 | 示例 | |-----------|------|------| | 触发条件 | 告诉AI何时使用这个skill | "当用户说'创建feature'时" | | 工作流程 | 描述完整的操作步骤 | 1.验证环境 2.收集信息 3.调用CLI 4.展示结果 | | 调用方式 | 明确指出要调用的CLI命令或API | oms feature createcreateFeature() | | 交互指导 | 如何与用户对话收集信息 | 提示词、验证规则、错误处理 | | 最佳实践 | 给出建议和注意事项 | 何时使用、常见问题、下一步建议 |

Skill示例oms-feature-create.md

# Oh My Spec: 创建Feature

当用户说"创建feature"、"新建feature"时,使用此skill。

## 工作流程

### 1. 环境验证
- 检查是否为spec项目(`.oms/config.json`)
- 如果不是,提示:`oms init spec`

### 2. 收集Feature信息
询问用户:
1. Feature ID(格式:LOGIN-001)
2. Feature名称(必填)
3. Feature描述(可选)

### 3. 创建Feature
使用CLI命令:
\```bash
oms feature create <id> --name "<name>" --description "<desc>"
\```

或直接调用API(在代码环境中):
\```javascript
import { createFeature } from '@oh-my-spec/core';
await createFeature(projectPath, { id, name, description });
\```

### 4. 展示结果
\```
✅ Feature LOGIN-001 创建成功!
📁 features/LOGIN-001/
   ├── state.json
   └── context/
\```

### 5. 下一步建议
💡 使用 @oms-context-add.md 添加背景知识

AI的实际执行过程

用户输入:@oms-feature-create.md

  ↓ AI读取skill文件

  ↓ 理解工作流程

  ↓ 与用户对话收集信息
     "请输入Feature ID:"

  ↓ 用户输入 "LOGIN-001"

  ↓ AI调用CLI命令或API
     Shell("oms feature create LOGIN-001 --name '用户登录'")
     或
     createFeature(cwd, {...})

  ↓ 代码层执行业务逻辑
     - 创建目录
     - 生成state.json
     - 初始化文件

  ↓ AI获取执行结果

  ↓ 展示给用户并提供建议
     "✅ 创建成功!下一步..."

这样设计的好处

| 优势 | 说明 | |-----|------| | 🔄 解耦 | Skill更新不影响代码,代码升级不需要改Skill | | 🎯 专注 | 代码专注于"做什么",Skill专注于"怎么做" | | 🛠️ 灵活 | 用户可以自定义Skill来改变AI的行为方式 | | 🤖 通用 | 不限于Cursor,任何能读Markdown的AI都能用 | | 📚 文档化 | Skill本身就是最好的使用文档 | | 🔧 可维护 | 代码逻辑和交互逻辑分开,易于维护 |

代码层与Skill层的协作示例

以"创建并分析需求"为例:

用户:"帮我创建一个登录功能的需求"

AI 读取 @oms-feature-create.md
  ↓
AI 执行: oms feature create LOGIN-001 --name "用户登录"
  ↓
代码层: 创建feature目录和文件
  ↓
AI 读取 @oms-feature-requirement.md
  ↓
AI 与用户多轮对话收集需求信息
  ↓
AI 调用: renderStageTemplates('requirement', data)
  ↓
代码层: 基于模板生成需求文档
  ↓
AI 读取 @oms-feature-commit.md
  ↓
AI 执行: git commit ...
  ↓
代码层: 提交变更并更新状态
  ↓
完成!

关键点

  • Skill告诉AI"先创建,再分析,最后提交"的流程
  • 具体的创建、生成、提交都是代码层完成
  • AI只是按照Skill的指引来编排调用

📖 核心概念

Spec项目 vs Code项目

| 项目类型 | 用途 | 主要内容 | CLI命令 | |---------|------|---------|---------| | Spec | 需求管理 | Features目录、设计文档 | oms feature ... | | Code | 代码实现 | 实际代码 | oms dev ... |

一个Spec项目可以关联多个Code项目(如frontend、backend、mobile等)。

Feature生命周期

CREATED
   ↓
REQUIREMENT_ANALYSIS    # 需求分析
   ↓
REQUIREMENT_CONFIRMED   # 提交后自动进入
   ↓
USECASE_DESIGN         # 用例设计
   ↓
USECASE_CONFIRMED
   ↓
ARCHITECTURE_DESIGN    # 架构设计
   ↓
ARCHITECTURE_CONFIRMED
   ↓
DETAILED_DESIGN        # 详细设计
   ↓
DETAILED_CONFIRMED
   ↓
TASK_PLANNING          # 任务拆分
   ↓
TASK_CONFIRMED
   ↓
IN_DEVELOPMENT         # 开发中
   ↓
COMPLETED              # 完成

每个阶段:

  1. AI辅助生成文档
  2. 用户review和修改
  3. 确认后提交(自动git commit)
  4. 状态流转到下一阶段

Cursor Skills

Skills是Cursor中的特殊Markdown文件,AI会读取并执行其中的指令。

Spec项目Skills(需求管理):

  • oms-feature-create.md - 创建Feature
  • oms-feature-requirement.md - 需求分析
  • oms-feature-usecase.md - 用例设计
  • oms-feature-architecture.md - 架构设计
  • oms-feature-detailed-design.md - 详细设计
  • oms-feature-tasks.md - 任务拆分
  • oms-feature-commit.md - 确认提交
  • oms-context-add.md - 添加背景知识
  • oms-feature-status.md - 查看状态

Code项目Skills(开发管理):

  • oms-dev-start.md - 开始开发
  • oms-dev-status.md - 开发状态
  • oms-dev-complete.md - 完成开发

🛠️ CLI命令

初始化命令

# 初始化spec项目
oms init spec

# 初始化code项目
oms init code

Spec项目命令

# Feature管理
oms feature create [id]           # 创建feature
oms feature list                  # 列出所有features
oms feature status [id]           # 查看feature状态
oms feature delete <id>           # 删除feature

Code项目命令

# 项目关联
oms link <spec-path>              # 关联到spec项目

# 开发管理
oms dev start                     # 开始开发feature
oms dev status                    # 查看开发状态
oms dev complete                  # 完成开发

Skill管理命令

# Cursor集成
oms skill link-cursor             # 链接skills到.cursor/skills(让Cursor识别)

📂 项目结构

Spec项目结构

my-product-spec/
├── .oms/
│   ├── config.json              # Spec项目配置
│   ├── oms-skills/              # Oh My Spec Skills(从全局包复制)
│   │   ├── oms-feature-create/
│   │   │   └── SKILL.md
│   │   ├── oms-feature-requirement/
│   │   │   └── SKILL.md
│   │   └── ...
│   └── .gitkeep
├── .cursor/                      # Cursor 配置(init时选择Cursor自动创建)
│   └── skills/                   # Cursor Skills 目录
│       ├── oms-feature-create/  # 从 .oms/oms-skills 复制
│       │   └── SKILL.md
│       ├── oms-feature-requirement/
│       │   └── SKILL.md
│       └── ...
├── features/                     # 所有features
│   └── LOGIN-001/               # Feature目录
│       ├── state.json           # Feature状态
│       ├── context/             # 背景知识
│       │   ├── business.md
│       │   ├── code.md
│       │   └── references/
│       ├── 01-requirement/      # 需求文档
│       ├── 02-usecase/          # 用例文档
│       ├── 03-architecture/     # 架构文档
│       ├── 04-detailed-design/  # 详细设计
│       └── 05-tasks/            # 任务清单
├── .gitignore
└── README.md

关于 Skills 目录结构:

  1. .oms/oms-skills/ - 从全局 oh-my-spec 包复制的 Skills

    • 📁 真实文件:在项目初始化时从全局包复制
    • 可自定义:可以根据项目需要修改 skills
    • 📝 调用方式@.oms/oms-skills/oms-feature-create/SKILL.md
  2. .cursor/skills/ - Cursor 原生识别目录(init时选择Cursor自动创建)

    • 📁 真实目录和文件:从 .oms/oms-skills/ 复制
    • 🚀 快捷调用:可以使用 /oms-feature-create
    • Cursor 完美识别:真实目录和文件,无兼容性问题

推荐工作流:

# 初始化项目
oms init spec

# 选择 "Cursor" 会自动复制 skills 到 .cursor/skills
# 或稍后手动运行:
oms skill link-cursor

# 在 Cursor 中使用
# 方式1: /oms-feature-create (快捷方式)
# 方式2: @.oms/oms-skills/oms-feature-create/SKILL.md (@引用)

优势:

  • 完全可定制:Skills 是真实文件,可以根据项目需要自由修改
  • 无需依赖:不依赖符号链接,跨平台兼容性好
  • 版本独立:每个项目有独立的 skills 快照,不受全局包影响

注意:

  • Skills 是在项目初始化时复制的快照,不会随 oh-my-spec 升级自动更新
  • 如需获取最新的 skills,可以删除 .oms/oms-skills/.cursor/skills/ 后重新初始化

Code项目结构

my-product-frontend/
├── .oms/
│   ├── config.json              # Code项目配置
│   ├── current-feature.json     # 当前开发的feature
│   ├── oms-skills/              # 开发相关Skills(从全局包复制)
│   │   ├── oms-dev-start/
│   │   │   └── SKILL.md
│   │   ├── oms-dev-status/
│   │   │   └── SKILL.md
│   │   └── oms-dev-complete/
│   │       └── SKILL.md
│   └── .gitkeep
├── .cursor/                      # Cursor 配置(init时选择Cursor自动创建)
│   └── skills/                   # Cursor Skills 目录
│       ├── oms-dev-start/       # 从 .oms/oms-skills 复制
│       │   └── SKILL.md
│       ├── oms-dev-status/
│       │   └── SKILL.md
│       └── oms-dev-complete/
│           └── SKILL.md
├── src/                          # 实际代码
│   └── ...
└── package.json

💡 使用场景

场景1:新功能开发

  1. 在spec项目中创建feature
  2. 分析需求、设计用例、架构、详细设计
  3. 拆分任务
  4. 在code项目中开始开发
  5. 完成后更新状态

场景2:功能迭代

  1. 创建新feature(如LOGIN-002)
  2. 在背景知识中添加现有代码信息
  3. 分析迭代需求
  4. 后续流程同新功能

场景3:多项目协作

my-product-spec/          # 统一的需求管理
   └── features/

my-product-frontend/      # 前端项目
   └── .oms/config.json (指向spec)

my-product-backend/       # 后端项目
   └── .oms/config.json (指向spec)

my-product-mobile/        # 移动端项目
   └── .oms/config.json (指向spec)

所有code项目共享同一个spec项目,确保需求一致。

🎯 最佳实践

1. 充分的背景知识

在需求分析前,添加足够的背景知识:

  • 业务场景描述
  • 现有代码结构
  • 技术约束
  • 参考文档

2. 循序渐进

不要跳过阶段,按顺序完成:

  • 需求不清晰 → 架构设计会有问题
  • 架构不明确 → 详细设计会返工
  • 设计不完整 → 任务拆分不准确

3. 及时提交

每个阶段完成后及时提交:

  • 记录历史
  • 便于回溯
  • 团队协作

4. 合理拆分任务

任务拆分要:

  • 颗粒度适中(半天到1天)
  • 独立可测试
  • 明确验收标准

5. 定期同步状态

在开发过程中:

  • 使用oms dev status查看进度
  • 及时标记完成的任务
  • 遇到问题及时调整

🧪 测试

测试策略

代码层稳定性保障:所有Core API和CLI命令都有完整的单元测试覆盖,确保代码层能力的稳定性。

# 运行所有测试
npm test

# 监听模式(开发时)
npm run test:watch

# 生成覆盖率报告
npm run test:coverage

测试覆盖范围

| 模块 | 测试文件 | 覆盖内容 | |-----|---------|---------| | 生命周期管理 | lifecycle.test.ts | 阶段转换、验证、进度计算 | | Feature管理 | feature-manager.test.ts | CRUD操作、状态更新 | | Spec项目 | spec-manager.test.ts | 项目初始化、配置管理 | | Code项目 | code-manager.test.ts | 项目初始化、关联、开发状态 | | 背景知识 | context-manager.test.ts | 添加、读取、管理上下文 | | 模板引擎 | template-engine.test.ts | 模板渲染、数据注入 |

覆盖率目标

Branches   : 70% 
Functions  : 70% 
Lines      : 70% 
Statements : 70% 

测试示例

// tests/core/feature-manager.test.ts
describe('Feature Manager', () => {
  it('should create a new feature with all required files', async () => {
    const options = {
      id: 'TEST-001',
      name: 'Test Feature',
      description: 'A test feature',
    };

    await createFeature(testDir, options);

    // 验证目录结构
    expect(await fs.pathExists(featureDir)).toBe(true);
    
    // 验证state.json
    const state = await fs.readJSON(stateFile);
    expect(state.id).toBe('TEST-001');
    expect(state.current_stage).toBe('requirement');
  });
});

为什么需要测试?

| 原因 | 说明 | |-----|------| | 稳定性 | 代码层是基础能力,必须保证稳定可靠 | | 回归保护 | 修改代码后,测试确保不会破坏现有功能 | | 重构信心 | 有测试覆盖,可以放心重构优化 | | 文档作用 | 测试代码展示了API的正确使用方式 | | 质量保证 | 测试是代码质量的重要指标 |

原则

  • ✅ Core API 必须有单元测试
  • ✅ CLI命令必须有集成测试
  • ⚠️ Skill文件不需要测试(它们只是引导文档)
  • ⚠️ 模板文件不需要测试(它们是数据文件)

🔧 配置

Spec项目配置(.oms/config.json)

{
  "type": "spec",
  "name": "my-product",
  "version": "1.0.0",
  "oms_version": "1.0.0",
  "git": {
    "auto_commit": true,
    "commit_message_template": "feat({{feature_id}}): {{stage_name}}"
  }
}

Code项目配置(.oms/config.json)

{
  "type": "code",
  "spec_project": "/path/to/spec-project",
  "project_type": "frontend",
  "framework": "react",
  "oms_version": "1.0.0",
  "git": {
    "auto_commit_code": false,
    "commit_message_template": "feat({{feature_id}}): {{description}}"
  }
}

🎬 完整示例

查看完整使用示例了解从创建Feature到完成开发的详细流程。

🏗️ 架构设计

查看架构文档了解系统设计。

📦 发布与打包

如果你想发布自己的修改版本或参与开发:

# 1. 克隆项目
git clone https://github.com/yourusername/oh-my-spec.git
cd oh-my-spec

# 2. 安装依赖
npm install

# 3. 运行测试
npm test

# 4. 构建项目
npm run build

# 5. 发布前检查
./scripts/prepublish.sh

# 6. 发布到 npm
npm publish

详细的发布指南请参考:发布指南.md

🤝 贡献

欢迎贡献代码、报告问题、提出建议!

开发工作流:

# 1. Fork 项目并克隆

# 2. 创建功能分支
git checkout -b feature/your-feature

# 3. 进行开发
npm run dev

# 4. 运行测试
npm test

# 5. 提交改动
git commit -m "feat: add new feature"

# 6. 推送并创建 Pull Request
git push origin feature/your-feature

📄 许可证

MIT License

🔗 相关链接


Made with ❤️ for developers who love AI-assisted coding