@superspec/cli 1.1.0 → 1.2.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/LICENSE +21 -0
- package/dist/cli/index.js +763 -683
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +30 -30
- package/dist/index.js +275 -301
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/prompts/agents.md +35 -17
- package/prompts/rules.md +48 -27
- package/templates/en/checklist.md +31 -8
- package/templates/en/commands/ss-archive.md +12 -2
- package/templates/en/commands/ss-checklist.md +11 -6
- package/templates/en/commands/ss-create.md +38 -11
- package/templates/en/commands/ss-link.md +11 -2
- package/templates/en/commands/ss-resume.md +18 -5
- package/templates/en/commands/ss-search.md +12 -3
- package/templates/en/commands/ss-tasks.md +3 -2
- package/templates/en/commands/ss-validate.md +12 -2
- package/templates/en/proposal.md +14 -2
- package/templates/zh/checklist.md +31 -8
- package/templates/zh/commands/ss-archive.md +12 -2
- package/templates/zh/commands/ss-checklist.md +11 -6
- package/templates/zh/commands/ss-create.md +37 -10
- package/templates/zh/commands/ss-link.md +11 -2
- package/templates/zh/commands/ss-resume.md +18 -5
- package/templates/zh/commands/ss-search.md +12 -3
- package/templates/zh/commands/ss-tasks.md +3 -2
- package/templates/zh/commands/ss-validate.md +12 -2
- package/templates/zh/proposal.md +14 -2
|
@@ -27,11 +27,12 @@ $ARGUMENTS
|
|
|
27
27
|
|
|
28
28
|
**输入解析规则**
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
从用户输入中提取:**模式标志**、**功能名称**、**意图类型**、**开发者**、**语言**。
|
|
31
31
|
|
|
32
32
|
| 提取项 | 规则 | 示例 |
|
|
33
33
|
|--------|------|------|
|
|
34
|
-
|
|
|
34
|
+
| 模式标志 | 识别 `-b`/`--boost`/`boost`/`增强` → 增强模式; `-c`/`--creative`/`creative`/`创造` → 创造模式; `--no-branch`/`不建分支` → 跳过分支; 可组合使用 | `/ss-create -b 添加认证` → boost; `/ss-create -b -c 重构登录` → boost+creative |
|
|
35
|
+
| 功能名称 | 移除标志后剩余文本,转为 camelCase。中文 → 先翻译为英文 | "add user auth" → `addUserAuth`; "添加用户认证" → `addUserAuth` |
|
|
35
36
|
| 意图类型 | 语义推断 | add/new/implement/新增/添加 → `feature`; fix/bug/hotfix/修复 → `hotfix`; refactor/optimize/重构 → `refactor`; docs → `docs`; test → `test`; build/deps → `chore`; 默认 → `feature` |
|
|
36
37
|
| 开发者 | "@username" 或 "Developer: xxx" → 提取(移除"@")。回退: git 用户名 | "添加todolist @jay" → user=`jay` |
|
|
37
38
|
| 语言 | CJK 字符 → `zh`; 显式 "zh"/"中文" → `zh`; "en"/"English" → `en`; 回退: 配置 `lang` | "添加todolist" → `zh` |
|
|
@@ -57,7 +58,7 @@ superspec create fixLoginBug --intent-type hotfix
|
|
|
57
58
|
**CLI 命令结构**
|
|
58
59
|
```bash
|
|
59
60
|
superspec create <feature> [options]
|
|
60
|
-
-b, --boost 增强模式(spec + checklist)
|
|
61
|
+
-b, --boost 增强模式(spec(支持拆分子 spec )+ design + checklist)
|
|
61
62
|
-c, --creative 创造模式(探索新方案)
|
|
62
63
|
-d, --description <desc> 变更描述
|
|
63
64
|
--no-branch 跳过 git 分支创建
|
|
@@ -91,11 +92,37 @@ superspec create <feature> [options]
|
|
|
91
92
|
```
|
|
92
93
|
每个 spec.md < 300 行。在 proposal.md 中概述能力域,tasks.md 按能力域分组。
|
|
93
94
|
|
|
94
|
-
**
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
**Artifact 按需生成原则**
|
|
96
|
+
- CLI `superspec create` **只创建文件夹 + git 分支**,不生成任何 artifact 文件
|
|
97
|
+
- AI 读取 `{specDir}/templates/` 下的模板作为**结构参考**,直接生成包含真实内容的 artifact
|
|
98
|
+
- 只在当前步骤需要时才生成对应文件,不预先创建空模板
|
|
99
|
+
|
|
100
|
+
**Strategy 优先级**(从高到低)
|
|
101
|
+
1. 用户输入中的 `-c`/`--creative`/`创造` 标志
|
|
102
|
+
2. `superspec.config.json` 中的 `strategy` 默认值
|
|
103
|
+
|
|
104
|
+
**Standard 与 Boost 内容定位**
|
|
105
|
+
- **Standard**: proposal.md 自含需求 + 技术方案,足以直接拆分 task(无需 spec.md)
|
|
106
|
+
- **Boost**: proposal.md 聚焦需求背景(Background, Goals, Non-Goals, Impact, Risks);spec.md 承载需求细节和交互(US/FR/AC/Edge Cases);design.md 可选承载架构决策
|
|
107
|
+
|
|
108
|
+
**Steps(Standard 模式)**
|
|
109
|
+
1. 解析用户输入 → 提取功能名(camelCase)、意图类型、开发者、语言;**保留用户原始输入文本**
|
|
110
|
+
2. 确定 strategy(按优先级):用户输入 `-c` → config 默认值
|
|
111
|
+
3. 执行: `superspec create <feature> --intent-type <type> [--lang <lang>] [--user <user>] [-c]`(只创建文件夹 + 分支)
|
|
112
|
+
4. 前置审查: 读取项目上下文、检查现有变更、理解依赖关系
|
|
113
|
+
5. 读取 `{specDir}/templates/proposal.md` 作结构参考 → **直接生成** proposal.md(含需求描述 + 技术方案,必须具体到可拆分 task)。frontmatter `input` 字段填入用户原始输入
|
|
114
|
+
6. **自动执行 checklist 检查**(Standard 检查项,满分 10):读取 `{specDir}/templates/checklist.md`,评估 proposal 质量
|
|
115
|
+
7. 通过 → 生成 checklist.md,提示可执行 /ss-tasks;不通过 → 修复 proposal 后重新检查
|
|
116
|
+
|
|
117
|
+
**Steps(Boost 模式)**
|
|
118
|
+
1. 解析用户输入 → 提取功能名(camelCase)、意图类型、开发者、语言;**保留用户原始输入文本**
|
|
119
|
+
2. 确定 strategy(按优先级):用户输入 `-c` → config 默认值
|
|
120
|
+
3. 执行: `superspec create <feature> --intent-type <type> [--lang <lang>] [--user <user>] -b [-c]`(只创建文件夹 + 分支)
|
|
121
|
+
4. 前置审查: 读取项目上下文、检查现有变更、理解依赖关系
|
|
122
|
+
5. 读取 `{specDir}/templates/proposal.md` 作结构参考 → **直接生成** proposal.md(聚焦需求背景)。frontmatter `input` 字段填入用户原始输入
|
|
123
|
+
6. 读取 `{specDir}/templates/spec.md` 作结构参考 → **直接生成** spec.md(需求细节 + 交互)
|
|
124
|
+
7. **自动复杂度评估**:是否需要拆分 spec(多能力域 / spec > 300 行)、是否需要 design.md(跨系统 / 重大架构决策)
|
|
125
|
+
8. 如需 → 拆分 spec 到 `specs/<capability>/spec.md`;如需 → 读取 design 模板生成 design.md
|
|
126
|
+
9. **自动执行 checklist 检查**(Boost 检查项,满分 25):读取 `{specDir}/templates/checklist.md`,评估所有已有 artifacts
|
|
127
|
+
10. 通过 → 生成 checklist.md,提示可执行 /ss-tasks;不通过 → 修复后重新检查
|
|
101
128
|
<!-- SUPERSPEC:END -->
|
|
@@ -5,8 +5,17 @@ category: SuperSpec
|
|
|
5
5
|
description: 添加 spec 依赖
|
|
6
6
|
---
|
|
7
7
|
<!-- SUPERSPEC:START -->
|
|
8
|
+
**输入解析规则**
|
|
9
|
+
|
|
10
|
+
从用户输入中提取:**变更名称**、**依赖目标**。
|
|
11
|
+
|
|
12
|
+
| 提取项 | 规则 | 示例 |
|
|
13
|
+
|--------|------|------|
|
|
14
|
+
| 变更名称 | 第一个参数或 `--on` 之前的文本 | `/ss-link addAuth --on addDB` → name=`addAuth` |
|
|
15
|
+
| 依赖目标 | `--on <other>`/`依赖 <other>`/`→ <other>` → 提取目标名 | `/ss-link addAuth --on addDB`; `/ss-link addAuth 依赖 addDB` |
|
|
16
|
+
|
|
8
17
|
**Steps**
|
|
9
|
-
1.
|
|
10
|
-
2.
|
|
18
|
+
1. 解析用户输入 → 提取变更名称和依赖目标
|
|
19
|
+
2. 运行 `superspec deps add <name> --on <other>`
|
|
11
20
|
3. 验证: `superspec deps list <name>`
|
|
12
21
|
<!-- SUPERSPEC:END -->
|
|
@@ -7,11 +7,24 @@ description: 恢复 spec 上下文(用于 vibe coding)
|
|
|
7
7
|
<!-- SUPERSPEC:START -->
|
|
8
8
|
**Guardrails**
|
|
9
9
|
- 中断后返回工作时使用
|
|
10
|
-
-
|
|
10
|
+
- 默认只读 context.md(最小 token),其他文档由用户按需选择
|
|
11
11
|
|
|
12
12
|
**Steps**
|
|
13
|
-
1.
|
|
14
|
-
2.
|
|
15
|
-
3.
|
|
16
|
-
4.
|
|
13
|
+
1. 定位当前变更文件夹: `{specDir}/changes/`
|
|
14
|
+
2. 运行 `superspec sync <name>` 将最新 git 变更收集到 context.md
|
|
15
|
+
3. 读取 `context.md`(单文件,包含:goals、progress、strategy、input、git changes)
|
|
16
|
+
4. 根据 context.md 中的 `strategy` 确定行为模式(follow / create)
|
|
17
|
+
5. 汇报当前状态:目标、进度、git 变更、受影响文件
|
|
18
|
+
6. **询问用户是否需要读取其他文档**,列出变更目录中的可用文件,建议优先级:
|
|
19
|
+
- ✅ `tasks.md`(推荐,了解任务明细和依赖)
|
|
20
|
+
- `proposal.md`(需求和方案回顾)
|
|
21
|
+
- `spec.md`(Boost 模式,需求细节)
|
|
22
|
+
- `design.md`(架构决策)
|
|
23
|
+
- `checklist.md`(质量检查结果)
|
|
24
|
+
- `clarify.md`(历史 Q&A)
|
|
25
|
+
7. 根据用户选择读取对应文件
|
|
26
|
+
8. 询问用户:需要修复/调整什么?
|
|
27
|
+
9. 修复时遵循 `strategy`(follow 遵循规范 / create 可探索新方案)
|
|
28
|
+
10. 修复后更新 tasks.md 对应的 checkbox
|
|
29
|
+
11. 运行 `superspec sync <name>` 刷新 context.md
|
|
17
30
|
<!-- SUPERSPEC:END -->
|
|
@@ -5,8 +5,17 @@ category: SuperSpec
|
|
|
5
5
|
description: 全文搜索变更
|
|
6
6
|
---
|
|
7
7
|
<!-- SUPERSPEC:START -->
|
|
8
|
+
**输入解析规则**
|
|
9
|
+
|
|
10
|
+
从用户输入中提取:**搜索关键词**、**可选标志**。
|
|
11
|
+
|
|
12
|
+
| 提取项 | 规则 | 示例 |
|
|
13
|
+
|--------|------|------|
|
|
14
|
+
| 搜索关键词 | 移除标志后的剩余文本 | `/ss-search 用户认证` → query=`用户认证` |
|
|
15
|
+
| 包含归档 | `--archived`/`归档`/`包含归档`/`all` → 添加 `--archived` | `/ss-search 认证 --archived`; `/ss-search 认证 归档` |
|
|
16
|
+
| 过滤类型 | `--artifact <type>`/`类型:<type>` → 添加 `--artifact <type>`; type: `proposal`/`spec`/`tasks`/`clarify`/`checklist` | `/ss-search 认证 --artifact spec`; `/ss-search 认证 类型:proposal` |
|
|
17
|
+
|
|
8
18
|
**Steps**
|
|
9
|
-
1.
|
|
10
|
-
2.
|
|
11
|
-
3. 使用 `--artifact <type>` 按 artifact 类型过滤
|
|
19
|
+
1. 解析用户输入 → 提取搜索关键词和标志
|
|
20
|
+
2. 运行 `superspec search "<query>" [--archived] [--artifact <type>]`
|
|
12
21
|
<!-- SUPERSPEC:END -->
|
|
@@ -14,6 +14,7 @@ description: 从 proposal 生成任务清单
|
|
|
14
14
|
**Steps**
|
|
15
15
|
1. 读取 `{specDir}/changes/<name>/proposal.md`
|
|
16
16
|
2. 如果是 boost 模式,同时读取 `spec.md`
|
|
17
|
-
3.
|
|
18
|
-
4.
|
|
17
|
+
3. 读取 `{specDir}/templates/tasks.md` 作为**结构参考**
|
|
18
|
+
4. **直接生成** tasks.md(包含真实任务内容,不是模板占位符)
|
|
19
|
+
5. 每个任务应包含:清晰描述、文件路径、依赖关系、验证标准
|
|
19
20
|
<!-- SUPERSPEC:END -->
|
|
@@ -5,11 +5,21 @@ category: SuperSpec
|
|
|
5
5
|
description: 交叉引用一致性检查(boost 模式)
|
|
6
6
|
---
|
|
7
7
|
<!-- SUPERSPEC:START -->
|
|
8
|
+
**输入解析规则**
|
|
9
|
+
|
|
10
|
+
从用户输入中提取:**变更名称**、**可选标志**。
|
|
11
|
+
|
|
12
|
+
| 提取项 | 规则 | 示例 |
|
|
13
|
+
|--------|------|------|
|
|
14
|
+
| 变更名称 | 移除标志后的剩余文本;为空时使用当前活跃变更 | `/ss-validate addUserAuth` → name=`addUserAuth` |
|
|
15
|
+
| 检查依赖 | `--check-deps`/`检查依赖`/`依赖检查` → 添加 `--check-deps` | `/ss-validate --check-deps`; `/ss-validate 检查依赖` |
|
|
16
|
+
|
|
8
17
|
**Guardrails**
|
|
9
18
|
- 验证 US↔FR↔AC↔tasks 一致性
|
|
10
19
|
- 仅在 boost 模式下适用
|
|
11
20
|
|
|
12
21
|
**Steps**
|
|
13
|
-
1.
|
|
14
|
-
2.
|
|
22
|
+
1. 解析用户输入 → 提取变更名称和标志
|
|
23
|
+
2. 运行 `superspec validate [name] [--check-deps]`
|
|
24
|
+
3. 修复报告的任何一致性错误
|
|
15
25
|
<!-- SUPERSPEC:END -->
|
package/templates/zh/proposal.md
CHANGED
|
@@ -3,6 +3,7 @@ name: {{name}}
|
|
|
3
3
|
status: draft
|
|
4
4
|
strategy: {{strategy}}
|
|
5
5
|
depends_on: []
|
|
6
|
+
input: {{input}}
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
# 提案: {{name}}
|
|
@@ -30,9 +31,20 @@ depends_on: []
|
|
|
30
31
|
|
|
31
32
|
<!-- 明确不在范围内的内容 -->
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
<!-- ===== Standard 模式:使用以下两段 ===== -->
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
## 需求描述
|
|
37
|
+
|
|
38
|
+
<!-- 功能需求、交互逻辑、边界条件 -->
|
|
39
|
+
|
|
40
|
+
## 技术方案
|
|
41
|
+
|
|
42
|
+
<!-- 架构设计、关键实现思路、涉及的模块/文件。必须具体到可拆分 task -->
|
|
43
|
+
|
|
44
|
+
<!-- ===== Boost 模式:替换上面两段为以下一段 ===== -->
|
|
45
|
+
|
|
46
|
+
<!-- ## 方案概述 -->
|
|
47
|
+
<!-- 高层级的解决方案描述。详细需求和交互由 spec.md 承载 -->
|
|
36
48
|
|
|
37
49
|
## 影响范围
|
|
38
50
|
|