6aspec 3.0.0-dev.2 → 3.0.0-dev.21
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/.6aspec/rules/biz/code.md +7 -3
- package/.6aspec/rules/brown/brown_analyze_sop.md +7 -2
- package/.6aspec/rules/brown/brown_archive_sop.md +3 -2
- package/.6aspec/rules/brown/brown_continue_sop.md +1 -3
- package/.6aspec/rules/brown/brown_implement_sop.md +41 -15
- package/.6aspec/rules/brown/brown_new_sop.md +10 -6
- package/.6aspec/rules/brown/brown_quick_sop.md +1 -1
- package/.6aspec/rules/brown/brown_rollback_sop.md +3 -7
- package/.6aspec/rules/brown/brown_tasks_sop.md +8 -13
- package/.6aspec/rules/brown/brown_update_sop.md +4 -9
- package/.6aspec/rules/brown/subagents/implementer.md +35 -8
- package/.6aspec/rules/brown/subagents/spec-compliance-reviewer.md +80 -10
- package/.6aspec/rules/common/code-reviewer-agent.md +141 -0
- package/.agents/skills/6aspec-brown-analyze/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-archive/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-continue/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-design/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-explore/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-ff/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-implement/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-list/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-new/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-proposal/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-quick/SKILL.md +10 -0
- package/{.cursor/commands/6aspec/brown/impact.md → .agents/skills/6aspec-brown-review/SKILL.md} +5 -4
- package/.agents/skills/6aspec-brown-rollback/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-specs/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-status/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-tasks/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-update/SKILL.md +10 -0
- package/.agents/skills/6aspec-brown-verify/SKILL.md +10 -0
- package/.agents/skills/6aspec-review/SKILL.md +36 -0
- package/.claude/agents/{implementer.md → 6aspec-brown-implementer.md} +2 -1
- package/.claude/agents/6aspec-brown-spec-compliance-reviewer.md +7 -0
- package/.claude/agents/6aspec-code-reviewer.md +7 -0
- package/.claude/commands/6aspec/brown/analyze.md +1 -1
- package/.claude/commands/6aspec/brown/design.md +1 -1
- package/.claude/commands/6aspec/brown/quick.md +1 -1
- package/.claude/commands/6aspec/brown/review.md +1 -1
- package/.claude/commands/6aspec/brown/specs.md +1 -1
- package/.claude/commands/6aspec/brown/tasks.md +1 -1
- package/.claude/commands/6aspec/review.md +66 -0
- package/.claude/settings.local.json +1 -22
- package/.codex/agents/6aspec-brown-implementer.toml +11 -0
- package/.codex/agents/6aspec-brown-spec-compliance-reviewer.toml +11 -0
- package/.codex/agents/6aspec-code-reviewer.toml +11 -0
- package/.cursor/agents/6aspec-brown-implementer.md +7 -0
- package/.cursor/agents/6aspec-brown-spec-compliance-reviewer.md +8 -0
- package/.cursor/agents/6aspec-code-reviewer.md +8 -0
- package/.cursor/commands/6aspec-brown-analyze.md +9 -0
- package/.cursor/commands/{6aspec/brown/design.md → 6aspec-brown-design.md} +1 -1
- package/.cursor/commands/{6aspec/brown/implement.md → 6aspec-brown-implement.md} +1 -1
- package/.cursor/commands/{6aspec/brown/quick.md → 6aspec-brown-quick.md} +1 -1
- package/.cursor/commands/{6aspec/brown/review.md → 6aspec-brown-review.md} +1 -1
- package/.cursor/commands/{6aspec/brown/specs.md → 6aspec-brown-specs.md} +1 -1
- package/.cursor/commands/{6aspec/brown/tasks.md → 6aspec-brown-tasks.md} +1 -1
- package/.cursor/commands/6aspec-review.md +66 -0
- package/lib/cli.js +47 -11
- package/lib/installer.js +74 -23
- package/package.json +3 -1
- package/.claude/agents/spec-compliance-reviewer.md +0 -6
- package/.claude/commands/6aspec/brown/impact.md +0 -11
- package/.claude/commands/6aspec/brown/understand.md +0 -11
- package/.cursor/commands/6aspec/brown/understand.md +0 -9
- /package/.cursor/commands/{6aspec/brown/archive.md → 6aspec-brown-archive.md} +0 -0
- /package/.cursor/commands/{6aspec/brown/continue.md → 6aspec-brown-continue.md} +0 -0
- /package/.cursor/commands/{6aspec/brown/explore.md → 6aspec-brown-explore.md} +0 -0
- /package/.cursor/commands/{6aspec/brown/ff.md → 6aspec-brown-ff.md} +0 -0
- /package/.cursor/commands/{6aspec/brown/list.md → 6aspec-brown-list.md} +0 -0
- /package/.cursor/commands/{6aspec/brown/new.md → 6aspec-brown-new.md} +0 -0
- /package/.cursor/commands/{6aspec/brown/proposal.md → 6aspec-brown-proposal.md} +0 -0
- /package/.cursor/commands/{6aspec/brown/rollback.md → 6aspec-brown-rollback.md} +0 -0
- /package/.cursor/commands/{6aspec/brown/status.md → 6aspec-brown-status.md} +0 -0
- /package/.cursor/commands/{6aspec/brown/update.md → 6aspec-brown-update.md} +0 -0
- /package/.cursor/commands/{6aspec/brown/verify.md → 6aspec-brown-verify.md} +0 -0
- /package/.cursor/commands/{6aspec/code.md → 6aspec-code.md} +0 -0
- /package/.cursor/commands/{6aspec/green/archive.md → 6aspec-green-archive.md} +0 -0
- /package/.cursor/commands/{6aspec/green/clarify.md → 6aspec-green-clarify.md} +0 -0
- /package/.cursor/commands/{6aspec/green/continue.md → 6aspec-green-continue.md} +0 -0
- /package/.cursor/commands/{6aspec/green/design.md → 6aspec-green-design.md} +0 -0
- /package/.cursor/commands/{6aspec/green/implement.md → 6aspec-green-implement.md} +0 -0
- /package/.cursor/commands/{6aspec/green/import-model-table.md → 6aspec-green-import-model-table.md} +0 -0
- /package/.cursor/commands/{6aspec/green/init.md → 6aspec-green-init.md} +0 -0
- /package/.cursor/commands/{6aspec/green/model.md → 6aspec-green-model.md} +0 -0
- /package/.cursor/commands/{6aspec/green/new.md → 6aspec-green-new.md} +0 -0
- /package/.cursor/commands/{6aspec/green/rollback.md → 6aspec-green-rollback.md} +0 -0
- /package/.cursor/commands/{6aspec/green/status.md → 6aspec-green-status.md} +0 -0
- /package/.cursor/commands/{6aspec/green/tasks.md → 6aspec-green-tasks.md} +0 -0
- /package/.cursor/commands/{6aspec/green/visual-logic.md → 6aspec-green-visual-logic.md} +0 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 独立代码审查(优先 DIFF,其次 git diff),不绑定任何流程,随时可用
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Review
|
|
7
|
+
|
|
8
|
+
对当前代码变更进行独立审查。
|
|
9
|
+
|
|
10
|
+
## 步骤
|
|
11
|
+
|
|
12
|
+
### 1. 解析输入
|
|
13
|
+
|
|
14
|
+
用户可以提供以下参数(均可选):
|
|
15
|
+
- `<description>` — 变更描述
|
|
16
|
+
- `--diff <file>` — 本次变更的 unified diff 文件路径(优先)
|
|
17
|
+
- `--base <SHA>` — 起始 commit(默认:HEAD~1)
|
|
18
|
+
- `--head <SHA>` — 结束 commit(默认:HEAD)
|
|
19
|
+
- `--plan <file>` — 需求/计划文件路径
|
|
20
|
+
|
|
21
|
+
如果未提供 `--diff/--base/--head`,使用默认值(HEAD~1..HEAD)。
|
|
22
|
+
|
|
23
|
+
### 2. 确定变更来源
|
|
24
|
+
|
|
25
|
+
- 如果提供了 `--diff`:读取 diff 文件内容作为 `DIFF`,并直接进入步骤 3。
|
|
26
|
+
- 否则:使用 git 范围。
|
|
27
|
+
|
|
28
|
+
### 3. (可选)展示 git 范围
|
|
29
|
+
|
|
30
|
+
当使用 git 范围时:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
git log --oneline -10
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
显示最近 10 条 commit,帮助用户确认审查范围。
|
|
37
|
+
|
|
38
|
+
如果用户未指定 SHA,使用:
|
|
39
|
+
- BASE_SHA = HEAD~1
|
|
40
|
+
- HEAD_SHA = HEAD
|
|
41
|
+
|
|
42
|
+
### 4. 派发 6aspec-code-reviewer agent
|
|
43
|
+
|
|
44
|
+
调用 `6aspec-code-reviewer` agent,传入:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
变更描述:[用户提供的描述,或"最近一次提交的变更"]
|
|
48
|
+
需求/计划:[--plan 指定的文件路径,或"无"]
|
|
49
|
+
DIFF:[--diff 指定文件内容(如提供)]
|
|
50
|
+
BASE_SHA:[base SHA(如使用 git)]
|
|
51
|
+
HEAD_SHA:[head SHA(如使用 git)]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 5. 展示审查结果
|
|
55
|
+
|
|
56
|
+
直接展示 agent 返回的完整审查报告。
|
|
57
|
+
|
|
58
|
+
## 使用示例
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
/6aspec:review
|
|
62
|
+
/6aspec:review 实现了用户认证功能
|
|
63
|
+
/6aspec:review --diff /tmp/change.patch
|
|
64
|
+
/6aspec:review --base abc1234 --head def5678
|
|
65
|
+
/6aspec:review --plan 6aspecdoc/brown/add-user-auth/artifacts/specs.md
|
|
66
|
+
```
|
package/lib/cli.js
CHANGED
|
@@ -17,14 +17,37 @@ const CONFIG_FILE = '.6aspec/init.json';
|
|
|
17
17
|
const TOOLS = [
|
|
18
18
|
{ id: 'cursor', name: 'Cursor', desc: 'Cursor IDE 配置' },
|
|
19
19
|
{ id: 'claude', name: 'Claude Code', desc: 'Claude Code CLI 配置' },
|
|
20
|
+
{ id: 'codex', name: 'Codex CLI', desc: 'Codex CLI skills/agents 配置' },
|
|
20
21
|
];
|
|
21
22
|
|
|
22
23
|
// Only the 6aspec-owned subdirectory is removed — user's own commands are untouched
|
|
23
24
|
const TOOL_DIRS = {
|
|
24
25
|
cursor: ['.cursor/commands/6aspec'],
|
|
25
26
|
claude: ['.claude/commands/6aspec', '.claude/agents'],
|
|
27
|
+
codex: [
|
|
28
|
+
'.agents/skills/6aspec-brown-new',
|
|
29
|
+
'.agents/skills/6aspec-brown-explore',
|
|
30
|
+
'.agents/skills/6aspec-brown-analyze',
|
|
31
|
+
'.agents/skills/6aspec-brown-proposal',
|
|
32
|
+
'.agents/skills/6aspec-brown-specs',
|
|
33
|
+
'.agents/skills/6aspec-brown-design',
|
|
34
|
+
'.agents/skills/6aspec-brown-tasks',
|
|
35
|
+
'.agents/skills/6aspec-brown-implement',
|
|
36
|
+
'.agents/skills/6aspec-brown-verify',
|
|
37
|
+
'.agents/skills/6aspec-brown-review',
|
|
38
|
+
'.agents/skills/6aspec-brown-archive',
|
|
39
|
+
'.agents/skills/6aspec-brown-continue',
|
|
40
|
+
'.agents/skills/6aspec-brown-status',
|
|
41
|
+
'.agents/skills/6aspec-brown-list',
|
|
42
|
+
'.agents/skills/6aspec-brown-ff',
|
|
43
|
+
'.agents/skills/6aspec-brown-quick',
|
|
44
|
+
'.agents/skills/6aspec-brown-rollback',
|
|
45
|
+
'.agents/skills/6aspec-brown-update',
|
|
46
|
+
'.codex/agents/6aspec-brown-implementer.toml',
|
|
47
|
+
'.codex/agents/6aspec-brown-spec-compliance-reviewer.toml',
|
|
48
|
+
'.codex/agents/6aspec-code-reviewer.toml',
|
|
49
|
+
],
|
|
26
50
|
};
|
|
27
|
-
|
|
28
51
|
// ─── Welcome Screen with Animation ──────────────────────────────────
|
|
29
52
|
|
|
30
53
|
// Braille spinner frames
|
|
@@ -272,15 +295,23 @@ function writeConfig(targetDir, tools) {
|
|
|
272
295
|
|
|
273
296
|
// ─── Tool removal ───────────────────────────────────────────────────
|
|
274
297
|
|
|
275
|
-
function
|
|
276
|
-
if (!fs.existsSync(
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
298
|
+
function removePathRecursive(targetPath) {
|
|
299
|
+
if (!fs.existsSync(targetPath)) return;
|
|
300
|
+
const stat = fs.lstatSync(targetPath);
|
|
301
|
+
|
|
302
|
+
if (stat.isDirectory()) {
|
|
303
|
+
const entries = fs.readdirSync(targetPath, { withFileTypes: true });
|
|
304
|
+
for (const entry of entries) {
|
|
305
|
+
const full = path.join(targetPath, entry.name);
|
|
306
|
+
if (entry.isDirectory()) removePathRecursive(full);
|
|
307
|
+
else fs.unlinkSync(full);
|
|
308
|
+
}
|
|
309
|
+
fs.rmdirSync(targetPath);
|
|
310
|
+
return;
|
|
282
311
|
}
|
|
283
|
-
|
|
312
|
+
|
|
313
|
+
// file or symlink
|
|
314
|
+
fs.unlinkSync(targetPath);
|
|
284
315
|
}
|
|
285
316
|
|
|
286
317
|
function removeToolFiles(targetDir, tools) {
|
|
@@ -289,13 +320,12 @@ function removeToolFiles(targetDir, tools) {
|
|
|
289
320
|
for (const rel of dirs) {
|
|
290
321
|
const full = path.join(targetDir, rel);
|
|
291
322
|
if (fs.existsSync(full)) {
|
|
292
|
-
|
|
323
|
+
removePathRecursive(full);
|
|
293
324
|
console.log(`${GREEN}[INFO]${RESET} 已删除 ${rel}`);
|
|
294
325
|
}
|
|
295
326
|
}
|
|
296
327
|
}
|
|
297
328
|
}
|
|
298
|
-
|
|
299
329
|
// Simple y/N prompt (readline, no raw mode needed)
|
|
300
330
|
function promptConfirm(question) {
|
|
301
331
|
return new Promise((resolve) => {
|
|
@@ -380,6 +410,9 @@ async function init(args) {
|
|
|
380
410
|
case 'claude':
|
|
381
411
|
installer.installClaude();
|
|
382
412
|
break;
|
|
413
|
+
case 'codex':
|
|
414
|
+
installer.installCodex();
|
|
415
|
+
break;
|
|
383
416
|
}
|
|
384
417
|
}
|
|
385
418
|
|
|
@@ -439,6 +472,9 @@ async function update(args) {
|
|
|
439
472
|
case 'claude':
|
|
440
473
|
installer.installClaude();
|
|
441
474
|
break;
|
|
475
|
+
case 'codex':
|
|
476
|
+
installer.installCodex();
|
|
477
|
+
break;
|
|
442
478
|
}
|
|
443
479
|
}
|
|
444
480
|
|
package/lib/installer.js
CHANGED
|
@@ -12,11 +12,11 @@ class Installer {
|
|
|
12
12
|
// 查找包目录(支持本地开发和 npm 安装)
|
|
13
13
|
findPackageDir() {
|
|
14
14
|
// 如果是本地开发,直接使用当前目录
|
|
15
|
-
if (fs.existsSync(path.join(__dirname, '../.6aspec')) ||
|
|
15
|
+
if (fs.existsSync(path.join(__dirname, '../.6aspec')) ||
|
|
16
16
|
fs.existsSync(path.join(__dirname, '../.cursor'))) {
|
|
17
17
|
return path.join(__dirname, '..');
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
// 如果是 npm 安装,查找 node_modules
|
|
21
21
|
let current = __dirname;
|
|
22
22
|
while (current !== path.dirname(current)) {
|
|
@@ -27,7 +27,7 @@ class Installer {
|
|
|
27
27
|
}
|
|
28
28
|
current = path.dirname(current);
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
throw new Error('未找到 .6aspec 或 .cursor 目录,请确保包已正确安装');
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -75,7 +75,7 @@ class Installer {
|
|
|
75
75
|
if (fs.existsSync(dest)) {
|
|
76
76
|
this.removeDir(dest);
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
|
|
79
79
|
// 重新创建目录并复制
|
|
80
80
|
fs.mkdirSync(dest, { recursive: true });
|
|
81
81
|
|
|
@@ -150,7 +150,7 @@ class Installer {
|
|
|
150
150
|
// 安装公共配置 (.6aspec)
|
|
151
151
|
install6aspec() {
|
|
152
152
|
this.log('开始安装公共配置 (.6aspec)...');
|
|
153
|
-
|
|
153
|
+
|
|
154
154
|
const sourceDir = path.join(this.packageDir, '.6aspec');
|
|
155
155
|
const targetDir = path.join(this.targetDir, '.6aspec');
|
|
156
156
|
|
|
@@ -160,23 +160,23 @@ class Installer {
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
const targetExists = fs.existsSync(targetDir);
|
|
163
|
-
|
|
163
|
+
|
|
164
164
|
if (this.mergeMode && targetExists) {
|
|
165
165
|
// 智能合并模式
|
|
166
166
|
this.log('使用智能合并模式(保留用户自定义文件)...');
|
|
167
|
-
|
|
167
|
+
|
|
168
168
|
// 统计用户自定义文件
|
|
169
169
|
const sourceFiles = new Set(this.getAllFiles(sourceDir, sourceDir));
|
|
170
170
|
const targetFiles = this.getAllFiles(targetDir, targetDir);
|
|
171
171
|
const customFiles = targetFiles.filter(f => !sourceFiles.has(f));
|
|
172
|
-
|
|
172
|
+
|
|
173
173
|
if (customFiles.length > 0) {
|
|
174
174
|
this.log(`检测到 ${customFiles.length} 个用户自定义文件,将保留`, 'info');
|
|
175
175
|
}
|
|
176
|
-
|
|
176
|
+
|
|
177
177
|
const result = this.mergeDir(sourceDir, targetDir);
|
|
178
178
|
this.log(`更新了 ${result.updated} 个文件,新增了 ${result.added} 个文件`, 'info');
|
|
179
|
-
|
|
179
|
+
|
|
180
180
|
if (customFiles.length > 0) {
|
|
181
181
|
this.log(`保留了 ${customFiles.length} 个用户自定义文件`, 'info');
|
|
182
182
|
}
|
|
@@ -188,14 +188,14 @@ class Installer {
|
|
|
188
188
|
this.log('复制公共配置文件...');
|
|
189
189
|
this.copyDir(sourceDir, targetDir);
|
|
190
190
|
}
|
|
191
|
-
|
|
191
|
+
|
|
192
192
|
this.log('✓ 公共配置安装完成!', 'success');
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
// 安装 Cursor 配置
|
|
196
196
|
installCursor() {
|
|
197
197
|
this.log('开始安装 Cursor 配置...');
|
|
198
|
-
|
|
198
|
+
|
|
199
199
|
const sourceDir = path.join(this.packageDir, '.cursor');
|
|
200
200
|
const targetDir = path.join(this.targetDir, '.cursor');
|
|
201
201
|
|
|
@@ -204,11 +204,11 @@ class Installer {
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
const targetExists = fs.existsSync(targetDir);
|
|
207
|
-
|
|
207
|
+
|
|
208
208
|
if (this.mergeMode && targetExists) {
|
|
209
209
|
// 智能合并模式
|
|
210
210
|
this.log('使用智能合并模式(保留用户自定义文件)...');
|
|
211
|
-
|
|
211
|
+
|
|
212
212
|
// 只复制 commands 目录
|
|
213
213
|
const commandsSourceDir = path.join(sourceDir, 'commands');
|
|
214
214
|
if (fs.existsSync(commandsSourceDir)) {
|
|
@@ -216,33 +216,48 @@ class Installer {
|
|
|
216
216
|
const result = this.mergeDir(commandsSourceDir, commandsTargetDir);
|
|
217
217
|
this.log(`commands: 更新了 ${result.updated} 个文件,新增了 ${result.added} 个文件`, 'info');
|
|
218
218
|
}
|
|
219
|
+
|
|
220
|
+
// 复制 agents 目录
|
|
221
|
+
const agentsSourceDir = path.join(sourceDir, 'agents');
|
|
222
|
+
if (fs.existsSync(agentsSourceDir)) {
|
|
223
|
+
const agentsTargetDir = path.join(targetDir, 'agents');
|
|
224
|
+
const result = this.mergeDir(agentsSourceDir, agentsTargetDir);
|
|
225
|
+
this.log(`agents: 更新了 ${result.updated} 个文件,新增了 ${result.added} 个文件`, 'info');
|
|
226
|
+
}
|
|
219
227
|
} else {
|
|
220
228
|
// 完全覆盖模式
|
|
221
229
|
if (targetExists) {
|
|
222
230
|
this.backupDir(targetDir);
|
|
223
231
|
}
|
|
224
232
|
this.log('复制 Cursor 配置文件...');
|
|
225
|
-
|
|
233
|
+
|
|
226
234
|
// 创建目标目录
|
|
227
235
|
if (!fs.existsSync(targetDir)) {
|
|
228
236
|
fs.mkdirSync(targetDir, { recursive: true });
|
|
229
237
|
}
|
|
230
|
-
|
|
238
|
+
|
|
231
239
|
// 只复制 commands 目录
|
|
232
240
|
const commandsSourceDir = path.join(sourceDir, 'commands');
|
|
233
241
|
if (fs.existsSync(commandsSourceDir)) {
|
|
234
242
|
const commandsTargetDir = path.join(targetDir, 'commands');
|
|
235
243
|
this.copyDir(commandsSourceDir, commandsTargetDir);
|
|
236
244
|
}
|
|
245
|
+
|
|
246
|
+
// 复制 agents 目录
|
|
247
|
+
const agentsSourceDir = path.join(sourceDir, 'agents');
|
|
248
|
+
if (fs.existsSync(agentsSourceDir)) {
|
|
249
|
+
const agentsTargetDir = path.join(targetDir, 'agents');
|
|
250
|
+
this.copyDir(agentsSourceDir, agentsTargetDir);
|
|
251
|
+
}
|
|
237
252
|
}
|
|
238
|
-
|
|
253
|
+
|
|
239
254
|
this.log('✓ Cursor 配置安装完成!', 'success');
|
|
240
255
|
}
|
|
241
256
|
|
|
242
257
|
// 安装 Claude 配置
|
|
243
258
|
installClaude() {
|
|
244
259
|
this.log('开始安装 Claude 配置...');
|
|
245
|
-
|
|
260
|
+
|
|
246
261
|
const sourceDir = path.join(this.packageDir, '.claude');
|
|
247
262
|
const targetDir = path.join(this.targetDir, '.claude');
|
|
248
263
|
|
|
@@ -252,7 +267,7 @@ class Installer {
|
|
|
252
267
|
}
|
|
253
268
|
|
|
254
269
|
const targetExists = fs.existsSync(targetDir);
|
|
255
|
-
|
|
270
|
+
|
|
256
271
|
// 创建目标目录结构
|
|
257
272
|
if (!fs.existsSync(targetDir)) {
|
|
258
273
|
fs.mkdirSync(targetDir, { recursive: true });
|
|
@@ -302,14 +317,46 @@ class Installer {
|
|
|
302
317
|
this.copyDir(agentsDir, targetAgentsDir);
|
|
303
318
|
}
|
|
304
319
|
}
|
|
305
|
-
|
|
320
|
+
|
|
306
321
|
this.log('✓ Claude 配置安装完成!', 'success');
|
|
307
322
|
}
|
|
308
323
|
|
|
324
|
+
// 安装 Codex CLI 配置(仅合并,不覆盖删除用户内容)
|
|
325
|
+
installCodex() {
|
|
326
|
+
this.log('开始安装 Codex CLI 配置...');
|
|
327
|
+
|
|
328
|
+
const agentsSourceDir = path.join(this.packageDir, '.agents');
|
|
329
|
+
const codexSourceDir = path.join(this.packageDir, '.codex');
|
|
330
|
+
|
|
331
|
+
const agentsTargetDir = path.join(this.targetDir, '.agents');
|
|
332
|
+
const codexTargetDir = path.join(this.targetDir, '.codex');
|
|
333
|
+
|
|
334
|
+
// 强制 merge 语义:绝不使用 copyDir(copyDir 会先 removeDir(dest))
|
|
335
|
+
if (fs.existsSync(agentsSourceDir)) {
|
|
336
|
+
const result = this.mergeDir(agentsSourceDir, agentsTargetDir);
|
|
337
|
+
if (result.updated > 0 || result.added > 0) {
|
|
338
|
+
this.log(`.agents: 更新了 ${result.updated} 个文件,新增了 ${result.added} 个文件`, 'info');
|
|
339
|
+
}
|
|
340
|
+
} else {
|
|
341
|
+
this.log('未找到 .agents 源目录,跳过', 'warn');
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
if (fs.existsSync(codexSourceDir)) {
|
|
345
|
+
const result = this.mergeDir(codexSourceDir, codexTargetDir);
|
|
346
|
+
if (result.updated > 0 || result.added > 0) {
|
|
347
|
+
this.log(`.codex: 更新了 ${result.updated} 个文件,新增了 ${result.added} 个文件`, 'info');
|
|
348
|
+
}
|
|
349
|
+
} else {
|
|
350
|
+
this.log('未找到 .codex 源目录,跳过', 'warn');
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
this.log('✓ Codex CLI 配置安装完成!', 'success');
|
|
354
|
+
}
|
|
355
|
+
|
|
309
356
|
// 主安装方法
|
|
310
357
|
async install(tool = 'cursor', mergeMode = false) {
|
|
311
358
|
this.mergeMode = mergeMode;
|
|
312
|
-
|
|
359
|
+
|
|
313
360
|
this.log(`6A-spec 安装工具`);
|
|
314
361
|
this.log(`目标目录: ${this.targetDir}`);
|
|
315
362
|
this.log(`工具: ${tool}`);
|
|
@@ -322,7 +369,7 @@ class Installer {
|
|
|
322
369
|
try {
|
|
323
370
|
// 无论安装哪个工具,都要先安装公共配置
|
|
324
371
|
this.install6aspec();
|
|
325
|
-
|
|
372
|
+
|
|
326
373
|
switch (tool.toLowerCase()) {
|
|
327
374
|
case 'cursor':
|
|
328
375
|
this.installCursor();
|
|
@@ -330,12 +377,16 @@ class Installer {
|
|
|
330
377
|
case 'claude':
|
|
331
378
|
this.installClaude();
|
|
332
379
|
break;
|
|
380
|
+
case 'codex':
|
|
381
|
+
this.installCodex();
|
|
382
|
+
break;
|
|
333
383
|
case 'all':
|
|
334
384
|
this.installCursor();
|
|
335
385
|
this.installClaude();
|
|
386
|
+
this.installCodex();
|
|
336
387
|
break;
|
|
337
388
|
default:
|
|
338
|
-
throw new Error(`未知工具: ${tool}\n支持的工具: cursor, claude, all`);
|
|
389
|
+
throw new Error(`未知工具: ${tool}\n支持的工具: cursor, claude, codex, all`);
|
|
339
390
|
}
|
|
340
391
|
|
|
341
392
|
this.log('安装完成!', 'success');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "6aspec",
|
|
3
|
-
"version": "3.0.0-dev.
|
|
3
|
+
"version": "3.0.0-dev.21",
|
|
4
4
|
"description": "6Aspec - 轻量级 spec 驱动开发框架,支持 Cursor 和 Claude Code",
|
|
5
5
|
"main": "lib/installer.js",
|
|
6
6
|
"bin": {
|
|
@@ -50,6 +50,8 @@
|
|
|
50
50
|
".cursor/",
|
|
51
51
|
".claude/",
|
|
52
52
|
".6aspec/",
|
|
53
|
+
".agents/",
|
|
54
|
+
".codex/",
|
|
53
55
|
"README.md"
|
|
54
56
|
],
|
|
55
57
|
"engines": {
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: "6aspec:brown: Impact"
|
|
3
|
-
description: Phase 2 - 影响面分析与非功能需求评估
|
|
4
|
-
category: Workflow
|
|
5
|
-
tags: [workflow, requirement, analysis]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
1. Immediate response upon activation: brown field requirement workflow - **Impact** has been activated
|
|
9
|
-
2. **Read and strictly follow the brown field constitution**: `.6aspec/rules/brown/brown_constitution.md`
|
|
10
|
-
3. Read file: `.6aspec/rules/brown/brown_impact_sop.md`
|
|
11
|
-
4. Strictly follow the SOP defined in that file
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: "6aspec:brown: Understand"
|
|
3
|
-
description: Phase 1 - 需求理解与现状分析
|
|
4
|
-
category: Workflow
|
|
5
|
-
tags: [workflow, requirement, analysis]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
1. Immediate response upon activation: brown field requirement workflow - **Understand** has been activated
|
|
9
|
-
2. **Read and strictly follow the brown field constitution**: `.6aspec/rules/brown/brown_constitution.md`
|
|
10
|
-
3. Read file: `.6aspec/rules/brown/brown_understand_sop.md`
|
|
11
|
-
4. Strictly follow the SOP defined in that file
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Phase 1 - 需求理解与现状分析
|
|
3
|
-
alwaysApply: false
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
1. Immediate response upon activation: brown field requirement workflow - **Understand** has been activated
|
|
7
|
-
2. **Read and strictly follow the brown field constitution**: `.6aspec/rules/brown/brown_constitution.md`
|
|
8
|
-
3. Read file: `.6aspec/rules/brown/brown_understand_sop.md`
|
|
9
|
-
4. Strictly follow the SOP defined in that file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/.cursor/commands/{6aspec/green/import-model-table.md → 6aspec-green-import-model-table.md}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|