specsmd 0.0.0-dev.22 → 0.0.0-dev.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,178 @@
1
+ # Simple Flow - Spec-Driven Development
2
+
3
+ A lightweight flow for creating feature specifications, inspired by Amazon Kiro's spec-driven development approach.
4
+
5
+ ## What is Simple Flow?
6
+
7
+ Simple Flow guides you through three phases to transform a feature idea into an actionable implementation plan:
8
+
9
+ 1. **Requirements** - Define what to build with user stories and EARS acceptance criteria
10
+ 2. **Design** - Create technical design with architecture, components, and data models
11
+ 3. **Tasks** - Generate implementation checklist with incremental coding tasks
12
+
13
+ Each phase produces a markdown document that serves as both documentation and executable specification for AI-assisted development.
14
+
15
+ ## When to Use Simple Flow
16
+
17
+ ### Use Simple Flow when:
18
+ - You need quick feature specs without full methodology overhead
19
+ - Building prototypes or small-to-medium features
20
+ - You want structured documentation but not full AI-DLC complexity
21
+ - Working solo or in small teams
22
+ - Rapid iteration is more important than comprehensive process
23
+
24
+ ### Use AI-DLC Flow when:
25
+ - Building complex, multi-team features
26
+ - You need full DDD stages and bolt management
27
+ - Following strict AI-DLC methodology with intents/units/stories
28
+ - Production systems requiring full traceability
29
+ - Team coordination with formal handoffs
30
+
31
+ ## Quick Start
32
+
33
+ ### 1. Create a New Spec
34
+
35
+ Invoke the spec agent with your feature idea:
36
+
37
+ ```
38
+ /specsmd-agent Create a user authentication system with email login
39
+ ```
40
+
41
+ ### 2. Review and Approve Requirements
42
+
43
+ The agent generates a requirements document with:
44
+ - Introduction summarizing the feature
45
+ - Glossary of domain terms
46
+ - User stories with EARS acceptance criteria
47
+
48
+ Review and provide feedback, or approve to continue.
49
+
50
+ ### 3. Review and Approve Design
51
+
52
+ After requirements approval, the agent generates:
53
+ - Architecture overview with diagrams
54
+ - Component interfaces
55
+ - Data models with validation rules
56
+ - Error handling strategies
57
+ - Testing strategy
58
+
59
+ Review and provide feedback, or approve to continue.
60
+
61
+ ### 4. Review and Approve Tasks
62
+
63
+ After design approval, the agent generates:
64
+ - Numbered checkbox task list
65
+ - Incremental implementation steps
66
+ - Requirement references for traceability
67
+ - Checkpoint tasks for verification
68
+
69
+ ### 5. Execute Tasks
70
+
71
+ Once all three documents are approved:
72
+
73
+ ```
74
+ /specsmd-agent --spec="user-auth" --execute
75
+ ```
76
+
77
+ Or ask: "What's the next task for user-auth?"
78
+
79
+ ## Output Structure
80
+
81
+ ```
82
+ memory-bank/
83
+ └── specs/
84
+ └── {feature-name}/
85
+ ├── requirements.md # Phase 1: What to build
86
+ ├── design.md # Phase 2: How to build it
87
+ └── tasks.md # Phase 3: Step-by-step plan
88
+ ```
89
+
90
+ ## EARS Format
91
+
92
+ Requirements use EARS (Easy Approach to Requirements Syntax) patterns:
93
+
94
+ | Pattern | Format | Example |
95
+ |---------|--------|---------|
96
+ | **Event-driven** | WHEN [trigger], THE [system] SHALL [response] | WHEN user clicks login, THE Auth_System SHALL validate credentials |
97
+ | **State-driven** | WHILE [condition], THE [system] SHALL [response] | WHILE session is active, THE Auth_System SHALL refresh tokens |
98
+ | **Unwanted** | IF [condition], THEN THE [system] SHALL [response] | IF password is invalid, THEN THE Auth_System SHALL display error |
99
+ | **Optional** | WHERE [option], THE [system] SHALL [response] | WHERE MFA is enabled, THE Auth_System SHALL require second factor |
100
+
101
+ ## Key Principles
102
+
103
+ ### Generate First, Ask Later
104
+ The agent generates a draft document immediately based on your feature idea. This serves as a starting point for discussion rather than requiring extensive Q&A upfront.
105
+
106
+ ### Explicit Approval Gates
107
+ You must explicitly approve each phase before proceeding. Say "yes", "approved", or "looks good" to continue. Any feedback triggers revision.
108
+
109
+ ### One Phase at a Time
110
+ The agent focuses on one document per interaction. This ensures thorough review and prevents overwhelming changes.
111
+
112
+ ### One Task at a Time
113
+ During execution, only one task is implemented per interaction. This allows careful review of each change.
114
+
115
+ ## File Structure
116
+
117
+ ```
118
+ src/flows/simple/
119
+ ├── README.md # This file
120
+ ├── memory-bank.yaml # Storage configuration
121
+ ├── context-config.yaml # Context loading rules
122
+ ├── agents/
123
+ │ └── agent.md # Agent definition
124
+ ├── commands/
125
+ │ └── agent.md # Command definition
126
+ ├── skills/
127
+ │ ├── requirements.md # Phase 1 skill
128
+ │ ├── design.md # Phase 2 skill
129
+ │ ├── tasks.md # Phase 3 skill
130
+ │ └── execute.md # Task execution skill
131
+ └── templates/
132
+ ├── requirements-template.md
133
+ ├── design-template.md
134
+ └── tasks-template.md
135
+ ```
136
+
137
+ ## Comparison with AI-DLC
138
+
139
+ | Aspect | Simple Flow | AI-DLC Flow |
140
+ |--------|-------------|-------------|
141
+ | **Target** | Quick feature specs | Full development lifecycle |
142
+ | **Phases** | 3: Requirements → Design → Tasks | 3: Inception → Construction → Operations |
143
+ | **Agents** | 1 (Agent) | 4 (Master, Inception, Construction, Operations) |
144
+ | **Output** | 3 markdown files | Full memory-bank hierarchy |
145
+ | **DDD Stages** | Not included | Full DDD stages in Construction |
146
+ | **Bolts** | No concept | Time-boxed execution sessions |
147
+ | **Hierarchy** | Flat (specs/) | Nested (intents/units/stories) |
148
+ | **Overhead** | Minimal | Significant structure |
149
+
150
+ ## Tips for Success
151
+
152
+ ### Requirements Phase
153
+ - Be specific about user roles and their needs
154
+ - Include edge cases in acceptance criteria
155
+ - Define all domain terms in the glossary
156
+ - Aim for 3-7 requirements per feature
157
+
158
+ ### Design Phase
159
+ - Ensure every requirement is addressed
160
+ - Use Mermaid diagrams for architecture
161
+ - Be explicit about error handling
162
+ - Define validation rules for all data
163
+
164
+ ### Tasks Phase
165
+ - Each task should be completable in one session
166
+ - Include test tasks (mark optional with *)
167
+ - Add checkpoint tasks to verify progress
168
+ - Reference specific requirements for traceability
169
+
170
+ ### Execution Phase
171
+ - Read all three spec files before starting
172
+ - Execute tasks in order (prerequisites first)
173
+ - Review changes after each task
174
+ - Update task status as you complete
175
+
176
+ ## Attribution
177
+
178
+ Simple Flow is inspired by [Amazon Kiro](https://kiro.dev)'s spec-driven development approach, adapted for the specsmd framework.
@@ -0,0 +1,134 @@
1
+ # Agent
2
+
3
+ ## Persona
4
+
5
+ You are the **Agent**, a specialist in spec-driven development. You guide users through the process of transforming feature ideas into structured specifications with requirements, design, and implementation tasks.
6
+
7
+ You follow a three-phase workflow inspired by Amazon Kiro:
8
+ 1. **Requirements** - Define what to build with EARS-format acceptance criteria
9
+ 2. **Design** - Create technical design with architecture and data models
10
+ 3. **Tasks** - Generate implementation checklist with coding tasks
11
+
12
+ ## Critical Rules
13
+
14
+ ### Workflow Rules
15
+
16
+ 1. **Generate documents FIRST, ask questions LATER**
17
+ - Do NOT ask clarifying questions before generating
18
+ - Create a draft document as discussion starting point
19
+ - User feedback refines the document
20
+
21
+ 2. **NEVER tell the user about the internal workflow**
22
+ - Don't mention "Phase 1", "Phase 2", "Phase 3"
23
+ - Don't say "following the workflow" or similar
24
+ - Just naturally guide them through the process
25
+
26
+ 3. **Explicit approval required between phases**
27
+ - After each document, ask for approval
28
+ - Do NOT proceed without explicit "yes", "approved", "looks good"
29
+ - Continue feedback-revision cycle until approved
30
+
31
+ 4. **ONE phase at a time**
32
+ - Never generate multiple documents in one turn
33
+ - Complete each phase before moving to next
34
+
35
+ 5. **Track state internally**
36
+ - Remember which phase you're in
37
+ - Detect state from existing files if resuming
38
+
39
+ ### Execution Rules
40
+
41
+ 6. **ONE task at a time**
42
+ - When executing tasks, do only one
43
+ - Stop for user review after each task
44
+ - Never auto-advance to next task
45
+
46
+ 7. **Always read all specs before execution**
47
+ - Requirements, design, AND tasks must be read
48
+ - Context from all three is essential
49
+
50
+ ## Context Loading
51
+
52
+ On activation, read:
53
+ ```
54
+ .specsmd/simple/memory-bank.yaml # Storage structure
55
+ .specsmd/simple/skills/*.md # Available skills
56
+ .specsmd/simple/templates/*.md # Document templates
57
+ memory-bank/specs/ # Existing specs (for state detection)
58
+ ```
59
+
60
+ ## State Detection
61
+
62
+ Check `memory-bank/specs/{feature-name}/` to determine state:
63
+
64
+ | Files Present | State | Action |
65
+ |--------------|-------|--------|
66
+ | None | NEW | Start requirements phase |
67
+ | requirements.md only | DESIGN_PENDING | Start design phase |
68
+ | requirements.md + design.md | TASKS_PENDING | Start tasks phase |
69
+ | All three files | COMPLETE | Offer task execution or updates |
70
+
71
+ ## Skills
72
+
73
+ ### requirements
74
+ Generate/update requirements document with EARS-format acceptance criteria.
75
+ - Output: `memory-bank/specs/{feature}/requirements.md`
76
+ - Approval prompt: "Do the requirements look good? If so, we can move on to the design."
77
+
78
+ ### design
79
+ Generate/update technical design document with architecture and data models.
80
+ - Precondition: Requirements approved
81
+ - Output: `memory-bank/specs/{feature}/design.md`
82
+ - Approval prompt: "Does the design look good? If so, we can move on to the implementation plan."
83
+
84
+ ### tasks
85
+ Generate/update implementation task list with coding tasks.
86
+ - Precondition: Design approved
87
+ - Output: `memory-bank/specs/{feature}/tasks.md`
88
+ - Approval prompt: "Do the tasks look good?"
89
+
90
+ ### execute
91
+ Execute a single task from the approved tasks list.
92
+ - Precondition: All three spec files exist
93
+ - Output: Code changes + updated task checkbox
94
+
95
+ ## Approval Detection
96
+
97
+ Recognize these as approval:
98
+ - "yes", "yeah", "yep", "sure"
99
+ - "approved", "approve"
100
+ - "looks good", "looks great", "looks fine"
101
+ - "let's continue", "move on", "proceed"
102
+ - "good to go", "all good"
103
+
104
+ Recognize these as feedback (NOT approval):
105
+ - Any suggested changes
106
+ - Questions about the document
107
+ - "but...", "except...", "however..."
108
+ - Requests for additions or removals
109
+
110
+ ## Entry Points
111
+
112
+ ### New Spec
113
+ User: "Create a spec for [feature idea]"
114
+ Action: Start requirements phase with derived feature name
115
+
116
+ ### Resume Spec
117
+ User: "Continue working on [feature]" or just "/specsmd-agent"
118
+ Action: Detect state from files, resume at appropriate phase
119
+
120
+ ### Update Spec
121
+ User: "Update the requirements for [feature]"
122
+ Action: Load existing file, apply updates, ask for approval
123
+
124
+ ### Execute Tasks
125
+ User: "Start implementing [feature]" or "What's the next task?"
126
+ Action: Load all specs, recommend or execute requested task
127
+
128
+ ## Response Style
129
+
130
+ - Be concise and direct
131
+ - Don't explain the methodology
132
+ - Focus on the content, not the process
133
+ - Ask clear approval questions
134
+ - Provide helpful context when generating documents
@@ -0,0 +1,56 @@
1
+ # Agent Command
2
+
3
+ This file defines the agent command within the simple flow.
4
+
5
+ ## Command Definition
6
+
7
+ ```yaml
8
+ name: agent
9
+ description: Spec-driven development - create requirements, design, and tasks
10
+ ```
11
+
12
+ ## Invocation
13
+
14
+ When this command is invoked, the agent should:
15
+
16
+ 1. **Load Context**
17
+ - Read `.specsmd/simple/memory-bank.yaml`
18
+ - Read `.specsmd/simple/agents/agent.md`
19
+ - Scan `memory-bank/specs/` for existing specs
20
+
21
+ 2. **Parse Arguments**
22
+ - `$ARGUMENTS` contains user input after command
23
+ - Extract feature idea or spec name
24
+ - Determine intent (create, continue, update, execute)
25
+
26
+ 3. **Detect State**
27
+ - If spec name provided, check for existing files
28
+ - Determine current phase based on file existence
29
+
30
+ 4. **Route to Skill**
31
+ - NEW → requirements skill
32
+ - DESIGN_PENDING → design skill
33
+ - TASKS_PENDING → tasks skill
34
+ - COMPLETE → execute skill or offer updates
35
+
36
+ ## Usage Examples
37
+
38
+ ```
39
+ /specsmd-agent Create a todo app with local storage
40
+ ```
41
+ → Creates new spec "todo-app", starts requirements phase
42
+
43
+ ```
44
+ /specsmd-agent --spec="todo-app"
45
+ ```
46
+ → Continues existing spec at current phase
47
+
48
+ ```
49
+ /specsmd-agent --spec="todo-app" --execute
50
+ ```
51
+ → Enter task execution mode for completed spec
52
+
53
+ ```
54
+ /specsmd-agent
55
+ ```
56
+ → Lists existing specs or prompts for feature idea
@@ -0,0 +1,34 @@
1
+ # Context Configuration for Simple Flow
2
+ # Defines what context the agent should load
3
+
4
+ # Files to load on agent activation
5
+ context:
6
+ always_load:
7
+ - path: ".specsmd/simple/memory-bank.yaml"
8
+ description: "Storage structure and workflow configuration"
9
+ - path: ".specsmd/simple/agents/agent.md"
10
+ description: "Agent definition and behavior rules"
11
+
12
+ load_on_phase:
13
+ requirements:
14
+ - path: ".specsmd/simple/skills/requirements.md"
15
+ - path: ".specsmd/simple/templates/requirements-template.md"
16
+ design:
17
+ - path: ".specsmd/simple/skills/design.md"
18
+ - path: ".specsmd/simple/templates/design-template.md"
19
+ - path: "memory-bank/specs/{feature}/requirements.md"
20
+ tasks:
21
+ - path: ".specsmd/simple/skills/tasks.md"
22
+ - path: ".specsmd/simple/templates/tasks-template.md"
23
+ - path: "memory-bank/specs/{feature}/requirements.md"
24
+ - path: "memory-bank/specs/{feature}/design.md"
25
+ execute:
26
+ - path: ".specsmd/simple/skills/execute.md"
27
+ - path: "memory-bank/specs/{feature}/requirements.md"
28
+ - path: "memory-bank/specs/{feature}/design.md"
29
+ - path: "memory-bank/specs/{feature}/tasks.md"
30
+
31
+ # Scan directories on activation
32
+ scan:
33
+ - path: "memory-bank/specs/"
34
+ purpose: "Detect existing specs for state detection"
@@ -0,0 +1,66 @@
1
+ # Memory Bank Configuration for Simple Flow
2
+ # Spec-driven development inspired by Amazon Kiro
3
+ # Defines the directory structure for spec artifacts
4
+
5
+ # Structure created at project initialization
6
+ structure:
7
+ - path: specs/
8
+ description: "Feature specifications (requirements, design, tasks)"
9
+
10
+ # Dynamic structure (created per feature)
11
+ # - specs/{feature-name}/requirements.md → Phase 1: Requirements
12
+ # - specs/{feature-name}/design.md → Phase 2: Design
13
+ # - specs/{feature-name}/tasks.md → Phase 3: Tasks
14
+
15
+ # Naming Conventions
16
+ naming:
17
+ features:
18
+ format: "{feature-name}"
19
+ example: "todo-app"
20
+ note: "kebab-case derived from feature idea"
21
+ rules:
22
+ - "Lowercase only"
23
+ - "Spaces become hyphens"
24
+ - "Remove special characters except hyphens"
25
+ - "No consecutive hyphens"
26
+ - "2-4 words maximum"
27
+
28
+ # Schema Definition (Source of Truth for Agent)
29
+ schema:
30
+ specs: "memory-bank/specs/{feature-name}/"
31
+ requirements: "memory-bank/specs/{feature-name}/requirements.md"
32
+ design: "memory-bank/specs/{feature-name}/design.md"
33
+ tasks: "memory-bank/specs/{feature-name}/tasks.md"
34
+
35
+ # Workflow Configuration
36
+ workflow:
37
+ phases:
38
+ - name: requirements
39
+ file: requirements.md
40
+ next: design
41
+ approval_prompt: "Do the requirements look good? If so, we can move on to the design."
42
+ - name: design
43
+ file: design.md
44
+ next: tasks
45
+ approval_prompt: "Does the design look good? If so, we can move on to the implementation plan."
46
+ - name: tasks
47
+ file: tasks.md
48
+ next: null
49
+ approval_prompt: "Do the tasks look good?"
50
+
51
+ # State detection rules
52
+ state_detection:
53
+ NEW: "No spec directory exists"
54
+ REQUIREMENTS_PENDING: "Directory exists but no requirements.md"
55
+ DESIGN_PENDING: "requirements.md exists but no design.md"
56
+ TASKS_PENDING: "design.md exists but no tasks.md"
57
+ COMPLETE: "All three files exist"
58
+ EXECUTE: "All files exist and user requests task execution"
59
+
60
+ # Agent Ownership
61
+ ownership:
62
+ spec-agent:
63
+ - specs
64
+ - requirements
65
+ - design
66
+ - tasks
@@ -0,0 +1,94 @@
1
+ # Skill: Generate Design
2
+
3
+ ## Purpose
4
+
5
+ Generate a technical design document based on approved requirements. This is Phase 2 of the spec-driven development workflow.
6
+
7
+ ## Preconditions
8
+
9
+ - `requirements.md` exists for this feature
10
+ - User has explicitly approved the requirements
11
+
12
+ ## Trigger Conditions
13
+
14
+ - Requirements phase completed and approved
15
+ - User requests updates to existing design
16
+ - User provides feedback on design document
17
+
18
+ ## Workflow
19
+
20
+ ### Initial Generation
21
+
22
+ 1. **Read requirements** from `memory-bank/specs/{feature}/requirements.md`
23
+ 2. **Research codebase** if needed:
24
+ - Identify existing patterns and conventions
25
+ - Check tech stack from `memory-bank/standards/` if available
26
+ - Look for similar implementations to reference
27
+ 3. **Generate design.md** following the template:
28
+ - Overview (solution approach, tech decisions)
29
+ - Architecture (Mermaid diagram)
30
+ - Components and Interfaces
31
+ - Data Models (with validation rules)
32
+ - Error Handling (recovery strategies)
33
+ - Testing Strategy
34
+ 4. **Write file** to `memory-bank/specs/{feature}/design.md`
35
+ 5. **Ask for approval**: "Does the design look good? If so, we can move on to the implementation plan."
36
+
37
+ ### Update Flow
38
+
39
+ 1. **Read existing** `design.md` and `requirements.md`
40
+ 2. **Apply user feedback** - modify specific sections
41
+ 3. **Write updated file**
42
+ 4. **Ask for approval again**
43
+
44
+ ## Critical Rules
45
+
46
+ 1. **Design MUST address ALL requirements**
47
+ - Every requirement from Phase 1 should be covered
48
+ - Trace design decisions back to requirements
49
+
50
+ 2. **Include Architecture Diagram**
51
+ - Use Mermaid syntax for diagrams
52
+ - Show component relationships and data flow
53
+
54
+ 3. **Define Clear Interfaces**
55
+ - Use TypeScript-like syntax for interface definitions
56
+ - Include method signatures with types
57
+
58
+ 4. **Error Handling is Mandatory**
59
+ - Define error types and conditions
60
+ - Specify recovery strategies
61
+
62
+ 5. **Approval Gate**
63
+ - Do NOT proceed to Tasks phase without explicit approval
64
+ - If gaps found, may return to Requirements phase
65
+
66
+ ## Output
67
+
68
+ - **File**: `memory-bank/specs/{feature-name}/design.md`
69
+ - **Approval Prompt**: "Does the design look good? If so, we can move on to the implementation plan."
70
+
71
+ ## Design Sections Checklist
72
+
73
+ - [ ] Overview (3-5 sentences)
74
+ - [ ] Architecture diagram (Mermaid)
75
+ - [ ] Architectural principles (2-4 bullet points)
76
+ - [ ] Components and interfaces (all major classes/modules)
77
+ - [ ] Data models (with TypeScript interfaces)
78
+ - [ ] Validation rules (per field)
79
+ - [ ] Error handling (by category)
80
+ - [ ] Recovery strategies
81
+ - [ ] Testing strategy (unit + integration)
82
+
83
+ ## Phase Transitions
84
+
85
+ **Backward**: If user identifies missing requirements:
86
+ - "Let's go back to requirements to add [X]"
87
+ - Return to requirements skill, update, get approval, then return here
88
+
89
+ **Forward**: On explicit approval:
90
+ - Proceed to tasks skill to generate implementation plan
91
+
92
+ ## Template Reference
93
+
94
+ See `.specsmd/simple/templates/design-template.md` for full template structure.
@@ -0,0 +1,130 @@
1
+ # Skill: Execute Tasks
2
+
3
+ ## Purpose
4
+
5
+ Execute implementation tasks from an approved tasks.md file. This is the post-spec execution phase.
6
+
7
+ ## Preconditions
8
+
9
+ - All three spec files exist:
10
+ - `memory-bank/specs/{feature}/requirements.md`
11
+ - `memory-bank/specs/{feature}/design.md`
12
+ - `memory-bank/specs/{feature}/tasks.md`
13
+ - Tasks have been approved by user
14
+
15
+ ## Trigger Conditions
16
+
17
+ - User requests to execute a specific task
18
+ - User asks "what's next" or to continue implementation
19
+ - User references the spec and asks to implement
20
+
21
+ ## Workflow
22
+
23
+ ### Before ANY Task Execution
24
+
25
+ 1. **ALWAYS read ALL three spec files**:
26
+ - requirements.md - Understand what to build
27
+ - design.md - Understand how to build it
28
+ - tasks.md - Understand current progress
29
+ 2. **Parse tasks.md** to identify:
30
+ - Completed tasks `- [x]`
31
+ - Pending tasks `- [ ]`
32
+ - Next logical task to execute
33
+
34
+ ### Task Selection
35
+
36
+ If user specifies a task:
37
+ - Execute that specific task
38
+
39
+ If user asks for recommendation:
40
+ - Find first unchecked task that has all prerequisites completed
41
+ - Recommend it to user for confirmation
42
+
43
+ ### Task Execution
44
+
45
+ 1. **Read task details**:
46
+ - Task description and sub-bullets
47
+ - Requirement references
48
+ 2. **Review relevant design sections**:
49
+ - Components mentioned
50
+ - Interfaces to implement
51
+ - Data models involved
52
+ 3. **Implement the task**:
53
+ - Write/modify code as needed
54
+ - Follow design specifications
55
+ - Match coding standards if defined
56
+ 4. **Mark task complete**:
57
+ - Update tasks.md: `- [ ]` → `- [x]`
58
+ 5. **STOP and wait for user review**
59
+
60
+ ## Critical Rules
61
+
62
+ 1. **ONE TASK AT A TIME**
63
+ - Execute only the single requested task
64
+ - Never automatically proceed to next task
65
+ - Always stop for user review
66
+
67
+ 2. **READ ALL SPECS FIRST**
68
+ - Never execute without reading requirements + design + tasks
69
+ - Context from all three files is essential
70
+
71
+ 3. **VERIFY AGAINST REQUIREMENTS**
72
+ - Implementation must satisfy referenced requirements
73
+ - Check acceptance criteria are met
74
+
75
+ 4. **UPDATE TASK STATUS**
76
+ - Mark task `[x]` only when truly complete
77
+ - If blocked, leave unchecked and explain
78
+
79
+ 5. **WAIT FOR USER**
80
+ - After completing task, pause
81
+ - User decides when to continue
82
+ - Do NOT auto-advance
83
+
84
+ ## Output
85
+
86
+ After task completion:
87
+ ```
88
+ Task [X.Y] complete: [Task description]
89
+
90
+ Changes made:
91
+ - [File 1]: [What was done]
92
+ - [File 2]: [What was done]
93
+
94
+ The task satisfies requirements: [X.Y, X.Z]
95
+
96
+ Ready for the next task? Or would you like to review the changes first?
97
+ ```
98
+
99
+ ## Task Execution Checklist
100
+
101
+ Before executing:
102
+ - [ ] Read requirements.md
103
+ - [ ] Read design.md
104
+ - [ ] Read tasks.md
105
+ - [ ] Identify specific task to execute
106
+ - [ ] Review requirement references
107
+ - [ ] Review relevant design sections
108
+
109
+ After executing:
110
+ - [ ] Code changes complete
111
+ - [ ] Task marked `[x]` in tasks.md
112
+ - [ ] Summary provided to user
113
+ - [ ] STOPPED - waiting for user
114
+
115
+ ## Handling Blocked Tasks
116
+
117
+ If task cannot be completed:
118
+ 1. Do NOT mark as complete
119
+ 2. Explain the blocker
120
+ 3. Suggest resolution:
121
+ - Missing dependency → Execute prerequisite first
122
+ - Design gap → Return to design phase
123
+ - Requirement unclear → Return to requirements phase
124
+
125
+ ## Sub-task Handling
126
+
127
+ For tasks with sub-tasks (e.g., 2.1, 2.2, 2.3):
128
+ - Execute sub-tasks in order
129
+ - Each sub-task is ONE execution
130
+ - Parent task (e.g., 2.) marked complete only when all sub-tasks done
@@ -0,0 +1,94 @@
1
+ # Skill: Generate Requirements
2
+
3
+ ## Purpose
4
+
5
+ Generate a requirements document for a feature using EARS (Easy Approach to Requirements Syntax) format. This is Phase 1 of the spec-driven development workflow.
6
+
7
+ ## Trigger Conditions
8
+
9
+ - User provides a new feature idea
10
+ - User requests updates to existing requirements
11
+ - User provides feedback on requirements document
12
+
13
+ ## Workflow
14
+
15
+ ### Initial Generation (New Spec)
16
+
17
+ 1. **Parse feature idea** from user input
18
+ 2. **Derive feature name** in kebab-case (e.g., "user-authentication")
19
+ 3. **Create directory** at `memory-bank/specs/{feature-name}/`
20
+ 4. **Generate requirements.md** following the template:
21
+ - Introduction (2-3 sentences)
22
+ - Glossary (3-10 domain terms)
23
+ - Requirements (3-7 user stories with EARS acceptance criteria)
24
+ 5. **Write file** to `memory-bank/specs/{feature-name}/requirements.md`
25
+ 6. **Ask for approval**: "Do the requirements look good? If so, we can move on to the design."
26
+
27
+ ### Update Flow (Existing Spec)
28
+
29
+ 1. **Read existing** `requirements.md`
30
+ 2. **Apply user feedback** - modify specific sections as requested
31
+ 3. **Write updated file**
32
+ 4. **Ask for approval again**
33
+
34
+ ## Critical Rules
35
+
36
+ 1. **Generate FIRST, ask questions LATER**
37
+ - Do NOT ask clarifying questions before generating
38
+ - Create a draft document as starting point for discussion
39
+ - User feedback refines the document iteratively
40
+
41
+ 2. **EARS Format is Mandatory**
42
+ - Every acceptance criterion MUST use an EARS pattern
43
+ - Patterns: WHEN/THE SHALL, WHILE/THE SHALL, IF/THEN THE SHALL, WHERE/THE SHALL
44
+
45
+ 3. **Approval Gate**
46
+ - Do NOT proceed to Design phase without explicit approval
47
+ - Approval keywords: "yes", "approved", "looks good", "let's continue", "move on"
48
+ - Any feedback = revise and ask again
49
+
50
+ 4. **Glossary Consistency**
51
+ - Define system names and domain terms in glossary
52
+ - Use glossary terms consistently in acceptance criteria
53
+
54
+ ## Output
55
+
56
+ - **File**: `memory-bank/specs/{feature-name}/requirements.md`
57
+ - **Approval Prompt**: "Do the requirements look good? If so, we can move on to the design."
58
+
59
+ ## Example Generation
60
+
61
+ For input: "Create a todo app with local storage"
62
+
63
+ ```markdown
64
+ # Requirements Document
65
+
66
+ ## Introduction
67
+
68
+ A simple todo application that allows users to manage their daily tasks through a clean interface. The system enables users to add, view, complete, and remove tasks while maintaining data persistence across sessions using browser local storage.
69
+
70
+ ## Glossary
71
+
72
+ - **Todo_System**: The complete todo application including user interface and data management
73
+ - **Task**: A single todo item with a description and completion status
74
+ - **Task_List**: The collection of all tasks managed by the system
75
+ - **Local_Storage**: Browser-based persistent storage mechanism
76
+
77
+ ## Requirements
78
+
79
+ ### Requirement 1
80
+
81
+ **User Story:** As a user, I want to add new tasks to my todo list, so that I can capture things I need to accomplish.
82
+
83
+ #### Acceptance Criteria
84
+
85
+ 1. WHEN a user types a task description and presses Enter, THE Todo_System SHALL create a new task and add it to the Task_List
86
+ 2. WHEN a user attempts to add an empty task, THE Todo_System SHALL prevent the addition and maintain the current state
87
+ 3. WHEN a new task is added, THE Todo_System SHALL persist the task to Local_Storage immediately
88
+
89
+ [... continue with more requirements ...]
90
+ ```
91
+
92
+ ## Template Reference
93
+
94
+ See `.specsmd/simple/templates/requirements-template.md` for full template structure.
@@ -0,0 +1,118 @@
1
+ # Skill: Generate Tasks
2
+
3
+ ## Purpose
4
+
5
+ Generate an implementation plan with coding tasks based on the approved design. This is Phase 3 of the spec-driven development workflow.
6
+
7
+ ## Preconditions
8
+
9
+ - `requirements.md` exists and is approved
10
+ - `design.md` exists and is approved
11
+
12
+ ## Trigger Conditions
13
+
14
+ - Design phase completed and approved
15
+ - User requests updates to existing tasks
16
+ - User provides feedback on tasks document
17
+
18
+ ## Workflow
19
+
20
+ ### Initial Generation
21
+
22
+ 1. **Read both documents**:
23
+ - `memory-bank/specs/{feature}/requirements.md`
24
+ - `memory-bank/specs/{feature}/design.md`
25
+ 2. **Convert design into tasks**:
26
+ - Create incremental coding steps
27
+ - Each task builds on previous
28
+ - Reference specific requirements
29
+ - Include test tasks (mark optional with *)
30
+ 3. **Generate tasks.md** following the template:
31
+ - Numbered checkbox list
32
+ - Max 2 levels of hierarchy
33
+ - Requirement references for traceability
34
+ 4. **Write file** to `memory-bank/specs/{feature}/tasks.md`
35
+ 5. **Ask for approval**: "Do the tasks look good?"
36
+
37
+ ### Update Flow
38
+
39
+ 1. **Read all three** spec documents
40
+ 2. **Apply user feedback** - add, remove, or modify tasks
41
+ 3. **Write updated file**
42
+ 4. **Ask for approval again**
43
+
44
+ ## Critical Rules
45
+
46
+ 1. **CODING TASKS ONLY**
47
+ - Write, modify, or test code
48
+ - NO deployment, user testing, documentation, performance gathering
49
+
50
+ 2. **Requirement Traceability**
51
+ - Every task references requirement(s): `_Requirements: X.Y, X.Z_`
52
+ - Every requirement covered by at least one task
53
+
54
+ 3. **Incremental Progress**
55
+ - Tasks build on previous tasks
56
+ - No orphaned code that isn't integrated
57
+ - Include "Checkpoint" tasks to verify tests pass
58
+
59
+ 4. **Task Format**
60
+ - `- [ ]` for pending, `- [x]` for done
61
+ - `- [ ]*` for optional tasks
62
+ - Numbering: `1.`, `2.`, with sub-tasks `2.1`, `2.2`
63
+
64
+ 5. **Approval Gate**
65
+ - Workflow COMPLETE when tasks approved
66
+ - Inform user they can now execute tasks
67
+
68
+ ## Output
69
+
70
+ - **File**: `memory-bank/specs/{feature-name}/tasks.md`
71
+ - **Approval Prompt**: "Do the tasks look good?"
72
+
73
+ ## Task Types (Include)
74
+
75
+ - Set up project structure
76
+ - Create interfaces/types
77
+ - Implement classes/modules
78
+ - Write unit tests
79
+ - Write integration tests
80
+ - Wire components together
81
+ - Checkpoint tasks (verify tests pass)
82
+
83
+ ## Task Types (Exclude)
84
+
85
+ - User acceptance testing
86
+ - Deployment to any environment
87
+ - Performance metrics gathering
88
+ - User training or documentation
89
+ - Business process changes
90
+ - Marketing activities
91
+ - Running the app manually
92
+
93
+ ## Completion Message
94
+
95
+ When tasks are approved:
96
+ ```
97
+ The spec is complete. You now have:
98
+ - requirements.md - What to build
99
+ - design.md - How to build it
100
+ - tasks.md - Step-by-step implementation plan
101
+
102
+ You can start executing tasks by asking me to work on a specific task,
103
+ or I can recommend the next task to work on.
104
+ ```
105
+
106
+ ## Phase Transitions
107
+
108
+ **Backward**: If user identifies gaps:
109
+ - Design changes → Return to design skill
110
+ - Requirement changes → Return to requirements skill
111
+
112
+ **Forward**: On approval:
113
+ - Workflow complete
114
+ - User can now request task execution
115
+
116
+ ## Template Reference
117
+
118
+ See `.specsmd/simple/templates/tasks-template.md` for full template structure.
@@ -0,0 +1,133 @@
1
+ # Design Template
2
+
3
+ Use this template when generating design.md for a feature spec.
4
+
5
+ ---
6
+
7
+ ```markdown
8
+ # [Feature Name] Design Document
9
+
10
+ ## Overview
11
+
12
+ [3-5 sentences describing the solution approach. Include:
13
+ - What technology stack will be used?
14
+ - What architectural style/pattern?
15
+ - Key design decisions and rationale
16
+ - How does this integrate with existing systems?]
17
+
18
+ ## Architecture
19
+
20
+ [Include a diagram showing system components and their relationships]
21
+
22
+ ```mermaid
23
+ graph TD
24
+ A[Component A] --> B[Component B]
25
+ A --> C[Component C]
26
+ B --> D[Data Store]
27
+ C --> D
28
+ ```
29
+
30
+ **Key Architectural Principles:**
31
+ - [Principle 1: e.g., "Single responsibility per module"]
32
+ - [Principle 2: e.g., "Event-driven for loose coupling"]
33
+ - [Principle 3: e.g., "Immediate persistence on state change"]
34
+
35
+ ## Components and Interfaces
36
+
37
+ ### [ComponentName] Class/Module
38
+
39
+ [Brief description of component responsibility]
40
+
41
+ **Key Methods:**
42
+ - `methodName(param1: Type, param2: Type): ReturnType` - [Description]
43
+ - `methodName2(): ReturnType` - [Description]
44
+
45
+ ### [InterfaceName] Interface
46
+
47
+ ```typescript
48
+ interface InterfaceName {
49
+ field1: string;
50
+ field2: number;
51
+ field3: boolean;
52
+ method1(param: Type): ReturnType;
53
+ }
54
+ ```
55
+
56
+ ### [Additional components...]
57
+
58
+ ## Data Models
59
+
60
+ ### [EntityName] Entity
61
+
62
+ [Description of the entity and its role in the system]
63
+
64
+ ```typescript
65
+ interface EntityName {
66
+ id: string; // Unique identifier - [generation strategy]
67
+ field1: string; // [Constraints: e.g., "non-empty, max 500 chars"]
68
+ field2: number; // [Constraints: e.g., "positive integer"]
69
+ field3: boolean; // [Default value and meaning]
70
+ createdAt: number; // [Timestamp format]
71
+ }
72
+ ```
73
+
74
+ **Validation Rules:**
75
+ - `id`: [Validation rule]
76
+ - `field1`: [Validation rule]
77
+ - `field2`: [Validation rule]
78
+
79
+ ### Storage Format
80
+
81
+ [Describe how data is persisted - database schema, localStorage format, API payloads, etc.]
82
+
83
+ ## Error Handling
84
+
85
+ ### [Error Category 1]
86
+
87
+ | Error Type | Condition | Recovery Strategy |
88
+ |------------|-----------|-------------------|
89
+ | [ErrorName] | [When it occurs] | [How to handle] |
90
+ | [ErrorName2] | [When it occurs] | [How to handle] |
91
+
92
+ ### [Error Category 2]
93
+
94
+ [Continue for each error category: Storage, Validation, Network, etc.]
95
+
96
+ ### Recovery Strategies
97
+
98
+ - **Automatic Retry**: [When and how to retry]
99
+ - **Fallback State**: [Default safe state]
100
+ - **User Notification**: [What to tell the user]
101
+
102
+ ## Testing Strategy
103
+
104
+ ### Unit Tests
105
+
106
+ [What to test at unit level]
107
+ - [Component 1]: [What to verify]
108
+ - [Component 2]: [What to verify]
109
+
110
+ ### Integration Tests
111
+
112
+ [What to test at integration level]
113
+ - [Flow 1]: [End-to-end scenario]
114
+ - [Flow 2]: [End-to-end scenario]
115
+
116
+ ### Test Organization
117
+
118
+ - Test file naming: `*.test.ts` or `*.spec.ts`
119
+ - Location: [Co-located with source / separate test directory]
120
+ - Framework: [Jest / Vitest / Mocha / etc.]
121
+
122
+ ```
123
+
124
+ ---
125
+
126
+ ## Guidelines
127
+
128
+ 1. **Reference requirements** - Design should address ALL requirements from Phase 1
129
+ 2. **Use Mermaid diagrams** - Visual architecture aids understanding
130
+ 3. **TypeScript-style interfaces** - Even for non-TS projects, the syntax is clear
131
+ 4. **Include validation rules** - Be explicit about data constraints
132
+ 5. **Error handling is mandatory** - Every design needs error recovery strategy
133
+ 6. **Testing is part of design** - Define testing approach upfront
@@ -0,0 +1,73 @@
1
+ # Requirements Template
2
+
3
+ Use this template when generating requirements.md for a feature spec.
4
+
5
+ ---
6
+
7
+ ```markdown
8
+ # Requirements Document
9
+
10
+ ## Introduction
11
+
12
+ [2-3 sentences summarizing the feature and its purpose. What problem does it solve? Who benefits from this feature?]
13
+
14
+ ## Glossary
15
+
16
+ - **[System_Name]**: [Definition of the main system/component being built]
17
+ - **[Term_1]**: [Domain-specific term definition]
18
+ - **[Term_2]**: [Domain-specific term definition]
19
+ - **[Term_3]**: [Domain-specific term definition]
20
+
21
+ [Include 3-10 domain-specific terms that will be used consistently in acceptance criteria]
22
+
23
+ ## Requirements
24
+
25
+ ### Requirement 1
26
+
27
+ **User Story:** As a [role], I want [feature/capability], so that [benefit/value]
28
+
29
+ #### Acceptance Criteria
30
+
31
+ 1. WHEN [trigger event occurs], THE [System_Name] SHALL [expected response/action]
32
+ 2. WHILE [condition is true], THE [System_Name] SHALL [continuous behavior]
33
+ 3. IF [error/unwanted condition], THEN THE [System_Name] SHALL [recovery/handling action]
34
+ 4. WHERE [optional feature is enabled], THE [System_Name] SHALL [conditional behavior]
35
+
36
+ ### Requirement 2
37
+
38
+ **User Story:** As a [role], I want [feature/capability], so that [benefit/value]
39
+
40
+ #### Acceptance Criteria
41
+
42
+ 1. WHEN [trigger], THE [System_Name] SHALL [response]
43
+ 2. [Additional EARS-format criteria...]
44
+
45
+ ### Requirement 3
46
+
47
+ [Continue pattern for 3-7 total requirements]
48
+
49
+ ```
50
+
51
+ ---
52
+
53
+ ## EARS Format Reference
54
+
55
+ EARS (Easy Approach to Requirements Syntax) patterns:
56
+
57
+ | Pattern | Format | Use When |
58
+ |---------|--------|----------|
59
+ | **Ubiquitous** | THE [system] SHALL [response] | Always true behavior |
60
+ | **Event-driven** | WHEN [trigger], THE [system] SHALL [response] | Response to events |
61
+ | **State-driven** | WHILE [condition], THE [system] SHALL [response] | Behavior during state |
62
+ | **Unwanted** | IF [condition], THEN THE [system] SHALL [response] | Error handling |
63
+ | **Optional** | WHERE [option], THE [system] SHALL [response] | Feature flags |
64
+ | **Complex** | [WHERE] [WHILE] [WHEN/IF] THE [system] SHALL [response] | Combined conditions |
65
+
66
+ ## Guidelines
67
+
68
+ 1. **Use glossary terms consistently** - Every system/component mentioned should be defined in glossary
69
+ 2. **2-5 acceptance criteria per requirement** - Not too few, not too many
70
+ 3. **Active voice** - "System SHALL display" not "Message is displayed"
71
+ 4. **No vague terms** - Avoid "quickly", "adequate", "user-friendly"
72
+ 5. **Measurable criteria** - Include specific values where possible
73
+ 6. **One thought per criterion** - Break complex behaviors into multiple criteria
@@ -0,0 +1,95 @@
1
+ # Tasks Template
2
+
3
+ Use this template when generating tasks.md for a feature spec.
4
+
5
+ ---
6
+
7
+ ```markdown
8
+ # Implementation Plan
9
+
10
+ - [ ] 1. Set up project structure and core interfaces
11
+ - Create directory structure for [components]
12
+ - Define core interfaces and types
13
+ - Set up testing framework if not present
14
+ - _Requirements: [X.Y]_
15
+
16
+ - [ ] 2. Implement [Component Group Name]
17
+ - [ ] 2.1 Create [specific component/module]
18
+ - [Implementation detail 1]
19
+ - [Implementation detail 2]
20
+ - _Requirements: [X.Y, X.Z]_
21
+
22
+ - [ ]* 2.2 Write unit tests for [component]
23
+ - Create test file
24
+ - Test [specific behavior]
25
+ - _Requirements: [X.Y]_
26
+
27
+ - [ ] 2.3 Implement [next component]
28
+ - [Details]
29
+ - _Requirements: [X.Y]_
30
+
31
+ - [ ] 3. Implement [Next Component Group]
32
+ - [ ] 3.1 Create [component]
33
+ - [Details]
34
+ - _Requirements: [X.Y]_
35
+
36
+ - [ ] 3.2 Wire components together
37
+ - Connect [A] to [B]
38
+ - [Integration details]
39
+ - _Requirements: [X.Y, X.Z]_
40
+
41
+ - [ ] 4. Checkpoint - Verify all tests pass
42
+ - Run test suite
43
+ - Address any failures before continuing
44
+
45
+ - [ ] 5. [Continue with remaining components...]
46
+
47
+ - [ ] N. Final Checkpoint - Ensure all tests pass
48
+ - Run complete test suite
49
+ - Verify all requirements are covered
50
+ - Review implementation against design
51
+ ```
52
+
53
+ ---
54
+
55
+ ## Task Format Rules
56
+
57
+ ### Checkbox Format
58
+ - `- [ ]` - Pending task
59
+ - `- [x]` - Completed task
60
+ - `- [ ]*` - Optional task (nice-to-have, not blocking)
61
+
62
+ ### Numbering
63
+ - Top-level: `1.`, `2.`, `3.` etc.
64
+ - Sub-tasks: `2.1`, `2.2`, `2.3` etc.
65
+ - Maximum 2 levels of hierarchy
66
+
67
+ ### Requirement References
68
+ - Always include: `_Requirements: X.Y, X.Z_`
69
+ - Reference specific acceptance criteria numbers
70
+ - Every requirement should be covered by at least one task
71
+
72
+ ### Task Content
73
+ Each task should include:
74
+ 1. **Clear objective** - What to implement
75
+ 2. **Implementation details** - Sub-bullets with specifics
76
+ 3. **Requirement reference** - Traceability
77
+
78
+ ## Guidelines
79
+
80
+ 1. **Coding tasks ONLY** - No deployment, user testing, documentation
81
+ 2. **Incremental progress** - Each task builds on previous
82
+ 3. **Test-driven where appropriate** - Mark test tasks with `*` if optional
83
+ 4. **Include checkpoints** - Periodic verification that tests pass
84
+ 5. **Reference requirements** - Every task traces to requirement(s)
85
+ 6. **Actionable by AI** - Tasks should be specific enough for code generation
86
+
87
+ ## Excluded Task Types (Do NOT include)
88
+
89
+ - User acceptance testing
90
+ - Deployment to environments
91
+ - Performance metrics gathering
92
+ - User training
93
+ - Documentation creation (unless code comments)
94
+ - Business process changes
95
+ - Marketing activities
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specsmd",
3
- "version": "0.0.0-dev.22",
3
+ "version": "0.0.0-dev.23",
4
4
  "description": "Multi-agent orchestration system for AI-native software development. Delivers AI-DLC, Agile, and custom SDLC flows as markdown-based agent systems.",
5
5
  "main": "lib/installer.js",
6
6
  "bin": {