speccore 5.22.3 → 5.22.5

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.
Files changed (48) hide show
  1. package/README.en.md +47 -77
  2. package/README.md +53 -139
  3. package/dist/cli.js +38 -76
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/ask.js +5 -5
  6. package/dist/commands/ask.js.map +1 -1
  7. package/dist/commands/dev.d.ts +1 -0
  8. package/dist/commands/dev.d.ts.map +1 -1
  9. package/dist/commands/dev.js +51 -107
  10. package/dist/commands/dev.js.map +1 -1
  11. package/dist/commands/doc2spec.d.ts +1 -1
  12. package/dist/commands/doc2spec.d.ts.map +1 -1
  13. package/dist/commands/doc2spec.js +3 -3
  14. package/dist/commands/doc2spec.js.map +1 -1
  15. package/dist/commands/done.d.ts +1 -0
  16. package/dist/commands/done.d.ts.map +1 -1
  17. package/dist/commands/done.js +63 -11
  18. package/dist/commands/done.js.map +1 -1
  19. package/dist/commands/execute.d.ts +1 -0
  20. package/dist/commands/execute.d.ts.map +1 -1
  21. package/dist/commands/execute.js +197 -112
  22. package/dist/commands/execute.js.map +1 -1
  23. package/dist/commands/help.js +3 -3
  24. package/dist/commands/help.js.map +1 -1
  25. package/dist/commands/plan.d.ts +4 -1
  26. package/dist/commands/plan.d.ts.map +1 -1
  27. package/dist/commands/plan.js +93 -78
  28. package/dist/commands/plan.js.map +1 -1
  29. package/dist/commands/schedule.d.ts +5 -0
  30. package/dist/commands/schedule.d.ts.map +1 -1
  31. package/dist/commands/schedule.js +51 -2
  32. package/dist/commands/schedule.js.map +1 -1
  33. package/dist/commands/welcome.d.ts +1 -5
  34. package/dist/commands/welcome.d.ts.map +1 -1
  35. package/dist/commands/welcome.js +42 -156
  36. package/dist/commands/welcome.js.map +1 -1
  37. package/dist/core/plan-store.d.ts +47 -0
  38. package/dist/core/plan-store.d.ts.map +1 -0
  39. package/dist/core/plan-store.js +85 -0
  40. package/dist/core/plan-store.js.map +1 -0
  41. package/dist/core/schedule-engine.d.ts.map +1 -1
  42. package/dist/core/schedule-engine.js +16 -0
  43. package/dist/core/schedule-engine.js.map +1 -1
  44. package/dist/core/schedule-store.d.ts +2 -0
  45. package/dist/core/schedule-store.d.ts.map +1 -1
  46. package/dist/core/schedule-store.js +6 -0
  47. package/dist/core/schedule-store.js.map +1 -1
  48. package/package.json +1 -1
package/README.en.md CHANGED
@@ -1,99 +1,69 @@
1
1
  # SpecCore — Code by Spec, Not by Vibe
2
2
 
3
- SpecCore is a specification-driven development toolkit for AI-native teams. It orchestrates the full cycle: requirement analysis task splitting plan scheduling code generation archival handoff all traceable and automated.
3
+ **SpecCore is not a code generator it's a human-AI collaboration operating system.** It turns requirements, splitting, planning, execution, and delivery into a closed loop every step previewable and adjustable, ensuring human and AI reach consensus before a single line of code is written.
4
4
 
5
- ---
5
+ > Juggling 5 microservices and 3 frontend platforms? SpecCore turns requirements → splits → plans → code → delivery into a traceable, automated pipeline.
6
6
 
