speccore 5.25.2 → 5.26.3

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 (62) hide show
  1. package/README.md +115 -73
  2. package/dist/cli.js +123 -45
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/ask.d.ts +4 -5
  5. package/dist/commands/ask.d.ts.map +1 -1
  6. package/dist/commands/ask.js +257 -292
  7. package/dist/commands/ask.js.map +1 -1
  8. package/dist/commands/dashboard.d.ts +12 -0
  9. package/dist/commands/dashboard.d.ts.map +1 -1
  10. package/dist/commands/dashboard.js +442 -77
  11. package/dist/commands/dashboard.js.map +1 -1
  12. package/dist/commands/dev.d.ts +2 -0
  13. package/dist/commands/dev.d.ts.map +1 -1
  14. package/dist/commands/dev.js +292 -292
  15. package/dist/commands/dev.js.map +1 -1
  16. package/dist/commands/doc2spec.d.ts +2 -0
  17. package/dist/commands/doc2spec.d.ts.map +1 -1
  18. package/dist/commands/doc2spec.js +22 -6
  19. package/dist/commands/doc2spec.js.map +1 -1
  20. package/dist/commands/help.d.ts.map +1 -1
  21. package/dist/commands/help.js +47 -9
  22. package/dist/commands/help.js.map +1 -1
  23. package/dist/commands/init.js +42 -10
  24. package/dist/commands/init.js.map +1 -1
  25. package/dist/commands/spec2doc.d.ts +11 -0
  26. package/dist/commands/spec2doc.d.ts.map +1 -0
  27. package/dist/commands/spec2doc.js +183 -0
  28. package/dist/commands/spec2doc.js.map +1 -0
  29. package/dist/commands/status-panel.d.ts +1 -0
  30. package/dist/commands/status-panel.d.ts.map +1 -1
  31. package/dist/commands/status-panel.js +97 -3
  32. package/dist/commands/status-panel.js.map +1 -1
  33. package/dist/commands/welcome.d.ts +10 -0
  34. package/dist/commands/welcome.d.ts.map +1 -1
  35. package/dist/commands/welcome.js +77 -30
  36. package/dist/commands/welcome.js.map +1 -1
  37. package/dist/core/ask-engine.d.ts +45 -0
  38. package/dist/core/ask-engine.d.ts.map +1 -0
  39. package/dist/core/ask-engine.js +405 -0
  40. package/dist/core/ask-engine.js.map +1 -0
  41. package/dist/core/ask-host-ai.d.ts +33 -0
  42. package/dist/core/ask-host-ai.d.ts.map +1 -0
  43. package/dist/core/ask-host-ai.js +156 -0
  44. package/dist/core/ask-host-ai.js.map +1 -0
  45. package/dist/core/ask-llm.d.ts +12 -0
  46. package/dist/core/ask-llm.d.ts.map +1 -0
  47. package/dist/core/ask-llm.js +166 -0
  48. package/dist/core/ask-llm.js.map +1 -0
  49. package/dist/core/dev-llm.d.ts +34 -0
  50. package/dist/core/dev-llm.d.ts.map +1 -0
  51. package/dist/core/dev-llm.js +209 -0
  52. package/dist/core/dev-llm.js.map +1 -0
  53. package/dist/core/help-panel.d.ts +1 -1
  54. package/dist/core/help-panel.d.ts.map +1 -1
  55. package/dist/core/help-panel.js +6 -5
  56. package/dist/core/help-panel.js.map +1 -1
  57. package/dist/core/intent-recognition.js +3 -3
  58. package/dist/core/intent-recognition.js.map +1 -1
  59. package/dist/utils/logger.d.ts.map +1 -1
  60. package/dist/utils/logger.js +5 -2
  61. package/dist/utils/logger.js.map +1 -1
  62. package/package.json +1 -1
package/README.md CHANGED
@@ -1,93 +1,135 @@
1
1
  # SpecCore — Code by Spec, Not by Vibe
2
2
 
3
- **SpecCore 是一套面向 AI 原生团队的规范驱动工具链。** 它用「Spec 先行」的方式把需求、拆分、计划、执行、交付串成一个闭环——人和 AI 在每个关键节点预览、调整、确认,生成的代码自然对齐需求。
4
-
5
- > v5.25.1 | [更新日志](CHANGELOG.md) | [English](README.en.md)
6
-
7
- ```
8
- init → iteration create → doc2spec → analyze → split → plan → execute → pr → done
9
- 🚀初始化 📅创建期次 📝导入需求 🧠AI分析 📦智能拆分 📋计划 💻执行 🔀提交 ✅收尾
10
- ```
11
-
12
- ## 🚀 5 分钟体验
3
+ 🖥️ 规范驱动开发 CLI · 20 命令(55 全量)· 人机协同闭环 · 三层 AI 架构
13
4
 
