@superspec/cli 1.0.0 → 1.1.1
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-archive.md +12 -2
- package/templates/en/commands/ss-create.md +91 -8
- package/templates/en/commands/ss-link.md +12 -2
- package/templates/en/commands/ss-search.md +12 -3
- package/templates/en/commands/ss-specs.md +54 -0
- package/templates/en/commands/ss-validate.md +12 -2
- package/templates/en/design.md +126 -0
- package/templates/zh/commands/ss-archive.md +12 -2
- package/templates/zh/commands/ss-create.md +91 -8
- package/templates/zh/commands/ss-link.md +12 -2
- package/templates/zh/commands/ss-search.md +12 -3
- package/templates/zh/commands/ss-specs.md +54 -0
- package/templates/zh/commands/ss-validate.md +12 -2
- package/templates/zh/design.md +126 -0
|
@@ -2,18 +2,101 @@
|
|
|
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: **mode flags**, **feature name**, **intent type**, **developer**, **lang**.
|
|
31
|
+
|
|
32
|
+
| Extract | Rule | Example |
|
|
33
|
+
|---------|------|---------|
|
|
34
|
+
| Mode flags | Detect `-b`/`--boost`/`boost` → boost mode; `-c`/`--creative`/`creative` → creative mode; `--no-branch` → skip branch; flags can be combined | `/ss-create -b add auth` → boost; `/ss-create -b -c refactor login` → boost+creative |
|
|
35
|
+
| Feature name | Remove flags from input, convert remainder to camelCase. Chinese → translate to English first | "add user auth" → `addUserAuth`; "添加用户认证" → `addUserAuth` |
|
|
36
|
+
| 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` |
|
|
37
|
+
| Developer | "@username" or "Developer: xxx" → extract (remove "@"). Fallback: git user name | "添加todolist @jay" → user=`jay` |
|
|
38
|
+
| Lang | CJK chars → `zh`; explicit "zh"/"中文" → `zh`; "en"/"English" → `en`; fallback: config `lang` | "添加todolist" → `zh` |
|
|
39
|
+
|
|
40
|
+
**Naming Templates**
|
|
41
|
+
|
|
42
|
+
Config supports custom templates with variables `{date}`, `{feature}`, `{user}`, `{intentType}`, `{prefix}`:
|
|
43
|
+
- `branchTemplate` (default: `{intentType}-{date}-{feature}-{user}`)
|
|
44
|
+
- `changeNameTemplate` (default: `{intentType}-{date}-{feature}-{user}`)
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# "添加todolist @jay" → feature=addTodolist, user=jay, intentType=feature, lang=zh
|
|
48
|
+
superspec create addTodolist --intent-type feature --lang zh
|
|
49
|
+
# Branch: feature-20260212-addTodolist-jay
|
|
50
|
+
|
|
51
|
+
# "fix login bug" → feature=fixLoginBug, intentType=hotfix, user=<git username>
|
|
52
|
+
superspec create fixLoginBug --intent-type hotfix
|
|
53
|
+
# Branch: hotfix-20260212-fixLoginBug-gitusername
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
If user provides custom `--branch-prefix`, prepend to template.
|
|
57
|
+
|
|
58
|
+
**CLI Command Structure**
|
|
59
|
+
```bash
|
|
60
|
+
superspec create <feature> [options]
|
|
61
|
+
-b, --boost Boost mode (spec + checklist)
|
|
62
|
+
-c, --creative Creative mode (explore new solutions)
|
|
63
|
+
-d, --description <desc> Change description
|
|
64
|
+
--no-branch Skip git branch creation
|
|
65
|
+
--spec-dir <dir> Custom spec folder
|
|
66
|
+
--branch-prefix <prefix> Custom branch prefix
|
|
67
|
+
--branch-template <template> Override branch name template
|
|
68
|
+
--change-name-template <template> Override folder name template
|
|
69
|
+
--intent-type <type> Intent type (feature, hotfix, bugfix, refactor, chore)
|
|
70
|
+
--feature <feature> Feature name
|
|
71
|
+
--user <user> Developer identifier
|
|
72
|
+
--lang <lang> SDD Document Language (en, zh)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**When to use design.md** (optional, boost mode):
|
|
76
|
+
- Solution spans multiple systems or introduces new architectural patterns
|
|
77
|
+
- Major architectural decisions with significant trade-offs
|
|
78
|
+
- Cross-team architecture alignment needed
|
|
79
|
+
|
|
80
|
+
**Spec Capability Splitting** (recommended for large changes):
|
|
81
|
+
When a change involves multiple independent capabilities, split by domain:
|
|
82
|
+
```
|
|
83
|
+
{specDir}/changes/<name>/
|
|
84
|
+
├── proposal.md
|
|
85
|
+
├── design.md (optional)
|
|
86
|
+
├── specs/
|
|
87
|
+
│ ├── auth/spec.md
|
|
88
|
+
│ ├── api/spec.md
|
|
89
|
+
│ └── ui/spec.md
|
|
90
|
+
├── tasks.md
|
|
91
|
+
└── checklist.md
|
|
92
|
+
```
|
|
93
|
+
Each spec.md < 300 lines. Outline domains in proposal.md, group tasks by domain in tasks.md.
|
|
94
|
+
|
|
14
95
|
**Steps**
|
|
15
|
-
1.
|
|
16
|
-
2.
|
|
17
|
-
3.
|
|
18
|
-
4.
|
|
96
|
+
1. Parse user input → extract feature (camelCase), intent type, developer, lang
|
|
97
|
+
2. Run: `superspec create <feature> --intent-type <type> [--lang <lang>] [--user <user>]`
|
|
98
|
+
3. Pre-task review: read project context, check existing changes, understand dependencies
|
|
99
|
+
4. Assess complexity: if multiple independent capability domains → consider splitting spec
|
|
100
|
+
5. Read generated proposal.md → understand scope; if design.md needed → clarify architectural decisions
|
|
101
|
+
6. Wait for user confirmation before proceeding to /ss-tasks
|
|
19
102
|
<!-- SUPERSPEC:END -->
|
|
@@ -5,7 +5,17 @@ category: SuperSpec
|
|
|
5
5
|
description: Add spec dependency
|
|
6
6
|
---
|
|
7
7
|
<!-- SUPERSPEC:START -->
|
|
8
|
+
**Input Parsing Rules**
|
|
9
|
+
|
|
10
|
+
From user input, extract: **change name**, **dependency target**.
|
|
11
|
+
|
|
12
|
+
| Extract | Rule | Example |
|
|
13
|
+
|---------|------|---------|
|
|
14
|
+
| Change name | First argument or text before `--on` | `/ss-link addAuth --on addDB` → name=`addAuth` |
|
|
15
|
+
| Dependency target | `--on <other>`/`depends on <other>`/`→ <other>` → extract target name | `/ss-link addAuth --on addDB`; `/ss-link addAuth depends on addDB` |
|
|
16
|
+
|
|
8
17
|
**Steps**
|
|
9
|
-
1.
|
|
10
|
-
2.
|
|
18
|
+
1. Parse user input → extract change name and dependency target
|
|
19
|
+
2. Run `superspec deps add <name> --on <other>`
|
|
20
|
+
3. Verify: `superspec deps list <name>`
|
|
11
21
|
<!-- SUPERSPEC:END -->
|
|
@@ -5,8 +5,17 @@ category: SuperSpec
|
|
|
5
5
|
description: Full-text search across changes
|
|
6
6
|
---
|
|
7
7
|
<!-- SUPERSPEC:START -->
|
|
8
|
+
**Input Parsing Rules**
|
|
9
|
+
|
|
10
|
+
From user input, extract: **search query**, **optional flags**.
|
|
11
|
+
|
|
12
|
+
| Extract | Rule | Example |
|
|
13
|
+
|---------|------|---------|
|
|
14
|
+
| Search query | Remaining text after removing flags | `/ss-search user auth` → query=`user auth` |
|
|
15
|
+
| Include archived | `--archived`/`archived`/`include archived`/`all` → add `--archived` | `/ss-search auth --archived`; `/ss-search auth archived` |
|
|
16
|
+
| Filter type | `--artifact <type>`/`type:<type>` → add `--artifact <type>`; type: `proposal`/`spec`/`tasks`/`clarify`/`checklist` | `/ss-search auth --artifact spec`; `/ss-search auth type:proposal` |
|
|
17
|
+
|
|
8
18
|
**Steps**
|
|
9
|
-
1.
|
|
10
|
-
2.
|
|
11
|
-
3. Use `--artifact <type>` to filter by artifact type
|
|
19
|
+
1. Parse user input → extract search query and flags
|
|
20
|
+
2. Run `superspec search "<query>" [--archived] [--artifact <type>]`
|
|
12
21
|
<!-- 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 -->
|
|
@@ -5,11 +5,21 @@ category: SuperSpec
|
|
|
5
5
|
description: Cross-reference consistency check (boost mode)
|
|
6
6
|
---
|
|
7
7
|
<!-- SUPERSPEC:START -->
|
|
8
|
+
**Input Parsing Rules**
|
|
9
|
+
|
|
10
|
+
From user input, extract: **change name**, **optional flags**.
|
|
11
|
+
|
|
12
|
+
| Extract | Rule | Example |
|
|
13
|
+
|---------|------|---------|
|
|
14
|
+
| Change name | Remaining text after removing flags; if empty, use current active change | `/ss-validate addUserAuth` → name=`addUserAuth` |
|
|
15
|
+
| Check deps | `--check-deps`/`check deps`/`dependencies` → add `--check-deps` | `/ss-validate --check-deps`; `/ss-validate check deps` |
|
|
16
|
+
|
|
8
17
|
**Guardrails**
|
|
9
18
|
- Validate US↔FR↔AC↔tasks consistency
|
|
10
19
|
- Only applicable in boost mode
|
|
11
20
|
|
|
12
21
|
**Steps**
|
|
13
|
-
1.
|
|
14
|
-
2.
|
|
22
|
+
1. Parse user input → extract change name and flags
|
|
23
|
+
2. Run `superspec validate [name] [--check-deps]`
|
|
24
|
+
3. Fix any consistency errors reported
|
|
15
25
|
<!-- 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
|
|
@@ -5,11 +5,21 @@ category: SuperSpec
|
|
|
5
5
|
description: 归档已完成的变更
|
|
6
6
|
---
|
|
7
7
|
<!-- SUPERSPEC:START -->
|
|
8
|
+
**输入解析规则**
|
|
9
|
+
|
|
10
|
+
从用户输入中提取:**变更名称**或**全部标志**。
|
|
11
|
+
|
|
12
|
+
| 提取项 | 规则 | 示例 |
|
|
13
|
+
|--------|------|------|
|
|
14
|
+
| 变更名称 | 移除标志后的剩余文本;为空时使用当前活跃变更 | `/ss-archive addUserAuth` → name=`addUserAuth` |
|
|
15
|
+
| 归档全部 | `--all`/`全部`/`所有` → 添加 `--all` | `/ss-archive --all`; `/ss-archive 全部` |
|
|
16
|
+
|
|
8
17
|
**Guardrails**
|
|
9
18
|
- 只有所有任务都 COMPLETE 后才能归档
|
|
10
19
|
- 归档前确保测试通过
|
|
11
20
|
|
|
12
21
|
**Steps**
|
|
13
|
-
1.
|
|
14
|
-
2.
|
|
22
|
+
1. 解析用户输入 → 提取变更名称或 `--all` 标志
|
|
23
|
+
2. 确认 tasks.md 中所有任务都标记为 COMPLETE
|
|
24
|
+
3. 运行 `superspec archive <name>` 或 `superspec archive --all`
|
|
15
25
|
<!-- SUPERSPEC:END -->
|
|
@@ -2,18 +2,101 @@
|
|
|
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
|
+
| 模式标志 | 识别 `-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` |
|
|
36
|
+
| 意图类型 | 语义推断 | add/new/implement/新增/添加 → `feature`; fix/bug/hotfix/修复 → `hotfix`; refactor/optimize/重构 → `refactor`; docs → `docs`; test → `test`; build/deps → `chore`; 默认 → `feature` |
|
|
37
|
+
| 开发者 | "@username" 或 "Developer: xxx" → 提取(移除"@")。回退: git 用户名 | "添加todolist @jay" → user=`jay` |
|
|
38
|
+
| 语言 | CJK 字符 → `zh`; 显式 "zh"/"中文" → `zh`; "en"/"English" → `en`; 回退: 配置 `lang` | "添加todolist" → `zh` |
|
|
39
|
+
|
|
40
|
+
**命名模板**
|
|
41
|
+
|
|
42
|
+
配置支持使用变量 `{date}`, `{feature}`, `{user}`, `{intentType}`, `{prefix}` 的自定义模板:
|
|
43
|
+
- `branchTemplate`(默认: `{intentType}-{date}-{feature}-{user}`)
|
|
44
|
+
- `changeNameTemplate`(默认: `{intentType}-{date}-{feature}-{user}`)
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# "添加todolist @jay" → feature=addTodolist, user=jay, intentType=feature, lang=zh
|
|
48
|
+
superspec create addTodolist --intent-type feature --lang zh
|
|
49
|
+
# 分支: feature-20260212-addTodolist-jay
|
|
50
|
+
|
|
51
|
+
# "fix login bug" → feature=fixLoginBug, intentType=hotfix, user=<git用户名>
|
|
52
|
+
superspec create fixLoginBug --intent-type hotfix
|
|
53
|
+
# 分支: hotfix-20260212-fixLoginBug-gitusername
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
如果用户提供自定义 `--branch-prefix`,添加到模板前面。
|
|
57
|
+
|
|
58
|
+
**CLI 命令结构**
|
|
59
|
+
```bash
|
|
60
|
+
superspec create <feature> [options]
|
|
61
|
+
-b, --boost 增强模式(spec + checklist)
|
|
62
|
+
-c, --creative 创造模式(探索新方案)
|
|
63
|
+
-d, --description <desc> 变更描述
|
|
64
|
+
--no-branch 跳过 git 分支创建
|
|
65
|
+
--spec-dir <dir> 自定义 spec 文件夹
|
|
66
|
+
--branch-prefix <prefix> 自定义分支前缀
|
|
67
|
+
--branch-template <template> 覆盖分支名模板
|
|
68
|
+
--change-name-template <template> 覆盖文件夹名模板
|
|
69
|
+
--intent-type <type> 意图类型(feature, hotfix, bugfix, refactor, chore)
|
|
70
|
+
--feature <feature> 功能名称
|
|
71
|
+
--user <user> 开发者标识
|
|
72
|
+
--lang <lang> SDD 文档语言(en, zh)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**何时使用 design.md**(boost 模式可选):
|
|
76
|
+
- 方案跨越多个系统或引入新架构模式
|
|
77
|
+
- 重大架构决策且有显著权衡
|
|
78
|
+
- 需要跨团队架构对齐
|
|
79
|
+
|
|
80
|
+
**Spec 能力域拆分**(推荐用于大型变更):
|
|
81
|
+
当变更涉及多个独立能力时,按能力域拆分:
|
|
82
|
+
```
|
|
83
|
+
{specDir}/changes/<name>/
|
|
84
|
+
├── proposal.md
|
|
85
|
+
├── design.md (可选)
|
|
86
|
+
├── specs/
|
|
87
|
+
│ ├── auth/spec.md
|
|
88
|
+
│ ├── api/spec.md
|
|
89
|
+
│ └── ui/spec.md
|
|
90
|
+
├── tasks.md
|
|
91
|
+
└── checklist.md
|
|
92
|
+
```
|
|
93
|
+
每个 spec.md < 300 行。在 proposal.md 中概述能力域,tasks.md 按能力域分组。
|
|
94
|
+
|
|
14
95
|
**Steps**
|
|
15
|
-
1.
|
|
16
|
-
2.
|
|
17
|
-
3.
|
|
18
|
-
4.
|
|
96
|
+
1. 解析用户输入 → 提取功能名(camelCase)、意图类型、开发者、语言
|
|
97
|
+
2. 执行: `superspec create <feature> --intent-type <type> [--lang <lang>] [--user <user>]`
|
|
98
|
+
3. 前置审查: 读取项目上下文、检查现有变更、理解依赖关系
|
|
99
|
+
4. 评估复杂度: 如涉及多个独立能力域 → 考虑拆分 spec
|
|
100
|
+
5. 读取生成的 proposal.md → 理解范围; 如需 design.md → 明确架构决策
|
|
101
|
+
6. 等待用户确认后再继续 /ss-tasks
|
|
19
102
|
<!-- SUPERSPEC:END -->
|
|
@@ -5,7 +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>`
|
|
20
|
+
3. 验证: `superspec deps list <name>`
|
|
11
21
|
<!-- 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 -->
|
|
@@ -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 -->
|
|
@@ -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 -->
|