@superspec/cli 1.0.0 → 1.1.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/dist/cli/index.js +295 -258
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.js +159 -103
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/prompts/agents.md +51 -9
- package/prompts/{cursor-rules.md → rules.md} +7 -7
- package/templates/en/commands/ss-create.md +90 -8
- package/templates/en/commands/ss-link.md +2 -1
- package/templates/en/commands/ss-specs.md +54 -0
- package/templates/en/design.md +126 -0
- package/templates/zh/commands/ss-create.md +90 -8
- package/templates/zh/commands/ss-link.md +2 -1
- package/templates/zh/commands/ss-specs.md +54 -0
- package/templates/zh/design.md +126 -0
|
@@ -2,18 +2,100 @@
|
|
|
2
2
|
name: /ss-create
|
|
3
3
|
id: ss-create
|
|
4
4
|
category: SuperSpec
|
|
5
|
-
description: Create a
|
|
5
|
+
description: Create or update the feature specification from a natural language feature with proposal (boost mode adds spec + checklist)
|
|
6
6
|
---
|
|
7
7
|
<!-- SUPERSPEC:START -->
|
|
8
|
+
## User Input
|
|
9
|
+
|
|
10
|
+
```text
|
|
11
|
+
$ARGUMENTS
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
You **MUST** consider the user input before proceeding (if not empty).
|
|
15
|
+
|
|
16
|
+
## Outline
|
|
17
|
+
|
|
18
|
+
The text the user typed after `/ss-create` **is** the feature description. Do not ask the user to repeat it unless they provided an empty command.
|
|
19
|
+
|
|
8
20
|
**Guardrails**
|
|
9
|
-
- Read `superspec.config.json` first
|
|
10
|
-
-
|
|
11
|
-
-
|
|
21
|
+
- Read `superspec.config.json` first → get `lang`, `specDir`, `boost`, `strategy`, `context`, `branchPrefix`, `branchTemplate`, `changeNameTemplate`
|
|
22
|
+
- **Pre-task review** (refer to AGENTS.md "Before ANY Task"):
|
|
23
|
+
- Read `context` files, README, architecture docs
|
|
24
|
+
- Inspect `{specDir}/changes/` → avoid duplicate changes via `depends_on`
|
|
25
|
+
- Never create change folders manually — use `superspec create <feature>` CLI
|
|
12
26
|
- Do not write any code during the proposal stage. Only create design documents
|
|
13
27
|
|
|
28
|
+
**Input Parsing Rules**
|
|
29
|
+
|
|
30
|
+
From user input, extract three things: **feature name**, **intent type**, **developer**, **lang**.
|
|
31
|
+
|
|
32
|
+
| Extract | Rule | Example |
|
|
33
|
+
|---------|------|---------|
|
|
34
|
+
| Feature name | Convert to camelCase. Chinese → translate to English first | "add user auth" → `addUserAuth`; "添加用户认证" → `addUserAuth` |
|
|
35
|
+
| Intent type | Semantic inference from input | add/new/implement → `feature`; fix/bug/hotfix → `hotfix`; refactor/optimize → `refactor`; docs → `docs`; test → `test`; build/deps → `chore`; default → `feature` |
|
|
36
|
+
| Developer | "@username" or "Developer: xxx" → extract (remove "@"). Fallback: git user name | "添加todolist @jay" → user=`jay` |
|
|
37
|
+
| Lang | CJK chars → `zh`; explicit "zh"/"中文" → `zh`; "en"/"English" → `en`; fallback: config `lang` | "添加todolist" → `zh` |
|
|
38
|
+
|
|
39
|
+
**Naming Templates**
|
|
40
|
+
|
|
41
|
+
Config supports custom templates with variables `{date}`, `{feature}`, `{user}`, `{intentType}`, `{prefix}`:
|
|
42
|
+
- `branchTemplate` (default: `{intentType}-{date}-{feature}-{user}`)
|
|
43
|
+
- `changeNameTemplate` (default: `{intentType}-{date}-{feature}-{user}`)
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# "添加todolist @jay" → feature=addTodolist, user=jay, intentType=feature, lang=zh
|
|
47
|
+
superspec create addTodolist --intent-type feature --lang zh
|
|
48
|
+
# Branch: feature-20260212-addTodolist-jay
|
|
49
|
+
|
|
50
|
+
# "fix login bug" → feature=fixLoginBug, intentType=hotfix, user=<git username>
|
|
51
|
+
superspec create fixLoginBug --intent-type hotfix
|
|
52
|
+
# Branch: hotfix-20260212-fixLoginBug-gitusername
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
If user provides custom `--branch-prefix`, prepend to template.
|
|
56
|
+
|
|
57
|
+
**CLI Command Structure**
|
|
58
|
+
```bash
|
|
59
|
+
superspec create <feature> [options]
|
|
60
|
+
-b, --boost Boost mode (spec + checklist)
|
|
61
|
+
-c, --creative Creative mode (explore new solutions)
|
|
62
|
+
-d, --description <desc> Change description
|
|
63
|
+
--no-branch Skip git branch creation
|
|
64
|
+
--spec-dir <dir> Custom spec folder
|
|
65
|
+
--branch-prefix <prefix> Custom branch prefix
|
|
66
|
+
--branch-template <template> Override branch name template
|
|
67
|
+
--change-name-template <template> Override folder name template
|
|
68
|
+
--intent-type <type> Intent type (feature, hotfix, bugfix, refactor, chore)
|
|
69
|
+
--feature <feature> Feature name
|
|
70
|
+
--user <user> Developer identifier
|
|
71
|
+
--lang <lang> SDD Document Language (en, zh)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**When to use design.md** (optional, boost mode):
|
|
75
|
+
- Solution spans multiple systems or introduces new architectural patterns
|
|
76
|
+
- Major architectural decisions with significant trade-offs
|
|
77
|
+
- Cross-team architecture alignment needed
|
|
78
|
+
|
|
79
|
+
**Spec Capability Splitting** (recommended for large changes):
|
|
80
|
+
When a change involves multiple independent capabilities, split by domain:
|
|
81
|
+
```
|
|
82
|
+
{specDir}/changes/<name>/
|
|
83
|
+
├── proposal.md
|
|
84
|
+
├── design.md (optional)
|
|
85
|
+
├── specs/
|
|
86
|
+
│ ├── auth/spec.md
|
|
87
|
+
│ ├── api/spec.md
|
|
88
|
+
│ └── ui/spec.md
|
|
89
|
+
├── tasks.md
|
|
90
|
+
└── checklist.md
|
|
91
|
+
```
|
|
92
|
+
Each spec.md < 300 lines. Outline domains in proposal.md, group tasks by domain in tasks.md.
|
|
93
|
+
|
|
14
94
|
**Steps**
|
|
15
|
-
1.
|
|
16
|
-
2.
|
|
17
|
-
3.
|
|
18
|
-
4.
|
|
95
|
+
1. Parse user input → extract feature (camelCase), intent type, developer, lang
|
|
96
|
+
2. Run: `superspec create <feature> --intent-type <type> [--lang <lang>] [--user <user>]`
|
|
97
|
+
3. Pre-task review: read project context, check existing changes, understand dependencies
|
|
98
|
+
4. Assess complexity: if multiple independent capability domains → consider splitting spec
|
|
99
|
+
5. Read generated proposal.md → understand scope; if design.md needed → clarify architectural decisions
|
|
100
|
+
6. Wait for user confirmation before proceeding to /ss-tasks
|
|
19
101
|
<!-- SUPERSPEC:END -->
|
|
@@ -6,6 +6,7 @@ description: Add spec dependency
|
|
|
6
6
|
---
|
|
7
7
|
<!-- SUPERSPEC:START -->
|
|
8
8
|
**Steps**
|
|
9
|
-
1. Run `superspec
|
|
9
|
+
1. Run `superspec deps add <name> --on <other>`
|
|
10
10
|
2. This updates the frontmatter: `depends_on: [other]`
|
|
11
|
+
3. Verify: `superspec deps list <name>`
|
|
11
12
|
<!-- SUPERSPEC:END -->
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: /ss-specs
|
|
3
|
+
id: ss-specs
|
|
4
|
+
category: SuperSpec
|
|
5
|
+
description: Create multi-capability spec structure for large changes
|
|
6
|
+
---
|
|
7
|
+
<!-- SUPERSPEC:START -->
|
|
8
|
+
**Purpose**
|
|
9
|
+
When spec.md may exceed 300 lines due to multiple independent capability domains, split into capability-specific spec files.
|
|
10
|
+
|
|
11
|
+
**When to Split**
|
|
12
|
+
- Change spans multiple system modules (e.g., auth + API + UI)
|
|
13
|
+
- Single spec.md expected to exceed 300 lines
|
|
14
|
+
- Need parallel development of independent capabilities
|
|
15
|
+
|
|
16
|
+
**When NOT to Split**
|
|
17
|
+
- Single module change or spec.md < 200 lines
|
|
18
|
+
- Capabilities are tightly coupled
|
|
19
|
+
- Rapid prototyping or experimental changes
|
|
20
|
+
|
|
21
|
+
**Capability Domain Types**
|
|
22
|
+
`auth` (authentication/authorization) · `api` (REST/GraphQL) · `ui` (frontend) · `data` (models/schema) · `workflow` (business processes) · `integration` (external systems) · `infra` (deployment)
|
|
23
|
+
|
|
24
|
+
**Spec Template**
|
|
25
|
+
```markdown
|
|
26
|
+
---
|
|
27
|
+
name: <name>-<capability>
|
|
28
|
+
status: draft
|
|
29
|
+
strategy: {{strategy}}
|
|
30
|
+
depends_on: []
|
|
31
|
+
capability: <capability-name>
|
|
32
|
+
---
|
|
33
|
+
# Spec: <name> - <Capability>
|
|
34
|
+
|
|
35
|
+
## Capability Scope
|
|
36
|
+
## User Stories
|
|
37
|
+
### US-<capability>-1: [Title]
|
|
38
|
+
## Functional Requirements
|
|
39
|
+
### FR-<capability>-1: [Title]
|
|
40
|
+
## Cross-Capability Dependencies
|
|
41
|
+
- Depends on `auth/spec.md` FR-auth-2
|
|
42
|
+
- Provides API-1 for `ui/spec.md`
|
|
43
|
+
## Edge Cases
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**ID Convention**: `US-<cap>-<n>`, `FR-<cap>-<n>`, `AC-<cap>-<n>.<sub>`
|
|
47
|
+
|
|
48
|
+
**Steps**
|
|
49
|
+
1. Identify 2-5 independent capability domains in proposal.md
|
|
50
|
+
2. Create `specs/<capability>/spec.md` for each, using template above
|
|
51
|
+
3. Document splitting rationale in design.md
|
|
52
|
+
4. Group tasks by capability in tasks.md
|
|
53
|
+
5. Validate: clear boundaries, explicit dependencies, each spec < 300 lines, IDs follow convention
|
|
54
|
+
<!-- SUPERSPEC:END -->
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: {{name}}
|
|
3
|
+
status: draft
|
|
4
|
+
strategy: {{strategy}}
|
|
5
|
+
depends_on: []
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Architecture Design: {{name}}
|
|
9
|
+
|
|
10
|
+
> Created: {{date}}
|
|
11
|
+
|
|
12
|
+
## Design Goals
|
|
13
|
+
|
|
14
|
+
<!-- Describe the core objectives of this architectural design -->
|
|
15
|
+
|
|
16
|
+
## System Scope
|
|
17
|
+
|
|
18
|
+
<!-- Define system/module boundaries affected by this change -->
|
|
19
|
+
|
|
20
|
+
- **Affected Systems**:
|
|
21
|
+
- **Affected Modules**:
|
|
22
|
+
- **Out of Scope**:
|
|
23
|
+
|
|
24
|
+
## Architecture Decisions
|
|
25
|
+
|
|
26
|
+
### Decision 1: [Decision Title]
|
|
27
|
+
|
|
28
|
+
**Context**: Why is this decision needed?
|
|
29
|
+
|
|
30
|
+
**Options Considered**:
|
|
31
|
+
- **Option A**: [Description]
|
|
32
|
+
- Pros:
|
|
33
|
+
- Cons:
|
|
34
|
+
- **Option B**: [Description]
|
|
35
|
+
- Pros:
|
|
36
|
+
- Cons:
|
|
37
|
+
|
|
38
|
+
**Decision**: [Chosen option]
|
|
39
|
+
|
|
40
|
+
**Rationale**: [Why this option was chosen]
|
|
41
|
+
|
|
42
|
+
### Decision 2: [Decision Title]
|
|
43
|
+
|
|
44
|
+
**Context**:
|
|
45
|
+
|
|
46
|
+
**Options Considered**:
|
|
47
|
+
- **Option A**:
|
|
48
|
+
- **Option B**:
|
|
49
|
+
|
|
50
|
+
**Decision**:
|
|
51
|
+
|
|
52
|
+
**Rationale**:
|
|
53
|
+
|
|
54
|
+
## Architecture Diagram
|
|
55
|
+
|
|
56
|
+
<!-- Use mermaid or text to describe key architecture -->
|
|
57
|
+
|
|
58
|
+
```mermaid
|
|
59
|
+
graph TD
|
|
60
|
+
A[Component A] --> B[Component B]
|
|
61
|
+
B --> C[Component C]
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Data Flow
|
|
65
|
+
|
|
66
|
+
<!-- Describe critical data flow paths -->
|
|
67
|
+
|
|
68
|
+
1. User Request →
|
|
69
|
+
2. Processing Layer →
|
|
70
|
+
3. Storage Layer →
|
|
71
|
+
4. Response
|
|
72
|
+
|
|
73
|
+
## Technology Stack
|
|
74
|
+
|
|
75
|
+
<!-- If introducing new technologies, explain rationale -->
|
|
76
|
+
|
|
77
|
+
| Technology | Version | Purpose | Rationale |
|
|
78
|
+
|------------|---------|---------|-----------|
|
|
79
|
+
| | | | |
|
|
80
|
+
|
|
81
|
+
## Performance Impact
|
|
82
|
+
|
|
83
|
+
- **Expected Performance Changes**:
|
|
84
|
+
- **Potential Bottlenecks**:
|
|
85
|
+
- **Optimization Strategies**:
|
|
86
|
+
|
|
87
|
+
## Security Considerations
|
|
88
|
+
|
|
89
|
+
- **Authentication**:
|
|
90
|
+
- **Authorization**:
|
|
91
|
+
- **Data Encryption**:
|
|
92
|
+
- **Audit Logging**:
|
|
93
|
+
|
|
94
|
+
## Scalability Considerations
|
|
95
|
+
|
|
96
|
+
- **Horizontal Scaling**:
|
|
97
|
+
- **Vertical Scaling**:
|
|
98
|
+
- **Future Evolution Path**:
|
|
99
|
+
|
|
100
|
+
## Migration Strategy
|
|
101
|
+
|
|
102
|
+
<!-- If major architectural changes, describe migration steps -->
|
|
103
|
+
|
|
104
|
+
1. **Phase 1**:
|
|
105
|
+
2. **Phase 2**:
|
|
106
|
+
3. **Phase 3**:
|
|
107
|
+
|
|
108
|
+
**Rollback Plan**:
|
|
109
|
+
|
|
110
|
+
## Risks & Mitigation
|
|
111
|
+
|
|
112
|
+
| Risk | Impact | Probability | Mitigation |
|
|
113
|
+
|------|--------|-------------|------------|
|
|
114
|
+
| | | | |
|
|
115
|
+
|
|
116
|
+
## Dependencies
|
|
117
|
+
|
|
118
|
+
<!-- Dependencies of this architectural design -->
|
|
119
|
+
|
|
120
|
+
- **Dependent Changes**:
|
|
121
|
+
- **External System Dependencies**:
|
|
122
|
+
- **Dependents**:
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
**Status**: 🟡 Draft
|
|
@@ -2,18 +2,100 @@
|
|
|
2
2
|
name: /ss-create
|
|
3
3
|
id: ss-create
|
|
4
4
|
category: SuperSpec
|
|
5
|
-
description: 创建变更 + 生成 proposal(boost 模式额外生成 spec + checklist)
|
|
5
|
+
description: 创建变更 + 生成 proposal(boost 模式额外生成 spec + design(当你需要) + checklist)
|
|
6
6
|
---
|
|
7
7
|
<!-- SUPERSPEC:START -->
|
|
8
|
+
## 用户输入
|
|
9
|
+
|
|
10
|
+
```text
|
|
11
|
+
$ARGUMENTS
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
你**必须**在继续之前考虑用户输入(如果非空)。
|
|
15
|
+
|
|
16
|
+
## 概述
|
|
17
|
+
|
|
18
|
+
用户在 `/ss-create` 后输入的文本**就是**功能描述。除非用户提供了空命令,否则不要要求用户重复输入。
|
|
19
|
+
|
|
8
20
|
**Guardrails**
|
|
9
|
-
- 首先读取 `superspec.config.json` 获取 `lang`, `specDir`, `boost`, `strategy`, `context`
|
|
10
|
-
-
|
|
11
|
-
-
|
|
21
|
+
- 首先读取 `superspec.config.json` → 获取 `lang`, `specDir`, `boost`, `strategy`, `context`, `branchPrefix`, `branchTemplate`, `changeNameTemplate`
|
|
22
|
+
- **执行前置审查**(参考 AGENTS.md "Before ANY Task"):
|
|
23
|
+
- 读取 `context` 文件、README、架构文档
|
|
24
|
+
- 查看 `{specDir}/changes/` → 通过 `depends_on` 避免重复变更
|
|
25
|
+
- 永远不要手动创建变更文件夹 —— 使用 `superspec create <feature>` CLI
|
|
12
26
|
- 在提案阶段不要编写任何代码,只创建设计文档
|
|
13
27
|
|
|
28
|
+
**输入解析规则**
|
|
29
|
+
|
|
30
|
+
从用户输入中提取四项:**功能名称**、**意图类型**、**开发者**、**语言**。
|
|
31
|
+
|
|
32
|
+
| 提取项 | 规则 | 示例 |
|
|
33
|
+
|--------|------|------|
|
|
34
|
+
| 功能名称 | 转为 camelCase。中文 → 先翻译为英文 | "add user auth" → `addUserAuth`; "添加用户认证" → `addUserAuth` |
|
|
35
|
+
| 意图类型 | 语义推断 | add/new/implement/新增/添加 → `feature`; fix/bug/hotfix/修复 → `hotfix`; refactor/optimize/重构 → `refactor`; docs → `docs`; test → `test`; build/deps → `chore`; 默认 → `feature` |
|
|
36
|
+
| 开发者 | "@username" 或 "Developer: xxx" → 提取(移除"@")。回退: git 用户名 | "添加todolist @jay" → user=`jay` |
|
|
37
|
+
| 语言 | CJK 字符 → `zh`; 显式 "zh"/"中文" → `zh`; "en"/"English" → `en`; 回退: 配置 `lang` | "添加todolist" → `zh` |
|
|
38
|
+
|
|
39
|
+
**命名模板**
|
|
40
|
+
|
|
41
|
+
配置支持使用变量 `{date}`, `{feature}`, `{user}`, `{intentType}`, `{prefix}` 的自定义模板:
|
|
42
|
+
- `branchTemplate`(默认: `{intentType}-{date}-{feature}-{user}`)
|
|
43
|
+
- `changeNameTemplate`(默认: `{intentType}-{date}-{feature}-{user}`)
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# "添加todolist @jay" → feature=addTodolist, user=jay, intentType=feature, lang=zh
|
|
47
|
+
superspec create addTodolist --intent-type feature --lang zh
|
|
48
|
+
# 分支: feature-20260212-addTodolist-jay
|
|
49
|
+
|
|
50
|
+
# "fix login bug" → feature=fixLoginBug, intentType=hotfix, user=<git用户名>
|
|
51
|
+
superspec create fixLoginBug --intent-type hotfix
|
|
52
|
+
# 分支: hotfix-20260212-fixLoginBug-gitusername
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
如果用户提供自定义 `--branch-prefix`,添加到模板前面。
|
|
56
|
+
|
|
57
|
+
**CLI 命令结构**
|
|
58
|
+
```bash
|
|
59
|
+
superspec create <feature> [options]
|
|
60
|
+
-b, --boost 增强模式(spec + checklist)
|
|
61
|
+
-c, --creative 创造模式(探索新方案)
|
|
62
|
+
-d, --description <desc> 变更描述
|
|
63
|
+
--no-branch 跳过 git 分支创建
|
|
64
|
+
--spec-dir <dir> 自定义 spec 文件夹
|
|
65
|
+
--branch-prefix <prefix> 自定义分支前缀
|
|
66
|
+
--branch-template <template> 覆盖分支名模板
|
|
67
|
+
--change-name-template <template> 覆盖文件夹名模板
|
|
68
|
+
--intent-type <type> 意图类型(feature, hotfix, bugfix, refactor, chore)
|
|
69
|
+
--feature <feature> 功能名称
|
|
70
|
+
--user <user> 开发者标识
|
|
71
|
+
--lang <lang> SDD 文档语言(en, zh)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**何时使用 design.md**(boost 模式可选):
|
|
75
|
+
- 方案跨越多个系统或引入新架构模式
|
|
76
|
+
- 重大架构决策且有显著权衡
|
|
77
|
+
- 需要跨团队架构对齐
|
|
78
|
+
|
|
79
|
+
**Spec 能力域拆分**(推荐用于大型变更):
|
|
80
|
+
当变更涉及多个独立能力时,按能力域拆分:
|
|
81
|
+
```
|
|
82
|
+
{specDir}/changes/<name>/
|
|
83
|
+
├── proposal.md
|
|
84
|
+
├── design.md (可选)
|
|
85
|
+
├── specs/
|
|
86
|
+
│ ├── auth/spec.md
|
|
87
|
+
│ ├── api/spec.md
|
|
88
|
+
│ └── ui/spec.md
|
|
89
|
+
├── tasks.md
|
|
90
|
+
└── checklist.md
|
|
91
|
+
```
|
|
92
|
+
每个 spec.md < 300 行。在 proposal.md 中概述能力域,tasks.md 按能力域分组。
|
|
93
|
+
|
|
14
94
|
**Steps**
|
|
15
|
-
1.
|
|
16
|
-
2.
|
|
17
|
-
3.
|
|
18
|
-
4.
|
|
95
|
+
1. 解析用户输入 → 提取功能名(camelCase)、意图类型、开发者、语言
|
|
96
|
+
2. 执行: `superspec create <feature> --intent-type <type> [--lang <lang>] [--user <user>]`
|
|
97
|
+
3. 前置审查: 读取项目上下文、检查现有变更、理解依赖关系
|
|
98
|
+
4. 评估复杂度: 如涉及多个独立能力域 → 考虑拆分 spec
|
|
99
|
+
5. 读取生成的 proposal.md → 理解范围; 如需 design.md → 明确架构决策
|
|
100
|
+
6. 等待用户确认后再继续 /ss-tasks
|
|
19
101
|
<!-- SUPERSPEC:END -->
|
|
@@ -6,6 +6,7 @@ description: 添加 spec 依赖
|
|
|
6
6
|
---
|
|
7
7
|
<!-- SUPERSPEC:START -->
|
|
8
8
|
**Steps**
|
|
9
|
-
1. 运行 `superspec
|
|
9
|
+
1. 运行 `superspec deps add <name> --on <other>`
|
|
10
10
|
2. 这会更新 frontmatter: `depends_on: [other]`
|
|
11
|
+
3. 验证: `superspec deps list <name>`
|
|
11
12
|
<!-- SUPERSPEC:END -->
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: /ss-specs
|
|
3
|
+
id: ss-specs
|
|
4
|
+
category: SuperSpec
|
|
5
|
+
description: 为大型变更创建多能力域 spec 结构
|
|
6
|
+
---
|
|
7
|
+
<!-- SUPERSPEC:START -->
|
|
8
|
+
**用途**
|
|
9
|
+
当 spec.md 因涉及多个独立能力域可能超过 300 行时,拆分为能力域维度的 spec 文件。
|
|
10
|
+
|
|
11
|
+
**何时拆分**
|
|
12
|
+
- 变更跨多个系统模块(如 auth + API + UI)
|
|
13
|
+
- 单个 spec.md 预计超过 300 行
|
|
14
|
+
- 需要并行开发多个独立能力
|
|
15
|
+
|
|
16
|
+
**何时不拆分**
|
|
17
|
+
- 单一模块变更或 spec.md < 200 行
|
|
18
|
+
- 能力域之间高度耦合
|
|
19
|
+
- 快速原型或实验性变更
|
|
20
|
+
|
|
21
|
+
**能力域类型**
|
|
22
|
+
`auth`(认证/授权)· `api`(REST/GraphQL)· `ui`(前端)· `data`(模型/schema)· `workflow`(业务流程)· `integration`(外部集成)· `infra`(部署)
|
|
23
|
+
|
|
24
|
+
**Spec 模板**
|
|
25
|
+
```markdown
|
|
26
|
+
---
|
|
27
|
+
name: <name>-<capability>
|
|
28
|
+
status: draft
|
|
29
|
+
strategy: {{strategy}}
|
|
30
|
+
depends_on: []
|
|
31
|
+
capability: <capability-name>
|
|
32
|
+
---
|
|
33
|
+
# Spec: <name> - <Capability>
|
|
34
|
+
|
|
35
|
+
## 能力域范围
|
|
36
|
+
## 用户故事
|
|
37
|
+
### US-<capability>-1: [标题]
|
|
38
|
+
## 功能需求
|
|
39
|
+
### FR-<capability>-1: [标题]
|
|
40
|
+
## 跨能力域依赖
|
|
41
|
+
- 依赖 `auth/spec.md` 的 FR-auth-2
|
|
42
|
+
- 为 `ui/spec.md` 提供 API-1
|
|
43
|
+
## 边界情况
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**ID 约定**: `US-<cap>-<n>`, `FR-<cap>-<n>`, `AC-<cap>-<n>.<sub>`
|
|
47
|
+
|
|
48
|
+
**Steps**
|
|
49
|
+
1. 在 proposal.md 中识别 2-5 个独立能力域
|
|
50
|
+
2. 为每个能力域创建 `specs/<capability>/spec.md`,使用上述模板
|
|
51
|
+
3. 在 design.md 中说明拆分理由
|
|
52
|
+
4. 在 tasks.md 中按能力域分组任务
|
|
53
|
+
5. 验证:边界清晰、依赖明确、每个 spec < 300 行、ID 遵循约定
|
|
54
|
+
<!-- SUPERSPEC:END -->
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: {{name}}
|
|
3
|
+
status: draft
|
|
4
|
+
strategy: {{strategy}}
|
|
5
|
+
depends_on: []
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# 架构设计: {{name}}
|
|
9
|
+
|
|
10
|
+
> 创建日期: {{date}}
|
|
11
|
+
|
|
12
|
+
## 设计目标
|
|
13
|
+
|
|
14
|
+
<!-- 描述本次架构设计要达成的核心目标 -->
|
|
15
|
+
|
|
16
|
+
## 系统范围
|
|
17
|
+
|
|
18
|
+
<!-- 说明本次变更涉及的系统/模块边界 -->
|
|
19
|
+
|
|
20
|
+
- **影响的系统**:
|
|
21
|
+
- **影响的模块**:
|
|
22
|
+
- **不涉及的范围**:
|
|
23
|
+
|
|
24
|
+
## 架构决策
|
|
25
|
+
|
|
26
|
+
### 决策 1: [决策标题]
|
|
27
|
+
|
|
28
|
+
**上下文**: 为什么需要这个决策?
|
|
29
|
+
|
|
30
|
+
**可选方案**:
|
|
31
|
+
- **方案 A**: [描述]
|
|
32
|
+
- 优点:
|
|
33
|
+
- 缺点:
|
|
34
|
+
- **方案 B**: [描述]
|
|
35
|
+
- 优点:
|
|
36
|
+
- 缺点:
|
|
37
|
+
|
|
38
|
+
**最终选择**: [选择的方案]
|
|
39
|
+
|
|
40
|
+
**理由**: [为什么选择这个方案]
|
|
41
|
+
|
|
42
|
+
### 决策 2: [决策标题]
|
|
43
|
+
|
|
44
|
+
**上下文**:
|
|
45
|
+
|
|
46
|
+
**可选方案**:
|
|
47
|
+
- **方案 A**:
|
|
48
|
+
- **方案 B**:
|
|
49
|
+
|
|
50
|
+
**最终选择**:
|
|
51
|
+
|
|
52
|
+
**理由**:
|
|
53
|
+
|
|
54
|
+
## 架构图
|
|
55
|
+
|
|
56
|
+
<!-- 使用 mermaid 或文本描述关键架构 -->
|
|
57
|
+
|
|
58
|
+
```mermaid
|
|
59
|
+
graph TD
|
|
60
|
+
A[组件A] --> B[组件B]
|
|
61
|
+
B --> C[组件C]
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## 数据流
|
|
65
|
+
|
|
66
|
+
<!-- 描述关键数据流转路径 -->
|
|
67
|
+
|
|
68
|
+
1. 用户请求 →
|
|
69
|
+
2. 处理层 →
|
|
70
|
+
3. 存储层 →
|
|
71
|
+
4. 响应
|
|
72
|
+
|
|
73
|
+
## 技术栈选型
|
|
74
|
+
|
|
75
|
+
<!-- 如引入新技术栈,说明选择理由 -->
|
|
76
|
+
|
|
77
|
+
| 技术 | 版本 | 用途 | 选择理由 |
|
|
78
|
+
|------|------|------|---------|
|
|
79
|
+
| | | | |
|
|
80
|
+
|
|
81
|
+
## 性能影响
|
|
82
|
+
|
|
83
|
+
- **预期性能变化**:
|
|
84
|
+
- **潜在瓶颈**:
|
|
85
|
+
- **优化策略**:
|
|
86
|
+
|
|
87
|
+
## 安全考量
|
|
88
|
+
|
|
89
|
+
- **身份认证**:
|
|
90
|
+
- **权限控制**:
|
|
91
|
+
- **数据加密**:
|
|
92
|
+
- **审计日志**:
|
|
93
|
+
|
|
94
|
+
## 扩展性考虑
|
|
95
|
+
|
|
96
|
+
- **水平扩展能力**:
|
|
97
|
+
- **垂直扩展能力**:
|
|
98
|
+
- **未来演进路径**:
|
|
99
|
+
|
|
100
|
+
## 迁移策略
|
|
101
|
+
|
|
102
|
+
<!-- 如涉及重大架构变更,描述迁移步骤 -->
|
|
103
|
+
|
|
104
|
+
1. **阶段 1**:
|
|
105
|
+
2. **阶段 2**:
|
|
106
|
+
3. **阶段 3**:
|
|
107
|
+
|
|
108
|
+
**回滚方案**:
|
|
109
|
+
|
|
110
|
+
## 风险与缓解
|
|
111
|
+
|
|
112
|
+
| 风险 | 影响 | 概率 | 缓解措施 |
|
|
113
|
+
|------|------|------|---------|
|
|
114
|
+
| | | | |
|
|
115
|
+
|
|
116
|
+
## 依赖关系
|
|
117
|
+
|
|
118
|
+
<!-- 本架构设计依赖的其他变更或系统 -->
|
|
119
|
+
|
|
120
|
+
- **依赖的变更**:
|
|
121
|
+
- **依赖的外部系统**:
|
|
122
|
+
- **被依赖方**:
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
**状态**: 🟡 草稿
|