autobmad 0.1.0
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/LICENSE +21 -0
- package/README.md +177 -0
- package/dist/cli.js +8756 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lynricsy
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# 🦊 AutoBMAD
|
|
2
|
+
|
|
3
|
+
**BMAD-METHOD Phase 4 自动化引擎**
|
|
4
|
+
|
|
5
|
+
全自动化 Sprint 编排:从规划到开发、对抗性代码审查、修复循环,无人值守完成所有 Story。
|
|
6
|
+
|
|
7
|
+
> 把重复的 Sprint 流程交给机器,你只需要喝杯咖啡 ☕
|
|
8
|
+
|
|
9
|
+
## ✨ 功能特性
|
|
10
|
+
|
|
11
|
+
- 🚀 **全自动 Sprint 编排** — 从 `sprint-planning` 到 `code-review`,一键走完整个流程
|
|
12
|
+
- 🔄 **智能修复循环** — `dev` ↔ `review` 自动重试,最多 3 次,直到审查通过
|
|
13
|
+
- 💾 **断点续跑** — 中断后从失败点恢复,不浪费已完成的工作
|
|
14
|
+
- 🎨 **美观终端仪表盘** — Unicode 方框绘制 + ANSI 彩色输出,清晰掌握进度
|
|
15
|
+
- ⚡ **基于 Bun** — 极速启动,TypeScript 原生支持,零编译等待
|
|
16
|
+
- 🔧 **可配置** — CLI 参数 / `.autobmad.yaml` / 自定义 Prompt,灵活适配你的项目
|
|
17
|
+
- 🧪 **完善测试** — 200+ 个测试用例,100% 通过
|
|
18
|
+
|
|
19
|
+
## 📦 安装
|
|
20
|
+
|
|
21
|
+
### 全局安装(推荐)
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
bun add -g autobmad
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
安装后即可在任何目录使用 `autobmad` 命令。
|
|
28
|
+
|
|
29
|
+
### 从源码安装
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
git clone https://github.com/Lynricsy/AutoBMAD.git
|
|
33
|
+
cd AutoBMAD
|
|
34
|
+
bun install
|
|
35
|
+
bun run build
|
|
36
|
+
bun link
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 🚀 快速开始
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# 开始新 Sprint(自动执行规划 → 创建 Story → 开发 → 审查)
|
|
43
|
+
autobmad start --dir /path/to/your/bmad-project
|
|
44
|
+
|
|
45
|
+
# 查看当前 Sprint 状态
|
|
46
|
+
autobmad status --dir /path/to/project
|
|
47
|
+
|
|
48
|
+
# 中断后恢复执行
|
|
49
|
+
autobmad resume --dir /path/to/project
|
|
50
|
+
|
|
51
|
+
# 重置本地运行状态
|
|
52
|
+
autobmad reset --dir /path/to/project
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
如果从源码安装,也可以直接运行:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
bun run src/cli/index.ts start --dir /path/to/project
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## ⚙️ 配置
|
|
62
|
+
|
|
63
|
+
在项目根目录创建 `.autobmad.yaml` 文件即可自定义配置:
|
|
64
|
+
|
|
65
|
+
```yaml
|
|
66
|
+
# 每个 Story 的最大重试次数(dev↔review 循环)
|
|
67
|
+
maxRetries: 3
|
|
68
|
+
|
|
69
|
+
# 单次工作流超时(秒)
|
|
70
|
+
timeout: 300
|
|
71
|
+
|
|
72
|
+
# 开启详细日志
|
|
73
|
+
verbose: false
|
|
74
|
+
|
|
75
|
+
# 自定义各阶段 Prompt(可选)
|
|
76
|
+
prompts:
|
|
77
|
+
sprint-planning: "你的自定义 Sprint 规划 Prompt..."
|
|
78
|
+
create-story: "你的自定义 Story 创建 Prompt..."
|
|
79
|
+
dev-story: "你的自定义开发 Prompt..."
|
|
80
|
+
code-review: "你的自定义审查 Prompt..."
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
CLI 参数会覆盖配置文件中的同名选项:
|
|
84
|
+
|
|
85
|
+
| 参数 | 缩写 | 说明 |
|
|
86
|
+
|------|------|------|
|
|
87
|
+
| `--dir` | `-d` | 项目目录路径(默认:当前目录) |
|
|
88
|
+
| `--verbose` | `-v` | 开启详细日志输出 |
|
|
89
|
+
| `--help` | `-h` | 显示帮助信息 |
|
|
90
|
+
|
|
91
|
+
## 🏗️ 架构
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
AutoBMAD/src
|
|
95
|
+
├── cli/ # CLI 层
|
|
96
|
+
│ ├── index.ts # 入口 + 参数解析
|
|
97
|
+
│ ├── dashboard.ts # 终端仪表盘(美化输出)
|
|
98
|
+
│ └── commands/
|
|
99
|
+
│ ├── start.ts # 启动 Sprint
|
|
100
|
+
│ ├── resume.ts # 断点恢复
|
|
101
|
+
│ ├── status.ts # 状态查看
|
|
102
|
+
│ └── reset.ts # 状态重置
|
|
103
|
+
│
|
|
104
|
+
└── core/ # 核心引擎
|
|
105
|
+
├── sprint-orchestrator.ts # Sprint 编排器(主循环)
|
|
106
|
+
├── story-processor.ts # Story 处理器(dev↔review 循环)
|
|
107
|
+
├── runner.ts # 工作流运行器(调用 oh-my-opencode)
|
|
108
|
+
├── router.ts # 工作流路由(映射 workflow → agent)
|
|
109
|
+
├── state-manager.ts # Sprint 状态管理(YAML 读写)
|
|
110
|
+
├── run-state.ts # 运行状态持久化(JSON,断点续跑)
|
|
111
|
+
├── config.ts # 配置加载与合并
|
|
112
|
+
├── prompts.ts # Prompt 模板管理
|
|
113
|
+
├── logger.ts # 日志系统
|
|
114
|
+
├── errors.ts # 错误类型定义
|
|
115
|
+
└── types.ts # TypeScript 类型与接口
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**核心流程:**
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
Sprint Orchestrator
|
|
122
|
+
│
|
|
123
|
+
├─ 1. sprint-planning → 生成 Sprint 规划
|
|
124
|
+
├─ 2. create-story → 为每个 Story 创建详细描述
|
|
125
|
+
└─ 3. 遍历所有 Story:
|
|
126
|
+
├─ dev-story → 执行 TDD 开发
|
|
127
|
+
├─ code-review → 对抗性代码审查
|
|
128
|
+
└─ 失败? → 重试(最多 maxRetries 次)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## 🧪 测试
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# 运行全部测试
|
|
135
|
+
bun test
|
|
136
|
+
|
|
137
|
+
# 类型检查
|
|
138
|
+
bun run typecheck
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
项目包含 200+ 个测试用例,覆盖核心模块的所有关键路径。
|
|
142
|
+
|
|
143
|
+
## 📋 前提条件
|
|
144
|
+
|
|
145
|
+
- [Bun](https://bun.sh) 运行时(v1.0+)
|
|
146
|
+
- [oh-my-opencode](https://github.com/anthropics/opencode) 及 oh-my-opencode 插件已安装并配置
|
|
147
|
+
- 一个遵循 BMAD-METHOD 的项目,包含 `sprint-status.yaml` 文件
|
|
148
|
+
|
|
149
|
+
## 🛠️ 技术栈
|
|
150
|
+
|
|
151
|
+
| 组件 | 选型 |
|
|
152
|
+
|------|------|
|
|
153
|
+
| 运行时 | Bun |
|
|
154
|
+
| 语言 | TypeScript(strict 模式) |
|
|
155
|
+
| 运行时依赖 | `yaml` ^2.7.0(仅此一个) |
|
|
156
|
+
| 测试 | `bun test` |
|
|
157
|
+
| 状态存储 | YAML + JSON 文件系统 |
|
|
158
|
+
|
|
159
|
+
## 📤 发布
|
|
160
|
+
|
|
161
|
+
本项目通过 GitHub Actions 自动发布到 npm。
|
|
162
|
+
|
|
163
|
+
### 发布新版本
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
# 更新版本号(patch/minor/major)
|
|
167
|
+
npm version patch
|
|
168
|
+
|
|
169
|
+
# 推送 tag 触发自动发布
|
|
170
|
+
git push --follow-tags
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
发布需要在 GitHub 仓库设置中配置 `NPM_TOKEN` Secret。
|
|
174
|
+
|
|
175
|
+
## 📄 License
|
|
176
|
+
|
|
177
|
+
[MIT](LICENSE)
|