specline 1.0.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.
@@ -0,0 +1,79 @@
1
+ ---
2
+ name: specline-propose
3
+ description: >-
4
+ 生成 Spec 规划文件(proposal/design/tasks/spec)。根据自然语言需求,
5
+ 直接按内联模板创建全部 Artifact,不依赖外部 CLI。
6
+ ---
7
+
8
+ 根据用户自然语言需求,在 `specline/changes/<change-name>/` 下生成完整规划文件。
9
+
10
+ **Input**: 用户需求描述(自然语言),由编排者传入 change-name。
11
+
12
+ **Steps**
13
+
14
+ 1. **理解需求并推导 change name**
15
+
16
+ 如果编排者没有传入明确的 change name,从需求描述推导 kebab-case 名称(如 "添加用户登录功能" → `add-user-login`)。
17
+
18
+ 2. **创建 Change 目录**
19
+
20
+ ```bash
21
+ specline-pipeline-gate.sh new --change "<name>"
22
+ ```
23
+
24
+ 创建 `specline/changes/<name>/` 目录及必要的元数据文件。
25
+
26
+ 3. **按顺序生成 4 个 Artifact**
27
+
28
+ | 顺序 | Artifact | 路径 | 内容要点 |
29
+ |------|----------|------|---------|
30
+ | 1 | proposal.md | `specline/changes/<name>/proposal.md` | What/Why/Scope/Non-goals |
31
+ | 2 | spec.md | `specline/changes/<name>/specs/<capability>/spec.md` | Purpose/Requirements/Scenarios(WHEN/THEN) |
32
+ | 3 | design.md | `specline/changes/<name>/design.md` | Architecture/Decisions/DataFlow |
33
+ | 4 | tasks.md | `specline/changes/<name>/tasks.md` | Type/Depends/Covers/Files 标注 |
34
+
35
+ **每个 Artifact 的创建规则**:
36
+
37
+ - **proposal.md**:描述 What(做什么)/ Why(为什么做)/ Scope(包含和不包含的范围)/ Impact(影响哪些系统)
38
+
39
+ - **spec.md**:H1 标题含 "Specification",包含 `## Purpose` 和 `## Requirements`,每个 Requirement 至少 1 个 Scenario,每个 Scenario 含 `**WHEN**`/`**THEN**` 配对,至少覆盖 Happy Path 和 1 个异常场景
40
+
41
+ - **design.md**:包含 Architecture、Key Design Decisions(每项说明选择理由和替代方案)、Data Flow、组件/模块交互
42
+
43
+ - **tasks.md**:每个任务必须标注:
44
+ - **Type**: frontend | backend | infra | db | config | docs
45
+ - **Depends**: (none) | 依赖的任务编号
46
+ - **Covers**: Requirement: xxx, Scenario: xxx
47
+ - **Files**: 任务涉及的文件路径列表
48
+
49
+ 任务拆分原则:
50
+ - 按功能领域垂直拆分(前/后端分开)
51
+ - `Depends: (none)` 占比 ≥ 60%
52
+ - 第 1 批次(无依赖任务)的 Files 集合互不重叠
53
+
54
+ 4. **验证完整性**
55
+
56
+ ```bash
57
+ specline-pipeline-gate.sh artifacts --change "<name>" --json
58
+ ```
59
+
60
+ 确保 proposal/design/tasks/specs 四个文件都已存在。
61
+
62
+ 5. **并行度自检**
63
+
64
+ 统计 tasks.md 中 `Depends: (none)` 的任务占比:
65
+ - ≥ 60% → 通过
66
+ - < 60% → 重新拆解(最多 2 次),仍不达标则记录警告
67
+
68
+ **Output**
69
+
70
+ 完成摘要:
71
+ - Change 名称和位置
72
+ - 4 个文件生成确认
73
+ - 任务统计(总数 N、独立任务 M、并行度 M/N)
74
+
75
+ **Guardrails**
76
+ - 所有文件直接写入 `specline/changes/<name>/`,不调用外部 CLI
77
+ - 先读已有 dependency 再生成后续文件
78
+ - 需求不明确时用结构化提问(AskUserQuestion)澄清
79
+ - 优先做出合理判断保持节奏,只在关键不清时询问
@@ -0,0 +1 @@
1
+ version: "1.0.0"
@@ -0,0 +1,20 @@
1
+ schema: spec-driven
2
+
3
+ # Project context (optional)
4
+ # This is shown to AI when creating artifacts.
5
+ # Add your tech stack, conventions, style guides, domain knowledge, etc.
6
+ # Example:
7
+ # context: |
8
+ # Tech stack: TypeScript, React, Node.js
9
+ # We use conventional commits
10
+ # Domain: e-commerce platform
11
+
12
+ # Per-artifact rules (optional)
13
+ # Add custom rules for specific artifacts.
14
+ # Example:
15
+ # rules:
16
+ # proposal:
17
+ # - Keep proposals under 500 words
18
+ # - Always include a "Non-goals" section
19
+ # tasks:
20
+ # - Break tasks into chunks of max 2 hours