6a-spec-install 1.0.8-dev.0 → 1.0.8-dev.2

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.
@@ -0,0 +1,280 @@
1
+ # 绿地需求状态文件结构定义
2
+
3
+ ## 概述
4
+
5
+ 每个绿地需求都有一个状态文件 `.green-status.json`,用于跟踪需求的生命周期状态、工件完成情况和任务进度。
6
+
7
+ ## 文件位置
8
+
9
+ ```
10
+ 6aspec/green/<feature-name>/.green-status.json
11
+ ```
12
+
13
+ ## 状态文件结构
14
+
15
+ ```json
16
+ {
17
+ "name": "string", // 需求名称(kebab-case)
18
+ "status": "string", // 当前生命周期状态
19
+ "created": "ISO8601", // 创建时间
20
+ "lastModified": "ISO8601", // 最后修改时间
21
+ "artifacts": { // 工件完成情况
22
+ "requirement": {
23
+ "status": "string", // 工件状态:pending/ready/done/blocked
24
+ "path": "string", // 工件路径
25
+ "completedAt": "ISO8601" // 完成时间(可选)
26
+ },
27
+ "models": {
28
+ "status": "string",
29
+ "path": "string",
30
+ "completedAt": "ISO8601",
31
+ "files": ["string"] // 模型文件列表(可选)
32
+ },
33
+ "design": {
34
+ "status": "string",
35
+ "path": "string",
36
+ "completedAt": "ISO8601"
37
+ },
38
+ "tasks": {
39
+ "status": "string",
40
+ "path": "string",
41
+ "completedAt": "ISO8601",
42
+ "files": ["string"] // 任务文件列表(可选)
43
+ }
44
+ },
45
+ "tasks": { // 任务进度
46
+ "total": 0, // 总任务数
47
+ "completed": 0, // 已完成任务数
48
+ "remaining": 0, // 剩余任务数
49
+ "lastExecuted": "string" // 最后执行的任务文件名(可选)
50
+ },
51
+ "nextAction": { // 下一步建议(可选)
52
+ "command": "string", // 建议的命令
53
+ "description": "string" // 描述
54
+ }
55
+ }
56
+ ```
57
+
58
+ ## 生命周期状态
59
+
60
+ | 状态 | 说明 | 下一步命令 |
61
+ |------|------|-----------|
62
+ | `created` | 已创建,等待需求澄清 | `/6aspec:green:new` 或 `/6aspec:green:clarify` |
63
+ | `requirement_clarified` | 需求已澄清 | `/6aspec:green:model`(可选:`/6aspec:green:clarify` 继续深化) |
64
+ | `modeled` | 领域建模完成 | `/6aspec:green:design` |
65
+ | `designed` | 技术方案完成 | `/6aspec:green:tasks` |
66
+ | `tasks_created` | 任务已拆解 | `/6aspec:green:execute-task` |
67
+ | `implementing` | 实施中 | `/6aspec:green:execute-task` |
68
+ | `completed` | 已完成 | `/6aspec:green:archive` |
69
+ | `archived` | 已归档 | - |
70
+
71
+ ## 工件状态
72
+
73
+ | 状态 | 说明 |
74
+ |------|------|
75
+ | `pending` | 等待创建 |
76
+ | `ready` | 准备就绪,可以创建 |
77
+ | `done` | 已完成 |
78
+ | `blocked` | 被阻塞,等待依赖工件完成 |
79
+
80
+ ## 工件依赖关系
81
+
82
+ ```
83
+ requirement (需求澄清文档)
84
+
85
+ models (领域模型)
86
+
87
+ design (技术方案)
88
+
89
+ tasks (任务列表)
90
+ ```
91
+
92
+ ## 状态转换规则
93
+
94
+ 1. **created → requirement_clarified**
95
+ - 条件:requirement 工件状态为 done
96
+ - 触发:完成需求澄清文档
97
+
98
+ 2. **requirement_clarified → modeled**
99
+ - 条件:models 工件状态为 done
100
+ - 触发:完成领域建模
101
+
102
+ 3. **modeled → designed**
103
+ - 条件:design 工件状态为 done
104
+ - 触发:完成技术方案
105
+
106
+ 4. **designed → tasks_created**
107
+ - 条件:tasks 工件状态为 done
108
+ - 触发:完成任务拆解
109
+
110
+ 5. **tasks_created → implementing**
111
+ - 条件:开始执行任务
112
+ - 触发:执行第一个任务
113
+
114
+ 6. **implementing → completed**
115
+ - 条件:所有任务完成(tasks.completed == tasks.total)
116
+ - 触发:完成最后一个任务
117
+
118
+ 7. **completed → archived**
119
+ - 条件:用户确认归档
120
+ - 触发:执行归档命令
121
+
122
+ ## 示例
123
+
124
+ ### 初始状态(刚创建)
125
+
126
+ ```json
127
+ {
128
+ "name": "user-authentication",
129
+ "status": "created",
130
+ "created": "2026-02-16T03:00:00Z",
131
+ "lastModified": "2026-02-16T03:00:00Z",
132
+ "artifacts": {
133
+ "requirement": {
134
+ "status": "pending",
135
+ "path": "6aspec/green/user-authentication/requirement.md"
136
+ },
137
+ "models": {
138
+ "status": "blocked",
139
+ "path": "6aspec/green/user-authentication/artifacts/"
140
+ },
141
+ "design": {
142
+ "status": "blocked",
143
+ "path": "6aspec/green/user-authentication/artifacts/"
144
+ },
145
+ "tasks": {
146
+ "status": "blocked",
147
+ "path": "6aspec/green/user-authentication/tasks/"
148
+ }
149
+ },
150
+ "tasks": {
151
+ "total": 0,
152
+ "completed": 0,
153
+ "remaining": 0
154
+ },
155
+ "nextAction": {
156
+ "command": "new",
157
+ "description": "开始需求澄清"
158
+ }
159
+ }
160
+ ```
161
+
162
+ ### 需求澄清完成后
163
+
164
+ ```json
165
+ {
166
+ "name": "user-authentication",
167
+ "status": "requirement_clarified",
168
+ "created": "2026-02-16T03:00:00Z",
169
+ "lastModified": "2026-02-16T03:15:00Z",
170
+ "artifacts": {
171
+ "requirement": {
172
+ "status": "done",
173
+ "path": "6aspec/green/user-authentication/requirement.md",
174
+ "completedAt": "2026-02-16T03:15:00Z"
175
+ },
176
+ "models": {
177
+ "status": "ready",
178
+ "path": "6aspec/green/user-authentication/artifacts/"
179
+ },
180
+ "design": {
181
+ "status": "blocked",
182
+ "path": "6aspec/green/user-authentication/artifacts/"
183
+ },
184
+ "tasks": {
185
+ "status": "blocked",
186
+ "path": "6aspec/green/user-authentication/tasks/"
187
+ }
188
+ },
189
+ "tasks": {
190
+ "total": 0,
191
+ "completed": 0,
192
+ "remaining": 0
193
+ },
194
+ "nextAction": {
195
+ "command": "model",
196
+ "description": "开始领域建模"
197
+ }
198
+ }
199
+ ```
200
+
201
+ ### 实施中
202
+
203
+ ```json
204
+ {
205
+ "name": "user-authentication",
206
+ "status": "implementing",
207
+ "created": "2026-02-16T03:00:00Z",
208
+ "lastModified": "2026-02-16T05:30:00Z",
209
+ "artifacts": {
210
+ "requirement": {
211
+ "status": "done",
212
+ "path": "6aspec/green/user-authentication/requirement.md",
213
+ "completedAt": "2026-02-16T03:15:00Z"
214
+ },
215
+ "models": {
216
+ "status": "done",
217
+ "path": "6aspec/green/user-authentication/artifacts/",
218
+ "completedAt": "2026-02-16T03:45:00Z",
219
+ "files": ["domain-model.md"]
220
+ },
221
+ "design": {
222
+ "status": "done",
223
+ "path": "6aspec/green/user-authentication/artifacts/",
224
+ "completedAt": "2026-02-16T04:15:00Z"
225
+ },
226
+ "tasks": {
227
+ "status": "done",
228
+ "path": "6aspec/green/user-authentication/tasks/",
229
+ "completedAt": "2026-02-16T04:30:00Z",
230
+ "files": ["task_01_user_model.md", "task_02_auth_api.md", "task_03_session.md"]
231
+ }
232
+ },
233
+ "tasks": {
234
+ "total": 8,
235
+ "completed": 5,
236
+ "remaining": 3,
237
+ "lastExecuted": "task_05_session_management.md"
238
+ },
239
+ "nextAction": {
240
+ "command": "execute-task",
241
+ "description": "继续执行剩余 3 个任务"
242
+ }
243
+ }
244
+ ```
245
+
246
+ ## 使用说明
247
+
248
+ ### 读取状态
249
+
250
+ 所有命令在执行前应该读取状态文件,了解当前状态:
251
+
252
+ ```javascript
253
+ const statusPath = '6aspec/green/<feature-name>/.green-status.json';
254
+ const status = JSON.parse(fs.readFileSync(statusPath, 'utf8'));
255
+ ```
256
+
257
+ ### 更新状态
258
+
259
+ 命令执行后应该更新状态文件:
260
+
261
+ ```javascript
262
+ status.lastModified = new Date().toISOString();
263
+ status.artifacts.requirement.status = 'done';
264
+ status.artifacts.requirement.completedAt = new Date().toISOString();
265
+ status.status = 'requirement_clarified';
266
+ fs.writeFileSync(statusPath, JSON.stringify(status, null, 2));
267
+ ```
268
+
269
+ ### 状态检查
270
+
271
+ 在执行命令前,检查状态是否符合预期:
272
+
273
+ ```javascript
274
+ if (status.status !== 'requirement_clarified') {
275
+ console.error('错误:当前状态不允许执行此命令');
276
+ console.error(`当前状态:${status.status}`);
277
+ console.error(`期望状态:requirement_clarified`);
278
+ process.exit(1);
279
+ }
280
+ ```
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: 归档已完成的绿地需求
3
+ ---
4
+
5
+ 1. Immediate response upon activation: archive workflow has been activated
6
+ 2. Read file: `.6aspec/rules/green/6A_archive_sop.md`
7
+ 3. Strictly follow the "Archive Workflow SOP" defined in that file
8
+ 4. Archive the completed requirement
@@ -0,0 +1,13 @@
1
+ ---
2
+ description: 深化需求澄清(对已有需求进行更细节的澄清和补充)
3
+ ---
4
+
5
+ 1. Immediate response upon activation: clarify 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_clarify_sop.md`
12
+ 5. Strictly follow the "Requirement Clarification SOP" defined in that file
13
+ 6. Update the requirement document with clarified details
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: 自动执行绿地需求的下一步工作流
3
+ ---
4
+
5
+ 1. Immediate response upon activation: continue workflow has been activated
6
+ 2. Read file: `.6aspec/rules/green/6A_continue_sop.md`
7
+ 3. Strictly follow the "Continue Workflow SOP" defined in that file
8
+ 4. Automatically execute the next step based on current status
@@ -0,0 +1,13 @@
1
+ ---
2
+ description: 开始一个新的绿地需求(需求澄清与结构化)
3
+ ---
4
+
5
+ 1. Immediate response upon activation: new feature 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_new_sop.md`
12
+ 5. Strictly follow the "New Feature Requirement SOP" defined in that file
13
+ 6. Output the structured requirement document
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: 查看绿地需求的当前状态和进度
3
+ ---
4
+
5
+ 1. Immediate response upon activation: status workflow has been activated
6
+ 2. Read file: `.6aspec/rules/green/6A_status_sop.md`
7
+ 3. Strictly follow the "Status Query SOP" defined in that file
8
+ 4. Output the current status and progress
@@ -0,0 +1,8 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(ls -la .claude/commands/6aspec/green/*.md)",
5
+ "Bash(xargs -I {} basename {})"
6
+ ]
7
+ }
8
+ }
@@ -0,0 +1,9 @@
1
+ ---
2
+ description: 归档已完成的绿地需求
3
+ alwaysApply: false
4
+ ---
5
+
6
+ 1. Immediate response upon activation: archive workflow has been activated
7
+ 2. Read file: `.6aspec/rules/green/6A_archive_sop.md`
8
+ 3. Strictly follow the "Archive Workflow SOP" defined in that file
9
+ 4. Archive the completed requirement
@@ -0,0 +1,14 @@
1
+ ---
2
+ description: 深化需求澄清(对已有需求进行更细节的澄清和补充)
3
+ alwaysApply: false
4
+ ---
5
+
6
+ 1. Immediate response upon activation: clarify 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_clarify_sop.md`
13
+ 5. Strictly follow the "Requirement Clarification SOP" defined in that file
14
+ 6. Update the requirement document with clarified details
@@ -0,0 +1,9 @@
1
+ ---
2
+ description: 自动执行绿地需求的下一步工作流
3
+ alwaysApply: false
4
+ ---
5
+
6
+ 1. Immediate response upon activation: continue workflow has been activated
7
+ 2. Read file: `.6aspec/rules/green/6A_continue_sop.md`
8
+ 3. Strictly follow the "Continue Workflow SOP" defined in that file
9
+ 4. Automatically execute the next step based on current status
@@ -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: 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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "6a-spec-install",
3
- "version": "1.0.8-dev.0",
3
+ "version": "1.0.8-dev.2",
4
4
  "description": "6A-spec 驱动开发提示词安装工具,支持 Cursor 和 Claude",
5
5
  "main": "lib/installer.js",
6
6
  "bin": {