14
5
  ```bash
15
- npm install -g speccore # 安装
16
- speccore init # 初始化(CONSTITUTION+Git配置)
17
- speccore iteration create -n Q1 --owner=张三 # 创建期次(自动生成STAFFING.md)
18
- speccore doc2spec -f PRD.docx -I Q1 # 导入需求到 00-产品需求/
19
- speccore analyze -I Q1 # AI分析(改动范围+风险+变更预测)
20
- speccore iteration split -i Q1 --interactive # 智能拆分(复杂度+优先级+人员分配)
21
- speccore plan -I Q1 # 生成执行计划
22
- speccore execute -t Task-001 # 执行(自动建分支+依赖感知)
23
- speccore done --task=Task-001 # 收尾归档
6
+ speccore ask "我想做一个登录功能,计划晚8点分批执行"
24
7
  ```
25
8
 
26
- ## 📂 目录结构 (v5.25)
9
+ ---
10
+
11
+ ## 架构概览
27
12
 
28
13
  ```
29
- 项目根/
30
- ├── .speccore/CONSTITUTION.md ← 项目信息 + 技术栈 + Git分支策略
31
- └── 期次-Q1/
32
- ├── STAFFING.md ← 人员排期(每期可不同)
33
- ├── 00-产品需求/ ← 产品原始需求(按端分目录,只读)
34
- │ ├── backend/ ← 后台端
35
- │ ├── frontend/Web/ ← Web端
36
- │ ├── frontend/小程序/ ← 小程序端
37
- └── _shared/ ← 跨端共用
38
- ├── 00-需求文档/ ← Analyzer 生成(ANALYSIS+TECH+TEST+...)
39
- ├── 00-期次总览/PROJECT_GRAPH.md ← 任务总览 + 默认分支
40
- └── Task-001~004/ 拆分后任务
14
+ speccore ask ←── 万能 AI 入口 ──→ speccore dev (智能级联)
15
+ │ │
16
+ ├─ 📖 命令解释 "dashboard 怎么用" ├─ 🏗️ 初始化
17
+ ├─ 🗺️ 任务指引 "我想做登录" ├─ 📝 导入需求
18
+ ├─ 🎯 意图匹配 "查看进度" ├─ 🧠 AI 分析
19
+ └─ ⚡ 复杂编排 "计划→定时→分批" ├─ 📦 拆分任务
20
+ ├─ ⚡ 执行开发
21
+ ┌─────────────────────────────┐ ├─ 🔀 提交 PR
22
+ speccore dashboard │ └─ ✅ 归档收尾
23
+ │ ─ 全局仪表盘 (7 大维度) │
24
+ │ ─ 9 主题 / 中英文 / 字号 │
25
+ │ ─ F 键全屏 / 四边扫描线 │
26
+ └─────────────────────────────┘
41
27
  ```
42
28
 
43
- ## 🎯 我想...
29
+ ## 快速开始
44
30
 
45
- | 我想... | 用这个 |
46
- |:---|:---|
47
- | **新建项目** | `speccore init --interactive` |
48
- | **导入 PRD 文档** | `speccore doc2spec -f PRD.docx -I Q1` |
49
- | **分析需求 + 代码健康** | `speccore analyze -I Q1` / `--scope global` |
50
- | **拆分需求为 Task** | `speccore iteration split -I Q1 --interactive` |
51
- | **生成执行计划** | `speccore plan -I Q1 --interactive` |
52
- | **查看计划历史** | `speccore plan --list` / `plan --show plan-xxx` |
53
- | **修复一个 Bug** | `speccore task new -n "登录超时" --type=bugfix` |
54
- | **批量修复 Bug** | `speccore task new --batch-file=bugs.xlsx --type=bugfix` |
55
- | **定时自动执行** | `speccore schedule create --at "02:00" --all -I Q1` |
56
- | **AI 自动开发** | `speccore execute -t Task-001` / `--plan=plan-xxx` |
57
- | **创建 Pull Request** | `speccore pr --task=Task-001 --interactive` |
58
- | **收尾归档** | `speccore done --task=Task-001` / `done --all -I Q1 --interactive` |
59
- | **查看到哪了** | `speccore status-panel` 或直接 `speccore` |
60
- | **自然语言说需求** | `speccore ask "帮我分析当前需求"` |
61
-
62
- > 📋 全部 44 个命令 → [命令参考手册](docs/命令参考.md)
31
+ ```bash
32
+ npm install -g speccore
33
+ speccore init # 初始化项目
34
+ speccore welcome # 查看项目名片
35
+ speccore ask "查看进度" # AI 万能入口
36
+ speccore dev --auto # 智能级联一键推进
37
+ ```
63
38
 
