speccore 5.19.3 → 5.22.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/README.en.md +63 -210
- package/README.md +108 -252
- package/dist/cli.js +224 -300
- package/dist/cli.js.map +1 -1
- package/dist/commands/analyze.d.ts +5 -0
- package/dist/commands/analyze.d.ts.map +1 -1
- package/dist/commands/analyze.js +235 -543
- package/dist/commands/analyze.js.map +1 -1
- package/dist/commands/ask.d.ts +8 -0
- package/dist/commands/ask.d.ts.map +1 -0
- package/dist/commands/ask.js +293 -0
- package/dist/commands/ask.js.map +1 -0
- package/dist/commands/bugfix.d.ts +4 -0
- package/dist/commands/bugfix.d.ts.map +1 -1
- package/dist/commands/bugfix.js +122 -2
- package/dist/commands/bugfix.js.map +1 -1
- package/dist/commands/change.d.ts +2 -0
- package/dist/commands/change.d.ts.map +1 -1
- package/dist/commands/change.js +37 -2
- package/dist/commands/change.js.map +1 -1
- package/dist/commands/completion.js +1 -1
- package/dist/commands/completion.js.map +1 -1
- package/dist/commands/dev.d.ts +2 -0
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +175 -1
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/doc2spec.d.ts +10 -0
- package/dist/commands/doc2spec.d.ts.map +1 -0
- package/dist/commands/{word2spec.js → doc2spec.js} +55 -19
- package/dist/commands/doc2spec.js.map +1 -0
- package/dist/commands/done.d.ts.map +1 -1
- package/dist/commands/done.js +47 -0
- package/dist/commands/done.js.map +1 -1
- package/dist/commands/execute.d.ts +1 -0
- package/dist/commands/execute.d.ts.map +1 -1
- package/dist/commands/execute.js +118 -11
- package/dist/commands/execute.js.map +1 -1
- package/dist/commands/help-quick.js +2 -2
- package/dist/commands/help-quick.js.map +1 -1
- package/dist/commands/help.d.ts +3 -2
- package/dist/commands/help.d.ts.map +1 -1
- package/dist/commands/help.js +372 -51
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/import.d.ts +1 -0
- package/dist/commands/import.d.ts.map +1 -1
- package/dist/commands/import.js +289 -15
- package/dist/commands/import.js.map +1 -1
- package/dist/commands/init.d.ts +0 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +177 -283
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/iteration/create.d.ts +1 -0
- package/dist/commands/iteration/create.d.ts.map +1 -1
- package/dist/commands/iteration/create.js +1 -0
- package/dist/commands/iteration/create.js.map +1 -1
- package/dist/commands/iteration/split.d.ts +1 -0
- package/dist/commands/iteration/split.d.ts.map +1 -1
- package/dist/commands/iteration/split.js +240 -7
- package/dist/commands/iteration/split.js.map +1 -1
- package/dist/commands/plan.d.ts +1 -0
- package/dist/commands/plan.d.ts.map +1 -1
- package/dist/commands/plan.js +25 -1
- package/dist/commands/plan.js.map +1 -1
- package/dist/commands/pr.d.ts +1 -0
- package/dist/commands/pr.d.ts.map +1 -1
- package/dist/commands/pr.js +94 -22
- package/dist/commands/pr.js.map +1 -1
- package/dist/commands/schedule.d.ts +27 -0
- package/dist/commands/schedule.d.ts.map +1 -0
- package/dist/commands/schedule.js +203 -0
- package/dist/commands/schedule.js.map +1 -0
- package/dist/commands/status-panel.d.ts +8 -1
- package/dist/commands/status-panel.d.ts.map +1 -1
- package/dist/commands/status-panel.js +1095 -5
- package/dist/commands/status-panel.js.map +1 -1
- package/dist/commands/task/new.d.ts +4 -0
- package/dist/commands/task/new.d.ts.map +1 -1
- package/dist/commands/task/new.js +87 -0
- package/dist/commands/task/new.js.map +1 -1
- package/dist/core/analyze-engine.d.ts +32 -0
- package/dist/core/analyze-engine.d.ts.map +1 -0
- package/dist/core/analyze-engine.js +935 -0
- package/dist/core/analyze-engine.js.map +1 -0
- package/dist/core/capabilities.d.ts +12 -0
- package/dist/core/capabilities.d.ts.map +1 -0
- package/dist/core/capabilities.js +58 -0
- package/dist/core/capabilities.js.map +1 -0
- package/dist/core/code-scanner.d.ts.map +1 -1
- package/dist/core/code-scanner.js +4 -1
- package/dist/core/code-scanner.js.map +1 -1
- package/dist/core/intent-recognition.d.ts +1 -1
- package/dist/core/intent-recognition.d.ts.map +1 -1
- package/dist/core/intent-recognition.js +5 -5
- package/dist/core/intent-recognition.js.map +1 -1
- package/dist/core/next-steps.js +1 -1
- package/dist/core/next-steps.js.map +1 -1
- package/dist/core/schedule-engine.d.ts +25 -0
- package/dist/core/schedule-engine.d.ts.map +1 -0
- package/dist/core/schedule-engine.js +179 -0
- package/dist/core/schedule-engine.js.map +1 -0
- package/dist/core/schedule-store.d.ts +104 -0
- package/dist/core/schedule-store.d.ts.map +1 -0
- package/dist/core/schedule-store.js +188 -0
- package/dist/core/schedule-store.js.map +1 -0
- package/dist/core/schemas/iteration.schema.d.ts +4 -4
- package/dist/core/schemas/task.schema.d.ts +2 -2
- package/package.json +7 -13
- package/dist/commands/demo.d.ts +0 -10
- package/dist/commands/demo.d.ts.map +0 -1
- package/dist/commands/demo.js +0 -151
- package/dist/commands/demo.js.map +0 -1
- package/dist/commands/goal.d.ts +0 -15
- package/dist/commands/goal.d.ts.map +0 -1
- package/dist/commands/goal.js +0 -232
- package/dist/commands/goal.js.map +0 -1
- package/dist/commands/new-task.d.ts +0 -15
- package/dist/commands/new-task.d.ts.map +0 -1
- package/dist/commands/new-task.js +0 -208
- package/dist/commands/new-task.js.map +0 -1
- package/dist/commands/platform-add.d.ts +0 -12
- package/dist/commands/platform-add.d.ts.map +0 -1
- package/dist/commands/platform-add.js +0 -111
- package/dist/commands/platform-add.js.map +0 -1
- package/dist/commands/retro.d.ts +0 -10
- package/dist/commands/retro.d.ts.map +0 -1
- package/dist/commands/retro.js +0 -131
- package/dist/commands/retro.js.map +0 -1
- package/dist/commands/spec.d.ts +0 -8
- package/dist/commands/spec.d.ts.map +0 -1
- package/dist/commands/spec.js +0 -159
- package/dist/commands/spec.js.map +0 -1
- package/dist/commands/template-add.d.ts +0 -12
- package/dist/commands/template-add.d.ts.map +0 -1
- package/dist/commands/template-add.js +0 -65
- package/dist/commands/template-add.js.map +0 -1
- package/dist/commands/word2spec.d.ts +0 -8
- package/dist/commands/word2spec.d.ts.map +0 -1
- package/dist/commands/word2spec.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -35,47 +35,36 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
const commander_1 = require("commander");
|
|
37
37
|
const package_json_1 = require("../package.json");
|
|
38
|
+
const fs_1 = require("fs");
|
|
39
|
+
const path_1 = require("path");
|
|
38
40
|
const init_1 = require("./commands/init");
|
|
39
|
-
const import_1 = require("./commands/import");
|
|
40
41
|
const validate_1 = require("./commands/validate");
|
|
41
|
-
const archive_1 = require("./commands/archive");
|
|
42
|
-
const progress_1 = require("./commands/progress");
|
|
43
42
|
const status_1 = require("./commands/status");
|
|
44
43
|
const health_1 = require("./commands/health");
|
|
45
|
-
const report_1 = require("./commands/report");
|
|
46
44
|
const config_1 = require("./commands/config");
|
|
47
|
-
const create_1 = require("./commands/iteration/create");
|
|
48
45
|
const split_1 = require("./commands/iteration/split");
|
|
49
46
|
const new_1 = require("./commands/task/new");
|
|
50
47
|
const plan_1 = require("./commands/plan");
|
|
51
48
|
const execute_1 = require("./commands/execute");
|
|
52
49
|
// 新增命令
|
|
53
|
-
const
|
|
54
|
-
const goal_1 = require("./commands/goal");
|
|
55
|
-
const bugfix_1 = require("./commands/bugfix");
|
|
56
|
-
const new_task_1 = require("./commands/new-task");
|
|
50
|
+
const ask_1 = require("./commands/ask");
|
|
57
51
|
const change_1 = require("./commands/change");
|
|
58
52
|
const sync_1 = require("./commands/sync");
|
|
59
53
|
const pattern_1 = require("./commands/pattern");
|
|
60
54
|
const rollback_1 = require("./commands/rollback");
|
|
61
55
|
const handover_1 = require("./commands/handover");
|
|
62
|
-
const retro_1 = require("./commands/retro");
|
|
63
|
-
const template_add_1 = require("./commands/template-add");
|
|
64
56
|
const help_1 = require("./commands/help");
|
|
65
57
|
const dev_1 = require("./commands/dev");
|
|
66
58
|
const status_panel_1 = require("./commands/status-panel");
|
|
67
|
-
const demo_1 = require("./commands/demo");
|
|
68
59
|
const welcome_1 = require("./commands/welcome");
|
|
69
|
-
const
|
|
60
|
+
const doc2spec_1 = require("./commands/doc2spec");
|
|
70
61
|
// 全量层命令
|
|
71
62
|
const iteration_from_global_1 = require("./commands/iteration-from-global");
|
|
72
63
|
const sync_global_1 = require("./commands/sync-global");
|
|
73
64
|
const global_status_1 = require("./commands/global-status");
|
|
74
|
-
const history_1 = require("./commands/history");
|
|
75
65
|
// P0/P1/P2 新增命令
|
|
76
66
|
const impact_1 = require("./commands/impact");
|
|
77
67
|
const baseline_1 = require("./commands/baseline");
|
|
78
|
-
const dashboard_1 = require("./commands/dashboard");
|
|
79
68
|
const audit_1 = require("./commands/audit");
|
|
80
69
|
const analyze_1 = require("./commands/analyze");
|
|
81
70
|
const lifecycle_1 = require("./commands/lifecycle");
|
|
@@ -86,7 +75,6 @@ const done_1 = require("./commands/done");
|
|
|
86
75
|
// rename 命令
|
|
87
76
|
const rename_1 = require("./commands/rename");
|
|
88
77
|
// v4.0.0 新增命令
|
|
89
|
-
const platform_add_1 = require("./commands/platform-add");
|
|
90
78
|
const index_update_1 = require("./commands/index-update");
|
|
91
79
|
// v4.6.0 迁移命令
|
|
92
80
|
const migrate_1 = require("./commands/migrate");
|
|
@@ -101,13 +89,15 @@ const update_1 = require("./commands/update");
|
|
|
101
89
|
const diff_1 = require("./commands/diff");
|
|
102
90
|
const trace_1 = require("./commands/trace");
|
|
103
91
|
const merge_check_1 = require("./commands/merge-check");
|
|
104
|
-
const
|
|
92
|
+
const history_1 = require("./commands/history");
|
|
105
93
|
const tracker_1 = require("./commands/tracker");
|
|
106
94
|
// v5.5.0 新增
|
|
107
95
|
const delete_1 = require("./commands/delete");
|
|
108
96
|
// v5.6.0 新增
|
|
109
97
|
const search_1 = require("./commands/search");
|
|
110
98
|
const watch_1 = require("./commands/watch");
|
|
99
|
+
// v5.21.0 任务调度
|
|
100
|
+
const schedule_1 = require("./commands/schedule");
|
|
111
101
|
const i18n_1 = require("./i18n");
|
|
112
102
|
commander_1.program
|
|
113
103
|
.name('speccore')
|
|
@@ -120,13 +110,38 @@ commander_1.program
|
|
|
120
110
|
i18n_1.i18n.setLocale(opts.lang);
|
|
121
111
|
}
|
|
122
112
|
});
|
|
123
|
-
//
|
|
124
|
-
|
|
125
|
-
|
|
113
|
+
// ── 模式检测:简洁版(默认) vs 全量版 ──
|
|
114
|
+
function readMode() {
|
|
115
|
+
try {
|
|
116
|
+
const p = (0, path_1.join)(process.cwd(), '.speccore', 'config', 'mode.json');
|
|
117
|
+
if ((0, fs_1.existsSync)(p)) {
|
|
118
|
+
const data = JSON.parse((0, fs_1.readFileSync)(p, 'utf-8'));
|
|
119
|
+
return data.mode === 'full' ? 'full' : 'simple';
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
catch { /* ignore */ }
|
|
123
|
+
return 'simple';
|
|
124
|
+
}
|
|
125
|
+
const MODE = readMode();
|
|
126
|
+
/** 简洁模式下在 help 中显示的命令 */
|
|
127
|
+
const SIMPLE_COMMANDS = new Set([
|
|
128
|
+
'ask', 'init', 'doc2spec', 'analyze', 'split', 'execute',
|
|
129
|
+
'pr', 'done', 'status-panel', 'dev',
|
|
130
|
+
'iteration', 'task', 'plan', 'ops', 'change', 'validate', 'rename',
|
|
131
|
+
]);
|
|
132
|
+
/** 简洁模式下过滤 help 命令列表 */
|
|
133
|
+
function filterCommands(commands) {
|
|
134
|
+
if (MODE === 'full')
|
|
135
|
+
return [...commands];
|
|
136
|
+
return [...commands].filter(c => SIMPLE_COMMANDS.has(c.name()));
|
|
137
|
+
}
|
|
138
|
+
commander_1.program.configureHelp({
|
|
139
|
+
visibleCommands: (cmd) => filterCommands(cmd.commands),
|
|
140
|
+
});
|
|
126
141
|
commander_1.program
|
|
127
|
-
.command('
|
|
128
|
-
.description('
|
|
129
|
-
.action((input) => (0,
|
|
142
|
+
.command('ask [input...]')
|
|
143
|
+
.description('Natural language intent recognition (previously "spec")')
|
|
144
|
+
.action((input) => (0, ask_1.askCommand)(input.join(' '), {}));
|
|
130
145
|
// ================================================================
|
|
131
146
|
// 👋 引导与体验
|
|
132
147
|
// ================================================================
|
|
@@ -135,11 +150,17 @@ commander_1.program
|
|
|
135
150
|
.alias('wc')
|
|
136
151
|
.description('First-time setup guide (interactive)')
|
|
137
152
|
.option('--force', 'Force re-initialization')
|
|
153
|
+
.option('--auto', '全自动流水线:无人干预级联执行全部阶段')
|
|
154
|
+
.option('--from <phase>', '从指定阶段开始(init/analyze/split/plan/execute/pr/done)')
|
|
138
155
|
.action(welcome_1.welcomeCommand);
|
|
139
156
|
commander_1.program
|
|
140
157
|
.command('status-panel')
|
|
141
158
|
.alias('sp')
|
|
142
159
|
.description('IDE-style status panel: phase + tasks + progress + next action')
|
|
160
|
+
.option('--export <format>', 'Export: json | md | html')
|
|
161
|
+
.option("--assignee <name>", "导出指定人员的统计")
|
|
162
|
+
.option("--platform <platform>", "导出指定平台: backend | frontend | web | h5 | miniapp")
|
|
163
|
+
.option("--type <type>", "导出指定类型: feature | bugfix | research")
|
|
143
164
|
.action(status_panel_1.statusPanelCommand);
|
|
144
165
|
commander_1.program
|
|
145
166
|
.command('open')
|
|
@@ -171,57 +192,34 @@ commander_1.program;
|
|
|
171
192
|
commander_1.program
|
|
172
193
|
.command('dev')
|
|
173
194
|
.alias('d')
|
|
174
|
-
.description('
|
|
195
|
+
.description('智能级联:自动检测阶段 → 引导/自动执行下一步')
|
|
175
196
|
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
176
|
-
.option('--force', 'Auto-execute the next step')
|
|
197
|
+
.option('--force', 'Auto-execute the next step without confirmation')
|
|
198
|
+
.option('--auto', '全自动流水线:无人干预级联执行全部阶段')
|
|
199
|
+
.option('--from <phase>', '从指定阶段开始(init/analyze/split/plan/execute/pr/done)')
|
|
177
200
|
.action(dev_1.devCommand);
|
|
178
201
|
commander_1.program;
|
|
179
|
-
commander_1.program;
|
|
180
|
-
commander_1.program
|
|
181
|
-
.command('dev')
|
|
182
|
-
.alias('d')
|
|
183
|
-
.description('Smart dev entry: auto-detect phase and suggest next step')
|
|
184
|
-
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
185
|
-
.option('--force', 'Auto-execute the next step')
|
|
186
|
-
.action(dev_1.devCommand);
|
|
187
|
-
commander_1.program
|
|
188
|
-
.command('demo')
|
|
189
|
-
.alias('dm')
|
|
190
|
-
.description('Quick experience demo (5 min)')
|
|
191
|
-
.option('--project <key>', 'Demo project type: book, todo, blog', 'book')
|
|
192
|
-
.option('--list', 'List available demo projects')
|
|
193
|
-
.action(demo_1.demoCommand);
|
|
194
202
|
// ================================================================
|
|
195
203
|
// 🏗️ 初始化与导入
|
|
196
204
|
// ================================================================
|
|
197
205
|
commander_1.program
|
|
198
206
|
.command('init')
|
|
199
207
|
.alias('in')
|
|
200
|
-
.description('
|
|
208
|
+
.description('初始化 SpecCore(默认简洁模式,--full 开启全量)')
|
|
201
209
|
.option('--mode <mode>', 'Initialization mode: fresh or migration', 'fresh')
|
|
210
|
+
.option('--full', 'Full mode: all 68+ commands (default: simple)')
|
|
202
211
|
.option('--force', 'Force overwrite existing configuration')
|
|
212
|
+
.option('--auto', '全自动流水线:无人干预级联执行全部阶段')
|
|
213
|
+
.option('--from <phase>', '从指定阶段开始(init/analyze/split/plan/execute/pr/done)')
|
|
203
214
|
.action(init_1.initCommand);
|
|
204
|
-
commander_1.program
|
|
205
|
-
.command('import')
|
|
206
|
-
.alias('imp')
|
|
207
|
-
.description('Import project into global layer (multi-project support)')
|
|
208
|
-
.option('--source <source>', 'Source type: code, prd, prototype, all', 'all')
|
|
209
|
-
.option('--path <path>', 'Project source path', './')
|
|
210
|
-
.option('--url <url>', 'Prototype URL')
|
|
211
|
-
.option('-i, --iteration <iteration>', 'Target iteration name')
|
|
212
|
-
.option('--project <name>', 'Project name for global layer import')
|
|
213
|
-
.option('--type <type>', 'Project type: backend, web, h5, miniapp', 'backend')
|
|
214
|
-
.option('--scope <scope>', 'Selective import: all, core, api', 'all')
|
|
215
|
-
.option('--ignore <packages>', 'Ignore specific packages (comma-separated)')
|
|
216
|
-
.option('--update', 'Incremental sync mode')
|
|
217
|
-
.option('--force', 'Force overwrite')
|
|
218
|
-
.action(import_1.importCommand);
|
|
219
215
|
commander_1.program
|
|
220
216
|
.command('migrate')
|
|
221
217
|
.alias('mg')
|
|
222
218
|
.description('Migrate Shell v3.x config to CLI v4.x (v4.6)')
|
|
223
219
|
.option('--dry-run', 'Preview migration, no changes')
|
|
224
220
|
.option('--force', 'Skip confirmation')
|
|
221
|
+
.option('--auto', '全自动流水线:无人干预级联执行全部阶段')
|
|
222
|
+
.option('--from <phase>', '从指定阶段开始(init/analyze/split/plan/execute/pr/done)')
|
|
225
223
|
.action(migrate_1.migrateCommand);
|
|
226
224
|
// ================================================================
|
|
227
225
|
// 📋 期次管理
|
|
@@ -230,14 +228,7 @@ const iterationCmd = commander_1.program
|
|
|
230
228
|
.command('iteration')
|
|
231
229
|
.alias('it')
|
|
232
230
|
.description('Iteration management commands');
|
|
233
|
-
iterationCmd
|
|
234
|
-
.command('create')
|
|
235
|
-
.alias('cr')
|
|
236
|
-
.description('Create a new iteration')
|
|
237
|
-
.option('-n, --name <name>', 'Iteration name (required)')
|
|
238
|
-
.option('--from <date>', 'Start date', new Date().toISOString().split('T')[0])
|
|
239
|
-
.option('--to <date>', 'End date')
|
|
240
|
-
.action(create_1.iterationCreateCommand);
|
|
231
|
+
iterationCmd;
|
|
241
232
|
iterationCmd
|
|
242
233
|
.command('split')
|
|
243
234
|
.alias('sp')
|
|
@@ -248,7 +239,10 @@ iterationCmd
|
|
|
248
239
|
.option('--target <target>', 'Merge into existing task')
|
|
249
240
|
.option('-p, --platforms <platforms>', 'Comma-separated platforms (auto-detected if omitted)')
|
|
250
241
|
.option('--dry-run', 'Preview without creating')
|
|
242
|
+
.option('--interactive', 'Preview → adjust → confirm before creating')
|
|
251
243
|
.option('--strict', 'Review each section before creating tasks')
|
|
244
|
+
.option('--scheduled', '夜间调度:只执行标记为 queue 的任务')
|
|
245
|
+
.option('--verify', '生成代码后自动检查 TEST/REVIEW/DEPLOY → 最多3轮自动修复')
|
|
252
246
|
.action(split_1.iterationSplitCommand);
|
|
253
247
|
// ================================================================
|
|
254
248
|
// 📝 任务管理
|
|
@@ -257,63 +251,12 @@ const taskCmd = commander_1.program
|
|
|
257
251
|
.command('task')
|
|
258
252
|
.alias('tk')
|
|
259
253
|
.description('Task management commands');
|
|
260
|
-
taskCmd
|
|
261
|
-
.command('new')
|
|
262
|
-
.alias('add')
|
|
263
|
-
.description('Create a new atomic task')
|
|
264
|
-
.option('-n, --name <name>', 'Task name (required)')
|
|
265
|
-
.option('-t, --type <type>', 'Task type: feature, bugfix, research, optimization, migration, document', 'feature')
|
|
266
|
-
.option('--task-id <id>', 'Task ID (auto-generated if omitted)')
|
|
267
|
-
.option('-d, --desc <desc>', 'Task description')
|
|
268
|
-
.option('--file <file>', 'Requirement file path')
|
|
269
|
-
.option('--sections <sections>', 'Sections to extract from file')
|
|
270
|
-
.option('--backend-only', 'Create backend only')
|
|
271
|
-
.option('--frontend-only', 'Create frontend only')
|
|
272
|
-
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
273
|
-
.action(new_1.taskNewCommand);
|
|
254
|
+
taskCmd;
|
|
274
255
|
// 完整需求交付
|
|
275
|
-
commander_1.program
|
|
276
|
-
.command('goal')
|
|
277
|
-
.alias('gl')
|
|
278
|
-
.description('Complete requirement delivery (from requirement to code)')
|
|
279
|
-
.option('-n, --name <name>', 'Feature name')
|
|
280
|
-
.option('-d, --desc <desc>', 'Feature description')
|
|
281
|
-
.option('-t, --type <type>', 'Task type', 'feature')
|
|
282
|
-
.option('--task-id <id>', 'Task ID')
|
|
283
|
-
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
284
|
-
.option('--backend-only', 'Backend only')
|
|
285
|
-
.option('--frontend-only', 'Frontend only')
|
|
286
|
-
.action(goal_1.goalCommand);
|
|
256
|
+
commander_1.program;
|
|
287
257
|
// Bug 修复
|
|
288
|
-
commander_1.program
|
|
289
|
-
.command('bugfix')
|
|
290
|
-
.alias('bf')
|
|
291
|
-
.description('Quick bug fix: create fix task + impact analysis')
|
|
292
|
-
.option('-n, --name <name>', 'Bug name')
|
|
293
|
-
.option('-d, --desc <desc>', 'Bug description')
|
|
294
|
-
.option('--task-id <id>', 'Task ID')
|
|
295
|
-
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
296
|
-
.option('--affected-task <task>', 'Affected task for regression')
|
|
297
|
-
.action(bugfix_1.bugfixCommand);
|
|
298
258
|
// 技术调研
|
|
299
|
-
commander_1.program
|
|
300
|
-
.command('research')
|
|
301
|
-
.alias('rs')
|
|
302
|
-
.description('Technical research: evaluate solutions and compare options')
|
|
303
|
-
.option('-n, --name <name>', 'Research topic');
|
|
304
|
-
// ================================================================
|
|
305
|
-
// ⚡ 执行与调度
|
|
306
|
-
// ================================================================
|
|
307
|
-
commander_1.program
|
|
308
|
-
.command('pr')
|
|
309
|
-
.alias('mr')
|
|
310
|
-
.description('Create Pull Request with task summary')
|
|
311
|
-
.option('-t, --task <task>', 'Target task (auto-detect from branch if omitted)')
|
|
312
|
-
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
313
|
-
.option('--base <branch>', 'Base branch', 'main')
|
|
314
|
-
.option('--draft', 'Create as draft PR')
|
|
315
|
-
.option('--title <title>', 'Custom PR title')
|
|
316
|
-
.action(pr_1.prCommand);
|
|
259
|
+
commander_1.program;
|
|
317
260
|
commander_1.program
|
|
318
261
|
.command('pr')
|
|
319
262
|
.alias('mr')
|
|
@@ -322,6 +265,7 @@ commander_1.program
|
|
|
322
265
|
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
323
266
|
.option('--base <branch>', 'Base branch', 'main')
|
|
324
267
|
.option('--draft', 'Create as draft PR')
|
|
268
|
+
.option('--interactive', '分步:预览变更 → 选文件 → commit → 推送 → 创建PR')
|
|
325
269
|
.option('--title <title>', 'Custom PR title')
|
|
326
270
|
.action(pr_1.prCommand);
|
|
327
271
|
commander_1.program
|
|
@@ -337,6 +281,7 @@ commander_1.program
|
|
|
337
281
|
.option('--priority <priority>', 'Filter by priority')
|
|
338
282
|
.option('--mode <mode>', 'Plan mode: auto, claim, parallel', 'auto')
|
|
339
283
|
.option('--dry-run', 'Preview without saving')
|
|
284
|
+
.option('--interactive', 'Preview → adjust → confirm before saving')
|
|
340
285
|
.action(plan_1.planCommand);
|
|
341
286
|
commander_1.program
|
|
342
287
|
.command('execute')
|
|
@@ -358,7 +303,11 @@ commander_1.program
|
|
|
358
303
|
.option('--parallel <count>', 'Parallel execution count', '1')
|
|
359
304
|
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
360
305
|
.option('--force', 'Skip preview and execute directly')
|
|
306
|
+
.option('--auto', '全自动流水线:无人干预级联执行全部阶段')
|
|
307
|
+
.option('--from <phase>', '从指定阶段开始(init/analyze/split/plan/execute/pr/done)')
|
|
361
308
|
.option('--strict', 'Pre-flight check: review req/tech/test before code gen')
|
|
309
|
+
.option('--scheduled', '夜间调度:只执行标记为 queue 的任务')
|
|
310
|
+
.option('--verify', '生成代码后自动检查 TEST/REVIEW/DEPLOY → 最多3轮自动修复')
|
|
362
311
|
.option('--base <branch>', 'Base branch for task branching (default: current)')
|
|
363
312
|
.option('--skip <tasks>', 'Comma-separated task IDs to skip')
|
|
364
313
|
.option('--only <tasks>', 'Comma-separated task IDs to execute exclusively (whitelist)')
|
|
@@ -366,21 +315,28 @@ commander_1.program
|
|
|
366
315
|
.option('--hotfix', 'Emergency fix: skip reverse sync (30min grace, 24h mandatory)')
|
|
367
316
|
.action(execute_1.executeCommand);
|
|
368
317
|
// ================================================================
|
|
318
|
+
// 任务调度(已通过 WorkBuddy Automation 实现)
|
|
319
|
+
// ================================================================
|
|
320
|
+
// ================================================================
|
|
369
321
|
// 🔄 变更管理
|
|
370
322
|
// ================================================================
|
|
371
323
|
commander_1.program
|
|
372
324
|
.command('change')
|
|
373
325
|
.alias('ch')
|
|
374
|
-
.description('
|
|
326
|
+
.description('需求变更:联动更新所有关联 Spec → 支持口语')
|
|
375
327
|
.option('-t, --task <task>', 'Target task')
|
|
376
328
|
.option('-r, --req <req>', 'Requirement ID')
|
|
377
|
-
.option('-d, --desc <desc>', 'Change description
|
|
329
|
+
.option('-d, --desc <desc>', 'Change description')
|
|
330
|
+
.option('--input <text>', '自然语言输入(口语化描述)')
|
|
378
331
|
.option('--global', 'Global layer change (CONSTITUTION.md)')
|
|
379
|
-
.option('--requirement', 'Also update REQUIREMENT.md
|
|
380
|
-
.option('--analysis', 'Also update ANALYSIS.md
|
|
332
|
+
.option('--requirement', 'Also update REQUIREMENT.md')
|
|
333
|
+
.option('--analysis', 'Also update ANALYSIS.md')
|
|
381
334
|
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
382
335
|
.option('--dry-run', 'Preview impact without modifying')
|
|
383
336
|
.option('--force', 'Skip preview and apply directly')
|
|
337
|
+
.option('--auto', '全自动流水线:无人干预级联执行全部阶段')
|
|
338
|
+
.option('--from <phase>', '从指定阶段开始(init/analyze/split/plan/execute/pr/done)')
|
|
339
|
+
.option('--interactive', 'Interactive: preview → adjust → confirm → apply')
|
|
384
340
|
.action(change_1.changeCommand);
|
|
385
341
|
commander_1.program
|
|
386
342
|
.command('sync')
|
|
@@ -391,6 +347,8 @@ commander_1.program
|
|
|
391
347
|
.option('--auto', 'Auto-apply sync without confirmation')
|
|
392
348
|
.option('--dry-run', 'Preview differences without modifying')
|
|
393
349
|
.option('--force', 'Skip preview')
|
|
350
|
+
.option('--auto', '全自动流水线:无人干预级联执行全部阶段')
|
|
351
|
+
.option('--from <phase>', '从指定阶段开始(init/analyze/split/plan/execute/pr/done)')
|
|
394
352
|
.option('--detect', 'Detect code-spec discrepancies (read-only, no changes)')
|
|
395
353
|
.action(sync_1.syncCommand);
|
|
396
354
|
// ================================================================
|
|
@@ -405,24 +363,14 @@ commander_1.program
|
|
|
405
363
|
.option('--type <type>', 'Filter by task type')
|
|
406
364
|
.option('--fix', 'Auto-fix issues where possible')
|
|
407
365
|
.option('--strict', 'Strict validation mode')
|
|
366
|
+
.option('--scheduled', '夜间调度:只执行标记为 queue 的任务')
|
|
367
|
+
.option('--verify', '生成代码后自动检查 TEST/REVIEW/DEPLOY → 最多3轮自动修复')
|
|
408
368
|
.option('--format <format>', 'Output format: text, json', 'text')
|
|
409
369
|
.action(validate_1.validateCommand);
|
|
410
370
|
// ================================================================
|
|
411
371
|
// 📊 进度与状态
|
|
412
372
|
// ================================================================
|
|
413
|
-
commander_1.program
|
|
414
|
-
.command('progress')
|
|
415
|
-
.alias('pg')
|
|
416
|
-
.description('Display project progress overview')
|
|
417
|
-
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
418
|
-
.option('-a, --assignee <assignee>', 'Filter by assignee')
|
|
419
|
-
.option('--type <type>', 'Filter by task type')
|
|
420
|
-
.option('--req <req>')
|
|
421
|
-
.option('--task <task>', 'Show specific task progress')
|
|
422
|
-
.option('--detail', 'Show detailed progress')
|
|
423
|
-
.option('--platform <platform>', 'Filter by frontend platform (web/h5/miniapp)')
|
|
424
|
-
.option('--format <format>', 'Output format: text, json, csv', 'text')
|
|
425
|
-
.action(progress_1.progressCommand);
|
|
373
|
+
commander_1.program;
|
|
426
374
|
commander_1.program
|
|
427
375
|
.command('status')
|
|
428
376
|
.alias('st')
|
|
@@ -442,17 +390,7 @@ commander_1.program
|
|
|
442
390
|
// ================================================================
|
|
443
391
|
// 📦 归档与交接
|
|
444
392
|
// ================================================================
|
|
445
|
-
commander_1.program
|
|
446
|
-
.command('archive')
|
|
447
|
-
.alias('ar')
|
|
448
|
-
.description('Archive completed tasks')
|
|
449
|
-
.option('-t, --task <task>', 'Archive specific task')
|
|
450
|
-
.option('--all', 'Archive all completed tasks')
|
|
451
|
-
.option('-i, --iteration <iteration>', 'Archive entire iteration')
|
|
452
|
-
.option('--list', 'List archived tasks')
|
|
453
|
-
.option('--restore <task>', 'Restore archived task')
|
|
454
|
-
.option('--force', 'Skip preview and archive directly')
|
|
455
|
-
.action(archive_1.archiveCommand);
|
|
393
|
+
commander_1.program;
|
|
456
394
|
commander_1.program
|
|
457
395
|
.command('handover')
|
|
458
396
|
.alias('ho')
|
|
@@ -461,13 +399,7 @@ commander_1.program
|
|
|
461
399
|
.option('-o, --output <path>', 'Output file path')
|
|
462
400
|
.option('--format <format>', 'Output format: md', 'md')
|
|
463
401
|
.action(handover_1.handoverCommand);
|
|
464
|
-
commander_1.program
|
|
465
|
-
.command('retro')
|
|
466
|
-
.alias('rt')
|
|
467
|
-
.description('Iteration retrospective: summarize experience and improvements')
|
|
468
|
-
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
469
|
-
.option('-o, --output <path>', 'Output file path')
|
|
470
|
-
.action(retro_1.retroCommand);
|
|
402
|
+
commander_1.program;
|
|
471
403
|
// ================================================================
|
|
472
404
|
// ⚙️ 配置与工具
|
|
473
405
|
// ================================================================
|
|
@@ -478,37 +410,15 @@ commander_1.program
|
|
|
478
410
|
.option('-t, --task <task>', 'Target task')
|
|
479
411
|
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
480
412
|
.action(context_output_1.contextCommand);
|
|
481
|
-
commander_1.program
|
|
482
|
-
.command('context')
|
|
483
|
-
.alias('ctx')
|
|
484
|
-
.description('Output task context for any AI tool (Copilot/Claude/GPT)')
|
|
485
|
-
.option('-t, --task <task>', 'Target task')
|
|
486
|
-
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
487
|
-
.action(context_output_1.contextCommand);
|
|
488
|
-
commander_1.program
|
|
489
|
-
.command('constitution')
|
|
490
|
-
.alias('cn')
|
|
491
|
-
.description('Auto-detect tech stack and generate CONSTITUTION.md rules')
|
|
492
|
-
.action(async () => { await (0, constitution_builder_1.buildConstitution)(process.cwd()); });
|
|
493
|
-
commander_1.program
|
|
494
|
-
.command('context')
|
|
495
|
-
.alias('ctx')
|
|
496
|
-
.description('Output task context for any AI tool (Copilot/Claude/GPT)')
|
|
497
|
-
.option('-t, --task <task>', 'Target task')
|
|
498
|
-
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
499
|
-
.action(context_output_1.contextCommand);
|
|
500
|
-
commander_1.program
|
|
501
|
-
.command('context')
|
|
502
|
-
.alias('ctx')
|
|
503
|
-
.description('Output task context for any AI tool (Copilot/Claude/GPT)')
|
|
504
|
-
.option('-t, --task <task>', 'Target task')
|
|
505
|
-
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
506
|
-
.action(context_output_1.contextCommand);
|
|
413
|
+
commander_1.program;
|
|
507
414
|
commander_1.program
|
|
508
415
|
.command('constitution')
|
|
509
416
|
.alias('cn')
|
|
510
417
|
.description('Auto-detect tech stack and generate CONSTITUTION.md rules')
|
|
511
418
|
.action(async () => { await (0, constitution_builder_1.buildConstitution)(process.cwd()); });
|
|
419
|
+
commander_1.program;
|
|
420
|
+
commander_1.program;
|
|
421
|
+
commander_1.program;
|
|
512
422
|
commander_1.program
|
|
513
423
|
.command('config')
|
|
514
424
|
.alias('cf')
|
|
@@ -519,26 +429,8 @@ commander_1.program
|
|
|
519
429
|
.option('-t, --tech <target>', 'Target tech-stack (TECH_STACK.md): backend | frontend')
|
|
520
430
|
.option('--reset', 'Reset to default configuration')
|
|
521
431
|
.action(config_1.configCommand);
|
|
522
|
-
commander_1.program
|
|
523
|
-
|
|
524
|
-
.alias('rp')
|
|
525
|
-
.description('Generate project report')
|
|
526
|
-
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
527
|
-
.option('--format <format>', 'Output format: markdown, html, json', 'markdown')
|
|
528
|
-
.option('-o, --output <path>', 'Output file path')
|
|
529
|
-
.option('--team', 'Include team analysis')
|
|
530
|
-
.option('--risk', 'Include risk analysis')
|
|
531
|
-
.option('--trend', 'Include trend comparison')
|
|
532
|
-
.action(report_1.reportCommand);
|
|
533
|
-
commander_1.program
|
|
534
|
-
.command('template-add')
|
|
535
|
-
.alias('ta')
|
|
536
|
-
.description('Add code generation template from existing code')
|
|
537
|
-
.option('-n, --name <name>', 'Template name (required)')
|
|
538
|
-
.option('-t, --type <type>', 'Template type: crud, auth, export, report', 'crud')
|
|
539
|
-
.option('-f, --files <files>', 'Code file paths (comma-separated, required)')
|
|
540
|
-
.option('-d, --desc <desc>', 'Template description')
|
|
541
|
-
.action(template_add_1.templateAddCommand);
|
|
432
|
+
commander_1.program;
|
|
433
|
+
commander_1.program;
|
|
542
434
|
// ================================================================
|
|
543
435
|
// 📖 帮助
|
|
544
436
|
// ================================================================
|
|
@@ -548,6 +440,7 @@ commander_1.program
|
|
|
548
440
|
.description('Display command help and search')
|
|
549
441
|
.option('--command <command>', 'Show detailed help for specific command')
|
|
550
442
|
.option('--search <keyword>', 'Search commands by keyword')
|
|
443
|
+
.option('--examples', 'Show complete scenario examples')
|
|
551
444
|
.action(help_1.helpCommand);
|
|
552
445
|
// ================================================================
|
|
553
446
|
// 🌐 全量层命令
|
|
@@ -559,16 +452,18 @@ commander_1.program
|
|
|
559
452
|
.option('--reqs <reqs>', 'Requirement IDs (comma-separated, required)')
|
|
560
453
|
.option('--name <name>', 'Iteration name (required)')
|
|
561
454
|
.option('--force', 'Force overwrite existing iteration')
|
|
455
|
+
.option('--auto', '全自动流水线:无人干预级联执行全部阶段')
|
|
456
|
+
.option('--from <phase>', '从指定阶段开始(init/analyze/split/plan/execute/pr/done)')
|
|
562
457
|
.action(iteration_from_global_1.iterationFromGlobalCommand);
|
|
563
458
|
commander_1.program
|
|
564
|
-
.command('
|
|
565
|
-
.alias('
|
|
566
|
-
.description('
|
|
567
|
-
.option('-f, --file <path>', '
|
|
568
|
-
.option('-i, --iteration <name>', '
|
|
569
|
-
.option('-p, --platform <name>', '
|
|
570
|
-
.option('--files <files>', '
|
|
571
|
-
.action(
|
|
459
|
+
.command('doc2spec')
|
|
460
|
+
.alias('d2s')
|
|
461
|
+
.description('导入 PRD 文档 → SpecCore Markdown(支持 Word/PDF/MD/HTML/PPTX)')
|
|
462
|
+
.option('-f, --file <path>', '源文件路径')
|
|
463
|
+
.option('-i, --iteration <name>', '目标期次(必填)')
|
|
464
|
+
.option('-p, --platform <name>', '平台标识(backend / frontend-web / frontend-h5)')
|
|
465
|
+
.option('--files <files>', '批量: "a.docx=平台1,b.pdf=平台2"')
|
|
466
|
+
.action(doc2spec_1.doc2specCommand);
|
|
572
467
|
commander_1.program
|
|
573
468
|
.command('sync-global')
|
|
574
469
|
.alias('sg')
|
|
@@ -578,6 +473,8 @@ commander_1.program
|
|
|
578
473
|
.option('--auto', 'Auto-apply without confirmation')
|
|
579
474
|
.option('--dry-run', 'Preview changes without applying')
|
|
580
475
|
.option('--force', 'Skip preview and execute')
|
|
476
|
+
.option('--auto', '全自动流水线:无人干预级联执行全部阶段')
|
|
477
|
+
.option('--from <phase>', '从指定阶段开始(init/analyze/split/plan/execute/pr/done)')
|
|
581
478
|
.action(sync_global_1.syncGlobalCommand);
|
|
582
479
|
// ================================================================
|
|
583
480
|
// 📦 模式保存
|
|
@@ -593,6 +490,8 @@ commander_1.program
|
|
|
593
490
|
.option('-d, --desc <desc>', 'Pattern description')
|
|
594
491
|
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
595
492
|
.option('--force', 'Overwrite existing pattern')
|
|
493
|
+
.option('--auto', '全自动流水线:无人干预级联执行全部阶段')
|
|
494
|
+
.option('--from <phase>', '从指定阶段开始(init/analyze/split/plan/execute/pr/done)')
|
|
596
495
|
.action(pattern_1.patternCommand);
|
|
597
496
|
// ================================================================
|
|
598
497
|
// 🔙 回滚
|
|
@@ -616,13 +515,8 @@ commander_1.program
|
|
|
616
515
|
.command('ops')
|
|
617
516
|
.alias('op')
|
|
618
517
|
.description('View operation history (command log)')
|
|
619
|
-
.action(
|
|
620
|
-
commander_1.program
|
|
621
|
-
.command('history')
|
|
622
|
-
.alias('hs')
|
|
623
|
-
.description('View requirement change history')
|
|
624
|
-
.option('--req <id>', 'Requirement ID (e.g., REQ-001)')
|
|
625
|
-
.action(history_1.historyCommand);
|
|
518
|
+
.action(history_1.opsCommand);
|
|
519
|
+
commander_1.program;
|
|
626
520
|
// ================================================================
|
|
627
521
|
// 🔗 P0/P1/P2 新增命令
|
|
628
522
|
// ================================================================
|
|
@@ -645,20 +539,19 @@ commander_1.program
|
|
|
645
539
|
.option('--restore <name>', 'Restore to baseline')
|
|
646
540
|
.option('--req <id>', 'Requirement ID for rollback')
|
|
647
541
|
.action(baseline_1.baselineCommand);
|
|
648
|
-
commander_1.program
|
|
649
|
-
.command('dashboard')
|
|
650
|
-
.alias('db')
|
|
651
|
-
.description('Generate visual dashboard (HTML + Chart.js)')
|
|
652
|
-
.option('-o, --output <path>', 'Output file path', './speccore-dashboard.html')
|
|
653
|
-
.action(dashboard_1.dashboardCommand);
|
|
654
542
|
commander_1.program
|
|
655
543
|
.command('analyze')
|
|
656
544
|
.alias('al')
|
|
657
|
-
.description('
|
|
658
|
-
.option('-
|
|
659
|
-
.option('-
|
|
660
|
-
.option('--
|
|
661
|
-
.option('
|
|
545
|
+
.description('统一分析: 需求文档 + 源码目录 → 按范围(全局/期次/任务)生成分析报告')
|
|
546
|
+
.option('-I, --iteration <iteration>', '目标期次 (scope=iteration|task 时必填)')
|
|
547
|
+
.option('-t, --task <task-id>', '任务 ID (--scope task 快捷方式)')
|
|
548
|
+
.option('--scope <scope>', '输出范围: global(全局文档) | iteration(期次, 默认) | task(任务)')
|
|
549
|
+
.option('--src, --source <dirs>', '源码目录 (逗号分隔: --src backend/src,frontend/src)')
|
|
550
|
+
.option('--req, --requirements <files>', '需求文档 (逗号分隔: --req docs/a.md,docs/b.md)')
|
|
551
|
+
.option('-o, --output <file>', '输出文件名 (覆盖默认)')
|
|
552
|
+
.option('--depth <depth>', '分析深度: quick | normal(默认) | deep')
|
|
553
|
+
.option('--auto', '非交互: 直接生成报告 (默认)')
|
|
554
|
+
.option('--ask', '交互: AI 提问 → 回答 → 优化')
|
|
662
555
|
.action(analyze_1.analyzeCommand);
|
|
663
556
|
commander_1.program
|
|
664
557
|
.command('audit')
|
|
@@ -678,57 +571,39 @@ commander_1.program
|
|
|
678
571
|
.option('--pattern <pattern>', 'Batch pattern to match')
|
|
679
572
|
.option('--replacement <replacement>', 'Batch replacement string')
|
|
680
573
|
.option('--force', 'Skip preview and execute')
|
|
574
|
+
.option('--auto', '全自动流水线:无人干预级联执行全部阶段')
|
|
575
|
+
.option('--from <phase>', '从指定阶段开始(init/analyze/split/plan/execute/pr/done)')
|
|
681
576
|
.action(rename_1.renameCommand);
|
|
682
577
|
// ================================================================
|
|
683
578
|
// 🆕 v4.0.0 新增命令
|
|
684
579
|
// ================================================================
|
|
685
580
|
commander_1.program
|
|
686
|
-
.
|
|
687
|
-
.
|
|
688
|
-
.
|
|
689
|
-
.option('--
|
|
690
|
-
.option('--
|
|
691
|
-
.option('--
|
|
692
|
-
.option('--
|
|
693
|
-
.option('--backend-only', 'Create backend specs only')
|
|
694
|
-
.option('--frontend-only', 'Create frontend specs only')
|
|
581
|
+
.description('快捷创建 Task(同 task new)')
|
|
582
|
+
.option('-n, --name <name>', 'Task name (required)')
|
|
583
|
+
.option('-t, --type <type>', 'Task type', 'feature')
|
|
584
|
+
.option('-d, --desc <desc>', 'Task description')
|
|
585
|
+
.option('--platforms <platforms>', 'Frontend platforms: web,h5,miniapp')
|
|
586
|
+
.option('--backend-only', 'Create backend only')
|
|
587
|
+
.option('--frontend-only', 'Create frontend only')
|
|
695
588
|
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
696
|
-
.
|
|
697
|
-
|
|
698
|
-
.
|
|
699
|
-
.
|
|
700
|
-
.
|
|
701
|
-
|
|
702
|
-
.option('--description <desc>', 'Platform display name')
|
|
703
|
-
.option('--tech <tech>', 'Tech stack description')
|
|
704
|
-
.option('--no-sync', 'Skip syncing to existing tasks')
|
|
705
|
-
.action(platform_add_1.platformAddCommand);
|
|
589
|
+
.option('--batch <tasks>', '批量:换行分隔的多个任务描述')
|
|
590
|
+
.option('--batch-file <path>', '从 Excel/CSV 文件批量导入')
|
|
591
|
+
.option('--interactive', 'Preview → edit → confirm → create')
|
|
592
|
+
.option('--schedule <mode>', '调度模式:night / now', 'now')
|
|
593
|
+
.action(new_1.taskNewCommand);
|
|
594
|
+
commander_1.program;
|
|
706
595
|
commander_1.program
|
|
707
596
|
.command('index-update')
|
|
708
597
|
.alias('iu')
|
|
709
598
|
.description('Scan requirements and rebuild GLOBAL/INDEX.md (v4.0)')
|
|
710
599
|
.option('--dry-run', 'Preview mode, no actual changes')
|
|
711
600
|
.action(index_update_1.indexUpdateCommand);
|
|
712
|
-
commander_1.program
|
|
713
|
-
.command('context')
|
|
714
|
-
.alias('ctx')
|
|
715
|
-
.description('View task context loading status and dependency chain (v4.0)')
|
|
716
|
-
.option('--req <req>')
|
|
717
|
-
.option('--task <task>', 'Target task (default: current task)')
|
|
718
|
-
.action(context_output_1.contextCommand);
|
|
601
|
+
commander_1.program;
|
|
719
602
|
// ================================================================
|
|
720
603
|
// 快捷别名(顶层别名)
|
|
721
604
|
// ================================================================
|
|
722
605
|
// 为常用命令提供顶层快捷访问
|
|
723
|
-
commander_1.program
|
|
724
|
-
.command('rv')
|
|
725
|
-
.description('[Alias] speccore validate')
|
|
726
|
-
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
727
|
-
.option('-t, --task <task>', 'Validate specific task')
|
|
728
|
-
.option('--strict', 'Strict mode')
|
|
729
|
-
.option('--fix', 'Auto-fix')
|
|
730
|
-
.option('--format <format>', 'Output format: text or json', 'text')
|
|
731
|
-
.action(validate_1.validateCommand);
|
|
606
|
+
commander_1.program;
|
|
732
607
|
// v4.7.0 体验增强命令
|
|
733
608
|
commander_1.program;
|
|
734
609
|
commander_1.program
|
|
@@ -749,11 +624,11 @@ commander_1.program
|
|
|
749
624
|
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
750
625
|
.option('--skip-validate', 'Skip validation step')
|
|
751
626
|
.option('--skip-sync', 'Skip global sync step')
|
|
627
|
+
.option('--interactive', 'Interactive: preview archive → confirm → complete')
|
|
752
628
|
.action(done_1.doneCommand);
|
|
753
629
|
commander_1.program
|
|
754
630
|
.command('completion [shell]')
|
|
755
631
|
.alias('cmp')
|
|
756
|
-
.alias('cmp')
|
|
757
632
|
.description('Generate shell completion script (bash/zsh)')
|
|
758
633
|
.action(completion_1.completionCommand);
|
|
759
634
|
commander_1.program
|
|
@@ -764,9 +639,7 @@ commander_1.program
|
|
|
764
639
|
.option('--restore <name>', 'Restore from backup')
|
|
765
640
|
.action(backup_1.backupCommand);
|
|
766
641
|
// v4.8.0 高级功能
|
|
767
|
-
commander_1.program
|
|
768
|
-
.command('hooks')
|
|
769
|
-
.description('Install Git hooks (pre-commit + pre-push)');
|
|
642
|
+
commander_1.program;
|
|
770
643
|
commander_1.program
|
|
771
644
|
.command('current')
|
|
772
645
|
.alias('cr')
|
|
@@ -786,6 +659,8 @@ commander_1.program
|
|
|
786
659
|
.option('--type <type>', 'Task type')
|
|
787
660
|
.option('-i, --iteration <name>', 'Target iteration')
|
|
788
661
|
.option('--force', 'Skip confirmation')
|
|
662
|
+
.option('--auto', '全自动流水线:无人干预级联执行全部阶段')
|
|
663
|
+
.option('--from <phase>', '从指定阶段开始(init/analyze/split/plan/execute/pr/done)')
|
|
789
664
|
.action(update_1.updateCommand);
|
|
790
665
|
// v5.3.0 新增命令
|
|
791
666
|
commander_1.program
|
|
@@ -807,40 +682,7 @@ commander_1.program
|
|
|
807
682
|
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
808
683
|
.action(async (options) => { const { getDefaultIteration } = await Promise.resolve().then(() => __importStar(require('./core/context'))); const it = await getDefaultIteration(options.iteration); if (it)
|
|
809
684
|
await (0, merge_check_1.mergeCheck)(it); });
|
|
810
|
-
commander_1.program
|
|
811
|
-
.command('rollback')
|
|
812
|
-
.alias('rb')
|
|
813
|
-
.description('Rollback a task: revert branch + archive spec')
|
|
814
|
-
.option('-t, --task <task>', 'Task to rollback')
|
|
815
|
-
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
816
|
-
.option('--reason <reason>', 'Rollback reason')
|
|
817
|
-
.action(async (options) => { const it = await require('../core/context').getDefaultIteration(options.iteration); if (it && options.task)
|
|
818
|
-
await (0, merge_check_1.rollbackTask)(options.task, it, options.reason); });
|
|
819
|
-
commander_1.program
|
|
820
|
-
.command('arch-update')
|
|
821
|
-
.alias('au')
|
|
822
|
-
.description('Auto-update ARCHITECTURE.md with new APIs/tables')
|
|
823
|
-
.option('-i, --iteration <iteration>', 'Source iteration')
|
|
824
|
-
.option('--apis <apis>', 'Comma-separated API paths')
|
|
825
|
-
.option('--tables <tables>', 'Comma-separated table names')
|
|
826
|
-
.action(async (options) => { const it = await require('../core/context').getDefaultIteration(options.iteration); if (it)
|
|
827
|
-
await (0, merge_check_1.updateArchitecture)(it, (options.apis || '').split(',').filter(Boolean), (options.tables || '').split(',').filter(Boolean)); });
|
|
828
|
-
commander_1.program
|
|
829
|
-
.command('merge-check')
|
|
830
|
-
.alias('mc')
|
|
831
|
-
.description('Predict merge conflicts across task branches')
|
|
832
|
-
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
833
|
-
.action(async (options) => { const { getDefaultIteration } = await Promise.resolve().then(() => __importStar(require('./core/context'))); const it = await getDefaultIteration(options.iteration); if (it)
|
|
834
|
-
await (0, merge_check_1.mergeCheck)(it); });
|
|
835
|
-
commander_1.program
|
|
836
|
-
.command('rollback')
|
|
837
|
-
.alias('rb')
|
|
838
|
-
.description('Rollback a task: revert branch + archive spec')
|
|
839
|
-
.option('-t, --task <task>', 'Task to rollback')
|
|
840
|
-
.option('-i, --iteration <iteration>', 'Target iteration')
|
|
841
|
-
.option('--reason <reason>', 'Rollback reason')
|
|
842
|
-
.action(async (options) => { const it = await require('../core/context').getDefaultIteration(options.iteration); if (it && options.task)
|
|
843
|
-
await (0, merge_check_1.rollbackTask)(options.task, it, options.reason); });
|
|
685
|
+
commander_1.program;
|
|
844
686
|
commander_1.program
|
|
845
687
|
.command('arch-update')
|
|
846
688
|
.alias('au')
|
|
@@ -850,6 +692,9 @@ commander_1.program
|
|
|
850
692
|
.option('--tables <tables>', 'Comma-separated table names')
|
|
851
693
|
.action(async (options) => { const it = await require('../core/context').getDefaultIteration(options.iteration); if (it)
|
|
852
694
|
await (0, merge_check_1.updateArchitecture)(it, (options.apis || '').split(',').filter(Boolean), (options.tables || '').split(',').filter(Boolean)); });
|
|
695
|
+
commander_1.program;
|
|
696
|
+
commander_1.program;
|
|
697
|
+
commander_1.program;
|
|
853
698
|
commander_1.program
|
|
854
699
|
.command('trace')
|
|
855
700
|
.alias('tr')
|
|
@@ -866,6 +711,8 @@ commander_1.program
|
|
|
866
711
|
.option('--task <id>', 'Task ID to delete')
|
|
867
712
|
.option('--iteration <name>', 'Iteration name to delete')
|
|
868
713
|
.option('--force', 'Skip confirmation prompt')
|
|
714
|
+
.option('--auto', '全自动流水线:无人干预级联执行全部阶段')
|
|
715
|
+
.option('--from <phase>', '从指定阶段开始(init/analyze/split/plan/execute/pr/done)')
|
|
869
716
|
.action(delete_1.deleteCommand);
|
|
870
717
|
// v5.6.0 新增命令
|
|
871
718
|
commander_1.program
|
|
@@ -882,7 +729,71 @@ commander_1.program
|
|
|
882
729
|
.option('--task <id>', 'Watch a specific task')
|
|
883
730
|
.option('--iteration <name>', 'Watch a specific iteration')
|
|
884
731
|
.action(watch_1.watchCommand);
|
|
732
|
+
// ── 调度任务管理 ──
|
|
733
|
+
const scheduleCmd = commander_1.program
|
|
734
|
+
.command('schedule')
|
|
735
|
+
.alias('sc')
|
|
736
|
+
.description('定时调度任务管理');
|
|
737
|
+
scheduleCmd
|
|
738
|
+
.command('create')
|
|
739
|
+
.description('创建定时调度任务')
|
|
740
|
+
.option('-t, --task <task>', '指定 Task ID')
|
|
741
|
+
.option('--all', '批量执行所有任务')
|
|
742
|
+
.option('-i, --iteration <iteration>', '目标期次')
|
|
743
|
+
.option('--at <datetime>', '执行时间: "YYYY-MM-DD HH:mm:ss"')
|
|
744
|
+
.option('-n, --name <name>', '任务名称')
|
|
745
|
+
.action(schedule_1.scheduleCreateCommand);
|
|
746
|
+
scheduleCmd
|
|
747
|
+
.command('list')
|
|
748
|
+
.description('查看调度任务列表')
|
|
749
|
+
.option('--status <status>', '按状态筛选: pending|running|completed|failed|cancelled')
|
|
750
|
+
.action(schedule_1.scheduleListCommand);
|
|
751
|
+
scheduleCmd
|
|
752
|
+
.command('cancel')
|
|
753
|
+
.description('取消调度任务')
|
|
754
|
+
.option('--id <id>', '调度任务 ID')
|
|
755
|
+
.action(schedule_1.scheduleCancelCommand);
|
|
756
|
+
scheduleCmd
|
|
757
|
+
.command('delete')
|
|
758
|
+
.description('删除调度记录')
|
|
759
|
+
.option('--id <id>', '调度任务 ID')
|
|
760
|
+
.action(schedule_1.scheduleDeleteCommand);
|
|
761
|
+
scheduleCmd
|
|
762
|
+
.command('daemon')
|
|
763
|
+
.description('守护进程管理 [start|stop|restart|status]')
|
|
764
|
+
.argument('[action]', 'start | stop | restart | status', 'status')
|
|
765
|
+
.option('--foreground', '前台运行守护进程')
|
|
766
|
+
.action((action, options) => {
|
|
767
|
+
return (0, schedule_1.scheduleDaemonCommand)({ action, foreground: options.foreground });
|
|
768
|
+
});
|
|
885
769
|
// Parse arguments
|
|
770
|
+
// ── 帮助分层:核心命令前置 ──
|
|
771
|
+
commander_1.program.addHelpText('beforeAll', `
|
|
772
|
+
┌───────────────────────────────────────────────────┐
|
|
773
|
+
│ 🔵 核心 9 步(完整闭环) │
|
|
774
|
+
│ init → iteration create → doc2spec │
|
|
775
|
+
│ → analyze → split → plan → execute → pr → done │
|
|
776
|
+
├───────────────────────────────────────────────────┤
|
|
777
|
+
│ 🚀 speccore init 初始化项目 │
|
|
778
|
+
│ 📅 speccore iteration create 新建期次 │
|
|
779
|
+
│ 📝 speccore doc2spec 导入需求文档 │
|
|
780
|
+
│ 🔍 speccore analyze 需求分析+代码审查 │
|
|
781
|
+
│ 📦 speccore split 拆分为独立Task │
|
|
782
|
+
│ 📋 speccore plan 生成执行计划 │
|
|
783
|
+
│ 💻 speccore execute 执行开发 │
|
|
784
|
+
│ 🔀 speccore pr 创建PR │
|
|
785
|
+
│ ✅ speccore done 完成任务 │
|
|
786
|
+
├───────────────────────────────────────────────────┤
|
|
787
|
+
│ 💡 speccore(无参数) → 自适应引导面板 │
|
|
788
|
+
│ 💬 speccore ask \"...\" → 自然语言入口 │
|
|
789
|
+
│ 📊 speccore status-panel → 可视化看板 │
|
|
790
|
+
│ 🤖 speccore dev → 智能检测+级联执行 │
|
|
791
|
+
│ 🔍 speccore analyze --depth deep --scope global → 全局代码健康 │
|
|
792
|
+
└───────────────────────────────────────────────────┘
|
|
793
|
+
`);
|
|
794
|
+
commander_1.program.addHelpText('afterAll', `
|
|
795
|
+
💡 完整文档: https://github.com/windfallsheng/SpecCore-ts
|
|
796
|
+
`);
|
|
886
797
|
// ── Adaptive welcome panel (no args) ──
|
|
887
798
|
if (process.argv.length <= 2) {
|
|
888
799
|
const { existsSync, readdirSync, readFileSync } = require('fs');
|
|
@@ -902,7 +813,7 @@ if (process.argv.length <= 2) {
|
|
|
902
813
|
const ana = join(base, '00-需求文档', 'ANALYSIS.md');
|
|
903
814
|
if (!existsSync(req)) {
|
|
904
815
|
phase = 'require';
|
|
905
|
-
nextCmd = 'speccore
|
|
816
|
+
nextCmd = 'speccore doc2spec -i ' + iteration;
|
|
906
817
|
nextDesc = '导入需求文档';
|
|
907
818
|
}
|
|
908
819
|
else if (!existsSync(ana)) {
|
|
@@ -965,5 +876,18 @@ if (process.argv.length <= 2) {
|
|
|
965
876
|
logger.info('');
|
|
966
877
|
process.exit(0);
|
|
967
878
|
}
|
|
968
|
-
|
|
879
|
+
// ── Natural language intent (e.g. speccore "帮我分析需求") ──
|
|
880
|
+
commander_1.program.exitOverride().configureOutput({ outputError: () => { } });
|
|
881
|
+
try {
|
|
882
|
+
commander_1.program.parse();
|
|
883
|
+
}
|
|
884
|
+
catch (err) {
|
|
885
|
+
const input = (process.argv.slice(2)).filter((a) => !a.startsWith('-')).join(' ');
|
|
886
|
+
if (input) {
|
|
887
|
+
(0, ask_1.askCommand)(input, {}).then(() => process.exit(0));
|
|
888
|
+
}
|
|
889
|
+
else {
|
|
890
|
+
process.exit(1);
|
|
891
|
+
}
|
|
892
|
+
}
|
|
969
893
|
//# sourceMappingURL=cli.js.map
|