@haposoft/cafekit 0.7.16 → 0.7.18
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/package.json +1 -1
- package/src/claude/CLAUDE.md +1 -1
- package/src/claude/agents/spec-maker.md +9 -37
- package/src/claude/skills/specs/SKILL.md +53 -21
- package/src/claude/skills/specs/references/research-strategy.md +2 -2
- package/src/claude/skills/specs/references/review.md +1 -1
- package/src/claude/skills/specs/references/scope-inquiry.md +40 -17
- package/src/claude/skills/specs/references/task-hydration.md +1 -1
- package/src/claude/skills/specs/rules/design-principles.md +2 -2
- package/src/claude/skills/specs/rules/ears-format.md +1 -0
- package/src/claude/skills/specs/rules/tasks-generation.md +27 -0
- package/src/claude/skills/specs/templates/design.md +2 -2
- package/src/claude/skills/specs/templates/requirements.md +12 -0
- package/src/claude/skills/specs/templates/research.md +2 -1
- package/src/claude/skills/specs/templates/task.md +6 -0
- package/src/claude/skills/specs/rules/gap-analysis.md +0 -144
- package/src/claude/skills/specs/rules/steering-principles.md +0 -90
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haposoft/cafekit",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.18",
|
|
4
4
|
"description": "Spec-Driven Development workflow for AI coding assistants. Supports Claude Code and Antigravity with spec-first workflows plus Claude Code hapo: skills.",
|
|
5
5
|
"author": "Haposoft <nghialt@haposoft.com>",
|
|
6
6
|
"license": "MIT",
|
package/src/claude/CLAUDE.md
CHANGED
|
@@ -39,30 +39,14 @@ Init → Requirements → Design → Tasks
|
|
|
39
39
|
4. **After each phase**: Update `spec.json` with correct `phase`, `progress`, `timestamps`, and approval fields
|
|
40
40
|
|
|
41
41
|
### Auto-Approval Behavior
|
|
42
|
-
- When running the full pipeline end-to-end, auto-
|
|
43
|
-
- When running a single phase, stop and report status after completion
|
|
42
|
+
- When running the full pipeline end-to-end, follow the auto-approval rules defined in `SKILL.md`.
|
|
43
|
+
- When running a single phase, stop and report status after completion.
|
|
44
44
|
|
|
45
45
|
## Scope Lock Protocol (MANDATORY)
|
|
46
46
|
|
|
47
|
-
Every specification MUST
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
{
|
|
51
|
-
"scope_lock": {
|
|
52
|
-
"source": "<original user description>",
|
|
53
|
-
"in_scope": ["<confirmed capability 1>", "<confirmed capability 2>"],
|
|
54
|
-
"out_of_scope": ["<excluded capability 1>", "<excluded capability 2>"],
|
|
55
|
-
"expansion_policy": "requires-user-approval"
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### Scope Lock Rules
|
|
61
|
-
- **Initialize** `scope_lock` during Init phase from user description + clarifying questions
|
|
62
|
-
- **Filter** all requirements against `scope_lock.in_scope` during Requirements phase
|
|
63
|
-
- **Reject** design elements that don't map to in-scope requirement IDs during Design phase
|
|
64
|
-
- **Defer** out-of-scope task candidates during Tasks phase
|
|
65
|
-
- **NEVER** expand scope without explicit user approval
|
|
47
|
+
Every specification MUST govern its scope through the `scope_lock` object in `spec.json`.
|
|
48
|
+
- **NEVER** expand scope without explicit user approval.
|
|
49
|
+
- Follow the rules defined in `SKILL.md` precisely.
|
|
66
50
|
|
|
67
51
|
## Requirements Protocol
|
|
68
52
|
|
|
@@ -108,7 +92,7 @@ Before writing `design.md`, select a discovery mode and record the reason:
|
|
|
108
92
|
## Task Generation Protocol
|
|
109
93
|
|
|
110
94
|
### Task File Structure
|
|
111
|
-
- Create **individual task files**: `tasks/task-
|
|
95
|
+
- Create **individual task files**: `tasks/task-R{N}-{SEQ}-<slug>.md`
|
|
112
96
|
- Each file follows `{{SKILLS_DIR}}/specs/templates/task.md`
|
|
113
97
|
- Load `{{SKILLS_DIR}}/specs/rules/tasks-generation.md`
|
|
114
98
|
|
|
@@ -149,19 +133,7 @@ Task(subagent_type="researcher", prompt="Research [feature topic]")
|
|
|
149
133
|
|
|
150
134
|
## Pre-Completion Checklist
|
|
151
135
|
|
|
152
|
-
Before finalizing any specification, assert
|
|
153
|
-
|
|
154
|
-
- [ ] **scope_lock** initialized and respected throughout all phases
|
|
155
|
-
- [ ] **EARS format** applied to all acceptance criteria in requirements.md
|
|
156
|
-
- [ ] **Numeric requirement IDs** assigned to every requirement
|
|
157
|
-
- [ ] **Discovery mode** selected and recorded in spec.json.design_context
|
|
158
|
-
- [ ] **Requirements traceability** matrix present in design.md
|
|
159
|
-
- [ ] **Every task file** maps to at least 1 valid in-scope requirement ID
|
|
160
|
-
- [ ] **State Machine Blueprint:** design.md contains Mermaid diagrams for non-trivial flows
|
|
161
|
-
- [ ] **Dependency graph complete**: no task can start before its blockers are listed
|
|
162
|
-
- [ ] **Risk matrix filled**: likelihood × impact, with mitigation for High items
|
|
163
|
-
- [ ] **Test strategy defined**: what gets unit tested, integration tested, e2e validated
|
|
164
|
-
- [ ] **spec.json fully updated**: phase, progress, timestamps, approvals, design_context
|
|
136
|
+
Before finalizing any specification, assert all 11 points in the `Pre-Finalization Checklist` defined in `SKILL.md`. Do not exit or declare completion until verifiable.
|
|
165
137
|
|
|
166
138
|
## Execution Workflow Summary
|
|
167
139
|
|
|
@@ -182,8 +154,8 @@ specs/<feature>/
|
|
|
182
154
|
├── design.md # Architecture with traceability matrix and diagrams
|
|
183
155
|
├── research.md # Research findings
|
|
184
156
|
└── tasks/
|
|
185
|
-
├── task-01-<
|
|
186
|
-
├── task-
|
|
157
|
+
├── task-R0-01-<slug>.md # Individual task files with requirement mapping
|
|
158
|
+
├── task-R1-01-<slug>.md
|
|
187
159
|
└── ...
|
|
188
160
|
```
|
|
189
161
|
|
|
@@ -11,10 +11,10 @@ argument-hint: "<feature-description> | status | resume | review | archive"
|
|
|
11
11
|
|
|
12
12
|
## Overview
|
|
13
13
|
|
|
14
|
-
This skill provides a
|
|
14
|
+
This skill provides a 10-step workflow to transform ideas into specs:
|
|
15
15
|
|
|
16
16
|
```
|
|
17
|
-
Init → Requirements → Design → Tasks →
|
|
17
|
+
Analyze → Dependency Scan → Complexity Assessment → Init → Requirements → Design → Tasks → Hydration → Review → Completion
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
**CRITICAL:** Before starting, the system MUST:
|
|
@@ -93,10 +93,14 @@ flowchart TD
|
|
|
93
93
|
E -->|No| F["Ask user 1-2 clarifying questions"]
|
|
94
94
|
F --> D
|
|
95
95
|
E -->|Yes| G["Step 2: Scan specs/ for related specs"]
|
|
96
|
-
G --> H["Step 3:
|
|
97
|
-
H -->
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
G --> H["Step 3: 5-Dimension Assessment"]
|
|
97
|
+
H --> H1{Risk level?}
|
|
98
|
+
H1 -->|Chaotic| HX["Exit → redirect to hapo:hotfix"]
|
|
99
|
+
H1 -->|Complex| H2["Include spike/prototype tasks"]
|
|
100
|
+
H1 -->|Clear/Complicated| H3{Need scope inquiry?}
|
|
101
|
+
H2 --> H3
|
|
102
|
+
H3 -->|Yes| J["Present 5D summary → user picks Expand/Hold/Reduce"]
|
|
103
|
+
H3 -->|No| K["Keep default scope"]
|
|
100
104
|
J --> L["Step 4: Init — create specs/<feature>/"]
|
|
101
105
|
K --> L
|
|
102
106
|
L --> M["Step 5: Requirements — write EARS"]
|
|
@@ -140,9 +144,11 @@ Load: `references/cross-spec-dependency.md`
|
|
|
140
144
|
|
|
141
145
|
### Step 3: Complexity Assessment & Scope Inquiry
|
|
142
146
|
Load: `references/scope-inquiry.md`
|
|
143
|
-
-
|
|
144
|
-
-
|
|
145
|
-
-
|
|
147
|
+
- Evaluate the request across **5 dimensions**: Semantic Intent, Implementation Hypothesis, Gap Sizing, Risk/Uncertainty (Cynefin), and Blast Radius
|
|
148
|
+
- If Risk = **Chaotic** → exit spec workflow, redirect to `hapo:hotfix`
|
|
149
|
+
- If Risk = **Complex** → include spike/prototype tasks in the spec
|
|
150
|
+
- If Blast Radius = **Critical Path** → spec MUST include rollback strategy and test coverage requirements
|
|
151
|
+
- User picks scope level: Expand / Hold / Reduce
|
|
146
152
|
- **Skip if:** trivial task (< 20 words, 1 file, user says "just do it")
|
|
147
153
|
|
|
148
154
|
### Step 4: Init
|
|
@@ -164,14 +170,17 @@ Load: `references/scope-inquiry.md`
|
|
|
164
170
|
- Analyze existing codebase if this is an enhancement (not greenfield)
|
|
165
171
|
- **MANDATORY Research:** Spawn `researcher` subagent to gather best practices, documentation, and technical foundation before detailing requirements. Use `Task(subagent_type="researcher", prompt="Research [feature]", description="Research")`.
|
|
166
172
|
- Write requirements in **EARS** format (see `rules/ears-format.md`)
|
|
173
|
+
- **Feasibility Check:** Cross-check each requirement against known technical constraints from `research.md`.
|
|
167
174
|
- Each requirement gets a unique numeric ID
|
|
175
|
+
- **Verify Quality:** Before proceeding, assert each requirement is: *Singular, Unambiguous, Testable, and has a numeric ID*. Include Non-Functional Requirements (Performance, Security, Scalability, Reliability, Accessibility).
|
|
168
176
|
- Record any findings in `research.md` from template `templates/research.md`
|
|
169
177
|
- Update `spec.json` phase + timestamps
|
|
170
178
|
|
|
171
179
|
### Step 6: Design
|
|
172
|
-
- Read `spec.json` — stop if requirements
|
|
173
|
-
-
|
|
174
|
-
-
|
|
180
|
+
- Read `spec.json` — stop if requirements haven't completed
|
|
181
|
+
- Pick discovery mode: `minimal` / `light` / `full` based on complexity. **Default: `light`** unless certain it is simple UI (minimal) or complex integration (full).
|
|
182
|
+
- Load `rules/design-principles.md`
|
|
183
|
+
- Load `rules/design-discovery-[mode].md`:
|
|
175
184
|
- **minimal**: UI-only or simple CRUD
|
|
176
185
|
- **light**: extending existing system
|
|
177
186
|
- **full**: integration, security, schema, or performance
|
|
@@ -249,7 +258,7 @@ Load: `references/task-hydration.md`
|
|
|
249
258
|
- Task files are the single source of truth — hydration is just a convenience
|
|
250
259
|
|
|
251
260
|
### Step 9: Review (Optional)
|
|
252
|
-
Load: `references/review.md`
|
|
261
|
+
Load: `references/review.md` + `rules/design-review.md`
|
|
253
262
|
- System auto-evaluates spec complexity and decides review depth:
|
|
254
263
|
- **< 3 task files, no security concerns** → Validate only (lightweight interview)
|
|
255
264
|
- **>= 5 task files OR security/migration keywords** → Red Team first, then Validate
|
|
@@ -289,6 +298,22 @@ When user calls `hapo:specs`, system checks `specs/`:
|
|
|
289
298
|
|
|
290
299
|
**State persistence:** Update `spec.json` `phase` field on each transition. `spec.json` is the single source of truth.
|
|
291
300
|
|
|
301
|
+
### spec.json Update Rules (MANDATORY)
|
|
302
|
+
|
|
303
|
+
**Timestamps:** Each `timestamps.*_done` field MUST use the **actual current time** (ISO 8601 with timezone) when that specific phase completes. Do NOT reuse the `init` timestamp for later phases. If running the full pipeline end-to-end, capture a fresh timestamp at each phase transition.
|
|
304
|
+
|
|
305
|
+
**Approvals (auto-approval behavior):**
|
|
306
|
+
- When running the **full pipeline end-to-end** (init → tasks in one session): set `approvals.{phase}.generated = true` AND `approvals.{phase}.approved = true` for each completed phase before proceeding to the next.
|
|
307
|
+
- When running a **single phase**: set `generated = true` but leave `approved = false` — user must explicitly approve before continuing.
|
|
308
|
+
|
|
309
|
+
**`ready_for_implementation`:** This field MUST only be set to `true` when ALL of the following conditions are met:
|
|
310
|
+
1. `approvals.requirements.approved = true`
|
|
311
|
+
2. `approvals.design.approved = true`
|
|
312
|
+
3. `approvals.tasks.approved = true`
|
|
313
|
+
4. `progress.tasks = "done"`
|
|
314
|
+
|
|
315
|
+
If any approval is `false`, `ready_for_implementation` MUST remain `false`.
|
|
316
|
+
|
|
292
317
|
## Output Structure
|
|
293
318
|
|
|
294
319
|
```
|
|
@@ -344,12 +369,18 @@ specs/
|
|
|
344
369
|
- No over-engineering: if a function suffices, don't create a class
|
|
345
370
|
|
|
346
371
|
### Pre-Finalization Checklist
|
|
347
|
-
|
|
348
|
-
- [ ]
|
|
349
|
-
- [ ]
|
|
350
|
-
- [ ]
|
|
351
|
-
- [ ]
|
|
352
|
-
- [ ]
|
|
372
|
+
Before finalizing any specification, assert all the following:
|
|
373
|
+
- [ ] **scope_lock** initialized and respected throughout all phases
|
|
374
|
+
- [ ] **EARS format** applied to all acceptance criteria in requirements.md
|
|
375
|
+
- [ ] **Numeric requirement IDs** assigned to every requirement
|
|
376
|
+
- [ ] **Discovery mode** selected and recorded in spec.json.design_context
|
|
377
|
+
- [ ] **Requirements traceability** matrix present in design.md
|
|
378
|
+
- [ ] **Every task file** maps to at least 1 valid in-scope requirement ID
|
|
379
|
+
- [ ] **State Machine Blueprint:** design.md contains Mermaid diagrams for non-trivial flows
|
|
380
|
+
- [ ] **Dependency graph complete**: no task can start before its blockers are listed
|
|
381
|
+
- [ ] **Risk matrix filled**: likelihood × impact, with mitigation for High items
|
|
382
|
+
- [ ] **Test strategy defined**: what gets unit tested, integration tested, e2e validated
|
|
383
|
+
- [ ] **spec.json fully updated**: phase, progress, timestamps, approvals, design_context
|
|
353
384
|
|
|
354
385
|
## When TO Use
|
|
355
386
|
|
|
@@ -379,12 +410,13 @@ specs/
|
|
|
379
410
|
- `design-principles.md` — Design principles
|
|
380
411
|
- `design-discovery-full.md` — Full research workflow
|
|
381
412
|
- `design-discovery-light.md` — Lightweight research workflow
|
|
382
|
-
- `
|
|
413
|
+
- `design-review.md` — Design review GO/NO-GO process
|
|
414
|
+
- `tasks-generation.md` — Task generation rules (includes spike task rules)
|
|
383
415
|
- `tasks-parallel-analysis.md` — Parallel task analysis
|
|
384
416
|
|
|
385
417
|
### References (`references/`)
|
|
386
418
|
- `cross-spec-dependency.md` — Cross-spec dependency detection
|
|
387
|
-
- `scope-inquiry.md` —
|
|
419
|
+
- `scope-inquiry.md` — 5-Dimension Complexity Assessment (Semantic, Hypothesis, Gap, Risk/Cynefin, Blast Radius)
|
|
388
420
|
- `research-strategy.md` — Research strategy (7 tools)
|
|
389
421
|
- `codebase-analysis.md` — Codebase analysis (4 mandatory files)
|
|
390
422
|
- `task-hydration.md` — Task files → Claude Tasks conversion
|
|
@@ -17,14 +17,14 @@ Provide tools and methods to gather necessary information before writing require
|
|
|
17
17
|
| 2 | **Sequential thinking** | Step-by-step reasoning, avoids context overload | Multi-step logic analysis, tangled problems |
|
|
18
18
|
| 3 | **Docs seeker** | Look up framework/package docs from official sources | Need to understand external APIs/libraries, find best practices |
|
|
19
19
|
| 4 | **GitHub analysis** (`gh`) | Read action logs, PRs, issues, discussions | Need context from project history, understand past decisions |
|
|
20
|
-
| 5 | **Repomix remote** (`repomix --remote <url>`) | Generate codebase summary from remote repo | Reference how other repos solve similar problems |
|
|
20
|
+
| 5 | **Repomix remote** (`repomix --remote <url>`) | Generate codebase summary from remote repo | Reference how other repos solve similar problems. *(If not installed, use WebFetch as fallback)* |
|
|
21
21
|
| 6 | **Scout agents** | Search for files across large codebases | Find relevant files faster than grep in large projects |
|
|
22
22
|
| 7 | **Debugger delegation** | Hand off to debugger agent for analysis | Investigate root cause of bugs |
|
|
23
23
|
|
|
24
24
|
## Workflow
|
|
25
25
|
|
|
26
26
|
### 1. Identify What Needs Research
|
|
27
|
-
|
|
27
|
+
Before detailing requirements, list unanswered questions:
|
|
28
28
|
- Which technology is most suitable?
|
|
29
29
|
- Is there an existing pattern/library that solves this?
|
|
30
30
|
- How does the current codebase handle similar functionality?
|
|
@@ -11,26 +11,46 @@ Skip Scope Inquiry when:
|
|
|
11
11
|
- Description is under 20 words and unambiguous
|
|
12
12
|
- User signals urgency ("just do it", "quick", etc.)
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## 5-Dimension Complexity Assessment
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
- Scan codebase for reusable code/patterns
|
|
18
|
-
- Check existing utilities, services, patterns
|
|
19
|
-
- Warn if spec would rebuild something that already exists
|
|
16
|
+
Evaluate complexity across **5 dimensions** to avoid blind spots. A task may be architecturally small but extremely risky, or seemingly simple but with a huge blast radius.
|
|
20
17
|
|
|
21
|
-
###
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
18
|
+
### Dimension 1: Semantic Intent & Current State
|
|
19
|
+
- What is the core business or technical meaning of the request?
|
|
20
|
+
- How does the system currently behave in this area? What existing patterns, services, or infrastructure can be leveraged?
|
|
21
|
+
- Would this spec rebuild something that already exists? If yes, warn before proceeding.
|
|
25
22
|
|
|
26
|
-
###
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
|
|
23
|
+
### Dimension 2: High-Level Implementation Hypothesis
|
|
24
|
+
- Conceptually, how must the architecture adapt to fulfill the semantic intent?
|
|
25
|
+
- Hypothesize the structural impact: Does this require new database models, API contracts, third-party integrations, or is it strictly localized logic/UI changes?
|
|
26
|
+
|
|
27
|
+
### Dimension 3: Gap Analysis & Sizing
|
|
28
|
+
Evaluate the gap between Current State and Hypothesis:
|
|
29
|
+
- **Small**: No architectural changes. Extending existing patterns, adding UI components, or patching localized logic.
|
|
30
|
+
- **Medium**: Modifying data flows, adding new API endpoints, or bridging two previously unconnected modules.
|
|
31
|
+
- **Large**: New persistence models, security/auth changes, cross-system migrations, or touching core system foundations.
|
|
32
|
+
- **Scope check**: Separate aspirational goals (nice-to-haves) from what is strictly necessary to bridge the core gap.
|
|
33
|
+
|
|
34
|
+
### Dimension 4: Risk & Uncertainty (Cynefin-inspired)
|
|
35
|
+
Classify the *knowability* of the solution path:
|
|
36
|
+
- **Clear**: Well-understood problem with established patterns and documentation (e.g., CRUD endpoints, standard auth flows). Proceed with confidence.
|
|
37
|
+
- **Complicated**: Solution exists but requires expert analysis or research (e.g., payment gateway integration, complex query optimization). Plan carefully, may need `researcher` subagent.
|
|
38
|
+
- **Complex**: Outcome is uncertain; solution emerges through experimentation (e.g., AI/ML tuning, novel UX interactions, performance bottleneck with unknown root cause). Requires prototyping or spike tasks before committing to a full spec.
|
|
39
|
+
- **Chaotic**: No clear path; urgent stabilization needed first (e.g., production outage, data corruption). Skip spec workflow entirely — use `hapo:hotfix` instead.
|
|
40
|
+
|
|
41
|
+
> **Rule**: If Dimension 4 = Complex or Chaotic, flag this to the user immediately. Complex tasks should include explicit spike/prototype tasks in the spec. Chaotic tasks should exit the spec workflow.
|
|
42
|
+
|
|
43
|
+
### Dimension 5: Dependency & Blast Radius
|
|
44
|
+
Assess how many other parts of the system are affected if this change breaks or behaves unexpectedly:
|
|
45
|
+
- **Isolated**: Change is self-contained within a single module or feature. No shared interfaces touched.
|
|
46
|
+
- **Moderate**: Change touches shared utilities, common components, or API contracts consumed by 2-3 other modules.
|
|
47
|
+
- **Critical Path**: Change affects core infrastructure (auth, data layer, routing, state management) or shared libraries used system-wide. A bug here cascades everywhere.
|
|
48
|
+
|
|
49
|
+
> **Rule**: If Blast Radius = Critical Path, the spec MUST include rollback strategy and explicit test coverage requirements in the task files.
|
|
30
50
|
|
|
31
51
|
## Level Selection
|
|
32
52
|
|
|
33
|
-
After
|
|
53
|
+
After completing the 5-Dimension Assessment, present via `AskUserQuestion`:
|
|
34
54
|
|
|
35
55
|
**Title:** "Scope Inquiry"
|
|
36
56
|
**Question:** "Based on analysis, what scope level do you want?"
|
|
@@ -52,8 +72,11 @@ After answering the 3 questions, present via `AskUserQuestion`:
|
|
|
52
72
|
|
|
53
73
|
```
|
|
54
74
|
Scope Inquiry:
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
75
|
+
- Semantic Intent: [Core meaning of request]
|
|
76
|
+
- Hypothesis: [High-level architectural adaptation needed]
|
|
77
|
+
- Gap Size: [Small/Medium/Large] — [reason]
|
|
78
|
+
- Risk Level: [Clear/Complicated/Complex/Chaotic] — [reason]
|
|
79
|
+
- Blast Radius: [Isolated/Moderate/Critical Path] — [affected modules]
|
|
80
|
+
- Minimum Change: [Essential gap vs Niceties]
|
|
58
81
|
- User chose: [Expand / Hold / Reduce]
|
|
59
82
|
```
|
|
@@ -70,7 +70,7 @@ Convert task files (persistent storage) into Claude Tasks (session-scoped only),
|
|
|
70
70
|
3. Skips re-creation, begins implementing directly
|
|
71
71
|
|
|
72
72
|
### New session (resume)
|
|
73
|
-
1. User runs `/
|
|
73
|
+
1. User runs `/hapo:develop <feature>` in a new session
|
|
74
74
|
2. Code reads `TaskList` → empty (tasks died with old session)
|
|
75
75
|
3. Code reads task files → re-hydrates from `[ ]` items
|
|
76
76
|
4. `[x]` items = done, skip those
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
## Core Design Principles
|
|
4
4
|
|
|
5
5
|
### 1. Type Safety is Mandatory
|
|
6
|
-
- **NEVER** use `any`
|
|
6
|
+
- **NEVER** use generic/loosely-typed patterns (e.g., `any` in TypeScript, `object` in Python, `interface{}` in Go unless strictly necessary)
|
|
7
7
|
- Define explicit types for all parameters and returns
|
|
8
|
-
- Use discriminated unions for error handling
|
|
8
|
+
- Use discriminated unions for error handling where supported
|
|
9
9
|
- Specify generic constraints clearly
|
|
10
10
|
|
|
11
11
|
### 2. Design vs Implementation
|
|
@@ -45,5 +45,6 @@ Keep EARS trigger keywords and fixed phrases in English (`When`, `If`, `While`,
|
|
|
45
45
|
|
|
46
46
|
## Quality Criteria
|
|
47
47
|
- Requirements must be testable, verifiable, and describe a single behavior.
|
|
48
|
+
- **Measurability:** Avoid qualitative terms (e.g. "safe state", "fast", "some coverage"). Replace with measurable thresholds (e.g., "HTTP 400 error", "< 500ms response", ">= 80% coverage").
|
|
48
49
|
- Use objective language: "shall" for mandatory behavior, "should" for recommendations; avoid ambiguous terms.
|
|
49
50
|
- Follow EARS syntax: [condition], the [system] shall [response/action].
|
|
@@ -79,6 +79,33 @@ Grouping tasks vertically by requirement carries the risk of "siloed" or fragmen
|
|
|
79
79
|
2. **Shared Interfaces (Horizontal Contracts)**: Sub-tasks that touch shared cross-requirement architecture (like registering a new page in a global `router.ts` or adding a column to a shared table) MUST explicitly reference the shared contract defined in `design.md`.
|
|
80
80
|
3. **Integration Enforcers**: If R1 and R2 interact (e.g., R2 UI displays data fetched by R1 backend), the later task MUST have a sub-task explicitly dedicated to "Wiring/Integrating with [Previous Feature] output".
|
|
81
81
|
|
|
82
|
+
### 3d. Spike Tasks for Complex/Uncertain Areas (MANDATORY)
|
|
83
|
+
|
|
84
|
+
When the 5-Dimension Complexity Assessment (Step 3) flags a component or requirement as **Risk = Complex** (Cynefin), the task breakdown MUST include a dedicated **spike/prototype task** before the main implementation task for that area.
|
|
85
|
+
|
|
86
|
+
**Purpose**: Validate assumptions and reduce uncertainty before committing to full implementation.
|
|
87
|
+
|
|
88
|
+
**Naming convention:** `tasks/task-R{N}-00-spike-<slug>.md`
|
|
89
|
+
- Use `00` as the sequence number to ensure it runs FIRST within its requirement group.
|
|
90
|
+
|
|
91
|
+
**Spike task structure:**
|
|
92
|
+
1. **Objective**: State the specific uncertainty to resolve (e.g., "Validate that Google Meet captions DOM can be reliably scraped across account types")
|
|
93
|
+
2. **Success Criteria**: Define what a successful spike looks like (e.g., "Demonstrate caption text extraction from 3 different Meet account types")
|
|
94
|
+
3. **Time-box**: Maximum 4 hours. If spike exceeds time-box, escalate to user.
|
|
95
|
+
4. **Output**: A brief findings report (can be inline in the task file) and a go/no-go recommendation.
|
|
96
|
+
5. **Dependencies**: The main implementation task for this area MUST depend on the spike task.
|
|
97
|
+
|
|
98
|
+
**When NOT to create spike tasks:**
|
|
99
|
+
- Risk = Clear or Complicated → skip spike, proceed directly.
|
|
100
|
+
- The uncertain area is already covered by research.md with concrete evidence (real API tests, not just documentation links).
|
|
101
|
+
|
|
102
|
+
### 6. Risk Assessment Table (MANDATORY)
|
|
103
|
+
|
|
104
|
+
Every task file MUST contain the Risk Assessment table, even if no risks are identified.
|
|
105
|
+
- **Rule**: If there are risks, list them with Severity and Mitigation.
|
|
106
|
+
- **Rule**: If no risks are found, you MUST still include the table and write `| None identified | — | — |`.
|
|
107
|
+
- Never skip the `## Risk Assessment` section.
|
|
108
|
+
|
|
82
109
|
### 4. Requirements Mapping
|
|
83
110
|
|
|
84
111
|
**End each task detail section with**:
|
|
@@ -252,10 +252,10 @@ Error tracking, logging, and health monitoring implementation.
|
|
|
252
252
|
- E2E/UI Tests (if applicable): 3–5 critical user paths (e.g., forms, dashboards)
|
|
253
253
|
- Performance/Load (if applicable): 3–4 items (e.g., concurrency, high-volume ops)
|
|
254
254
|
|
|
255
|
-
##
|
|
255
|
+
## Conditional Sections (Include when relevant)
|
|
256
256
|
|
|
257
257
|
### Security Considerations
|
|
258
|
-
|
|
258
|
+
_**REQUIRED** when features handle user data, authentication, PII, external integrations, or permissions. Omit only for purely internal UI changes._
|
|
259
259
|
- Threat modeling, security controls, compliance requirements
|
|
260
260
|
- Authentication and authorization patterns
|
|
261
261
|
- Data protection and privacy considerations
|
|
@@ -24,3 +24,15 @@
|
|
|
24
24
|
2. When [event] and [condition], the [system] shall [response/action]
|
|
25
25
|
|
|
26
26
|
<!-- Additional requirements follow the same pattern -->
|
|
27
|
+
|
|
28
|
+
## Non-Functional Requirements (NFRs)
|
|
29
|
+
|
|
30
|
+
### Performance & Scalability
|
|
31
|
+
- The [system] shall [measurable performance metric, e.g. "respond within 500ms"]
|
|
32
|
+
- The [system] shall [measurable scale metric, e.g. "support 100 concurrent users"]
|
|
33
|
+
|
|
34
|
+
### Security & Privacy
|
|
35
|
+
- The [system] shall [measurable security behavior, e.g. "encrypt data at rest using AES-256"]
|
|
36
|
+
|
|
37
|
+
### Reliability & Availability
|
|
38
|
+
- If [failure condition], the [system] shall [recovery behavior]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Research & Design Decisions
|
|
1
|
+
# Research & Design Decisions
|
|
2
2
|
|
|
3
3
|
---
|
|
4
4
|
**Purpose**: Capture discovery findings, architectural investigations, and rationale that inform the technical design.
|
|
@@ -45,6 +45,7 @@ Record major decisions that influence `design.md`. Focus on choices with signifi
|
|
|
45
45
|
2. Option B — short description
|
|
46
46
|
- **Selected Approach**: What was chosen and how it works
|
|
47
47
|
- **Rationale**: Why this approach fits the current project context
|
|
48
|
+
- **Status**: [Proposed / Accepted / Superseded]
|
|
48
49
|
- **Trade-offs**: Benefits vs. compromises
|
|
49
50
|
- **Follow-up**: Items to verify during implementation or testing
|
|
50
51
|
|
|
@@ -11,6 +11,12 @@
|
|
|
11
11
|
|
|
12
12
|
{{Brief 1-2 sentence objective detailing WHAT to accomplish, not HOW. Must relate directly to requirement R{{REQ_NUMBER}}.}}
|
|
13
13
|
|
|
14
|
+
## Constraints
|
|
15
|
+
|
|
16
|
+
- **MUST**: {{Non-negotiable requirement or technical constraint}}
|
|
17
|
+
- **SHOULD**: {{Recommended approach or optimization}}
|
|
18
|
+
- **MUST NOT**: {{Explicitly forbidden action or approach}}
|
|
19
|
+
|
|
14
20
|
## Implementation Steps
|
|
15
21
|
|
|
16
22
|
- [ ] 1. {{MAJOR_STEP_1}}
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
# Gap Analysis Process
|
|
2
|
-
|
|
3
|
-
## Objective
|
|
4
|
-
Analyze the gap between requirements and existing codebase to inform implementation strategy decisions.
|
|
5
|
-
|
|
6
|
-
## Analysis Framework
|
|
7
|
-
|
|
8
|
-
### 1. Current State Investigation
|
|
9
|
-
|
|
10
|
-
- Scan for domain-related assets:
|
|
11
|
-
- Key files/modules and directory layout
|
|
12
|
-
- Reusable components/services/utilities
|
|
13
|
-
- Dominant architecture patterns and constraints
|
|
14
|
-
|
|
15
|
-
- Extract conventions:
|
|
16
|
-
- Naming, layering, dependency direction
|
|
17
|
-
- Import/export patterns and dependency hotspots
|
|
18
|
-
- Testing placement and approach
|
|
19
|
-
|
|
20
|
-
- Note integration surfaces:
|
|
21
|
-
- Data models/schemas, API clients, auth mechanisms
|
|
22
|
-
|
|
23
|
-
### 2. Requirements Feasibility Analysis
|
|
24
|
-
|
|
25
|
-
- From EARS requirements, list technical needs:
|
|
26
|
-
- Data models, APIs/services, UI/components
|
|
27
|
-
- Business rules/validation
|
|
28
|
-
- Non-functionals: security, performance, scalability, reliability
|
|
29
|
-
|
|
30
|
-
- Identify gaps and constraints:
|
|
31
|
-
- Missing capabilities in current codebase
|
|
32
|
-
- Unknowns to be researched later (mark as "Research Needed")
|
|
33
|
-
- Constraints from existing architecture and patterns
|
|
34
|
-
|
|
35
|
-
- Note complexity signals:
|
|
36
|
-
- Simple CRUD / algorithmic logic / workflows / external integrations
|
|
37
|
-
|
|
38
|
-
### 3. Implementation Approach Options
|
|
39
|
-
|
|
40
|
-
#### Option A: Extend Existing Components
|
|
41
|
-
**When to consider**: Feature fits naturally into existing structure
|
|
42
|
-
|
|
43
|
-
- **Which files/modules to extend**:
|
|
44
|
-
- Identify specific files requiring changes
|
|
45
|
-
- Assess impact on existing functionality
|
|
46
|
-
- Evaluate backward compatibility concerns
|
|
47
|
-
|
|
48
|
-
- **Compatibility assessment**:
|
|
49
|
-
- Check if extension respects existing interfaces
|
|
50
|
-
- Verify no breaking changes to consumers
|
|
51
|
-
- Assess test coverage impact
|
|
52
|
-
|
|
53
|
-
- **Complexity and maintainability**:
|
|
54
|
-
- Evaluate cognitive load of additional functionality
|
|
55
|
-
- Check if single responsibility principle is maintained
|
|
56
|
-
- Assess if file size remains manageable
|
|
57
|
-
|
|
58
|
-
**Trade-offs**:
|
|
59
|
-
- ✅ Minimal new files, faster initial development
|
|
60
|
-
- ✅ Leverages existing patterns and infrastructure
|
|
61
|
-
- ❌ Risk of bloating existing components
|
|
62
|
-
- ❌ May complicate existing logic
|
|
63
|
-
|
|
64
|
-
#### Option B: Create New Components
|
|
65
|
-
**When to consider**: Feature has distinct responsibility or existing components are already complex
|
|
66
|
-
|
|
67
|
-
- **Rationale for new creation**:
|
|
68
|
-
- Clear separation of concerns justifies new file
|
|
69
|
-
- Existing components are already complex
|
|
70
|
-
- Feature has distinct lifecycle or dependencies
|
|
71
|
-
|
|
72
|
-
- **Integration points**:
|
|
73
|
-
- How new components connect to existing system
|
|
74
|
-
- APIs or interfaces exposed
|
|
75
|
-
- Dependencies on existing components
|
|
76
|
-
|
|
77
|
-
- **Responsibility boundaries**:
|
|
78
|
-
- Clear definition of what new component owns
|
|
79
|
-
- Interfaces with existing components
|
|
80
|
-
- Data flow and control flow
|
|
81
|
-
|
|
82
|
-
**Trade-offs**:
|
|
83
|
-
- ✅ Clean separation of concerns
|
|
84
|
-
- ✅ Easier to test in isolation
|
|
85
|
-
- ✅ Reduces complexity in existing components
|
|
86
|
-
- ❌ More files to navigate
|
|
87
|
-
- ❌ Requires careful interface design
|
|
88
|
-
|
|
89
|
-
#### Option C: Hybrid Approach
|
|
90
|
-
**When to consider**: Complex features requiring both extension and new creation
|
|
91
|
-
|
|
92
|
-
- **Combination strategy**:
|
|
93
|
-
- Which parts extend existing components
|
|
94
|
-
- Which parts warrant new components
|
|
95
|
-
- How they interact
|
|
96
|
-
|
|
97
|
-
- **Phased implementation**:
|
|
98
|
-
- Initial phase: minimal viable changes
|
|
99
|
-
- Subsequent phases: refactoring or new components
|
|
100
|
-
- Migration strategy if needed
|
|
101
|
-
|
|
102
|
-
- **Risk mitigation**:
|
|
103
|
-
- Incremental rollout approach
|
|
104
|
-
- Feature flags or configuration
|
|
105
|
-
- Rollback strategy
|
|
106
|
-
|
|
107
|
-
**Trade-offs**:
|
|
108
|
-
- ✅ Balanced approach for complex features
|
|
109
|
-
- ✅ Allows iterative refinement
|
|
110
|
-
- ❌ More complex planning required
|
|
111
|
-
- ❌ Potential for inconsistency if not well-coordinated
|
|
112
|
-
### 4. Out-of-Scope for Gap Analysis
|
|
113
|
-
|
|
114
|
-
- Defer deep research activities to the design phase.
|
|
115
|
-
- Record unknowns as concise "Research Needed" items only.
|
|
116
|
-
|
|
117
|
-
### 5. Implementation Complexity & Risk
|
|
118
|
-
|
|
119
|
-
- Effort:
|
|
120
|
-
- S (1–3 days): existing patterns, minimal deps, straightforward integration
|
|
121
|
-
- M (3–7 days): some new patterns/integrations, moderate complexity
|
|
122
|
-
- L (1–2 weeks): significant functionality, multiple integrations or workflows
|
|
123
|
-
- XL (2+ weeks): architectural changes, unfamiliar tech, broad impact
|
|
124
|
-
- Risk:
|
|
125
|
-
- High: unknown tech, complex integrations, architectural shifts, unclear perf/security path
|
|
126
|
-
- Medium: new patterns with guidance, manageable integrations, known perf solutions
|
|
127
|
-
- Low: extend established patterns, familiar tech, clear scope, minimal integration
|
|
128
|
-
|
|
129
|
-
### Output Checklist
|
|
130
|
-
|
|
131
|
-
- Requirement-to-Asset Map with gaps tagged (Missing / Unknown / Constraint)
|
|
132
|
-
- Options A/B/C with short rationale and trade-offs
|
|
133
|
-
- Effort (S/M/L/XL) and Risk (High/Medium/Low) with one-line justification each
|
|
134
|
-
- Recommendations for design phase:
|
|
135
|
-
- Preferred approach and key decisions
|
|
136
|
-
- Research items to carry forward
|
|
137
|
-
|
|
138
|
-
## Principles
|
|
139
|
-
|
|
140
|
-
- **Information over decisions**: Provide analysis and options, not final choices
|
|
141
|
-
- **Multiple viable options**: Offer credible alternatives when applicable
|
|
142
|
-
- **Explicit gaps and assumptions**: Flag unknowns and constraints clearly
|
|
143
|
-
- **Context-aware**: Align with existing patterns and architecture limits
|
|
144
|
-
- **Transparent effort and risk**: Justify labels succinctly
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
# Steering Principles
|
|
2
|
-
|
|
3
|
-
Steering files are **project memory**, not exhaustive specifications.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Content Granularity
|
|
8
|
-
|
|
9
|
-
### Golden Rule
|
|
10
|
-
> "If new code follows existing patterns, steering shouldn't need updating."
|
|
11
|
-
|
|
12
|
-
### ✅ Document
|
|
13
|
-
- Organizational patterns (feature-first, layered)
|
|
14
|
-
- Naming conventions (PascalCase rules)
|
|
15
|
-
- Import strategies (absolute vs relative)
|
|
16
|
-
- Architectural decisions (state management)
|
|
17
|
-
- Technology standards (key frameworks)
|
|
18
|
-
|
|
19
|
-
### ❌ Avoid
|
|
20
|
-
- Complete file listings
|
|
21
|
-
- Every component description
|
|
22
|
-
- All dependencies
|
|
23
|
-
- Implementation details
|
|
24
|
-
- Agent-specific tooling directories (e.g. `.cursor/`, `.gemini/`, `.claude/`)
|
|
25
|
-
- Detailed documentation of `.sdd/` metadata directories (settings, automation)
|
|
26
|
-
|
|
27
|
-
### Example Comparison
|
|
28
|
-
|
|
29
|
-
**Bad** (Specification-like):
|
|
30
|
-
```markdown
|
|
31
|
-
- /components/Button.tsx - Primary button with variants
|
|
32
|
-
- /components/Input.tsx - Text input with validation
|
|
33
|
-
- /components/Modal.tsx - Modal dialog
|
|
34
|
-
... (50+ files)
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
**Good** (Project Memory):
|
|
38
|
-
```markdown
|
|
39
|
-
## UI Components (`/components/ui/`)
|
|
40
|
-
Reusable, design-system aligned primitives
|
|
41
|
-
- Named by function (Button, Input, Modal)
|
|
42
|
-
- Export component + TypeScript interface
|
|
43
|
-
- No business logic
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## Security
|
|
49
|
-
|
|
50
|
-
Never include:
|
|
51
|
-
- API keys, passwords, credentials
|
|
52
|
-
- Database URLs, internal IPs
|
|
53
|
-
- Secrets or sensitive data
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
## Quality Standards
|
|
58
|
-
|
|
59
|
-
- **Single domain**: One topic per file
|
|
60
|
-
- **Concrete examples**: Show patterns with code
|
|
61
|
-
- **Explain rationale**: Why decisions were made
|
|
62
|
-
- **Maintainable size**: 100-200 lines typical
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## Preservation (when updating)
|
|
67
|
-
|
|
68
|
-
- Preserve user sections and custom examples
|
|
69
|
-
- Additive by default (add, don't replace)
|
|
70
|
-
- Add `updated_at` timestamp
|
|
71
|
-
- Note why changes were made
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
## Notes
|
|
76
|
-
|
|
77
|
-
- Templates are starting points, customize as needed
|
|
78
|
-
- Follow same granularity principles as core steering
|
|
79
|
-
- All steering files loaded as project memory
|
|
80
|
-
- Light references to `.sdd/specs/` and `.sdd/steering/` are acceptable; avoid other `.sdd/` directories
|
|
81
|
-
- Custom files equally important as core files
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
## File-Specific Focus
|
|
86
|
-
|
|
87
|
-
- **product.md**: Purpose, value, business context (not exhaustive features)
|
|
88
|
-
- **tech.md**: Key frameworks, standards, conventions (not all dependencies)
|
|
89
|
-
- **structure.md**: Organization patterns, naming rules (not directory trees)
|
|
90
|
-
- **Custom files**: Specialized patterns (API, testing, security, etc.)
|