7
- ## Two Modes
8
-
9
- | | Simple (default) | Full |
10
- | :--- | :--- | :--- |
11
- | Commands | 17 core | 51 all |
12
- | For | Daily development | Fine-grained control |
13
- | Enable | `speccore init` | `speccore init --full` |
14
-
15
- **Simple mode commands:** `ask init iteration task doc2spec analyze split plan execute pr done change validate rename dev status-panel ops`
16
-
17
- ---
18
-
19
- ---
7
+ ```
8
+ init → doc2spec → analyze → split → plan → execute → pr → done
9
+ 🚀Setup 📝Import 🧠Analyze 📦Split 📋Plan 💻Build 🔀PR ✅Archive
10
+ ```
20
11
 
21
- ## Quick Start
12
+ ## 🚀 5 Minutes to First Task
22
13
 
23
14
  ```bash
24
15
  npm install -g speccore
25
- speccore init # Initialize
26
- speccore iteration create --name=Q1 # Create iteration
27
- speccore doc2spec -f PRD.md -p backend -i Q1 # Import requirements
28
- speccore analyze -I Q1 # Analyze (req+code, 3 scopes)
29
- speccore iteration split -i Q1 # Split into tasks
30
- speccore plan --iteration=Q1 # Generate plan
31
- speccore execute --task=Task-001 # AI development
32
- speccore pr --task=Task-001 # Create PR
33
- speccore done --task=Task-001 # Complete
16
+ speccore init
17
+ speccore doc2spec -f requirements.docx --iter=Q1 # Import PRD
18
+ speccore analyze -I Q1 # AI analysis + code health
19
+ speccore iteration split -I Q1 # Split into tasks
20
+ speccore plan -I Q1 # Generate plan
21
+ speccore execute -t Task-001 # AI-powered development
22
+ speccore done --task=Task-001 # Validate → archive
34
23
  ```
35
24
 
25
+ ## 🎯 What do you want to do?
36
26
 
