ai-dev-requirements 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +227 -0
- package/README.zh-CN.md +227 -0
- package/dist/index.cjs +785 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +759 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +63 -0
- package/skills/dev-workflow/SKILL.md +215 -0
- package/skills/dev-workflow/references/requirement-validation.md +114 -0
- package/skills/dev-workflow/references/service-transform.md +109 -0
- package/skills/dev-workflow/references/task-types.md +123 -0
- package/skills/dev-workflow/references/templates/code-dev-task.md +29 -0
- package/skills/dev-workflow/references/templates/code-fix-task.md +28 -0
- package/skills/dev-workflow/references/templates/code-refactor-task.md +30 -0
- package/skills/dev-workflow/references/templates/doc-write-task.md +29 -0
- package/skills/dev-workflow/references/templates/research-task.md +30 -0
- package/skills/dev-workflow/references/templates/test-task.md +30 -0
- package/skills/dev-workflow/references/workflow.md +162 -0
package/README.md
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
# AI Development Workflow
|
|
2
|
+
|
|
3
|
+
[中文](./README.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
A parallel-task development framework for AI coding tools, enabling end-to-end development workflow automation.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## What's Included
|
|
10
|
+
|
|
11
|
+
| Deliverable | Description |
|
|
12
|
+
|-------------|-------------|
|
|
13
|
+
| **Requirements MCP Server** (`src/`) | MCP server for fetching requirements, with built-in ONES adapter. Installable via npm. |
|
|
14
|
+
| **Dev Workflow Skill** (`skills/dev-workflow/`) | Self-contained development workflow skill. Install it and run the full process. |
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
### 1. Install Dev Workflow Skill
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx skills add daguanren21/ai-dev-workflow
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Install to a specific agent with `-a`:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx skills add daguanren21/ai-dev-workflow -a claude-code
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Once installed, AI coding tools will automatically use the dev-workflow skill to drive the full development process.
|
|
33
|
+
|
|
34
|
+
### 2. Install MCP Server (Optional)
|
|
35
|
+
|
|
36
|
+
If you use ONES for requirement management:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm install -g ai-dev-requirements
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Create `.requirements-mcp.json` in your project root:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"sources": {
|
|
47
|
+
"ones": {
|
|
48
|
+
"enabled": true,
|
|
49
|
+
"apiBase": "https://your-org.ones.com",
|
|
50
|
+
"auth": {
|
|
51
|
+
"type": "ones-pkce",
|
|
52
|
+
"emailEnv": "ONES_ACCOUNT",
|
|
53
|
+
"passwordEnv": "ONES_PASSWORD"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"defaultSource": "ones"
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Add to your `.mcp.json`:
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"mcpServers": {
|
|
66
|
+
"requirements": {
|
|
67
|
+
"command": "npx",
|
|
68
|
+
"args": ["ai-dev-requirements"],
|
|
69
|
+
"env": {
|
|
70
|
+
"ONES_ACCOUNT": "${ONES_ACCOUNT}",
|
|
71
|
+
"ONES_PASSWORD": "${ONES_PASSWORD}"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 3. Add Companion MCP Servers (Optional)
|
|
79
|
+
|
|
80
|
+
Requirements are not limited to ONES. Pair with official MCP servers for GitHub / Jira / Figma:
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"mcpServers": {
|
|
85
|
+
"github": {
|
|
86
|
+
"command": "docker",
|
|
87
|
+
"args": ["run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"],
|
|
88
|
+
"env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}" }
|
|
89
|
+
},
|
|
90
|
+
"figma": {
|
|
91
|
+
"url": "https://mcp.figma.com/mcp"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Supported Requirement Platforms
|
|
100
|
+
|
|
101
|
+
| Platform | Integration | Description |
|
|
102
|
+
|----------|-------------|-------------|
|
|
103
|
+
| ONES | Built-in adapter | Directly supported by this MCP server, OAuth2 PKCE auth |
|
|
104
|
+
| GitHub Issues | External MCP | Use [github/github-mcp-server](https://github.com/github/github-mcp-server) |
|
|
105
|
+
| Jira | External MCP | Use [Atlassian Rovo MCP Server](https://www.atlassian.com/blog/announcements/remote-mcp-server) |
|
|
106
|
+
|
|
107
|
+
> This project uses an adapter architecture (`BaseAdapter`). To add a new platform as a built-in adapter, extend `SourceType` and implement `BaseAdapter`.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Dev Workflow Skill
|
|
112
|
+
|
|
113
|
+
A self-contained AI-assisted development workflow skill that drives 7 phases:
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
Requirements → User Stories → UI Resources → Skill Matching → Implementation Plan → Code → Verification
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Skill directory structure:
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
skills/dev-workflow/
|
|
123
|
+
├── SKILL.md # Skill entry (YAML frontmatter + workflow definition)
|
|
124
|
+
└── references/
|
|
125
|
+
├── workflow.md # 10-step end-to-end workflow
|
|
126
|
+
├── task-types.md # Task types, scheduling strategies, declaration syntax
|
|
127
|
+
├── service-transform.md # Service-layer transform pattern for Mock/API adaptation
|
|
128
|
+
└── templates/ # Task declaration templates
|
|
129
|
+
├── code-dev-task.md
|
|
130
|
+
├── code-fix-task.md
|
|
131
|
+
├── code-refactor-task.md
|
|
132
|
+
├── doc-write-task.md
|
|
133
|
+
├── research-task.md
|
|
134
|
+
└── test-task.md
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Project Structure
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
ai-dev-workflow/
|
|
143
|
+
├── skills/dev-workflow/ # Dev Workflow Skill (self-contained)
|
|
144
|
+
│ ├── SKILL.md
|
|
145
|
+
│ └── references/
|
|
146
|
+
│ ├── workflow.md
|
|
147
|
+
│ ├── task-types.md
|
|
148
|
+
│ ├── service-transform.md
|
|
149
|
+
│ └── templates/
|
|
150
|
+
│
|
|
151
|
+
├── src/ # Requirements MCP Server source
|
|
152
|
+
│ ├── index.ts # Entry & MCP Server definition
|
|
153
|
+
│ ├── adapters/
|
|
154
|
+
│ │ ├── base.ts # BaseAdapter abstract class
|
|
155
|
+
│ │ ├── ones.ts # ONES adapter
|
|
156
|
+
│ │ └── index.ts # Factory function createAdapter()
|
|
157
|
+
│ ├── config/
|
|
158
|
+
│ │ └── loader.ts # Config loading & env resolution
|
|
159
|
+
│ ├── tools/
|
|
160
|
+
│ │ ├── get-requirement.ts # get_requirement tool
|
|
161
|
+
│ │ ├── search-requirements.ts # search_requirements tool
|
|
162
|
+
│ │ └── list-sources.ts # list_sources tool
|
|
163
|
+
│ ├── types/
|
|
164
|
+
│ │ ├── auth.ts
|
|
165
|
+
│ │ ├── config.ts
|
|
166
|
+
│ │ └── requirement.ts
|
|
167
|
+
│ └── utils/
|
|
168
|
+
│ ├── http.ts
|
|
169
|
+
│ └── map-status.ts
|
|
170
|
+
│
|
|
171
|
+
├── tests/ # Tests
|
|
172
|
+
├── .requirements-mcp.json.example # MCP Server config template
|
|
173
|
+
├── package.json
|
|
174
|
+
├── tsconfig.json
|
|
175
|
+
├── tsdown.config.ts
|
|
176
|
+
└── vitest.config.ts
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Tech Stack
|
|
182
|
+
|
|
183
|
+
| Technology | Purpose |
|
|
184
|
+
|------------|---------|
|
|
185
|
+
| TypeScript | MCP Server language |
|
|
186
|
+
| [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk) | MCP protocol SDK |
|
|
187
|
+
| [Zod](https://zod.dev/) | Schema validation & type inference |
|
|
188
|
+
| [tsdown](https://github.com/nicepkg/tsdown) | Build tool (ESM + CJS + dts) |
|
|
189
|
+
| [Vitest](https://vitest.dev/) | Test framework |
|
|
190
|
+
| [bumpp](https://github.com/antfu/bumpp) | Version management & publishing |
|
|
191
|
+
| Node.js >= 20 | Runtime |
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## Development
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# Install dependencies
|
|
199
|
+
pnpm install
|
|
200
|
+
|
|
201
|
+
# Dev mode
|
|
202
|
+
pnpm dev
|
|
203
|
+
|
|
204
|
+
# Build
|
|
205
|
+
pnpm build
|
|
206
|
+
|
|
207
|
+
# Run tests
|
|
208
|
+
pnpm test
|
|
209
|
+
|
|
210
|
+
# Type check
|
|
211
|
+
pnpm lint
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Publishing
|
|
215
|
+
|
|
216
|
+
This project uses [bumpp](https://github.com/antfu/bumpp) for version management:
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
# Interactive version bump, auto commit + tag + push
|
|
220
|
+
pnpm release
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## License
|
|
226
|
+
|
|
227
|
+
[MIT](LICENSE)
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
# AI Development Workflow
|
|
2
|
+
|
|
3
|
+
[English](./README.md)
|
|
4
|
+
|
|
5
|
+
一套面向 AI 编码工具的并行任务开发框架,实现端到端的开发工作流自动化。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 核心交付物
|
|
10
|
+
|
|
11
|
+
| 交付物 | 说明 |
|
|
12
|
+
|-------|------|
|
|
13
|
+
| **Requirements MCP Server** (`src/`) | 需求获取 MCP 服务,内置 ONES 适配器,可通过 npm 安装 |
|
|
14
|
+
| **Dev Workflow Skill** (`skills/dev-workflow/`) | 自包含的开发工作流 Skill,安装后即可跑通完整流程 |
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 快速开始
|
|
19
|
+
|
|
20
|
+
### 1. 安装 Dev Workflow Skill
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx skills add daguanren21/ai-dev-workflow
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
指定 AI 工具安装,使用 `-a`:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx skills add daguanren21/ai-dev-workflow -a claude-code
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
安装后,AI 编码工具会自动识别并使用 dev-workflow skill 驱动完整的开发流程。
|
|
33
|
+
|
|
34
|
+
### 2. 安装 MCP Server(可选)
|
|
35
|
+
|
|
36
|
+
如果使用 ONES 进行需求管理:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm install -g ai-dev-requirements
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
在项目根目录创建 `.requirements-mcp.json`:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"sources": {
|
|
47
|
+
"ones": {
|
|
48
|
+
"enabled": true,
|
|
49
|
+
"apiBase": "https://your-org.ones.com",
|
|
50
|
+
"auth": {
|
|
51
|
+
"type": "ones-pkce",
|
|
52
|
+
"emailEnv": "ONES_ACCOUNT",
|
|
53
|
+
"passwordEnv": "ONES_PASSWORD"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"defaultSource": "ones"
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
在 `.mcp.json` 中注册:
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"mcpServers": {
|
|
66
|
+
"requirements": {
|
|
67
|
+
"command": "npx",
|
|
68
|
+
"args": ["ai-dev-requirements"],
|
|
69
|
+
"env": {
|
|
70
|
+
"ONES_ACCOUNT": "${ONES_ACCOUNT}",
|
|
71
|
+
"ONES_PASSWORD": "${ONES_PASSWORD}"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 3. 搭配其他 MCP Server(可选)
|
|
79
|
+
|
|
80
|
+
需求不限于 ONES,可搭配官方 MCP Server 获取 GitHub / Jira / Figma 资源:
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"mcpServers": {
|
|
85
|
+
"github": {
|
|
86
|
+
"command": "docker",
|
|
87
|
+
"args": ["run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"],
|
|
88
|
+
"env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}" }
|
|
89
|
+
},
|
|
90
|
+
"figma": {
|
|
91
|
+
"url": "https://mcp.figma.com/mcp"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 支持的需求管理平台
|
|
100
|
+
|
|
101
|
+
| 平台 | 接入方式 | 说明 |
|
|
102
|
+
|-----|---------|------|
|
|
103
|
+
| ONES | 内置适配器 | 本项目 MCP Server 直接支持,OAuth2 PKCE 认证 |
|
|
104
|
+
| GitHub Issues | 外置 MCP | 使用 [github/github-mcp-server](https://github.com/github/github-mcp-server) |
|
|
105
|
+
| Jira | 外置 MCP | 使用 [Atlassian Rovo MCP Server](https://www.atlassian.com/blog/announcements/remote-mcp-server) |
|
|
106
|
+
|
|
107
|
+
> 本项目采用适配器架构(`BaseAdapter`),如需将新平台作为内置适配器,扩展 `SourceType` 并实现 `BaseAdapter` 即可。
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Dev Workflow Skill
|
|
112
|
+
|
|
113
|
+
自包含的 AI 辅助开发工作流 Skill,安装后自动驱动 7 个阶段:
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
需求获取 → 用户故事 → UI 资源获取 → 技能匹配 → 实现计划 → 代码实现 → 验证
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Skill 目录结构:
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
skills/dev-workflow/
|
|
123
|
+
├── SKILL.md # Skill 入口(YAML frontmatter + 工作流定义)
|
|
124
|
+
└── references/
|
|
125
|
+
├── workflow.md # 10 步端到端工作流
|
|
126
|
+
├── task-types.md # 任务类型、调度策略、声明语法
|
|
127
|
+
├── service-transform.md # Service 层 Transform 适配模式
|
|
128
|
+
└── templates/ # 任务声明模板
|
|
129
|
+
├── code-dev-task.md
|
|
130
|
+
├── code-fix-task.md
|
|
131
|
+
├── code-refactor-task.md
|
|
132
|
+
├── doc-write-task.md
|
|
133
|
+
├── research-task.md
|
|
134
|
+
└── test-task.md
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 项目结构
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
ai-dev-workflow/
|
|
143
|
+
├── skills/dev-workflow/ # Dev Workflow Skill(自包含工作流)
|
|
144
|
+
│ ├── SKILL.md
|
|
145
|
+
│ └── references/
|
|
146
|
+
│ ├── workflow.md
|
|
147
|
+
│ ├── task-types.md
|
|
148
|
+
│ ├── service-transform.md
|
|
149
|
+
│ └── templates/
|
|
150
|
+
│
|
|
151
|
+
├── src/ # Requirements MCP Server 源码
|
|
152
|
+
│ ├── index.ts # 入口 & MCP Server 定义
|
|
153
|
+
│ ├── adapters/
|
|
154
|
+
│ │ ├── base.ts # BaseAdapter 抽象类
|
|
155
|
+
│ │ ├── ones.ts # ONES 适配器
|
|
156
|
+
│ │ └── index.ts # 工厂函数 createAdapter()
|
|
157
|
+
│ ├── config/
|
|
158
|
+
│ │ └── loader.ts # 配置文件加载 & 环境变量解析
|
|
159
|
+
│ ├── tools/
|
|
160
|
+
│ │ ├── get-requirement.ts # get_requirement 工具
|
|
161
|
+
│ │ ├── search-requirements.ts # search_requirements 工具
|
|
162
|
+
│ │ └── list-sources.ts # list_sources 工具
|
|
163
|
+
│ ├── types/
|
|
164
|
+
│ │ ├── auth.ts
|
|
165
|
+
│ │ ├── config.ts
|
|
166
|
+
│ │ └── requirement.ts
|
|
167
|
+
│ └── utils/
|
|
168
|
+
│ ├── http.ts
|
|
169
|
+
│ └── map-status.ts
|
|
170
|
+
│
|
|
171
|
+
├── tests/ # 测试
|
|
172
|
+
├── .requirements-mcp.json.example # MCP Server 配置模板
|
|
173
|
+
├── package.json
|
|
174
|
+
├── tsconfig.json
|
|
175
|
+
├── tsdown.config.ts
|
|
176
|
+
└── vitest.config.ts
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## 技术栈
|
|
182
|
+
|
|
183
|
+
| 技术 | 用途 |
|
|
184
|
+
|-----|------|
|
|
185
|
+
| TypeScript | MCP Server 开发语言 |
|
|
186
|
+
| [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk) | MCP 协议 SDK |
|
|
187
|
+
| [Zod](https://zod.dev/) | 参数校验与类型推导 |
|
|
188
|
+
| [tsdown](https://github.com/nicepkg/tsdown) | 构建工具(ESM + CJS + dts) |
|
|
189
|
+
| [Vitest](https://vitest.dev/) | 测试框架 |
|
|
190
|
+
| [bumpp](https://github.com/antfu/bumpp) | 版本管理与发布 |
|
|
191
|
+
| Node.js >= 20 | 运行时 |
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## 开发
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# 安装依赖
|
|
199
|
+
pnpm install
|
|
200
|
+
|
|
201
|
+
# 开发模式
|
|
202
|
+
pnpm dev
|
|
203
|
+
|
|
204
|
+
# 构建
|
|
205
|
+
pnpm build
|
|
206
|
+
|
|
207
|
+
# 运行测试
|
|
208
|
+
pnpm test
|
|
209
|
+
|
|
210
|
+
# 类型检查
|
|
211
|
+
pnpm lint
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### 发版流程
|
|
215
|
+
|
|
216
|
+
本项目使用 [bumpp](https://github.com/antfu/bumpp) 管理版本:
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
# 交互式选择版本号,自动 commit + tag + push
|
|
220
|
+
pnpm release
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## License
|
|
226
|
+
|
|
227
|
+
[MIT](LICENSE)
|