mcpField
O
openspec-proposal

openspec-proposal

github.com/chyiiiiiiiiiiii开发1347 次安装39 周前更新
代码仓库

关于 openspec-proposal

openspec-proposal 是用于 OpenSpec 规范驱动开发流程中创建变更提案的技能。它生成变更 ID、提案与任务文件及增量规范,并提交审阅。

主要功能

  1. 01生成 kebab-case 变更 ID
  2. 02创建变更目录结构
  3. 03生成提案和任务文件
  4. 04为受影响部分创建增量规范
  5. 05提交生成的文件供审阅

适用场景

  1. 01为新功能起草变更提案
  2. 02准备 OpenSpec 审阅所需的变更文件

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/chyiiiiiiiiiiii/openspec-skills --skill openspec-proposal

安装后在 Claude Code 中输入/openspec-proposal确认已加载。

详细介绍

OpenSpec:提案

按照 OpenSpec 规范驱动开发工作流创建新的变更提案。

用法

/openspec-proposal <feature description>

示例:

/openspec-proposal add user search feature

此技能的作用

  1. 根据描述生成唯一的变更 ID(kebab-case)
  2. 在 openspec/changes/ 下创建变更目录结构
  3. 生成 proposal.md、tasks.md 和增量规范
  4. 提交提案以供审查

执行步骤

步骤 1:生成变更 ID

将描述转换为 kebab-case,作为变更 ID。

示例:“添加用户搜索” → add-user-search

步骤 2:创建目录结构
mkdir -p openspec/changes/{change-id}/specs
步骤 3:生成 proposal.md

创建 openspec/changes/{change-id}/proposal.md:

# Proposal: {Feature Title}

**Change ID:** `{change-id}`
**Created:** {YYYY-MM-DD}
**Status:** Draft

---

## Problem Statement

{Analyze the request and describe:}
- What problem are we solving?
- Who is affected?
- What's the current pain point?

## Proposed Solution

{High-level approach:}
- Key components
- Technical approach
- Expected outcomes

## Scope

### In Scope
- {Core functionality}
- {Essential features}

### Out of Scope
- {Explicitly excluded items}
- {Future considerations}

## Impact Analysis

| Component | Change Required | Details |
|-----------|-----------------|---------|
| Database | Yes/No | {details} |
| API | Yes/No | {details} |
| State | Yes/No | {details} |
| UI | Yes/No | {details} |

## Architecture Considerations

{How does this fit with existing patterns?}
{Any new patterns introduced?}
{Dependencies on other components?}

## Success Criteria

- [ ] {Measurable outcome 1}
- [ ] {Measurable outcome 2}
- [ ] {Measurable outcome 3}

## Risks & Mitigations

| Risk | Probability | Impact | Mitigation |
|------|-------------|--------|------------|
| {risk} | Low/Med/High | Low/Med/High | {strategy} |
步骤 4:生成 tasks.md

创建 openspec/changes/{change-id}/tasks.md:

# Implementation Tasks: {Feature Title}

**Change ID:** `{change-id}`

---

## Phase 1: Foundation (Data Layer)

- [ ] 1.1 {Data model task}
- [ ] 1.2 {Repository task}
- [ ] 1.3 {Data layer tests}

**Quality Gate:**
- [ ] Code analysis passes
- [ ] Unit tests pass

---

## Phase 2: Business Logic (Domain/State)

- [ ] 2.1 {Provider/state task}
- [ ] 2.2 {Business logic task}
- [ ] 2.3 {Provider tests}

**Quality Gate:**
- [ ] Code analysis passes
- [ ] State transitions tested

---

## Phase 3: User Interface

- [ ] 3.1 {Page/widget task}
- [ ] 3.2 {Component task}
- [ ] 3.3 {Widget tests}

**Quality Gate:**
- [ ] Code analysis passes
- [ ] Widget tests pass

---

## Phase 4: Integration & Polish

- [ ] 4.1 Add i18n strings (if applicable)
- [ ] 4.2 Integration testing
- [ ] 4.3 Performance verification
- [ ] 4.4 Documentation update

**Quality Gate:**
- [ ] All tests pass
- [ ] Code analysis clean
- [ ] Documentation synced

---

## Completion Checklist

- [ ] All phases complete
- [ ] All quality gates passed
- [ ] Documentation synced
- [ ] Ready for `/openspec-archive`
步骤 5:生成增量规范

创建 openspec/changes/{change-id}/specs/{component}_delta.md:

# Delta: {Component Name}

**Change ID:** `{change-id}`
**Affects:** {list of affected areas}

---

## ADDED

### Requirement: {New Requirement Title}

{Description of new functionality}

#### Scenario: {Scenario Name}
- GIVEN {precondition}
- WHEN {action}
- THEN {expected result}

---

## MODIFIED

### Requirement: {Existing Requirement Title}

{Updated description}

#### Scenario: {Updated Scenario}
- GIVEN {new precondition}
- WHEN {new action}
- THEN {new result}

---

## REMOVED

{List any deprecated requirements, or "(None)" if nothing removed}
步骤 6:提交审查

生成所有文件后,总结:

## Proposal Created: {change-id}

### Files Generated:
- `openspec/changes/{change-id}/proposal.md`
- `openspec/changes/{change-id}/tasks.md`
- `openspec/changes/{change-id}/specs/{component}_delta.md`

### Next Steps:
1. Review the proposal.md for accuracy
2. Adjust tasks.md if needed
3. Verify delta specs match requirements
4. When ready: `/openspec-apply {change-id}`

重要说明

  • 阅读 openspec/specs/ 中的现有规范,了解当前状态
  • 参考 openspec/project.md 了解项目约定
  • 遵循项目 CLAUDE.md 中的模式
  • 尽量缩小范围,避免功能蔓延

评论

支持 Markdown