@kynetic-ai/spec 0.3.0 → 0.5.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/batch-exec.d.ts +0 -9
- package/dist/cli/batch-exec.d.ts.map +1 -1
- package/dist/cli/batch-exec.js +16 -4
- package/dist/cli/batch-exec.js.map +1 -1
- package/dist/cli/commands/derive.d.ts.map +1 -1
- package/dist/cli/commands/derive.js +2 -1
- package/dist/cli/commands/derive.js.map +1 -1
- package/dist/cli/commands/guard.d.ts +43 -0
- package/dist/cli/commands/guard.d.ts.map +1 -0
- package/dist/cli/commands/guard.js +200 -0
- package/dist/cli/commands/guard.js.map +1 -0
- package/dist/cli/commands/index.d.ts +1 -0
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +1 -0
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/item.d.ts.map +1 -1
- package/dist/cli/commands/item.js +18 -0
- package/dist/cli/commands/item.js.map +1 -1
- package/dist/cli/commands/log.d.ts.map +1 -1
- package/dist/cli/commands/log.js +5 -4
- package/dist/cli/commands/log.js.map +1 -1
- package/dist/cli/commands/meta.d.ts.map +1 -1
- package/dist/cli/commands/meta.js +2 -1
- package/dist/cli/commands/meta.js.map +1 -1
- package/dist/cli/commands/plan-import.d.ts.map +1 -1
- package/dist/cli/commands/plan-import.js +100 -30
- package/dist/cli/commands/plan-import.js.map +1 -1
- package/dist/cli/commands/ralph.d.ts.map +1 -1
- package/dist/cli/commands/ralph.js +143 -330
- package/dist/cli/commands/ralph.js.map +1 -1
- package/dist/cli/commands/session.d.ts +73 -1
- package/dist/cli/commands/session.d.ts.map +1 -1
- package/dist/cli/commands/session.js +607 -162
- package/dist/cli/commands/session.js.map +1 -1
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +97 -217
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/skill-install.d.ts +4 -1
- package/dist/cli/commands/skill-install.d.ts.map +1 -1
- package/dist/cli/commands/skill-install.js +62 -5
- package/dist/cli/commands/skill-install.js.map +1 -1
- package/dist/cli/commands/task.d.ts.map +1 -1
- package/dist/cli/commands/task.js +128 -59
- package/dist/cli/commands/task.js.map +1 -1
- package/dist/cli/commands/tasks.d.ts.map +1 -1
- package/dist/cli/commands/tasks.js +2 -4
- package/dist/cli/commands/tasks.js.map +1 -1
- package/dist/cli/commands/triage.d.ts.map +1 -1
- package/dist/cli/commands/triage.js +12 -98
- package/dist/cli/commands/triage.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +18 -4
- package/dist/cli/output.js.map +1 -1
- package/dist/daemon/routes/triage.ts +4 -70
- package/dist/parser/config.d.ts +106 -0
- package/dist/parser/config.d.ts.map +1 -1
- package/dist/parser/config.js +47 -0
- package/dist/parser/config.js.map +1 -1
- package/dist/parser/file-lock.d.ts +14 -0
- package/dist/parser/file-lock.d.ts.map +1 -0
- package/dist/parser/file-lock.js +124 -0
- package/dist/parser/file-lock.js.map +1 -0
- package/dist/parser/index.d.ts +1 -0
- package/dist/parser/index.d.ts.map +1 -1
- package/dist/parser/index.js +1 -0
- package/dist/parser/index.js.map +1 -1
- package/dist/parser/plan-document.d.ts +44 -0
- package/dist/parser/plan-document.d.ts.map +1 -1
- package/dist/parser/plan-document.js +76 -8
- package/dist/parser/plan-document.js.map +1 -1
- package/dist/parser/plans.d.ts.map +1 -1
- package/dist/parser/plans.js +28 -102
- package/dist/parser/plans.js.map +1 -1
- package/dist/parser/shadow.d.ts.map +1 -1
- package/dist/parser/shadow.js +11 -7
- package/dist/parser/shadow.js.map +1 -1
- package/dist/parser/yaml.d.ts.map +1 -1
- package/dist/parser/yaml.js +322 -297
- package/dist/parser/yaml.js.map +1 -1
- package/dist/ralph/events.d.ts.map +1 -1
- package/dist/ralph/events.js +24 -0
- package/dist/ralph/events.js.map +1 -1
- package/dist/ralph/index.d.ts +1 -1
- package/dist/ralph/index.d.ts.map +1 -1
- package/dist/ralph/index.js +1 -1
- package/dist/ralph/index.js.map +1 -1
- package/dist/ralph/subagent.d.ts +12 -1
- package/dist/ralph/subagent.d.ts.map +1 -1
- package/dist/ralph/subagent.js +22 -3
- package/dist/ralph/subagent.js.map +1 -1
- package/dist/schema/batch.d.ts +2 -0
- package/dist/schema/batch.d.ts.map +1 -1
- package/dist/schema/common.d.ts +6 -0
- package/dist/schema/common.d.ts.map +1 -1
- package/dist/schema/common.js +8 -0
- package/dist/schema/common.js.map +1 -1
- package/dist/schema/task.d.ts +22 -0
- package/dist/schema/task.d.ts.map +1 -1
- package/dist/schema/task.js +7 -0
- package/dist/schema/task.js.map +1 -1
- package/dist/sessions/store.d.ts +226 -1
- package/dist/sessions/store.d.ts.map +1 -1
- package/dist/sessions/store.js +712 -38
- package/dist/sessions/store.js.map +1 -1
- package/dist/sessions/types.d.ts +51 -2
- package/dist/sessions/types.d.ts.map +1 -1
- package/dist/sessions/types.js +25 -0
- package/dist/sessions/types.js.map +1 -1
- package/dist/strings/errors.d.ts +4 -0
- package/dist/strings/errors.d.ts.map +1 -1
- package/dist/strings/errors.js +2 -0
- package/dist/strings/errors.js.map +1 -1
- package/dist/strings/labels.d.ts +2 -0
- package/dist/strings/labels.d.ts.map +1 -1
- package/dist/strings/labels.js +2 -0
- package/dist/strings/labels.js.map +1 -1
- package/dist/triage/actions.d.ts +27 -0
- package/dist/triage/actions.d.ts.map +1 -0
- package/dist/triage/actions.js +95 -0
- package/dist/triage/actions.js.map +1 -0
- package/dist/triage/constants.d.ts +6 -0
- package/dist/triage/constants.d.ts.map +1 -0
- package/dist/triage/constants.js +7 -0
- package/dist/triage/constants.js.map +1 -0
- package/dist/triage/index.d.ts +3 -0
- package/dist/triage/index.d.ts.map +1 -0
- package/dist/triage/index.js +3 -0
- package/dist/triage/index.js.map +1 -0
- package/dist/utils/git.d.ts +2 -0
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +21 -5
- package/dist/utils/git.js.map +1 -1
- package/package.json +1 -1
- package/plugin/.claude-plugin/marketplace.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/plugins/kspec/skills/create-workflow/SKILL.md +235 -0
- package/plugin/plugins/kspec/skills/observations/SKILL.md +143 -0
- package/plugin/plugins/kspec/skills/plan/SKILL.md +343 -0
- package/plugin/plugins/kspec/skills/reflect/SKILL.md +161 -0
- package/plugin/plugins/kspec/skills/review/SKILL.md +230 -0
- package/plugin/plugins/kspec/skills/task-work/SKILL.md +319 -0
- package/plugin/plugins/kspec/skills/triage-automation/SKILL.md +140 -0
- package/plugin/plugins/kspec/skills/triage-inbox/SKILL.md +232 -0
- package/plugin/plugins/kspec/skills/writing-specs/SKILL.md +354 -0
- package/templates/agents-sections/03-task-lifecycle.md +2 -2
- package/templates/agents-sections/04-pr-workflow.md +3 -3
- package/templates/agents-sections/05-commit-convention.md +14 -0
- package/templates/skills/create-workflow/SKILL.md +228 -0
- package/templates/skills/manifest.yaml +45 -0
- package/templates/skills/observations/SKILL.md +137 -0
- package/templates/skills/plan/SKILL.md +336 -0
- package/templates/skills/reflect/SKILL.md +155 -0
- package/templates/skills/review/SKILL.md +223 -0
- package/templates/skills/task-work/SKILL.md +312 -0
- package/templates/skills/triage-automation/SKILL.md +134 -0
- package/templates/skills/triage-inbox/SKILL.md +225 -0
- package/templates/skills/writing-specs/SKILL.md +347 -0
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plan
|
|
3
|
+
description: Translate approved plans into specs and tasks. Import structured
|
|
4
|
+
documents or create incrementally. Plans persist as durable artifacts with
|
|
5
|
+
audit trail.
|
|
6
|
+
---
|
|
7
|
+
<!-- kspec-managed -->
|
|
8
|
+
# Plan to Spec Translation
|
|
9
|
+
|
|
10
|
+
Translate approved plans into specs and tasks. Plans are durable artifacts — they persist in the shadow branch, link to derived work, and provide auditable planning history across sessions.
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
- After plan mode approval — turning an approved plan into trackable specs and tasks
|
|
15
|
+
- Creating specs for new features or multi-spec capabilities
|
|
16
|
+
- Translating design documents into the spec hierarchy
|
|
17
|
+
|
|
18
|
+
**Not for:** Raw ideas (use `kspec inbox add`), single spec creation (use `/kspec:writing-specs`), or triage (use `/kspec:triage`).
|
|
19
|
+
|
|
20
|
+
## Two Paths
|
|
21
|
+
|
|
22
|
+
### Import Path (Recommended for 3+ Specs)
|
|
23
|
+
|
|
24
|
+
Write a structured markdown document, then import it. All specs, tasks, and notes created atomically.
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
kspec plan import ./plan.md --module @target-module --dry-run # Preview
|
|
28
|
+
kspec plan import ./plan.md --module @target-module # Execute
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Manual Path (1-2 Specs)
|
|
32
|
+
|
|
33
|
+
Create plan record and specs incrementally via CLI.
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
kspec plan add --title "Plan Title" --content "Description" --status approved
|
|
37
|
+
kspec item add --under @parent --title "Feature" --type feature --slug slug
|
|
38
|
+
kspec item ac add @slug --given "..." --when "..." --then "..."
|
|
39
|
+
kspec derive @slug
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### When to Use Which
|
|
43
|
+
|
|
44
|
+
| Situation | Path |
|
|
45
|
+
|-----------|------|
|
|
46
|
+
| Plan mode just approved, complex feature | Import |
|
|
47
|
+
| Adding a requirement to existing feature | Manual |
|
|
48
|
+
| Multiple related specs with parent/child | Import |
|
|
49
|
+
| Quick bug fix that needs spec coverage | Manual |
|
|
50
|
+
| Translating design doc with many specs | Import |
|
|
51
|
+
| Iterating on previously imported plan | Import (`--update`) |
|
|
52
|
+
|
|
53
|
+
## Three-Phase Workflow
|
|
54
|
+
|
|
55
|
+
### Phase 1: Design
|
|
56
|
+
|
|
57
|
+
Always start here — never skip research.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
kspec workflow start @spec-plan-design
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
1. **Explore** — Read relevant code, understand current state
|
|
64
|
+
2. **Clarify** — Identify ambiguities, resolve with user
|
|
65
|
+
3. **Design** — Spec structure, AC coverage, trait selection
|
|
66
|
+
4. **Review** — Check for completeness and gaps
|
|
67
|
+
|
|
68
|
+
Design concludes by choosing import or manual path.
|
|
69
|
+
|
|
70
|
+
### Phase 2: Execute
|
|
71
|
+
|
|
72
|
+
Run the chosen workflow:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# Import path
|
|
76
|
+
kspec workflow start @spec-plan-import
|
|
77
|
+
|
|
78
|
+
# Manual path
|
|
79
|
+
kspec workflow start @spec-plan-manual
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Phase 3: Validate
|
|
83
|
+
|
|
84
|
+
After creating specs:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
kspec validate # Check spec quality
|
|
88
|
+
kspec validate --alignment # Verify spec-task links
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Plan Document Format
|
|
92
|
+
|
|
93
|
+
The import parser extracts specs, tasks, and notes from this markdown structure:
|
|
94
|
+
|
|
95
|
+
````markdown
|
|
96
|
+
# Plan Title
|
|
97
|
+
|
|
98
|
+
## Specs
|
|
99
|
+
|
|
100
|
+
```yaml
|
|
101
|
+
- title: OAuth Provider Support
|
|
102
|
+
slug: oauth-provider
|
|
103
|
+
type: feature
|
|
104
|
+
parent: "@auth"
|
|
105
|
+
description: Support third-party OAuth providers for authentication
|
|
106
|
+
traits:
|
|
107
|
+
- trait-error-guidance
|
|
108
|
+
acceptance_criteria:
|
|
109
|
+
- id: ac-1
|
|
110
|
+
given: User clicks sign-in with Google
|
|
111
|
+
when: OAuth flow completes successfully
|
|
112
|
+
then: User session is created with provider metadata
|
|
113
|
+
- id: ac-2
|
|
114
|
+
given: OAuth provider returns an error
|
|
115
|
+
when: Error callback is received
|
|
116
|
+
then: User sees descriptive error with retry option
|
|
117
|
+
implementation_notes: |
|
|
118
|
+
Use passport.js for OAuth. Per-spec notes go to this spec's derived task.
|
|
119
|
+
|
|
120
|
+
- title: Token Refresh
|
|
121
|
+
slug: token-refresh
|
|
122
|
+
type: requirement
|
|
123
|
+
parent: "@oauth-provider"
|
|
124
|
+
acceptance_criteria:
|
|
125
|
+
- id: ac-1
|
|
126
|
+
given: Access token is within 5 minutes of expiry
|
|
127
|
+
when: User makes an API request
|
|
128
|
+
then: Token is silently refreshed before the request proceeds
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Tasks
|
|
132
|
+
|
|
133
|
+
derive_from_specs: true
|
|
134
|
+
|
|
135
|
+
```yaml
|
|
136
|
+
- title: Write migration guide
|
|
137
|
+
slug: migration-guide
|
|
138
|
+
priority: 2
|
|
139
|
+
tags:
|
|
140
|
+
- docs
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Implementation Notes
|
|
144
|
+
|
|
145
|
+
General architecture notes. Attached to the plan record.
|
|
146
|
+
Use passport.js for OAuth, following existing auth patterns.
|
|
147
|
+
````
|
|
148
|
+
|
|
149
|
+
### Section Reference
|
|
150
|
+
|
|
151
|
+
| Section | Content | Notes |
|
|
152
|
+
|---------|---------|-------|
|
|
153
|
+
| `## Specs` | YAML code block — array of spec objects | **Must** use fenced code block (triple-backtick yaml) |
|
|
154
|
+
| `## Tasks` | `derive_from_specs: true` + optional manual tasks | Manual tasks get `plan_ref` but no `spec_ref` |
|
|
155
|
+
| `## Implementation Notes` | Plain text | Attached to plan record; per-spec notes use `implementation_notes` field |
|
|
156
|
+
|
|
157
|
+
### Spec Fields
|
|
158
|
+
|
|
159
|
+
| Field | Required | Description |
|
|
160
|
+
|-------|----------|-------------|
|
|
161
|
+
| `title` | Yes | Spec title |
|
|
162
|
+
| `slug` | No | Human-friendly ID (auto-generated if omitted) |
|
|
163
|
+
| `type` | No | `feature`, `requirement`, `constraint`, `decision` (default: `feature`) |
|
|
164
|
+
| `parent` | No | Parent ref (e.g., `"@parent-slug"`) |
|
|
165
|
+
| `description` | No | What and why |
|
|
166
|
+
| `acceptance_criteria` | No | Array of `{id, given, when, then}` |
|
|
167
|
+
| `traits` | No | Array of trait slugs (e.g., `trait-json-output`) |
|
|
168
|
+
| `implementation_notes` | No | Scoped to this spec's derived task |
|
|
169
|
+
|
|
170
|
+
## Trait Selection
|
|
171
|
+
|
|
172
|
+
Before writing specs, review available traits:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
kspec trait list
|
|
176
|
+
kspec trait get @trait-json-output # See inherited ACs
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Common Trait Applications
|
|
180
|
+
|
|
181
|
+
| Building... | Consider these traits |
|
|
182
|
+
|-------------|---------------------|
|
|
183
|
+
| CLI command with output | `@trait-json-output`, `@trait-semantic-exit-codes` |
|
|
184
|
+
| Destructive operation | `@trait-confirmation-prompt`, `@trait-dry-run` |
|
|
185
|
+
| List/search command | `@trait-filterable-list`, `@trait-json-output` |
|
|
186
|
+
| Shadow branch mutation | `@trait-shadow-commit` |
|
|
187
|
+
| User-facing error paths | `@trait-error-guidance` |
|
|
188
|
+
| Batch operations | `@trait-multi-ref-batch` |
|
|
189
|
+
| API endpoint | `@trait-api-endpoint`, `@trait-localhost-security` |
|
|
190
|
+
| WebSocket feature | `@trait-websocket-protocol` |
|
|
191
|
+
|
|
192
|
+
### Trait Naming in Plan Documents
|
|
193
|
+
|
|
194
|
+
Use the **full trait slug** — import only auto-prefixes `@`, not `@trait-`:
|
|
195
|
+
|
|
196
|
+
```yaml
|
|
197
|
+
# Wrong — resolves to nonexistent item
|
|
198
|
+
traits:
|
|
199
|
+
- json-output
|
|
200
|
+
|
|
201
|
+
# Correct — full slug
|
|
202
|
+
traits:
|
|
203
|
+
- trait-json-output
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## YAML Pitfalls
|
|
207
|
+
|
|
208
|
+
Plan documents embed YAML that is parsed as structured data. Common issues:
|
|
209
|
+
|
|
210
|
+
### Block Scalars for Complex Text
|
|
211
|
+
|
|
212
|
+
Use `|` (literal block scalar) when AC text contains quotes, colons, or special characters:
|
|
213
|
+
|
|
214
|
+
```yaml
|
|
215
|
+
# Problem — mixed quoting breaks parser
|
|
216
|
+
acceptance_criteria:
|
|
217
|
+
- id: ac-1
|
|
218
|
+
when: "kspec foo" is run
|
|
219
|
+
|
|
220
|
+
# Solution — block scalar preserves content literally
|
|
221
|
+
acceptance_criteria:
|
|
222
|
+
- id: ac-1
|
|
223
|
+
when: |
|
|
224
|
+
"kspec foo" is run
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Colons in Values
|
|
228
|
+
|
|
229
|
+
YAML treats `: ` (colon-space) as a key-value separator:
|
|
230
|
+
|
|
231
|
+
```yaml
|
|
232
|
+
# Problem — parsed as nested key
|
|
233
|
+
then: output shows time: 10:30
|
|
234
|
+
|
|
235
|
+
# Solution — quote the value
|
|
236
|
+
then: "output shows time: 10:30"
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Best Practice
|
|
240
|
+
|
|
241
|
+
Use block scalars (`|`) for ALL given/when/then text. This avoids every quoting issue:
|
|
242
|
+
|
|
243
|
+
```yaml
|
|
244
|
+
acceptance_criteria:
|
|
245
|
+
- id: ac-1
|
|
246
|
+
given: |
|
|
247
|
+
user has an existing session
|
|
248
|
+
when: |
|
|
249
|
+
user runs "kspec session start"
|
|
250
|
+
then: |
|
|
251
|
+
session context shows: active tasks, recent notes, inbox count
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
## Always Dry-Run First
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
kspec plan import ./plan.md --module @target --dry-run
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Dry-run catches:
|
|
261
|
+
- YAML syntax errors before partial state is created
|
|
262
|
+
- Missing parent refs
|
|
263
|
+
- Invalid trait references
|
|
264
|
+
- Duplicate slugs
|
|
265
|
+
|
|
266
|
+
## Post-Import Checklist
|
|
267
|
+
|
|
268
|
+
After importing, verify the results:
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
# Verify each spec has ACs
|
|
272
|
+
kspec item get @spec-slug
|
|
273
|
+
|
|
274
|
+
# Check trait coverage
|
|
275
|
+
kspec validate
|
|
276
|
+
|
|
277
|
+
# Set task dependencies (import doesn't infer these)
|
|
278
|
+
kspec task set @task-slug --depends-on @other-task
|
|
279
|
+
|
|
280
|
+
# Review plan record
|
|
281
|
+
kspec plan get @plan-slug
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
## Plan Lifecycle
|
|
285
|
+
|
|
286
|
+
```
|
|
287
|
+
draft → approved → active → completed
|
|
288
|
+
↓
|
|
289
|
+
rejected
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
- **Import** auto-creates plan as `active`
|
|
293
|
+
- **Manual** creates plan as `approved`
|
|
294
|
+
- Mark completed when all derived work is done:
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
kspec plan set @plan --status completed
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
## Programmatic Alternative: Batch
|
|
301
|
+
|
|
302
|
+
For fully programmatic creation (scripts, agent pipelines):
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
kspec batch --commands '[
|
|
306
|
+
{"command":"item add","args":{"under":"@parent","title":"Feature X","type":"feature","slug":"feature-x"}},
|
|
307
|
+
{"command":"item ac add","args":{"ref":"@feature-x","given":"...","when":"...","then":"..."}},
|
|
308
|
+
{"command":"derive","args":{"ref":"@feature-x"}}
|
|
309
|
+
]'
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
Atomic — all succeed or all roll back. Use `--dry-run` to preview.
|
|
313
|
+
|
|
314
|
+
## Command Reference
|
|
315
|
+
|
|
316
|
+
```bash
|
|
317
|
+
# Design phase
|
|
318
|
+
kspec workflow start @spec-plan-design
|
|
319
|
+
|
|
320
|
+
# Import path
|
|
321
|
+
kspec plan import <path> --module @module --dry-run # Preview
|
|
322
|
+
kspec plan import <path> --module @module # Create
|
|
323
|
+
kspec plan import <path> --module @module --update # Re-import
|
|
324
|
+
|
|
325
|
+
# Manual path
|
|
326
|
+
kspec plan add --title "..." --content "..." --status approved
|
|
327
|
+
kspec plan get <ref>
|
|
328
|
+
kspec plan set <ref> --status <status>
|
|
329
|
+
kspec plan note <ref> "..."
|
|
330
|
+
kspec plan list
|
|
331
|
+
|
|
332
|
+
# Validation
|
|
333
|
+
kspec validate
|
|
334
|
+
kspec validate --completeness
|
|
335
|
+
kspec validate --alignment
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
## Integration
|
|
339
|
+
|
|
340
|
+
- **`/kspec:writing-specs`** — Spec authoring details (types, AC format, traits)
|
|
341
|
+
- **`/kspec:task-work`** — After specs are created, work on derived tasks
|
|
342
|
+
- **`/kspec:triage`** — Inbox items may trigger plan creation
|
|
343
|
+
- **`/kspec:observations`** — Friction during planning becomes observations
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: reflect
|
|
3
|
+
description: Structured reflection at the end of work sessions. Identifies
|
|
4
|
+
learnings, friction points, and improvements for system evolution.
|
|
5
|
+
---
|
|
6
|
+
<!-- kspec-managed -->
|
|
7
|
+
# Session Reflection
|
|
8
|
+
|
|
9
|
+
Structured reflection at the end of a work session. Identifies learnings, friction points, and improvements — the raw material for system evolution.
|
|
10
|
+
|
|
11
|
+
## When to Use
|
|
12
|
+
|
|
13
|
+
- End of a work session (interactive or automated)
|
|
14
|
+
- After completing a significant piece of work
|
|
15
|
+
- When you notice recurring patterns worth capturing
|
|
16
|
+
|
|
17
|
+
## Workflow
|
|
18
|
+
|
|
19
|
+
### Interactive Mode
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
kspec workflow start @session-reflect
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Six steps, guided by the workflow engine:
|
|
26
|
+
|
|
27
|
+
1. **What Worked Well** — Identify effective practices
|
|
28
|
+
2. **Friction Points** — Where things were harder than needed
|
|
29
|
+
3. **Check Coverage** — Search for existing tracking before proposing new items
|
|
30
|
+
4. **Propose Improvements** — Concrete ideas for untracked friction
|
|
31
|
+
5. **Discussion** — Present to user, get approval one at a time
|
|
32
|
+
6. **Capture** — Add approved items to inbox/observations
|
|
33
|
+
|
|
34
|
+
Use `kspec workflow show` to see progress, `kspec workflow next --notes "..."` to advance.
|
|
35
|
+
|
|
36
|
+
### Loop Mode (Automated)
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
kspec workflow start @session-reflect-loop
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Key differences from interactive:
|
|
43
|
+
- **High confidence only** — Only capture what you're certain about
|
|
44
|
+
- **Search first** — MUST search before capturing anything
|
|
45
|
+
- **No user prompts** — Skip discussion, auto-resolve
|
|
46
|
+
- **Lower volume** — Better to capture nothing than capture noise
|
|
47
|
+
- **Higher bar for tasks** — Prefer `inbox add` over `task add` without user confirmation
|
|
48
|
+
|
|
49
|
+
## Gate: Is There Anything to Reflect On?
|
|
50
|
+
|
|
51
|
+
Before starting, check if the session had meaningful work:
|
|
52
|
+
|
|
53
|
+
1. **Tasks completed recently** — Any `completed_at` timestamps from the current session?
|
|
54
|
+
2. **Code changes** — Any staged, unstaged, or untracked files?
|
|
55
|
+
3. **Recent commits** — Any commits from the current session?
|
|
56
|
+
|
|
57
|
+
**Skip reflection if** no tasks completed, working tree is clean, and no commits made. Don't manufacture reflection from nothing.
|
|
58
|
+
|
|
59
|
+
## The Reflection Process
|
|
60
|
+
|
|
61
|
+
### Step 1: What Worked Well
|
|
62
|
+
|
|
63
|
+
Be specific — "categorizing items first" not "good planning."
|
|
64
|
+
|
|
65
|
+
- Workflows that flowed smoothly
|
|
66
|
+
- Tools or commands that helped
|
|
67
|
+
- Decisions that proved correct
|
|
68
|
+
- Patterns worth replicating
|
|
69
|
+
|
|
70
|
+
### Step 2: Friction Points
|
|
71
|
+
|
|
72
|
+
Focus on systemic issues, not one-off mistakes.
|
|
73
|
+
|
|
74
|
+
- Repetitive manual steps
|
|
75
|
+
- Missing commands or options
|
|
76
|
+
- Context loss or re-explanation needed
|
|
77
|
+
- Workarounds used
|
|
78
|
+
|
|
79
|
+
### Step 3: Check Existing Coverage
|
|
80
|
+
|
|
81
|
+
**Before proposing anything, search ALL sources:**
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
kspec search "<keyword>" # Searches specs, tasks, AND inbox
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
For each friction point:
|
|
88
|
+
- **Already tracked** — Reference the existing item, don't duplicate
|
|
89
|
+
- **Partially covered** — Note what's missing
|
|
90
|
+
- **Not tracked** — Candidate for capture
|
|
91
|
+
|
|
92
|
+
### Step 4: Propose Improvements
|
|
93
|
+
|
|
94
|
+
For untracked friction, propose:
|
|
95
|
+
- What it would do
|
|
96
|
+
- How it would help
|
|
97
|
+
- Rough scope (small/medium/large)
|
|
98
|
+
|
|
99
|
+
### Step 5: Discussion (Interactive Only)
|
|
100
|
+
|
|
101
|
+
Present findings one at a time:
|
|
102
|
+
- Is this worth capturing?
|
|
103
|
+
- Any refinements?
|
|
104
|
+
- Related ideas from user perspective?
|
|
105
|
+
|
|
106
|
+
### Step 6: Capture
|
|
107
|
+
|
|
108
|
+
Route each item to the right destination:
|
|
109
|
+
|
|
110
|
+
| What you found | Where | Why |
|
|
111
|
+
|----------------|-------|-----|
|
|
112
|
+
| Clear scope (know what and where) | `task add` | Ready to implement |
|
|
113
|
+
| Unclear scope (vague, needs triage) | `inbox add` | Will be triaged later |
|
|
114
|
+
| Systemic friction pattern | `meta observe friction` | Informs process improvement |
|
|
115
|
+
| Success pattern | `meta observe success` | Worth documenting |
|
|
116
|
+
| Behavior change needing spec work | Ask user | May need spec-first workflow |
|
|
117
|
+
|
|
118
|
+
**Inbox vs Task:** Can you describe the change and where it goes? Use `task add`. Only use inbox when scope is genuinely unclear.
|
|
119
|
+
|
|
120
|
+
When capturing 2+ items, use `kspec batch`:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
kspec batch --commands '[
|
|
124
|
+
{"command":"inbox add","args":{"text":"Improvement idea","tag":["reflection"]}},
|
|
125
|
+
{"command":"meta observe","args":{"type":"friction","content":"Friction pattern"}},
|
|
126
|
+
{"command":"meta observe","args":{"type":"success","content":"Success pattern"}}
|
|
127
|
+
]'
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Reflection Prompts
|
|
131
|
+
|
|
132
|
+
Use these to surface insights:
|
|
133
|
+
|
|
134
|
+
- **Process:** What did I repeat 3+ times? What workarounds did I use?
|
|
135
|
+
- **Tools:** What command or flag did I wish existed?
|
|
136
|
+
- **Communication:** Where was the user surprised? What should I have asked earlier?
|
|
137
|
+
- **Learning:** What do I know now that I didn't at session start?
|
|
138
|
+
|
|
139
|
+
## Key Principles
|
|
140
|
+
|
|
141
|
+
- **Specific over general** — "No bulk AC add" not "CLI could be better"
|
|
142
|
+
- **Systemic over incidental** — Focus on repeatable friction
|
|
143
|
+
- **Ask don't assume** — User decides what's worth capturing (interactive mode)
|
|
144
|
+
- **Brief on successes** — Friction points are the primary value
|
|
145
|
+
- **Search before capture** — Never duplicate existing tracking
|
|
146
|
+
|
|
147
|
+
## Workflow Commands
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
kspec workflow show # Check current step
|
|
151
|
+
kspec workflow next --notes "..." # Advance with notes
|
|
152
|
+
kspec workflow next --skip --notes "reason" # Skip a step
|
|
153
|
+
kspec workflow pause # Pause for later
|
|
154
|
+
kspec workflow resume # Resume
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Integration
|
|
158
|
+
|
|
159
|
+
- Observations created during reflection feed into `/kspec:triage observations`
|
|
160
|
+
- Friction observations may be promoted to tasks via `kspec meta promote @ref`
|
|
161
|
+
- Success patterns may inform AGENTS.md or convention updates
|