37
- ## Two Ways to Use
38
-
39
- Same command, different syntax depending on context:
40
-
41
- | Context | Syntax | Example |
42
- |:---|:---|:---|
43
- | 🖥 Terminal CLI | `speccore <command>` | `speccore init` `speccore execute -t Task-001 --force` |
44
- | 💬 AI Chat | Natural language | "Create a login feature" |
45
- | 💬 AI Chat | `/spec-<command>` | `/spec-init` `/spec-execute Task-001` |
46
-
47
- > Full reference (all 17 commands classified) [Commands Reference — Two Ways to Use](docs/commands.en.md#-two-ways-to-use)
48
-
49
- ## Interactive Mode
50
-
51
- Key steps support `--interactive` for human-AI collaboration:
52
- `analyze --ask` `split --interactive` `plan --interactive` `change --interactive`
53
-
54
- ## Smart Entry
55
-
56
- ```bash
57
- speccore # Adaptive panel
58
- speccore "analyze specs" # Natural language (no subcommand needed)
59
- speccore dev # Auto-detect phase + cascade execute
60
- ```
27
+ | I want to... | Command |
28
+ |:---|:---|
29
+ | **Start a new project** | `speccore init --interactive` |
30
+ | **Import a PRD document** | `speccore doc2spec -f PRD.docx -I Q1` |
31
+ | **Analyze requirements + code health** | `speccore analyze -I Q1` |
32
+ | **Split requirements into tasks** | `speccore iteration split -I Q1 --interactive` |
33
+ | **Fix a bug** | `speccore task new -n "Login timeout" --type=bugfix` |
34
+ | **Batch fix bugs** | `speccore task new --batch-file=bugs.xlsx --type=bugfix` |
35
+ | **Schedule overnight execution** | `speccore schedule create --at "02:00" --all -I Q1` |
36
+ | **AI auto-development** | `speccore execute -t Task-001` |
37
+ | **Create a Pull Request** | `speccore pr --task=Task-001 --interactive` |
38
+ | **Archive a completed task** | `speccore done --task=Task-001 --interactive` |
39
+ | **Check project status** | `speccore` or `speccore status-panel` |
40
+ | **Natural language queries** | `speccore ask "analyze current requirements"` |
61
41
 
62
- ## Multi-Platform
42
+ > 📋 Full command reference → [Command Reference](docs/commands.en.md) | 中文文档 → [README.zh.md](README.md)
63
43
 
64
- All steps support parallel multi-project: backend services (`backend/room-service/`) and frontend platforms (`frontend/web/`, `frontend/h5/`).
44
+ ## 🤝 Interactive Mode
65
45
 
66
- ## Bug Fix
46
+ 6 commands support `--interactive` — preview changes before confirming:
67
47
 
68
- ```bash
69
- speccore task new --name="Login timeout" --desc="Token expiry" --type=bugfix # Single
70
- speccore task new --batch-file=bugs.xlsx --type=bugfix # Batch import
71
- speccore task new --batch-file=bugs.xlsx --type=bugfix --interactive # Confirm each
72
- ```
48
+ | `🧠 analyze --ask` | `🧠 split --interactive` | `🧠 plan --interactive` |
49
+ |:---|:---|:---|
50
+ | `🧠 pr --interactive` | `🧠 change --interactive` | `🧠 done --interactive` |
73
51
 
74
- ## Scheduled Execution
52
+ ## Scheduled Execution
75
53
 
76
54
  ```bash
77
- # Method 1: Mark tasks for queue, trigger manually
78
- speccore task new -n "Fix login timeout" --type=bugfix --schedule=night # Mark as queue
79
- speccore execute --all --scheduled # Run all queued tasks
80
-
81
- # Method 2: Precise time scheduling
82
- speccore schedule create --at "2026-08-10 21:00:00" -t Task-001 # Schedule single task
83
- speccore schedule create --at "2026-08-10 02:00:00" --all -i Q1 # Schedule all tasks
84
- speccore schedule list # View schedule queue
85
- speccore schedule cancel --id=sch-xxx # Cancel
86
- speccore schedule daemon start # Start daemon (auto-execute)
87
- speccore schedule daemon status # Check daemon status
55
+ speccore task new -n "Data migration" --schedule=night # Queue for night
56
+ speccore execute --all --scheduled # Run all queued
57
+ speccore schedule create --at "2026-08-10 02:00" --all -I Q1 # Exact time
58
+ speccore schedule daemon start # Auto-execute on schedule
88
59
  ```
89
60
 
90
- ## Documentation
61
+ ## 📚 Documentation
91
62
 
92
63
  | Doc | Content |
93
- | :--- | :--- |
94
- | 🚀 [Quick Start](docs/快速开始.md) | Full tutorial |
95
- | 🔧 [Full Command Reference](docs/命令参考.md) | 51 commands |
96
- | [Scenarios](docs/场景实战.md) | Typical use cases |
97
- | [Overview](docs/总览.md) | Architecture + concepts |
98
- | [SDD Methodology](docs/SDD方法论.md) | Why Spec-Driven Development |
99
- | [Examples](examples/meeting-system/README.md) | Meeting booking system demo |
64
+ |:---|:---|
65
+ | 🚀 [Quick Start](docs/quick-start.en.md) | Full tutorial |
66
+ | 🔧 [Command Reference](docs/commands.en.md) | All 51 commands |
67
+ | 🎬 [Scenarios](docs/scenarios.en.md) | Real-world examples |
68
+ | 🗺 [Overview](docs/总览.md) | Architecture & philosophy |
69
+ | 📝 [SDD Methodology](docs/sdd-methodology.en.md) | Spec-driven development |
package/README.md CHANGED
@@ -1,161 +1,75 @@
1
1
  # SpecCore — Code by Spec, Not by Vibe
2
2
 
3
- SpecCore 是一套面向 AI 原生团队的规范驱动研发工具链。将需求分析、任务拆分、计划编排、代码生成、归档交接串联为可追溯的自动化流程。
3
+ **SpecCore 是一套面向 AI 原生团队的规范驱动工具链。** 它用「Spec 先行」的方式把需求、拆分、计划、执行、交付串成一个闭环——人和 AI 在每个关键节点预览、调整、确认,生成的代码自然对齐需求。
4
4
 
5
- ---
5
+ > 同时维护 5 个微服务和 3 个前端平台?SpecCore 把「需求 → 拆分 → 计划 → 执行 → 交付」串成一条可追溯的自动化流水线。
6
6
 
7
- ---
8
-
9
- ## 两种模式
10
-
11
- | | 简洁模式(默认) | 全量模式 |
12
- | :--- | :--- | :--- |
13
- | 命令数 | 17 个核心命令 | 51 全部命令 |
14
- | 适用 | 日常开发够用 | 精细控制 |
15
- | 开启 | `speccore init` | `speccore init --full` |
16
- | 帮助 | `speccore --help` | 同上 |
17
-
18
- **简洁模式 17 个命令:**
19
7
  ```
20
- ask init iteration task doc2spec
21
- analyze split plan execute pr done
22
- change validate rename dev status-panel ops
8
+ initdoc2spec → analyze → split → plan → execute → pr → done
9
+ 🚀初始化 📝导入需求 🧠分析 📦拆分 📋计划 💻执行 🔀提交 ✅收尾
23
10
  ```
24
11
 
25
- ---
26
-
27
- ## 安装
12
+ ## 🚀 5 分钟体验
28
13
 
29
14
  ```bash
30
- npm install -g speccore
15
+ npm install -g speccore # 安装
16
+ speccore init # 初始化项目
17
+ speccore doc2spec -f PRD.docx --iter=Q1 # 导入需求文档
18
+ speccore analyze -I Q1 # AI 分析需求 + 代码检查
19
+ speccore iteration split -I Q1 # 拆分为独立 Task
20
+ speccore plan -I Q1 # 生成执行计划
21
+ speccore execute -t Task-001 # AI 自动开发
22
+ speccore done --task=Task-001 # 收尾归档
31
23
  ```
32
24
 
33
- ## 核心流程
34
-
35
- ```bash
36
- speccore init # ① 初始化
37
- speccore iteration create --name=Q1 # ② 新建期次
38
- speccore doc2spec -f PRD.md -p backend -i Q1 # ③ 导入需求文档
39
- speccore analyze -I Q1 # ④ 需求分析
40
- speccore analyze --scope global --depth deep # ④ 或:全局代码健康
41
- speccore iteration split -i Q1 # ⑤ 拆分 Task
42
- speccore plan -i Q1 # ⑥ 执行计划
43
- speccore execute -t Task-001 # ⑦ AI 开发
44
- speccore pr -t Task-001 # ⑧ 提交 PR
45
- speccore done -t Task-001 # ⑨ 完成任务
46
- ```
47
-
48
-
49
- ## 两种用法
25
+ ## 🎯 我想...
50
26
 
51
- 同一个命令有两种使用场景,写法不同:
52
-
53
- | 场景 | 写法 | 示例 |
27
+ | 我想... | 用这个 |
28
+ |:---|:---|
29
+ | **新建项目** | `speccore init --interactive` |
30
+ | **导入 PRD 文档** | `speccore doc2spec -f PRD.docx -I Q1` |
31
+ | **分析需求 + 代码健康** | `speccore analyze -I Q1` / `--scope global` |
32
+ | **拆分需求为 Task** | `speccore iteration split -I Q1 --interactive` |
33
+ | **生成执行计划** | `speccore plan -I Q1 --interactive` |
34
+ | **查看计划历史** | `speccore plan --list` / `plan --show plan-xxx` |
35
+ | **修复一个 Bug** | `speccore task new -n "登录超时" --type=bugfix` |
36
+ | **批量修复 Bug** | `speccore task new --batch-file=bugs.xlsx --type=bugfix` |
37
+ | **定时自动执行** | `speccore schedule create --at "02:00" --all -I Q1` |
38
+ | **AI 自动开发** | `speccore execute -t Task-001` / `--plan=plan-xxx` |
39
+ | **创建 Pull Request** | `speccore pr --task=Task-001 --interactive` |
40
+ | **收尾归档** | `speccore done --task=Task-001` / `done --all -I Q1 --interactive` |
41
+ | **查看到哪了** | `speccore status-panel` 或直接 `speccore` |
42
+ | **自然语言说需求** | `speccore ask "帮我分析当前需求"` |
43
+
44
+ > 📋 全部 51 个命令 → [命令参考手册](docs/命令参考.md)
45
+
46
+ ## 🤝 协作模式
47
+
48
+ 6 个命令支持 `--interactive` 人机协作,预览变更后才确认执行:
49
+
50
+ | `🧠 analyze --ask` | `🧠 split --interactive` | `🧠 plan --interactive` |
54
51
  |:---|:---|:---|
55
- | 🖥 终端 CLI | `speccore <命令>` | `speccore init` `speccore execute -t Task-001 --force` |
56
- | 💬 AI 对话 | 直接说人话 | "帮我创建登录功能" |
57
- | 💬 AI 对话 | `/spec-<命令>` | `/spec-init` `/spec-execute Task-001` |
58
-
59
- > 完整对照表(所有 17 个命令的分类说明)→ [命令参考 — 两种使用方式](docs/命令参考.md#-两种使用方式)
60
-
61
- ## 交互模式
62
-
63
- 关键步骤支持 `--interactive` 人机协作:
64
-
65
- | 命令 | 交互步骤 |
66
- | :--- | :--- |
67
- | `analyze --ask` | AI 提问 → 用户回答 → 调整分析 |
68
- | `split --interactive` | 预览 Task 列表 → 逐一确认/取消 |
69
- | `plan --interactive` | 预览调��方案 → 确认/取消 |
70
- | `change --interactive` | 预览影响范围 → 确认 → 应用 |
71
- | `pr --interactive` | 选文件 → commit → push → 创建 PR |
72
- | `done --interactive` | 预览步骤 → 跳过选项 → 确认执行 |
73
- | `init --interactive` | 选模式 → 确认 → 初始化 |
74
-
75
- ## 智能入口
76
-
77
- ```bash
78
- speccore # 自适应面板:检测当前阶段 → 提示下一步
79
- speccore ask "分析当前需求" # 自然语言意图识别
80
- speccore "帮我拆分任务" # 直接输入,无需子命令
81
- speccore dev # 一键级联:自动检测并执行下一步
82
- ```
83
-
84
- ## 多端支持
85
-
86
- 所有步骤原生支持多工程并行:后端多个服务(`backend/room-service/`、`backend/booking-service/`)、前端多个平台(`frontend/web/`、`frontend/h5/`)。
52
+ | `🧠 pr --interactive` | `🧠 change --interactive` | `🧠 done --interactive` |
87
53
 
88
- ## Bug 修复
54
+ ## 调度执行
89
55
 
90
- `task new --type=bugfix` 创建 Bug 任务,支持单条、批量、调度:
56
+ 指定时间自动执行。`--all` 会按依赖排序、分批执行当期次所有任务:
91
57
 
92
58
  ```bash
93
- speccore task new -n "登录超时" -d "Token 过期后未刷新" --type=bugfix # 单条
94
- speccore task new --batch-file=bugs.xlsx --type=bugfix # 批量导入
95
- speccore task new --batch-file=bugs.xlsx --type=bugfix --interactive # 逐条确认
96
- ```
97
-
98
- ## 调度执行
99
-
100
- 两种粒度的调度,支持指定任意时间:
101
-
102
- ```bash
103
- # ── 方式 1: 创建任务时标记 ──
104
- speccore task new -n "修复登录超时" --type=bugfix --schedule=night # 标记为 queue
105
- speccore execute --all --scheduled # 手动触发所有 queue 任务
106
-
107
- # ── 方式 2: 精确时间调度(支持人员、分批、类型等所有 execute 筛选参数)──
108
- speccore schedule create --at "2026-08-10 21:00:00" -t Task-001 # 单个任务定时
109
- speccore schedule create --at "2026-08-10 02:00:00" --all -i Q1 \
110
- -a 张三 --batch-size=3 --type=bugfix # 指定人员+分批+类型
111
- speccore schedule daemon start # 启动守护进程
112
- speccore schedule list # 查看队列
113
- speccore schedule cancel --id=sch-xxx # 取消
114
- ```
115
-
116
- `execute` 自动能力:
117
-
118
- | 能力 | 说明 |
119
- |:---|:---|
120
- | 依赖排序 | 自动分析 Task 间依赖关系,按拓扑顺序执行 |
121
- | 分批执行 | `--batch-size=3`(默认),每批做完再继续 |
122
- | 断点续传 | `--resume` 从上次中断位置继续 |
123
- | 多条件筛选 | `--priority high` `--type feature` `--platform web` 只跑指定条件 |
124
-
125
- > `execute --all` 跑 todo 任务,`execute --all --scheduled` 跑 queue 任务,互不干扰。
126
-
127
-
128
- ## 目录结构
129
-
130
- ```
131
- 项目/
132
- ├── .speccore/
133
- │ ├── CONSTITUTION.md # 技术宪法
134
- │ ├── GLOBAL/ # 全局层(架构文档、代码健康报告)
135
- │ └── RULES/ # 编码规则
136
-
137
- └── 期次-Q1/
138
- ├── 00-需求文档/ # 需求文档 + ANALYSIS.md
139
- ├── Task-001/
140
- │ ├── TASK.md
141
- │ ├── backend/{服务名}/ # 按服务分目录
142
- │ │ ├── TASK.md
143
- │ │ └── API_CONTRACT.yaml
144
- │ └── frontend/{平台}/ # 按平台分目录
145
- │ └── TASK.md
146
- └── Task-002/
59
+ speccore schedule create --at "2026-08-10 02:00:00" --all -I Q1 # 全部任务,自动排序
60
+ speccore schedule create --at "2026-08-10 21:00:00" -t Task-001 # 单个任务
61
+ speccore schedule create --at "02:00" --all -I Q1 -a 张三 --type=bugfix # 筛选后执行
62
+ speccore schedule daemon start # 启动守护进程
147
63
  ```
148
64
 
149
- ---
65
+ > 不需要手动 `plan`——`execute` 自动分析 Task 依赖,按拓扑顺序分批执行。`--batch-size=3` 控制每批数量。
150
66
 
151
- ## 文档
67
+ ## 📚 了解更多
152
68
 
153
69
  | 文档 | 内容 |
154
- | :--- | :--- |
155
- | 🚀 [快速开始](docs/快速开始.md) | 完整安装 → 使用教程 |
156
- | 🔧 [全量命令参考](docs/命令参考.md) | 51 命令完整说明(高级用户) |
157
- | [场景实战](docs/场景实战.md) | 日常开发典型场景 |
158
- | [总览](docs/总览.md) | 架构概览 + 理念 |
159
- | [SDD 方法论](docs/SDD方法论.md) | 规范驱动开发介绍 |
160
- | [Spec 加载机制](docs/Spec三层加载机制.md) | 三层 Spec 协同 |
161
- | [示例项目](examples/meeting-system/README.md) | 会议预订系统完整演示 |
70
+ |:---|:---|
71
+ | 🚀 [快速开始](docs/快速开始.md) | 完整安装与使用教程 |
72
+ | 🔧 [命令参考](docs/命令参考.md) | 51 个命令完整说明 |
73
+ | 🎬 [场景实战](docs/场景实战.md) | 33 个真实开发场景 |
74
+ | 🗺 [总览](docs/总览.md) | 架构概览与设计理念 |
75
+ | 📝 [SDD 方法论](docs/SDD方法论.md) | 规范驱动开发介绍 |