6aspec 2.0.0-dev.10
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/api_rule.md +578 -0
- package/.6aspec/rules/biz/background_job_rule.md +719 -0
- package/.6aspec/rules/biz/c_user_system_rule.md +240 -0
- package/.6aspec/rules/biz/code.md +39 -0
- package/.6aspec/rules/biz/event_subscriber_rule.md +529 -0
- package/.6aspec/rules/biz/project-structure.md +90 -0
- package/.6aspec/rules/biz/scheduled_job_rule.md +850 -0
- package/.6aspec/rules/brown/brown_archive_sop.md +132 -0
- package/.6aspec/rules/brown/brown_constitution.md +20 -0
- package/.6aspec/rules/brown/brown_continue_sop.md +97 -0
- package/.6aspec/rules/brown/brown_design_sop.md +155 -0
- package/.6aspec/rules/brown/brown_ff_sop.md +194 -0
- package/.6aspec/rules/brown/brown_impact_sop.md +293 -0
- package/.6aspec/rules/brown/brown_implement_sop.md +133 -0
- package/.6aspec/rules/brown/brown_list_sop.md +69 -0
- package/.6aspec/rules/brown/brown_new_sop.md +257 -0
- package/.6aspec/rules/brown/brown_proposal_sop.md +160 -0
- package/.6aspec/rules/brown/brown_quick_sop.md +134 -0
- package/.6aspec/rules/brown/brown_review_sop.md +270 -0
- package/.6aspec/rules/brown/brown_rollback_sop.md +188 -0
- package/.6aspec/rules/brown/brown_specs_sop.md +228 -0
- package/.6aspec/rules/brown/brown_status_sop.md +135 -0
- package/.6aspec/rules/brown/brown_tasks_sop.md +202 -0
- package/.6aspec/rules/brown/brown_understand_sop.md +208 -0
- package/.6aspec/rules/brown/brown_verify_sop.md +360 -0
- package/.6aspec/rules/green/6A_archive_sop.md +301 -0
- package/.6aspec/rules/green/6A_clarify_sop.md +238 -0
- package/.6aspec/rules/green/6A_code_implementation_sop.md +110 -0
- package/.6aspec/rules/green/6A_constitution.md +52 -0
- package/.6aspec/rules/green/6A_continue_sop.md +186 -0
- package/.6aspec/rules/green/6A_design_sop.md +228 -0
- package/.6aspec/rules/green/6A_import_model_table_sop.md +120 -0
- package/.6aspec/rules/green/6A_init_event_list_sop.md +62 -0
- package/.6aspec/rules/green/6A_init_map_sop.md +79 -0
- package/.6aspec/rules/green/6A_model_sop.md +210 -0
- package/.6aspec/rules/green/6A_new_sop.md +319 -0
- package/.6aspec/rules/green/6A_rollback_sop.md +198 -0
- package/.6aspec/rules/green/6A_status_sop.md +275 -0
- package/.6aspec/rules/green/6A_tasks_sop.md +181 -0
- package/.6aspec/rules/green/6A_visual_logic_sop.md +121 -0
- package/.6aspec/rules/green/green_status_schema.md +293 -0
- package/.6aspec/script/create_entities_from_markdown.py +688 -0
- package/.claude/commands/6aspec/brown/archive.md +11 -0
- package/.claude/commands/6aspec/brown/continue.md +11 -0
- package/.claude/commands/6aspec/brown/design.md +11 -0
- package/.claude/commands/6aspec/brown/ff.md +11 -0
- package/.claude/commands/6aspec/brown/impact.md +11 -0
- package/.claude/commands/6aspec/brown/implement.md +11 -0
- package/.claude/commands/6aspec/brown/list.md +11 -0
- package/.claude/commands/6aspec/brown/new.md +11 -0
- package/.claude/commands/6aspec/brown/proposal.md +11 -0
- package/.claude/commands/6aspec/brown/quick.md +11 -0
- package/.claude/commands/6aspec/brown/review.md +11 -0
- package/.claude/commands/6aspec/brown/rollback.md +11 -0
- package/.claude/commands/6aspec/brown/specs.md +11 -0
- package/.claude/commands/6aspec/brown/status.md +11 -0
- package/.claude/commands/6aspec/brown/tasks.md +11 -0
- package/.claude/commands/6aspec/brown/understand.md +11 -0
- package/.claude/commands/6aspec/brown/verify.md +11 -0
- package/.claude/commands/6aspec/green/archive.md +8 -0
- package/.claude/commands/6aspec/green/clarify.md +13 -0
- package/.claude/commands/6aspec/green/continue.md +8 -0
- package/.claude/commands/6aspec/green/design.md +8 -0
- package/.claude/commands/6aspec/green/execute-task.md +20 -0
- package/.claude/commands/6aspec/green/import-model-table.md +8 -0
- package/.claude/commands/6aspec/green/init.md +14 -0
- package/.claude/commands/6aspec/green/model.md +12 -0
- package/.claude/commands/6aspec/green/new.md +13 -0
- package/.claude/commands/6aspec/green/rollback.md +8 -0
- package/.claude/commands/6aspec/green/status.md +8 -0
- package/.claude/commands/6aspec/green/tasks.md +8 -0
- package/.claude/commands/6aspec/green/visual-logic.md +9 -0
- package/.claude/settings.local.json +8 -0
- package/.cursor/commands/6aspec/brown/archive.md +9 -0
- package/.cursor/commands/6aspec/brown/continue.md +9 -0
- package/.cursor/commands/6aspec/brown/design.md +9 -0
- package/.cursor/commands/6aspec/brown/ff.md +9 -0
- package/.cursor/commands/6aspec/brown/impact.md +9 -0
- package/.cursor/commands/6aspec/brown/implement.md +9 -0
- package/.cursor/commands/6aspec/brown/list.md +9 -0
- package/.cursor/commands/6aspec/brown/new.md +9 -0
- package/.cursor/commands/6aspec/brown/proposal.md +9 -0
- package/.cursor/commands/6aspec/brown/quick.md +9 -0
- package/.cursor/commands/6aspec/brown/review.md +9 -0
- package/.cursor/commands/6aspec/brown/rollback.md +9 -0
- package/.cursor/commands/6aspec/brown/specs.md +9 -0
- package/.cursor/commands/6aspec/brown/status.md +9 -0
- package/.cursor/commands/6aspec/brown/tasks.md +9 -0
- package/.cursor/commands/6aspec/brown/understand.md +9 -0
- package/.cursor/commands/6aspec/brown/verify.md +9 -0
- package/.cursor/commands/6aspec/green/archive.md +9 -0
- package/.cursor/commands/6aspec/green/clarify.md +14 -0
- package/.cursor/commands/6aspec/green/continue.md +9 -0
- package/.cursor/commands/6aspec/green/design.md +9 -0
- package/.cursor/commands/6aspec/green/execute-task.md +21 -0
- package/.cursor/commands/6aspec/green/import-model-table.md +9 -0
- package/.cursor/commands/6aspec/green/init.md +15 -0
- package/.cursor/commands/6aspec/green/model.md +13 -0
- package/.cursor/commands/6aspec/green/new.md +14 -0
- package/.cursor/commands/6aspec/green/rollback.md +9 -0
- package/.cursor/commands/6aspec/green/status.md +9 -0
- package/.cursor/commands/6aspec/green/tasks.md +9 -0
- package/.cursor/commands/6aspec/green/visual-logic.md +10 -0
- package/README.en.md +36 -0
- package/README.md +146 -0
- package/bin/6a-spec-install +54 -0
- package/bin/6aspec +64 -0
- package/lib/cli.js +451 -0
- package/lib/installer.js +333 -0
- package/package.json +62 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: import-model-table workflow
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
1. Immediate response upon activation: import-model-table workflow has been activated
|
|
6
|
+
2. Read file: `.6aspec/rules/green/6A_import_model_table_sop.md`
|
|
7
|
+
3. Strictly follow the "Import Model Table SOP" defined in that file
|
|
8
|
+
4. Execute the python script to import entities
|
|
9
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Init Project Artifacts (Functional Map & Event List)
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
Immediate response upon activation: Project Artifacts Initialization workflow has been activated.
|
|
6
|
+
|
|
7
|
+
Phase 1: Functional Capability Map
|
|
8
|
+
1. Read file: `.6aspec/rules/green/6A_init_map_sop.md`
|
|
9
|
+
2. Strictly follow the "Init Functional Capability Map SOP" defined in that file.
|
|
10
|
+
3. Execute the codebase scan and update the artifact at `.6aspec/biz/functional-capability-Map.md`.
|
|
11
|
+
|
|
12
|
+
Phase 2: Event List
|
|
13
|
+
1. Read file: `.6aspec/rules/green/6A_init_event_list_sop.md`
|
|
14
|
+
2. Strictly follow the "Event List Generation SOP" defined in that file.
|
|
15
|
+
3. Execute the codebase scan and update the artifact at `.6aspec/biz/event-list.md`.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: model workflow
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
1. Immediate response upon activation: model workflow has been activated
|
|
6
|
+
2. **You must first read and strictly abide by the principles in the constitutional documents**:`.6aspec/rules/green/6A_constitution.md`
|
|
7
|
+
3. **Context Restriction**:
|
|
8
|
+
- Do NOT perform `codebase_search`.
|
|
9
|
+
- Do NOT read any files unless they are explicitly provided by the user (via '@') or explicitly listed in the SOP steps.
|
|
10
|
+
- Stop and ask the user if you think you need more information.
|
|
11
|
+
4. Read file: `.6aspec/rules/green/6A_model_sop.md`
|
|
12
|
+
5. Strictly follow the "Domain modeling and database design Architecture SOP" defined in that file
|
|
13
|
+
6. Output the Domain model and table design
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 开始一个新的绿地需求(需求澄清与结构化)
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
1. Immediate response upon activation: new feature workflow has been activated
|
|
7
|
+
2. **You must first read and strictly abide by the principles in the constitutional documents**:`.6aspec/rules/green/6A_constitution.md`
|
|
8
|
+
3. **Context Restriction**:
|
|
9
|
+
- Do NOT perform `codebase_search`.
|
|
10
|
+
- Do NOT read any files unless they are explicitly provided by the user (via '@') or explicitly listed in the SOP steps.
|
|
11
|
+
- Stop and ask the user if you think you need more information.
|
|
12
|
+
4. Read file: `.6aspec/rules/green/6A_new_sop.md`
|
|
13
|
+
5. Strictly follow the "New Feature Requirement SOP" defined in that file
|
|
14
|
+
6. Output the structured requirement document
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 流程回退(单步回退并删除当前阶段工件,需用户明确确认)
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
1. Immediate response upon activation: rollback workflow has been activated
|
|
7
|
+
2. Read file: `.6aspec/rules/green/6A_rollback_sop.md`
|
|
8
|
+
3. Strictly follow the "Rollback SOP" defined in that file
|
|
9
|
+
4. **Do not** perform any file deletion or status file update until the user has explicitly confirmed (e.g. "确认回退" or "执行回退")
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 查看绿地需求的当前状态和进度
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
1. Immediate response upon activation: status workflow has been activated
|
|
7
|
+
2. Read file: `.6aspec/rules/green/6A_status_sop.md`
|
|
8
|
+
3. Strictly follow the "Status Query SOP" defined in that file
|
|
9
|
+
4. Output the current status and progress
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: tasks workflow
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
1. Immediate response upon activation: tasks workflow has been activated
|
|
6
|
+
2. **You must first read and strictly abide by the principles in the constitutional documents**:`.6aspec/rules/green/6A_constitution.md`
|
|
7
|
+
3. Read file: `.6aspec/rules/green/6A_tasks_sop.md`
|
|
8
|
+
4. Strictly follow the "Task Decomposition SOP" defined in that file
|
|
9
|
+
5. Output the task list
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: visual-logic workflow
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
1. Immediate response upon activation: visual-logic workflow has been activated.
|
|
6
|
+
2. **You must first read and strictly abide by the principles in the constitutional documents**:`.6aspec/rules/green/6A_constitution.md`
|
|
7
|
+
3. Read file: `.6aspec/rules/green/6A_visual_logic_sop.md`.
|
|
8
|
+
4. Strictly follow the "Visual Logic Diagrams SOP" defined in that file.
|
|
9
|
+
5. Output Mermaid diagrams as specified in the SOP.
|
|
10
|
+
|
package/README.en.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# 6A-spec
|
|
2
|
+
|
|
3
|
+
#### Description
|
|
4
|
+
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
|
|
5
|
+
|
|
6
|
+
#### Software Architecture
|
|
7
|
+
Software architecture description
|
|
8
|
+
|
|
9
|
+
#### Installation
|
|
10
|
+
|
|
11
|
+
1. xxxx
|
|
12
|
+
2. xxxx
|
|
13
|
+
3. xxxx
|
|
14
|
+
|
|
15
|
+
#### Instructions
|
|
16
|
+
|
|
17
|
+
1. xxxx
|
|
18
|
+
2. xxxx
|
|
19
|
+
3. xxxx
|
|
20
|
+
|
|
21
|
+
#### Contribution
|
|
22
|
+
|
|
23
|
+
1. Fork the repository
|
|
24
|
+
2. Create Feat_xxx branch
|
|
25
|
+
3. Commit your code
|
|
26
|
+
4. Create Pull Request
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
#### Gitee Feature
|
|
30
|
+
|
|
31
|
+
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
|
|
32
|
+
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
|
|
33
|
+
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
|
|
34
|
+
4. The most valuable open source project [GVP](https://gitee.com/gvp)
|
|
35
|
+
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
|
|
36
|
+
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
package/README.md
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# 6Aspec
|
|
2
|
+
|
|
3
|
+
轻量级 spec 驱动开发框架,支持 Cursor 和 Claude Code。
|
|
4
|
+
|
|
5
|
+
## 快速开始
|
|
6
|
+
|
|
7
|
+
### 交互式初始化(推荐)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx 6aspec init
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
会显示欢迎界面,按回车后进入工具选择:
|
|
14
|
+
|
|
15
|
+
- **↑↓** 移动光标
|
|
16
|
+
- **Enter** 选中/取消
|
|
17
|
+
- **Tab** 确认
|
|
18
|
+
|
|
19
|
+
### 非交互式初始化
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# 只安装 Cursor 配置
|
|
23
|
+
npx 6aspec init --tool cursor
|
|
24
|
+
|
|
25
|
+
# 只安装 Claude Code 配置
|
|
26
|
+
npx 6aspec init --tool claude
|
|
27
|
+
|
|
28
|
+
# 同时安装两种工具
|
|
29
|
+
npx 6aspec init --tool cursor,claude
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 增量初始化
|
|
33
|
+
|
|
34
|
+
重复执行 `6aspec init` 时:
|
|
35
|
+
- 已安装的工具显示为已选中
|
|
36
|
+
- 可以继续勾选未安装的工具
|
|
37
|
+
- 已安装工具会自动 merge 更新
|
|
38
|
+
|
|
39
|
+
### 更新配置
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# 使用最新版本更新(推荐)
|
|
43
|
+
npx 6aspec@latest update
|
|
44
|
+
|
|
45
|
+
# 全局安装后更新
|
|
46
|
+
6aspec update
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`update` 命令:
|
|
50
|
+
- 读取 `.6aspec/init.json` 中已选的工具列表
|
|
51
|
+
- 使用 **merge 模式** 更新所有配置
|
|
52
|
+
- 保留用户自定义文件,只更新包中提供的文件
|
|
53
|
+
|
|
54
|
+
### 全局安装(可选)
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# 安装最新正式版本
|
|
58
|
+
npm install -g 6aspec
|
|
59
|
+
|
|
60
|
+
# 安装指定版本
|
|
61
|
+
npm install -g 6aspec@2.0.0
|
|
62
|
+
npm install -g 6aspec@2.0.1-dev.5
|
|
63
|
+
|
|
64
|
+
# 安装预发布版本
|
|
65
|
+
npm install -g 6aspec@beta
|
|
66
|
+
npm install -g 6aspec@dev
|
|
67
|
+
|
|
68
|
+
# 然后直接使用
|
|
69
|
+
6aspec init
|
|
70
|
+
6aspec update
|
|
71
|
+
|
|
72
|
+
# 升级到最新版本
|
|
73
|
+
npm install -g 6aspec@latest
|
|
74
|
+
|
|
75
|
+
# 降级到指定版本(直接安装旧版本号即可覆盖)
|
|
76
|
+
npm install -g 6aspec@2.0.0
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 功能特性
|
|
80
|
+
|
|
81
|
+
- ✅ 交互式工具选择(Cursor / Claude Code)
|
|
82
|
+
- ✅ 增量初始化(重复 init 保留已选、可补选)
|
|
83
|
+
- ✅ merge 模式更新(保留用户自定义文件)
|
|
84
|
+
- ✅ 非交互模式(支持 CI/脚本)
|
|
85
|
+
- ✅ 统一配置管理(`.6aspec/init.json`)
|
|
86
|
+
|
|
87
|
+
## 目录结构
|
|
88
|
+
|
|
89
|
+
安装后会在项目根目录创建:
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
.6aspec/ 公共配置目录(Cursor 和 Claude Code 共用)
|
|
93
|
+
├── init.json 初始化配置(已选工具、版本等)
|
|
94
|
+
├── rules/ 公共规则文件
|
|
95
|
+
└── script/ 公共工具脚本
|
|
96
|
+
.cursor/ Cursor 专用配置目录
|
|
97
|
+
└── commands/ Cursor 命令提示词
|
|
98
|
+
.claude/ Claude Code 专用配置目录
|
|
99
|
+
└── commands/ Claude 命令提示词
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Slash Commands
|
|
103
|
+
|
|
104
|
+
### Brownfield(棕地 - 已有项目)
|
|
105
|
+
|
|
106
|
+
| 命令 | 说明 |
|
|
107
|
+
|------|------|
|
|
108
|
+
| `/6aspec:brown:new` | 创建一个变更 |
|
|
109
|
+
| `/6aspec:brown:continue` | 生成下一个工件 |
|
|
110
|
+
| `/6aspec:brown:implement` | 实施任务 |
|
|
111
|
+
| `/6aspec:brown:list` | 查看变更列表 |
|
|
112
|
+
| `/6aspec:brown:status` | 查看变更状态 |
|
|
113
|
+
| `/6aspec:brown:verify` | 验证实现 |
|
|
114
|
+
|
|
115
|
+
### Greenfield(绿地 - 新项目)
|
|
116
|
+
|
|
117
|
+
| 命令 | 说明 |
|
|
118
|
+
|------|------|
|
|
119
|
+
| `/6aspec:green:new` | 创建一个模块 |
|
|
120
|
+
| `/6aspec:green:continue` | 生成下一个工件 |
|
|
121
|
+
| `/6aspec:green:execute-task` | 执行任务 |
|
|
122
|
+
| `/6aspec:green:init` | 初始化项目 |
|
|
123
|
+
| `/6aspec:green:status` | 查看状态 |
|
|
124
|
+
| `/6aspec:green:model` | 数据建模 |
|
|
125
|
+
|
|
126
|
+
## 开发
|
|
127
|
+
|
|
128
|
+
### 本地测试
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
node bin/6aspec --help
|
|
132
|
+
node bin/6aspec init --tool cursor
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### 发布
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
npm run publish:dev # 发布开发版本
|
|
139
|
+
npm run publish:beta # 发布 Beta 版本
|
|
140
|
+
npm run publish:rc # 发布 RC 版本
|
|
141
|
+
npm run publish:latest # 发布正式版本
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## License
|
|
145
|
+
|
|
146
|
+
MIT
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const installer = require('../lib/installer');
|
|
5
|
+
|
|
6
|
+
// 解析命令行参数
|
|
7
|
+
const args = process.argv.slice(2);
|
|
8
|
+
let tool = 'cursor';
|
|
9
|
+
let help = false;
|
|
10
|
+
let mergeMode = false;
|
|
11
|
+
|
|
12
|
+
for (let i = 0; i < args.length; i++) {
|
|
13
|
+
const arg = args[i];
|
|
14
|
+
if (arg === '--tool' || arg === '-t') {
|
|
15
|
+
tool = args[++i] || 'cursor';
|
|
16
|
+
} else if (arg === '--help' || arg === '-h') {
|
|
17
|
+
help = true;
|
|
18
|
+
} else if (arg === '--merge' || arg === '-m') {
|
|
19
|
+
mergeMode = true;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (help) {
|
|
24
|
+
console.log(`
|
|
25
|
+
6A-spec 安装工具
|
|
26
|
+
|
|
27
|
+
用法:
|
|
28
|
+
npx 6a-spec-install [选项]
|
|
29
|
+
|
|
30
|
+
选项:
|
|
31
|
+
--tool, -t TOOL 安装目标工具 (cursor/claude/all, 默认: cursor)
|
|
32
|
+
--merge, -m 智能合并模式(保留用户自定义文件,只更新包中文件)
|
|
33
|
+
--help, -h 显示帮助信息
|
|
34
|
+
|
|
35
|
+
示例:
|
|
36
|
+
npx 6a-spec-install --tool cursor # 完全覆盖模式(会先备份)
|
|
37
|
+
npx 6a-spec-install --tool cursor --merge # 智能合并模式(保留自定义文件)
|
|
38
|
+
npx 6a-spec-install --tool claude --merge # 安装 Claude 配置(合并模式)
|
|
39
|
+
npx 6a-spec-install --tool all # 安装两种工具配置
|
|
40
|
+
|
|
41
|
+
支持的工具:
|
|
42
|
+
cursor - 安装 Cursor IDE 的提示词配置
|
|
43
|
+
claude - 安装 Claude Desktop 的提示词配置
|
|
44
|
+
all - 同时安装两种工具的配置
|
|
45
|
+
`);
|
|
46
|
+
process.exit(0);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// 执行安装
|
|
50
|
+
installer.install(tool, mergeMode).catch(err => {
|
|
51
|
+
console.error('❌ 安装失败:', err.message);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
});
|
|
54
|
+
|
package/bin/6aspec
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const pkg = require('../package.json');
|
|
5
|
+
const cli = require('../lib/cli');
|
|
6
|
+
|
|
7
|
+
const args = process.argv.slice(2);
|
|
8
|
+
const command = args[0];
|
|
9
|
+
|
|
10
|
+
if (!command || command === '--help' || command === '-h') {
|
|
11
|
+
console.log(`
|
|
12
|
+
\x1b[36m6Aspec\x1b[0m v${pkg.version} - 轻量级 spec 驱动开发框架
|
|
13
|
+
|
|
14
|
+
用法:
|
|
15
|
+
6aspec <command>
|
|
16
|
+
|
|
17
|
+
命令:
|
|
18
|
+
init 交互式初始化(选择工具 + 安装配置)
|
|
19
|
+
update 更新已安装的工具配置(merge 模式)
|
|
20
|
+
version 显示当前 CLI 版本
|
|
21
|
+
--help 显示帮助信息
|
|
22
|
+
|
|
23
|
+
示例:
|
|
24
|
+
6aspec init # 交互式选择并初始化
|
|
25
|
+
6aspec init --tool cursor,claude # 非交互模式,直接指定工具
|
|
26
|
+
6aspec update # 更新已安装的配置
|
|
27
|
+
npx 6aspec@latest update # 更新到最新版本
|
|
28
|
+
`);
|
|
29
|
+
process.exit(0);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (command === '--version' || command === '-v' || command === 'version') {
|
|
33
|
+
const fs = require('fs');
|
|
34
|
+
const configPath = path.join(process.cwd(), '.6aspec/init.json');
|
|
35
|
+
let projectInfo = '';
|
|
36
|
+
if (fs.existsSync(configPath)) {
|
|
37
|
+
try {
|
|
38
|
+
const cfg = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
39
|
+
projectInfo = `\n\x1b[2m 当前项目已安装: ${cfg.tools.join(', ')} (版本 ${cfg.version || 'unknown'})\x1b[0m`;
|
|
40
|
+
} catch {}
|
|
41
|
+
}
|
|
42
|
+
console.log(`\x1b[36m6Aspec\x1b[0m v${pkg.version}${projectInfo}`);
|
|
43
|
+
process.exit(0);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
(async () => {
|
|
47
|
+
try {
|
|
48
|
+
switch (command) {
|
|
49
|
+
case 'init':
|
|
50
|
+
await cli.init(args.slice(1));
|
|
51
|
+
break;
|
|
52
|
+
case 'update':
|
|
53
|
+
await cli.update(args.slice(1));
|
|
54
|
+
break;
|
|
55
|
+
default:
|
|
56
|
+
console.error(`\x1b[31m未知命令: ${command}\x1b[0m`);
|
|
57
|
+
console.log('运行 6aspec --help 查看可用命令');
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
} catch (err) {
|
|
61
|
+
console.error(`\x1b[31m${err.message}\x1b[0m`);
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
64
|
+
})();
|