@haposoft/cafekit 0.7.17 → 0.7.20
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/agents/spec-maker.md +9 -37
- package/src/claude/skills/specs/SKILL.md +50 -19
- 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 +1 -1
- 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.20",
|
|
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",
|
|
@@ -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
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: hapo:specs
|
|
3
3
|
description: "Structured specification workflow — from vague idea to actionable task list. Includes init, requirements, design, task breakdown, review, and archiving."
|
|
4
4
|
version: 2.0.0
|
|
5
|
-
argument-hint: "<feature-description> | status | resume |
|
|
5
|
+
argument-hint: "<feature-description> | status | resume | --validate | archive"
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Specs (SDD — Specification-Driven Development)
|
|
@@ -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:
|
|
@@ -67,7 +67,7 @@ Display selection menu via `AskUserQuestion`:
|
|
|
67
67
|
{ "label": "Create new spec", "description": "Initialize spec from a feature description" },
|
|
68
68
|
{ "label": "status", "description": "View status of all specs in specs/" },
|
|
69
69
|
{ "label": "resume", "description": "Continue an in-progress spec" },
|
|
70
|
-
{ "label": "
|
|
70
|
+
{ "label": "--validate", "description": "Review spec (auto-decides: red team or validation)" },
|
|
71
71
|
{ "label": "archive", "description": "Archive completed specs + write journal" }
|
|
72
72
|
],
|
|
73
73
|
"multiSelect": false
|
|
@@ -82,12 +82,17 @@ System auto-analyzes the description:
|
|
|
82
82
|
- If task is simple (small bugfix, config change) → suggest "A spec may not be needed for this. Continue anyway?"
|
|
83
83
|
- If task is complex (multi-module, security/migration related) → auto-activate deep research, ask user 3 scope questions
|
|
84
84
|
|
|
85
|
+
### When called WITH `--validate` argument
|
|
86
|
+
|
|
87
|
+
System IMMEDIATELY jumps to **Step 9: Validation Review**.
|
|
88
|
+
The system MUST NOT execute Steps 1-8. Instead, load `references/review.md`, adopt Red Team personas, and read the entire `specs/` directory to hunt for flaws before interviewing the user.
|
|
89
|
+
|
|
85
90
|
## Workflow Diagram
|
|
86
91
|
|
|
87
92
|
```mermaid
|
|
88
93
|
flowchart TD
|
|
89
94
|
A["Call /hapo:specs"] --> B{Has description?}
|
|
90
|
-
B -->|No| C["Menu: init / status / resume /
|
|
95
|
+
B -->|No| C["Menu: init / status / resume / --validate / archive"]
|
|
91
96
|
B -->|Yes| D["Step 1: Analyze description"]
|
|
92
97
|
D --> E{Clear enough?}
|
|
93
98
|
E -->|No| F["Ask user 1-2 clarifying questions"]
|
|
@@ -170,14 +175,17 @@ Load: `references/scope-inquiry.md`
|
|
|
170
175
|
- Analyze existing codebase if this is an enhancement (not greenfield)
|
|
171
176
|
- **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")`.
|
|
172
177
|
- Write requirements in **EARS** format (see `rules/ears-format.md`)
|
|
178
|
+
- **Feasibility Check:** Cross-check each requirement against known technical constraints from `research.md`.
|
|
173
179
|
- Each requirement gets a unique numeric ID
|
|
180
|
+
- **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).
|
|
174
181
|
- Record any findings in `research.md` from template `templates/research.md`
|
|
175
182
|
- Update `spec.json` phase + timestamps
|
|
176
183
|
|
|
177
184
|
### Step 6: Design
|
|
178
|
-
- Read `spec.json` — stop if requirements
|
|
179
|
-
-
|
|
180
|
-
-
|
|
185
|
+
- Read `spec.json` — stop if requirements haven't completed
|
|
186
|
+
- Pick discovery mode: `minimal` / `light` / `full` based on complexity. **Default: `light`** unless certain it is simple UI (minimal) or complex integration (full).
|
|
187
|
+
- Load `rules/design-principles.md`
|
|
188
|
+
- Load `rules/design-discovery-[mode].md`:
|
|
181
189
|
- **minimal**: UI-only or simple CRUD
|
|
182
190
|
- **light**: extending existing system
|
|
183
191
|
- **full**: integration, security, schema, or performance
|
|
@@ -254,8 +262,8 @@ Load: `references/task-hydration.md`
|
|
|
254
262
|
- If TaskCreate tool unavailable → fallback to `TodoWrite`
|
|
255
263
|
- Task files are the single source of truth — hydration is just a convenience
|
|
256
264
|
|
|
257
|
-
### Step 9: Review (Optional)
|
|
258
|
-
Load: `references/review.md`
|
|
265
|
+
### Step 9: Validation Review (Optional)
|
|
266
|
+
Load: `references/review.md` + `rules/design-review.md`
|
|
259
267
|
- System auto-evaluates spec complexity and decides review depth:
|
|
260
268
|
- **< 3 task files, no security concerns** → Validate only (lightweight interview)
|
|
261
269
|
- **>= 5 task files OR security/migration keywords** → Red Team first, then Validate
|
|
@@ -295,6 +303,22 @@ When user calls `hapo:specs`, system checks `specs/`:
|
|
|
295
303
|
|
|
296
304
|
**State persistence:** Update `spec.json` `phase` field on each transition. `spec.json` is the single source of truth.
|
|
297
305
|
|
|
306
|
+
### spec.json Update Rules (MANDATORY)
|
|
307
|
+
|
|
308
|
+
**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.
|
|
309
|
+
|
|
310
|
+
**Approvals (auto-approval behavior):**
|
|
311
|
+
- 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.
|
|
312
|
+
- When running a **single phase**: set `generated = true` but leave `approved = false` — user must explicitly approve before continuing.
|
|
313
|
+
|
|
314
|
+
**`ready_for_implementation`:** This field MUST only be set to `true` when ALL of the following conditions are met:
|
|
315
|
+
1. `approvals.requirements.approved = true`
|
|
316
|
+
2. `approvals.design.approved = true`
|
|
317
|
+
3. `approvals.tasks.approved = true`
|
|
318
|
+
4. `progress.tasks = "done"`
|
|
319
|
+
|
|
320
|
+
If any approval is `false`, `ready_for_implementation` MUST remain `false`.
|
|
321
|
+
|
|
298
322
|
## Output Structure
|
|
299
323
|
|
|
300
324
|
```
|
|
@@ -323,7 +347,7 @@ specs/
|
|
|
323
347
|
|---|---|---|
|
|
324
348
|
| `/hapo:specs status` | View status of all specs | — |
|
|
325
349
|
| `/hapo:specs resume <feature>` | Continue an in-progress spec | — |
|
|
326
|
-
| `/hapo:specs
|
|
350
|
+
| `/hapo:specs --validate <feature>` | Validate spec (auto: red team + validate based on complexity) | `references/review.md` |
|
|
327
351
|
| `/hapo:specs archive` | Archive completed specs + write journal | `references/archive-workflow.md` |
|
|
328
352
|
|
|
329
353
|
## Quality Standards
|
|
@@ -350,12 +374,18 @@ specs/
|
|
|
350
374
|
- No over-engineering: if a function suffices, don't create a class
|
|
351
375
|
|
|
352
376
|
### Pre-Finalization Checklist
|
|
353
|
-
|
|
354
|
-
- [ ]
|
|
355
|
-
- [ ]
|
|
356
|
-
- [ ]
|
|
357
|
-
- [ ]
|
|
358
|
-
- [ ]
|
|
377
|
+
Before finalizing any specification, assert all the following:
|
|
378
|
+
- [ ] **scope_lock** initialized and respected throughout all phases
|
|
379
|
+
- [ ] **EARS format** applied to all acceptance criteria in requirements.md
|
|
380
|
+
- [ ] **Numeric requirement IDs** assigned to every requirement
|
|
381
|
+
- [ ] **Discovery mode** selected and recorded in spec.json.design_context
|
|
382
|
+
- [ ] **Requirements traceability** matrix present in design.md
|
|
383
|
+
- [ ] **Every task file** maps to at least 1 valid in-scope requirement ID
|
|
384
|
+
- [ ] **State Machine Blueprint:** design.md contains Mermaid diagrams for non-trivial flows
|
|
385
|
+
- [ ] **Dependency graph complete**: no task can start before its blockers are listed
|
|
386
|
+
- [ ] **Risk matrix filled**: likelihood × impact, with mitigation for High items
|
|
387
|
+
- [ ] **Test strategy defined**: what gets unit tested, integration tested, e2e validated
|
|
388
|
+
- [ ] **spec.json fully updated**: phase, progress, timestamps, approvals, design_context
|
|
359
389
|
|
|
360
390
|
## When TO Use
|
|
361
391
|
|
|
@@ -385,12 +415,13 @@ specs/
|
|
|
385
415
|
- `design-principles.md` — Design principles
|
|
386
416
|
- `design-discovery-full.md` — Full research workflow
|
|
387
417
|
- `design-discovery-light.md` — Lightweight research workflow
|
|
388
|
-
- `
|
|
418
|
+
- `design-review.md` — Design review GO/NO-GO process
|
|
419
|
+
- `tasks-generation.md` — Task generation rules (includes spike task rules)
|
|
389
420
|
- `tasks-parallel-analysis.md` — Parallel task analysis
|
|
390
421
|
|
|
391
422
|
### References (`references/`)
|
|
392
423
|
- `cross-spec-dependency.md` — Cross-spec dependency detection
|
|
393
|
-
- `scope-inquiry.md` —
|
|
424
|
+
- `scope-inquiry.md` — 5-Dimension Complexity Assessment (Semantic, Hypothesis, Gap, Risk/Cynefin, Blast Radius)
|
|
394
425
|
- `research-strategy.md` — Research strategy (7 tools)
|
|
395
426
|
- `codebase-analysis.md` — Codebase analysis (4 mandatory files)
|
|
396
427
|
- `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?
|
|
@@ -50,7 +50,7 @@ Assess how many other parts of the system are affected if this change breaks or
|
|
|
50
50
|
|
|
51
51
|
## Level Selection
|
|
52
52
|
|
|
53
|
-
After
|
|
53
|
+
After completing the 5-Dimension Assessment, present via `AskUserQuestion`:
|
|
54
54
|
|
|
55
55
|
**Title:** "Scope Inquiry"
|
|
56
56
|
**Question:** "Based on analysis, what scope level do you want?"
|
|
@@ -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.)
|