64
- ## 🤝 协作模式
39
+ ## 核心能力
40
+
41
+ ### 🧠 ask — AI 万能入口
42
+ 4 种模式自动识别,无需记忆命令:
43
+ - **📖 命令解释**:`speccore ask "dashboard 怎么用"`
44
+ - **🗺️ 任务指引**:`speccore ask "我想做一个支付功能"` → 8 步全流程
45
+ - **🎯 意图匹配**:`speccore ask "查看进度"` → 自动匹配 dashboard
46
+ - **⚡ 复杂编排**:`speccore ask "计划任务,晚8点分批执行"` → plan→schedule→execute
47
+
48
+ ### 📊 dashboard — 全局仪表盘
49
+ `speccore dashboard --scope global` 生成 Jira 标准 7 维度 HTML 看板:
50
+ - 需求状态分布(饼图)+ 项目需求分布(柱状图)+ Created vs Resolved
51
+ - 项目健康度评分 + 期次进度条 + 需求详情表(按期次倒序)
52
+ - 9 套主题、中英文切换、字体/字号调节、F 键全屏、四边脉冲扫描线
53
+
54
+ ### 🔄 dev — 智能级联
55
+ 自动检测项目阶段,一键推进:`speccore dev --auto`
56
+
57
+ ### 🚀 全量流水线
58
+ | 阶段 | 命令 | AI 模式 |
59
+ |------|------|------|
60
+ | 导入需求 | `doc2spec -f PRD.docx` | 📖 命令解释 |
61
+ | AI 分析 | `analyze --audit` | 🗺️ 任务指引 |
62
+ | 拆分任务 | `split` | 🎯 意图匹配 |
63
+ | 执行计划 | `plan --all` | ⚡ 复杂编排 |
64
+ | 开发执行 | `execute --batch-size 3` | ⚡ 复杂编排 |
65
+ | 提交 PR | `pr --auto` | 🎯 意图匹配 |
66
+ | 归档收尾 | `done --all` | 🎯 意图匹配 |
67
+
68
+ ## 安装 & 环境
65
69
 
66
- 6 个命令支持 `--interactive` 人机协作,预览变更后才确认执行:
70
+ ```bash
71
+ npm install -g speccore
72
+ speccore --version # v5.26.2
73
+ ```
67
74
 
68
- | `🧠 analyze --interactive` | `🧠 split --interactive` | `🧠 plan --interactive` |
69
- |:---|:---|:---|
70
- | `🧠 pr --interactive` | `🧠 change --interactive` | `🧠 done --interactive` |
75
+ ## 命令列表
76
+
77
+ | 命令 | 别名 | 功能 |
78
+ |------|------|------|
79
+ | `ask` | — | 🧠 万能 AI 入口(4 模式) |
80
+ | `welcome` | — | 🏷️ 项目名片 + 使用引导 |
81
+ | `dashboard` | `db` | 📊 期次/全局仪表盘 |
82
+ | `dev` | `d` | 🔄 智能级联流水线 |
83
+ | `init` | `in` | 🏗️ 项目初始化 |
84
+ | `doc2spec` | `d2s` | 📝 PRD→SpecCore MD |
85
+ | `spec2doc` | `s2d` | 📤 SpecCore MD→Word/PDF/HTML |
86
+ | `analyze` | `al` | 🧠 AI 需求分析 |
87
+ | `split` | — | 📦 需求拆分 |
88
+ | `plan` | `pl` | 📐 执行计划 |
89
+ | `execute` | `ex` | ⚡ 执行开发 |
90
+ | `pr` | `mr` | 🔀 Pull Request |
91
+ | `done` | `dn` | ✅ 归档收尾 |
92
+ | `change` | `ch` | 🔄 需求变更 |
93
+ | `sync` | `sy` | 🔄 双向同步 |
94
+ | `validate` | `vl` | ✅ 合规验证 |
95
+ | `track` | `trk` | 🔗 REQ→Task→Code 全链路 |
96
+ | `search` | `sh` | 🔍 跨 Spec 全文搜索 |
97
+ | `rename` | `rn` | ✏️ 重命名 |
98
+ | `ops` | `op` | 📜 操作历史 |
99
+
100
+ ## TTY 智能适配
101
+
102
+ 所有 AI 命令 (`ask`, `welcome`, `dev`, `dashboard`, `help`) 自动检测环境:
103
+ - **终端**:Unicode 框线美化输出
104
+ - **AI 调用**:自动生成 Ocean 主题 HTML 页面(四边脉冲扫描线)
105
+
106
+ ## 🤖 三层 AI 架构
71
107
 
