ssd-ql-workflow 0.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.
@@ -0,0 +1,161 @@
1
+ ---
2
+ description: Verify implementation matches change artifacts before archiving
3
+ ---
4
+
5
+ Verify that an implementation matches the change artifacts (specs, tasks, design).
6
+
7
+ **Input**: Optionally specify a change name after `/opsx-verify` (e.g., `/opsx-verify add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
8
+
9
+ **Steps**
10
+
11
+ 1. **If no change name provided, prompt for selection**
12
+
13
+ Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
14
+
15
+ Show changes that have implementation tasks (tasks artifact exists).
16
+ Include the schema used for each change if available.
17
+ Mark changes with incomplete tasks as "(In Progress)".
18
+
19
+ **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
20
+
21
+ 2. **Check status to understand the schema**
22
+ ```bash
23
+ openspec status --change "<name>" --json
24
+ ```
25
+ Parse the JSON to understand:
26
+ - `schemaName`: The workflow being used (e.g., "spec-driven")
27
+ - Which artifacts exist for this change
28
+
29
+ 3. **Get the change directory and load artifacts**
30
+
31
+ ```bash
32
+ openspec instructions apply --change "<name>" --json
33
+ ```
34
+
35
+ This returns the change directory and context files. Read all available artifacts from `contextFiles`.
36
+
37
+ 4. **Initialize verification report structure**
38
+
39
+ Create a report structure with three dimensions:
40
+ - **Completeness**: Track tasks and spec coverage
41
+ - **Correctness**: Track requirement implementation and scenario coverage
42
+ - **Coherence**: Track design adherence and pattern consistency
43
+
44
+ Each dimension can have CRITICAL, WARNING, or SUGGESTION issues.
45
+
46
+ 5. **Verify Completeness**
47
+
48
+ **Task Completion**:
49
+ - If tasks.md exists in contextFiles, read it
50
+ - Parse checkboxes: `- [ ]` (incomplete) vs `- [x]` (complete)
51
+ - Count complete vs total tasks
52
+ - If incomplete tasks exist:
53
+ - Add CRITICAL issue for each incomplete task
54
+ - Recommendation: "Complete task: <description>" or "Mark as done if already implemented"
55
+
56
+ **Spec Coverage**:
57
+ - If delta specs exist in `openspec/changes/<name>/specs/`:
58
+ - Extract all requirements (marked with "### Requirement:")
59
+ - For each requirement:
60
+ - Search codebase for keywords related to the requirement
61
+ - Assess if implementation likely exists
62
+ - If requirements appear unimplemented:
63
+ - Add CRITICAL issue: "Requirement not found: <requirement name>"
64
+ - Recommendation: "Implement requirement X: <description>"
65
+
66
+ 6. **Verify Correctness**
67
+
68
+ **Requirement Implementation Mapping**:
69
+ - For each requirement from delta specs:
70
+ - Search codebase for implementation evidence
71
+ - If found, note file paths and line ranges
72
+ - Assess if implementation matches requirement intent
73
+ - If divergence detected:
74
+ - Add WARNING: "Implementation may diverge from spec: <details>"
75
+ - Recommendation: "Review <file>:<lines> against requirement X"
76
+
77
+ **Scenario Coverage**:
78
+ - For each scenario in delta specs (marked with "#### Scenario:"):
79
+ - Check if conditions are handled in code
80
+ - Check if tests exist covering the scenario
81
+ - If scenario appears uncovered:
82
+ - Add WARNING: "Scenario not covered: <scenario name>"
83
+ - Recommendation: "Add test or implementation for scenario: <description>"
84
+
85
+ 7. **Verify Coherence**
86
+
87
+ **Design Adherence**:
88
+ - If design.md exists in contextFiles:
89
+ - Extract key decisions (look for sections like "Decision:", "Approach:", "Architecture:")
90
+ - Verify implementation follows those decisions
91
+ - If contradiction detected:
92
+ - Add WARNING: "Design decision not followed: <decision>"
93
+ - Recommendation: "Update implementation or revise design.md to match reality"
94
+ - If no design.md: Skip design adherence check, note "No design.md to verify against"
95
+
96
+ **Code Pattern Consistency**:
97
+ - Review new code for consistency with project patterns
98
+ - Check file naming, directory structure, coding style
99
+ - If significant deviations found:
100
+ - Add SUGGESTION: "Code pattern deviation: <details>"
101
+ - Recommendation: "Consider following project pattern: <example>"
102
+
103
+ 8. **Generate Verification Report**
104
+
105
+ **Summary Scorecard**:
106
+ ```
107
+ ## Verification Report: <change-name>
108
+
109
+ ### Summary
110
+ | Dimension | Status |
111
+ |--------------|------------------|
112
+ | Completeness | X/Y tasks, N reqs|
113
+ | Correctness | M/N reqs covered |
114
+ | Coherence | Followed/Issues |
115
+ ```
116
+
117
+ **Issues by Priority**:
118
+
119
+ 1. **CRITICAL** (Must fix before archive):
120
+ - Incomplete tasks
121
+ - Missing requirement implementations
122
+ - Each with specific, actionable recommendation
123
+
124
+ 2. **WARNING** (Should fix):
125
+ - Spec/design divergences
126
+ - Missing scenario coverage
127
+ - Each with specific recommendation
128
+
129
+ 3. **SUGGESTION** (Nice to fix):
130
+ - Pattern inconsistencies
131
+ - Minor improvements
132
+ - Each with specific recommendation
133
+
134
+ **Final Assessment**:
135
+ - If CRITICAL issues: "X critical issue(s) found. Fix before archiving."
136
+ - If only warnings: "No critical issues. Y warning(s) to consider. Ready for archive (with noted improvements)."
137
+ - If all clear: "All checks passed. Ready for archive."
138
+
139
+ **Verification Heuristics**
140
+
141
+ - **Completeness**: Focus on objective checklist items (checkboxes, requirements list)
142
+ - **Correctness**: Use keyword search, file path analysis, reasonable inference - don't require perfect certainty
143
+ - **Coherence**: Look for glaring inconsistencies, don't nitpick style
144
+ - **False Positives**: When uncertain, prefer SUGGESTION over WARNING, WARNING over CRITICAL
145
+ - **Actionability**: Every issue must have a specific recommendation with file/line references where applicable
146
+
147
+ **Graceful Degradation**
148
+
149
+ - If only tasks.md exists: verify task completion only, skip spec/design checks
150
+ - If tasks + specs exist: verify completeness and correctness, skip design
151
+ - If full artifacts: verify all three dimensions
152
+ - Always note which checks were skipped and why
153
+
154
+ **Output Format**
155
+
156
+ Use clear markdown with:
157
+ - Table for summary scorecard
158
+ - Grouped lists for issues (CRITICAL/WARNING/SUGGESTION)
159
+ - Code references in format: `file.ts:123`
160
+ - Specific, actionable recommendations
161
+ - No vague suggestions like "consider reviewing"
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: Execute SDD workflow tasks
3
+ ---
4
+
5
+ Execute tasks from the SDD workflow.
6
+
7
+ This command delegates to the openspec-apply-change skill.
8
+
9
+ **Input**: Optional change name or batch number.
10
+
11
+ **Note**: This is an alias for `/opsx-apply`
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: Continue SDD workflow - create next artifact
3
+ ---
4
+
5
+ Continue the SDD workflow by creating the next artifact.
6
+
7
+ This command delegates to the openspec-continue-change skill.
8
+
9
+ **Input**: Optional change name.
10
+
11
+ **Note**: This is an alias for `/opsx-continue`
@@ -0,0 +1,24 @@
1
+ ---
2
+ description: Start a new SDD (Skill-Driven Development) workflow
3
+ ---
4
+
5
+ Start a new Skill-Driven Development workflow using trinity-workflow schema.
6
+
7
+ **Input**: Change name (kebab-case) or description.
8
+
9
+ **Steps**
10
+
11
+ 1. If no input, ask what to build using AskUserQuestion
12
+
13
+ 2. Create change with trinity-workflow schema:
14
+ ```bash
15
+ openspec new change "<name>" --schema trinity-workflow
16
+ ```
17
+
18
+ 3. Show status and first artifact instructions
19
+
20
+ **Output**
21
+ - Change created with trinity-workflow schema
22
+ - Ready for proposal creation
23
+
24
+ **Note**: This is an alias for `/opsx-new` with `--schema trinity-workflow`
@@ -0,0 +1,21 @@
1
+ ---
2
+ description: Show SDD workflow status
3
+ ---
4
+
5
+ Show current SDD workflow status and tracking layer progress.
6
+
7
+ **Input**: Optional change name.
8
+
9
+ **Steps**
10
+
11
+ 1. Get openspec status:
12
+ ```bash
13
+ openspec status --change "<name>"
14
+ ```
15
+
16
+ 2. If tracking files exist, show:
17
+ - Current phase (from task_plan.md)
18
+ - Progress percentage
19
+ - Recent activity (from progress.md)
20
+
21
+ **Note**: This is an alias for `/opsx-status` with tracking layer info
@@ -0,0 +1,97 @@
1
+ # ================================================
2
+ # OpenSpec 项目配置
3
+ # Schema: trinity-workflow(三位一体架构工作流)
4
+ # ================================================
5
+ schema: trinity-workflow
6
+
7
+ # ================================================
8
+ # 项目上下文(注入所有产出物)
9
+ # ================================================
10
+ context: |
11
+ 语言:中文(简体)
12
+ 所有产出物必须用简体中文撰写。
13
+
14
+ # 项目技术栈
15
+ Tech stack: TypeScript, React, Node.js
16
+
17
+ # ═══════════════════════════════════════════════
18
+ # 三位一体架构(Trinity Architecture)
19
+ # ═══════════════════════════════════════════════
20
+
21
+ 本项目使用 trinity-workflow schema,它整合了:
22
+
23
+ ## 1. 追踪层:Planning-with-Files
24
+ - task_plan.md: 阶段、目标、决策、错误日志
25
+ - findings.md: 技术发现、架构决策
26
+ - progress.md: 会话进度日志
27
+
28
+ ## 2. 方法层:阶段式产出
29
+ - proposal.md: 需求探索(@brainstorming)
30
+ - design.md: 技术设计(@writing-plans)
31
+ - specs/: 功能规格(Gherkin 格式)
32
+ - tasks.md: 任务分解(@executing-plans)
33
+
34
+ ## 3. 执行层:3-Strike 协议
35
+ - Attempt 1: 诊断并修复
36
+ - Attempt 2: 尝试替代方案
37
+ - Attempt 3: 重新思考问题
38
+ - 3次失败后: 升级给用户
39
+
40
+ [MUST] 执行任何工作流前,调用 planning-with-files 技能初始化追踪。
41
+
42
+ # ================================================
43
+ # 产出物规则(按 artifact 类型)
44
+ # ================================================
45
+ rules:
46
+ proposal:
47
+ - 字数控制在 500 字以内
48
+ - 必须包含 Non-goals 章节
49
+ - 必须提供 2-3 个方案选项
50
+ - 必须定义成功指标
51
+ design:
52
+ - 必须包含架构图
53
+ - 必须列出风险与缓解措施
54
+ - 必须说明 Breaking Changes
55
+ specs:
56
+ - 使用 Given/When/Then 格式
57
+ - 覆盖 Happy Path、Edge Cases、Error Cases
58
+ tasks:
59
+ - 每个任务 2-5 分钟可完成
60
+ - 每个任务有明确的验证步骤
61
+ - 任务按批次(Batch)组织
62
+
63
+ # ================================================
64
+ # 三位一体架构 - Superpowers 技能映射
65
+ # ================================================
66
+ superpowers:
67
+ enabled: true
68
+
69
+ skillMapping:
70
+ brainstorming:
71
+ triggers: ["@brainstorming", "/brainstorming"]
72
+ generates: "proposal.md"
73
+ instruction: |
74
+ Use the Skill tool with skill: "planning-with-files" 初始化追踪
75
+ 然后进行需求探索和方案设计
76
+ writing-plans:
77
+ triggers: ["@writing-plans", "/writing-plans"]
78
+ generates: ["design.md", "tasks.md"]
79
+ instruction: |
80
+ Use the Skill tool with skill: "excalidraw-diagram" 生成架构图(可选)
81
+ 创建技术设计文档和任务清单
82
+ executing-plans:
83
+ triggers: ["@executing-plans", "/executing-plans"]
84
+ generates: "tasks.md"
85
+ instruction: |
86
+ Use the Skill tool with skill: "openspec-apply-change" 执行任务
87
+ 按批次完成 tasks.md 中的任务
88
+
89
+ skillOutputs:
90
+ brainstorming:
91
+ pattern: "docs/plans/*-design.md"
92
+ target: "proposal.md"
93
+ writing-plans:
94
+ pattern: "docs/plans/*-plan.md"
95
+ target: "design.md"
96
+ executing-plans:
97
+ target: "tasks.md"
@@ -0,0 +1,184 @@
1
+ name: trinity-workflow
2
+ version: 1
3
+ description: |
4
+ 三位一体架构工作流 - 集成追踪层、方法层、执行层
5
+
6
+ 核心特性:
7
+ - 追踪层:Planning-with-Files 自动追踪进度
8
+ - 方法层:按阶段生成产出物
9
+ - 执行层:3-Strike 错误处理协议
10
+
11
+ # ================================================
12
+ # Workflow Artifacts 定义
13
+ # ================================================
14
+ artifacts:
15
+ # ----------------------------------------------
16
+ # Phase 1: 需求探索
17
+ # ----------------------------------------------
18
+ - id: proposal
19
+ generates: proposal.md
20
+ description: 需求探索与方案设计
21
+ template: proposal.md
22
+ instruction: |
23
+ ## Skill 调用
24
+ 触发词: @brainstorming 或 /brainstorming
25
+ [MUST] 执行前调用:Use the Skill tool with skill: "planning-with-files"
26
+
27
+ 创建需求提案文档,聚焦于 WHY 和 WHAT。
28
+
29
+ [MUST] 创建前先初始化追踪文件:
30
+ - task_plan.md: 阶段、目标、决策、错误日志
31
+ - findings.md: 技术发现、架构决策
32
+ - progress.md: 会话进度日志
33
+
34
+ 关键点:
35
+ 1. 明确问题陈述(Problem Statement)
36
+ 2. 提出多个方案选项(Options A/B/C)
37
+ 3. 定义成功指标(Success Metrics)
38
+ 4. 列出非目标(Non-goals)
39
+ 5. 评估影响范围(Impact Assessment)
40
+
41
+ 完成后更新 task_plan.md:
42
+ - Phase: proposal
43
+ - Status: complete
44
+ - Progress: 20%
45
+ requires: []
46
+
47
+ # ----------------------------------------------
48
+ # Phase 2: 技术设计
49
+ # ----------------------------------------------
50
+ - id: design
51
+ generates: design.md
52
+ description: 技术架构设计
53
+ template: design.md
54
+ instruction: |
55
+ ## Skill 调用
56
+ 触发词: @writing-plans 或 /writing-plans
57
+ [OPTIONAL] 架构图:Use the Skill tool with skill: "excalidraw-diagram"
58
+
59
+ 创建技术设计文档,聚焦于 HOW。
60
+
61
+ 关键点:
62
+ 1. 架构概述(Architecture Overview)
63
+ 2. 数据模型(Data Models)
64
+ 3. API 设计(API Design)
65
+ 4. 组件设计(Component Design)
66
+ 5. 风险与缓解(Risks & Mitigations)
67
+
68
+ 完成后更新 task_plan.md:
69
+ - Phase: design
70
+ - Status: complete
71
+ - Progress: 40%
72
+
73
+ 在 findings.md 记录架构决策(ADR)。
74
+ requires:
75
+ - proposal
76
+
77
+ # ----------------------------------------------
78
+ # Phase 3: 规格说明
79
+ # ----------------------------------------------
80
+ - id: specs
81
+ generates: specs/**/*.md
82
+ description: 功能规格说明(Gherkin 格式)
83
+ template: spec.md
84
+ instruction: |
85
+ 创建功能规格说明文档。
86
+
87
+ 使用 Gherkin 格式(Given/When/Then):
88
+ - Feature: 功能名称
89
+ - Scenario: 场景描述
90
+ - Given: 前置条件
91
+ - When: 触发动作
92
+ - Then: 期望结果
93
+
94
+ 覆盖三种场景:
95
+ - Happy Path: 成功路径
96
+ - Edge Cases: 边界情况
97
+ - Error Cases: 错误处理
98
+
99
+ 完成后更新 task_plan.md:
100
+ - Phase: specs
101
+ - Status: complete
102
+ - Progress: 60%
103
+ requires:
104
+ - design
105
+
106
+ # ----------------------------------------------
107
+ # Phase 4: 任务分解
108
+ # ----------------------------------------------
109
+ - id: tasks
110
+ generates: tasks.md
111
+ description: 实现任务清单
112
+ template: tasks.md
113
+ instruction: |
114
+ ## Skill 调用
115
+ 触发词: @executing-plans 或 /executing-plans
116
+
117
+ 创建任务分解清单。
118
+
119
+ 任务粒度要求:
120
+ - 每个任务 2-5 分钟可完成
121
+ - 每个任务有明确的验证步骤
122
+ - 任务按批次(Batch)组织
123
+ - 使用 `- [ ] X.Y Task description` 格式
124
+
125
+ 任务格式:
126
+ ```markdown
127
+ ## Batch 1: 基础设施
128
+ - [ ] 1.1 创建数据模型
129
+ - 验证:类型检查通过
130
+ - [ ] 1.2 实现 Repository
131
+ - 验证:单元测试通过
132
+ ```
133
+
134
+ 完成后更新 task_plan.md:
135
+ - Phase: tasks
136
+ - Status: complete
137
+ - Progress: 80%
138
+
139
+ 准备进入 apply 阶段。
140
+ requires:
141
+ - specs
142
+
143
+ # ================================================
144
+ # Apply 阶段配置
145
+ # ================================================
146
+ apply:
147
+ requires:
148
+ - tasks
149
+ tracks: tasks.md
150
+ instruction: |
151
+ ## 执行流程
152
+
153
+ 1. 读取 tasks.md 获取任务列表
154
+ 2. 读取 task_plan.md 获取执行状态
155
+ 3. 按批次执行任务
156
+ 4. 完成任务后:
157
+ - 更新 tasks.md 的 checkbox: `- [ ]` → `- [x]`
158
+ - 更新 task_plan.md 的 Progress
159
+ - 记录 progress.md 操作日志
160
+
161
+ ## 错误处理(3-Strike 协议)
162
+
163
+ | 尝试 | 动作 |
164
+ |------|------|
165
+ | Attempt 1 | 诊断并修复 |
166
+ | Attempt 2 | 尝试替代方案 |
167
+ | Attempt 3 | 重新思考问题 |
168
+ | 3次失败 | 升级给用户 |
169
+
170
+ 在 task_plan.md 的错误日志中记录每次尝试:
171
+
172
+ ```markdown
173
+ | 错误 | 尝试 | 解决方案 |
174
+ |------|------|----------|
175
+ | TypeError: ... | 1 | 添加 null check |
176
+ | TypeError: ... | 2 | 使用可选链 |
177
+ | TypeError: ... | 3 | 重构数据流 |
178
+ ```
179
+
180
+ ## 完成标准
181
+
182
+ - 所有 tasks.md 的 checkbox 已勾选
183
+ - task_plan.md Progress: 100%
184
+ - 所有验证步骤通过