72
- ## ⏰ 调度执行
108
+ ```
109
+ speccore ask "..." / speccore dev
110
+ ├─ 🧠 自有 LLM → OpenAI / Ollama(SPECCORE_LLM_KEY 环境变量)
111
+ ├─ 🤖 宿主 AI → WorkBuddy / TRAE / Qoder(自动检测)
112
+ └─ 📐 规则引擎 → 18 条命令 KB + 4 预定义工作流(永远可用)
113
+ ```
73
114
 
74
- 指定时间自动执行。`--all` 会按依赖排序、分批执行当期次所有任务:
115
+ 零配置:没配 Key 自动降级,功能不受影响。
75
116
 
76
- ```bash
77
- speccore schedule create --at "2026-08-10 02:00:00" --all -I Q1 # 全部任务,自动排序
78
- speccore schedule create --at "2026-08-10 21:00:00" -t Task-001 # 单个任务
79
- speccore schedule create --at "02:00" --all -I Q1 -a 张三 --type=bugfix # 筛选后执行
80
- speccore schedule daemon start # 启动守护进程
81
- ```
117
+ ## 📖 文档
82
118
 
83
- > 不需要手动 `plan`——`execute` 自动分析 Task 依赖,按拓扑顺序分批执行。`--batch-size=3` 控制每批数量。
119
+ | 文档 | 说明 |
120
+ |------|------|
121
+ | [快速开始](docs/快速开始.md) | 5 分钟上手,安装 → 完整流程 |
122
+ | [命令参考](docs/命令参考.md) | 全部 20 命令 + 子命令 + 示例 |
123
+ | [总览](docs/总览.md) | 核心概念 + 工作流 + 三种使用方式 |
124
+ | [场景实战](docs/场景实战.md) | 35 个真实开发场景 |
125
+ | [SDD 方法论](docs/SDD方法论.md) | 规范驱动开发理念 |
126
+ | [工作空间组织](docs/工作空间组织.md) | 目录结构与文件规范 |
127
+ | [工具适配说明](docs/工具适配说明.md) | Qoder/TRAE 等 AI 工具集成 |
128
+ | [三层加载机制](docs/Spec三层加载机制.md) | GLOBAL/ITERATION/TASK 加载原理 |
129
+ | [CI-CD 集成](docs/CI-CD与spec注释集成指南.md) | CI/CD 流水线 + Spec 注释 |
130
+ | [迁移指南](docs/migration-guide.md) | 从旧版本升级 |
131
+ | [CHANGELOG](CHANGELOG.md) | 版本历史 |
84
132
 
85
- ## 📚 了解更多
133
+ ## 许可
86
134
 
87
- | 文档 | 内容 |
88
- |:---|:---|
89
- | 🚀 [快速开始](docs/快速开始.md) | 完整安装与使用教程 |
90
- | 🔧 [命令参考](docs/命令参考.md) | 44 个命令完整说明 |
91
- | 🎬 [场景实战](docs/场景实战.md) | 34 个真实开发场景 |
92
- | 🗺 [总览](docs/总览.md) | 架构概览与设计理念 |
93
- | 📝 [SDD 方法论](docs/SDD方法论.md) | 规范驱动开发介绍 |
135
+ MIT © 2026 SpecCore Team
package/dist/cli.js CHANGED
@@ -39,7 +39,11 @@ const fs_1 = require("fs");
39
39
  const path_1 = require("path");
40
40
  const init_1 = require("./commands/init");
41
41
  const validate_1 = require("./commands/validate");
42
+ const archive_1 = require("./commands/archive");
43
+ const progress_1 = require("./commands/progress");
44
+ const report_1 = require("./commands/report");
42
45
  const config_1 = require("./commands/config");
46
+ const create_1 = require("./commands/iteration/create");
43
47
  const split_1 = require("./commands/iteration/split");
44
48
  const new_1 = require("./commands/task/new");
45
49
  const plan_1 = require("./commands/plan");
@@ -57,9 +61,10 @@ const dev_1 = require("./commands/dev");
57
61
  const welcome_1 = require("./commands/welcome");
58
62
  const status_panel_1 = require("./commands/status-panel");
59
63
  const doc2spec_1 = require("./commands/doc2spec");
64
+ const spec2doc_1 = require("./commands/spec2doc");
60
65
  // 全量层命令
61
66
  const iteration_from_global_1 = require("./commands/iteration-from-global");
62
- const global_status_1 = require("./commands/global-status");
67
+ const sync_global_1 = require("./commands/sync-global");
63
68
  // P0/P1/P2 新增命令
64
69
  const impact_1 = require("./commands/impact");
65
70
  const baseline_1 = require("./commands/baseline");
@@ -118,8 +123,8 @@ function readMode() {
118
123
  const MODE = readMode();
119
124
  /** 简洁模式下在 help 中显示的命令 */
120
125
  const SIMPLE_COMMANDS = new Set([
121
- 'ask', 'init', 'doc2spec', 'analyze', 'split', 'execute',
122
- 'pr', 'done', 'status-panel', 'dev',
126
+ 'ask', 'welcome', 'init', 'doc2spec', 'spec2doc', 'dashboard', 'analyze', 'split', 'execute',
127
+ 'pr', 'done', 'dev', 'sync', 'search', 'track',
123
128
  'iteration', 'task', 'plan', 'ops', 'change', 'validate', 'rename',
124
129
  ]);
125
130
  /** 简洁模式下过滤 help 命令列表 */
@@ -139,25 +144,31 @@ commander_1.program
139
144
  // 👋 引导与体验
140
145
  // ================================================================
141
146
  commander_1.program
142
- .command('status-panel')
143
- .alias('sp')
144
- .description('项目状态总览:进度+健康度+生命周期(合并 status/health/lifecycle)')
147
+ .command('dashboard')
148
+ .alias('db')
149
+ .description('项目仪表盘:期次状态+进度+健康度(--scope global 全量视图)')
145
150
  .option('--export <format>', 'Export: json | md | html')
146
151
  .option("--assignee <name>", "导出指定人员的统计")
147
152
  .option("--platform <platform>", "导出指定平台: backend | frontend | web | h5 | miniapp")
148
153
  .option("--type <type>", "导出指定类型: feature | bugfix | research")
149
154
  .option('--health', '项目健康度报告')
150
155
  .option('--lifecycle', '任务生命周期看板(等效 lifecycle --all)')
156
+ .option('--scope <scope>', '视图: iteration(默认/当前期次) | global(全量)', 'iteration')
151
157
  .action(status_panel_1.statusPanelCommand);
158
+ commander_1.program
159
+ .command('status-panel')
160
+ .alias('sp')
161
+ .description('→ dashboard(同一命令)')
162
+ .action((opts) => (0, status_panel_1.statusPanelCommand)(opts));
152
163
  commander_1.program
153
164
  .command('dev')
154
165
  .alias('d')
155
166
  .description('智能级联:--auto 全自动流水线,--from/--to 指定起止阶段')
156
167
  .option('-i, --iteration <iteration>', 'Target iteration')
157
168
  .option('--force', 'Auto-execute without confirmation')
158
- .option('--auto', '全自动流水线:init→doc2spec→analyze→split→plan→execute→pr→done')
159
- .option('--from <phase>', '从指定阶段开始(init/doc2spec/analyze/split/plan/execute/pr/done)')
160
- .option('--to <phase>', '到指定阶段结束(init/doc2spec/analyze/split/plan/execute/pr/done)')
169
+ .option('--auto', '全自动流水线:init→doc2spec→analyze→split→plan→execute→pr→done→spec2doc')
170
+ .option('--from <phase>', '从指定阶段开始(init/doc2spec/analyze/split/plan/execute/pr/done/spec2doc)')
171
+ .option('--to <phase>', '到指定阶段结束(init/doc2spec/analyze/split/plan/execute/pr/done/spec2doc)')
161
172
  .action(dev_1.devCommand);
162
173
  commander_1.program;
163
174
  // ================================================================
@@ -166,9 +177,9 @@ commander_1.program;
166
177
  commander_1.program
167
178
  .command('init')
168
179
  .alias('in')
169
- .description('初始化 SpecCore(17命令/44全量,--interactive 引导式)')
180
+ .description('初始化 SpecCore(17命令/58全量,--interactive 引导式)')
170
181
  .option('--mode <mode>', 'Initialization mode: fresh or migration', 'fresh')
171
- .option('--full', 'Full mode: all 45 commands (default: simple)')
182
+ .option('--full', 'Full mode: all 58 commands (default: simple)')
172
183
  .option('--force', 'Force overwrite existing configuration')
173
184
  .option('--interactive', 'Interactive guided setup: mode → confirm → init')
174
185
  .option('--auto', '全自动流水线:无人干预级联执行全部阶段')
@@ -180,8 +191,16 @@ commander_1.program
180
191
  const iterationCmd = commander_1.program
181
192
  .command('iteration')
182
193
  .alias('it')
183
- .description('Iteration management commands');
184
- iterationCmd;
194
+ .description('期次管理:创建/拆分/列表');
195
+ iterationCmd
196
+ .command('create')
197
+ .alias('c')
198
+ .description('创建新期次')
199
+ .option('-n, --name <name>', '期次名称(必填)')
200
+ .option('--from <phase>', '从指定阶段开始')
201
+ .option('--to <phase>', '到指定阶段结束')
202
+ .option('--owner <name>', '负责人')
203
+ .action(create_1.iterationCreateCommand);
185
204
  iterationCmd
186
205
  .command('split')
187
206
  .alias('sp')
@@ -203,8 +222,23 @@ iterationCmd
203
222
  const taskCmd = commander_1.program
204
223
  .command('task')
205
224
  .alias('tk')
206
- .description('Task management commands');
207
- taskCmd;
225
+ .description('任务管理:创建/列表/状态');
226
+ taskCmd
227
+ .command('new')
228
+ .alias('n')
229
+ .description('创建新任务')
230
+ .option('-n, --name <name>', '任务名称(必填)')
231
+ .option('-t, --type <type>', '任务类型: feature|bugfix|research', 'feature')
232
+ .option('-d, --desc <desc>', '任务描述')
233
+ .option('--platforms <platforms>', '前端平台: web,h5,miniapp')
234
+ .option('--backend-only', '仅后端')
235
+ .option('--frontend-only', '仅前端')
236
+ .option('-i, --iteration <iteration>', '目标期次')
237
+ .option('--batch <tasks>', '批量创建')
238
+ .option('--batch-file <path>', '从文件批量导入')
239
+ .option('--interactive', '交互式创建')
240
+ .option('--schedule <mode>', '调度模式: night|now', 'now')
241
+ .action(new_1.taskNewCommand);
208
242
  // 完整需求交付
209
243
  commander_1.program;
210
244
  // Bug 修复
@@ -313,7 +347,7 @@ commander_1.program
313
347
  commander_1.program
314
348
  .command('validate')
315
349
  .alias('vl')
316
- .description('Validate Spec compliance and integrity')
350
+ .description('合规验证:检查 Spec 完整性与一致性')
317
351
  .option('-i, --iteration <iteration>', 'Target iteration')
318
352
  .option('-t, --task <task>', 'Validate specific task')
319
353
  .option('--type <type>', 'Filter by task type')
@@ -340,6 +374,27 @@ commander_1.program
340
374
  .description('项目健康度 → status-panel --health')
341
375
  .option('-i, --iteration <iteration>', 'Target iteration')
342
376
  .action((opts) => (0, status_panel_1.statusPanelCommand)({ ...opts, health: true }));
377
+ commander_1.program
378
+ .command('progress')
379
+ .alias('pg')
380
+ .description('查看期次进度:任务完成率 + 各阶段统计')
381
+ .option('-i, --iteration <iteration>', 'Target iteration')
382
+ .option('-a, --assignee <assignee>', 'Filter by assignee')
383
+ .option('-t, --type <type>', 'Filter by task type')
384
+ .option('--detail', 'Show per-task detail')
385
+ .option('--format <format>', 'Output format: text, json', 'text')
386
+ .action(progress_1.progressCommand);
387
+ commander_1.program
388
+ .command('report')
389
+ .alias('rp')
390
+ .description('生成项目报告:团队/风险/趋势分析')
391
+ .option('-i, --iteration <iteration>', 'Target iteration')
392
+ .option('--format <format>', 'Output format: md, html, pdf', 'md')
393
+ .option('-o, --output <path>', 'Output file path')
394
+ .option('--team', 'Include team performance report')
395
+ .option('--risk', 'Include risk analysis')
396
+ .option('--trend', 'Include trend analysis')
397
+ .action(report_1.reportCommand);
343
398
  // ================================================================
344
399
  // 📦 归档与交接
345
400
  // ================================================================
@@ -352,7 +407,17 @@ commander_1.program
352
407
  .option('-o, --output <path>', 'Output file path')
353
408
  .option('--format <format>', 'Output format: md', 'md')
354
409
  .action(handover_1.handoverCommand);
355
- commander_1.program;
410
+ commander_1.program
411
+ .command('archive')
412
+ .alias('ar')
413
+ .description('归档任务:移至 archive/ 或从归档恢复')
414
+ .option('-t, --task <task>', 'Target task')
415
+ .option('-i, --iteration <iteration>', 'Target iteration')
416
+ .option('--all', 'Archive all completed tasks')
417
+ .option('--list', 'List archived tasks')
418
+ .option('--restore <task>', 'Restore from archive')
419
+ .option('--force', 'Skip confirmation')
420
+ .action(archive_1.archiveCommand);
356
421
  // ================================================================
357
422
  // ⚙️ 配置与工具
358
423
  // ================================================================
@@ -411,12 +476,26 @@ commander_1.program
411
476
  commander_1.program
412
477
  .command('doc2spec')
413
478
  .alias('d2s')
414
- .description('导入 PRD 文档 → SpecCore Markdown(支持 Word/PDF/MD/HTML/PPTX)')
479
+ .description('导入 PRD/文档 → SpecCore MD(双路验证:AI + Pandoc)')
415
480
  .option('-f, --file <path>', '源文件路径')
416
481
  .option('--iter <name>', '目标期次(必填)')
417
482
  .option('-p, --platform <name>', '平台标识(backend / frontend-web / frontend-h5)')
483
+ .option('--task <task>', '导入到指定 Task 目录')
418
484
  .option('--files <files>', '批量: "a.docx=平台1,b.pdf=平台2"')
485
+ .option('--no-ai', '纯 pandoc 机械转换(终端快速模式)')
419
486
  .action(doc2spec_1.doc2specCommand);
487
+ commander_1.program
488
+ .command('spec2doc')
489
+ .alias('s2d')
490
+ .description('SpecCore MD → Word/PDF/HTML/PPTX 导出')
491
+ .option('-i, --iteration <name>', '目标期次')
492
+ .option('-t, --task <task>', '导出指定任务文档')
493
+ .option('-f, --file <path>', '直接导出指定 .md 文件(相对/绝对路径)')
494
+ .option('--format <format>', '输出格式: docx|pdf|html|pptx', 'docx')
495
+ .option('-o, --output <path>', '输出文件路径')
496
+ .option('--all', '导出期次全部文档(合并)')
497
+ .option('--no-ai', '纯 pandoc 导出(终端快速模式)')
498
+ .action(spec2doc_1.spec2docCommand);
420
499
  // ================================================================
421
500
  // 📦 模式保存
422
501
  // ================================================================
@@ -449,13 +528,22 @@ commander_1.program
449
528
  commander_1.program
450
529
  .command('global-status')
451
530
  .alias('gs')
452
- .description('View global layer status: all projects, requirements, architecture')
453
- .option('--project <name>', 'Filter by project name')
454
- .action(global_status_1.globalStatusCommand);
531
+ .description(' dashboard --scope global')
532
+ .action(() => (0, status_panel_1.statusPanelCommand)({ scope: 'global' }));
533
+ commander_1.program
534
+ .command('sync-global')
535
+ .alias('syg')
536
+ .description('期次 ↔ 全量层双向同步')
537
+ .option('-i, --iteration <iteration>', 'Target iteration')
538
+ .option('-d, --direction <dir>', 'Sync direction: to_global | from_global', 'to_global')
539
+ .option('--auto', 'Auto-apply without confirmation')
540
+ .option('--dry-run', 'Preview without modifying')
541
+ .option('--force', 'Skip confirmation')
542
+ .action(sync_global_1.syncGlobalCommand);
455
543
  commander_1.program
456
544
  .command('ops')
457
545
  .alias('op')
458
- .description('View operation history (command log)')
546
+ .description('操作历史:查看命令执行日志')
459
547
  .action(history_1.opsCommand);
460
548
  commander_1.program;
461
549
  // ================================================================
@@ -505,7 +593,7 @@ commander_1.program
505
593
  commander_1.program
506
594
  .command('rename')
507
595
  .alias('rn')
508
- .description('Rename iteration or task, auto-update all references')
596
+ .description('重命名期次/任务,自动更新所有关联引用')
509
597
  .option('--target <name>', 'Current name (required for single rename)')
510
598
  .option('--new-name <name>', 'New name (required for single rename)')
511
599
  .option('--batch', 'Batch rename mode')
@@ -516,25 +604,6 @@ commander_1.program
516
604
  .option('--from <phase>', '从指定阶段开始(init/analyze/split/plan/execute/pr/done)')
517
605
  .action(rename_1.renameCommand);
518
606
  // ================================================================
519
- // 🆕 v4.0.0 新增命令
520
- // ================================================================
521
- commander_1.program
522
- .description('快捷创建 Task(同 task new)')
523
- .option('-n, --name <name>', 'Task name (required)')
524
- .option('-t, --type <type>', 'Task type', 'feature')
525
- .option('-d, --desc <desc>', 'Task description')
526
- .option('--platforms <platforms>', 'Frontend platforms: web,h5,miniapp')
527
- .option('--backend-only', 'Create backend only')
528
- .option('--frontend-only', 'Create frontend only')
529
- .option('-i, --iteration <iteration>', 'Target iteration')
530
- .option('--batch <tasks>', '批量:换行分隔的多个任务描述')
531
- .option('--batch-file <path>', '从 Excel/CSV 文件批量导入')
532
- .option('--interactive', 'Preview → edit → confirm → create')
533
- .option('--schedule <mode>', '调度模式:night / now', 'now')
534
- .action(new_1.taskNewCommand);
535
- commander_1.program;
536
- commander_1.program;
537
- // ================================================================
538
607
  // 快捷别名(顶层别名)
539
608
  // ================================================================
540
609
  // 为常用命令提供顶层快捷访问
@@ -624,6 +693,15 @@ commander_1.program
624
693
  .option('--task <id>', 'Trace from task ID')
625
694
  .option('--full', 'Full project trace')
626
695
  .action(trace_1.traceCommand);
696
+ // v5.25 — 统一追踪入口
697
+ commander_1.program
698
+ .command('track')
699
+ .alias('trk')
700
+ .description('合并 trace + tracker: REQ→Task→Code 全链路追踪')
701
+ .option('--req <id>', 'Trace from requirement ID')
702
+ .option('--task <id>', 'Trace from task ID')
703
+ .option('--full', 'Full project trace')
704
+ .action(trace_1.traceCommand);
627
705
  // v5.5.0 新增命令
628
706
  commander_1.program
629
707
  .command('delete')
@@ -639,7 +717,7 @@ commander_1.program
639
717
  commander_1.program
640
718
  .command('search <query>')
641
719
  .alias('sh')
642
- .description('Search across all Spec files for a keyword (v5.6)')
720
+ .description('全文搜索:跨所有 Spec 文件关键词检索')
643
721
  .option('--task <id>', 'Limit search to a task')
644
722
  .option('--iteration <name>', 'Limit search to an iteration')
645
723
  .action((query, opts) => (0, search_1.searchCommand)({ ...opts, query }));
@@ -774,7 +852,7 @@ if (process.argv.length <= 2) {
774
852
  const names = { init: '未初始化', require: '待导入需求', analyze: '待分析', split: '待拆分', dev: '开发中', done: '已完成' };
775
853
  logger.info('');
776
854
  logger.info('┌──────────────────────────────────────────┐');
777
- logger.info('│ SpecCore · v' + pkg.version + ' · 68 commands │');
855
+ logger.info('│ SpecCore · v' + pkg.version + ' · 58 commands │');
778
856
  logger.info('├──────────────────────────────────────────┤');
779
857
  if (iteration)
780
858
  logger.info('│ 期次: ' + iteration.padEnd(33) + '│');
@@ -790,7 +868,7 @@ if (process.argv.length <= 2) {
790
868
  logger.info('│ ' + nextDesc.padEnd(41) + '│');
791
869
  logger.info('│ │');
792
870
  logger.info('│ 💡 speccore --help 查看全部命令 │');
793
- logger.info('│ 📊 speccore status-panel 状态面板 │');
871
+ logger.info('│ 📊 speccore dashboard 仪表盘(期次/全局) │');
794
872
  logger.info('└──────────────────────────────────────────┘');
795
873
  logger.info('');
796
874
  process.exit(0);