specsmd 0.0.0-dev.25 → 0.0.0-dev.27

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.
@@ -150,10 +150,50 @@ Recognize these as feedback (NOT approval):
150
150
 
151
151
  ## Entry Points
152
152
 
153
+ ### No Arguments - Multi-Spec Handling
154
+ User: `/specsmd-agent` (with no arguments)
155
+ Action:
156
+ 1. Scan `memory-bank/specs/` for existing spec directories
157
+ 2. If NO specs exist:
158
+ - Prompt: "What feature would you like to spec out?"
159
+ 3. If ONE spec exists:
160
+ - Auto-select it, detect state, resume at appropriate phase
161
+ 4. If MULTIPLE specs exist:
162
+ - List all specs with their status (see format below)
163
+ - Ask user to choose or create new
164
+
165
+ **Status display format:**
166
+ ```
167
+ Existing specs:
168
+ | Spec | Status |
169
+ |------|--------|
170
+ | user-auth | Execution (3/10 tasks done) |
171
+ | payment-flow | Design Pending |
172
+ | dashboard | Requirements In Progress |
173
+
174
+ Which spec would you like to work on? Or describe a new feature to create.
175
+ ```
176
+
153
177
  ### New Spec
154
178
  User: "Create a spec for [feature idea]"
155
179
  Action: Start requirements phase with derived feature name
156
180
 
181
+ **Feature Name Derivation Rules:**
182
+ 1. Convert to kebab-case (lowercase, hyphens)
183
+ 2. Remove articles (a, an, the)
184
+ 3. Use nouns over verbs
185
+ 4. Max 3-4 words
186
+ 5. Be specific but concise
187
+
188
+ **Examples:**
189
+ | User Input | Derived Name |
190
+ |------------|--------------|
191
+ | "Add user authentication" | `user-auth` |
192
+ | "Create a dashboard for analytics" | `analytics-dashboard` |
193
+ | "Implement payment processing with Stripe" | `stripe-payment` |
194
+ | "Build a file upload feature" | `file-upload` |
195
+ | "I want to track user sessions" | `session-tracking` |
196
+
157
197
  ### Resume Spec
158
198
  User: "Continue working on [feature]" or just "/specsmd-agent"
159
199
  Action: Detect state from files, resume at appropriate phase
@@ -250,15 +290,45 @@ Action: Load all specs, recommend or execute requested task
250
290
 
251
291
  ```mermaid
252
292
  stateDiagram-v2
293
+ [*] --> ListSpecs : No Args
253
294
  [*] --> Requirements : New Spec
295
+ ListSpecs --> Requirements : Create New
296
+ ListSpecs --> Resume : Select Existing
297
+
298
+ Resume --> Requirements : req only
299
+ Resume --> Design : req+design
300
+ Resume --> Execute : all files
301
+
254
302
  Requirements --> ReviewReq : Complete
255
303
  ReviewReq --> Requirements : Feedback
256
304
  ReviewReq --> Design : Approved
305
+
257
306
  Design --> ReviewDesign : Complete
258
307
  ReviewDesign --> Design : Feedback
308
+ ReviewDesign --> Requirements : Req Gap Found
259
309
  ReviewDesign --> Tasks : Approved
310
+
260
311
  Tasks --> ReviewTasks : Complete
261
312
  ReviewTasks --> Tasks : Feedback
313
+ ReviewTasks --> Design : Design Gap Found
262
314
  ReviewTasks --> Execute : Approved
315
+
316
+ Execute --> Execute : Next Task
317
+ Execute --> Tasks : Task Gap Found
318
+ Execute --> Design : Design Flaw Found
263
319
  Execute --> [*] : All Tasks Done
264
320
  ```
321
+
322
+ ## Phase Regression Triggers
323
+
324
+ Suggest returning to a previous phase when:
325
+
326
+ | Current Phase | Trigger | Action |
327
+ |---------------|---------|--------|
328
+ | Design | Requirement is ambiguous or missing | "I noticed we need clarity on X. Should we update requirements?" |
329
+ | Design | Feature scope expanded | "This requires new requirements. Should we add them?" |
330
+ | Tasks | Design doesn't cover all requirements | "Design is missing coverage for req X. Should we update design?" |
331
+ | Tasks | Implementation approach unclear | "The design needs more detail on X. Should we update it?" |
332
+ | Execute | Task is blocked by missing task | "We need an additional task for X. Should I add it?" |
333
+ | Execute | Implementation reveals design flaw | "The design for X won't work because Y. Should we revise?" |
334
+ | Execute | Requirement can't be satisfied | "Requirement X isn't feasible. Should we update requirements?" |
@@ -0,0 +1,219 @@
1
+ # specsmd Simple Flow Quick Start Guide
2
+
3
+ Get started with spec-driven development in minutes.
4
+
5
+ ---
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npx specsmd@latest install
11
+ ```
12
+
13
+ Select **Simple** when prompted for the SDLC flow.
14
+
15
+ The installer will:
16
+
17
+ 1. Detect available agentic coding tools (Claude Code, Cursor, etc.)
18
+ 2. Install the spec agent and skills
19
+ 3. Set up slash commands for your tools
20
+
21
+ ---
22
+
23
+ ## Three-Phase Workflow
24
+
25
+ Simple Flow has three sequential phases:
26
+
27
+ | Phase | Output | Purpose |
28
+ |-------|--------|---------|
29
+ | **Requirements** | `requirements.md` | Define what to build with user stories and EARS criteria |
30
+ | **Design** | `design.md` | Create technical design with architecture and data models |
31
+ | **Tasks** | `tasks.md` | Generate implementation checklist with coding tasks |
32
+
33
+ One agent (`/specsmd-agent`) guides you through all phases.
34
+
35
+ ---
36
+
37
+ ## Quick Start Flow
38
+
39
+ ### Step 1: Create a New Spec
40
+
41
+ Open your AI coding tool and invoke the agent with your feature idea:
42
+
43
+ ```text
44
+ /specsmd-agent Create a user authentication system with email login
45
+ ```
46
+
47
+ The agent will:
48
+ 1. Derive a feature name (`user-auth`)
49
+ 2. Generate a requirements document
50
+ 3. Ask for your approval
51
+
52
+ ### Step 2: Review Requirements
53
+
54
+ The agent generates:
55
+ - **Introduction** - Feature summary
56
+ - **Glossary** - Domain terms
57
+ - **Requirements** - User stories with EARS acceptance criteria
58
+
59
+ **Approval phrases:** "yes", "approved", "looks good", "let's continue"
60
+
61
+ **Feedback:** Any other response triggers revision
62
+
63
+ ### Step 3: Review Design
64
+
65
+ After requirements approval, the agent generates:
66
+ - **Architecture** - System overview with Mermaid diagrams
67
+ - **Components** - Interfaces and responsibilities
68
+ - **Data Models** - Types with validation rules
69
+ - **Error Handling** - Strategies for edge cases
70
+ - **Testing Strategy** - Test categories and coverage
71
+
72
+ ### Step 4: Review Tasks
73
+
74
+ After design approval, the agent generates:
75
+ - **Numbered checkbox list** - Incremental coding steps
76
+ - **Requirement references** - Traceability to requirements
77
+ - **Checkpoint tasks** - Verification points
78
+
79
+ ### Step 5: Execute Tasks
80
+
81
+ Once all three documents are approved:
82
+
83
+ ```text
84
+ /specsmd-agent What's the next task?
85
+ ```
86
+
87
+ Or specify a task:
88
+
89
+ ```text
90
+ /specsmd-agent Execute task 2.1 from user-auth
91
+ ```
92
+
93
+ The agent executes one task at a time, then waits for your review.
94
+
95
+ ---
96
+
97
+ ## Commands Reference
98
+
99
+ ### Single Agent: `/specsmd-agent`
100
+
101
+ | Action | Example |
102
+ |--------|---------|
103
+ | Create new spec | `/specsmd-agent Create a todo app with local storage` |
104
+ | Continue existing | `/specsmd-agent` (lists specs if multiple exist) |
105
+ | Resume specific spec | `/specsmd-agent --spec="todo-app"` |
106
+ | Execute tasks | `/specsmd-agent What's the next task?` |
107
+ | Execute specific task | `/specsmd-agent Execute task 3.2` |
108
+
109
+ ---
110
+
111
+ ## File Structure
112
+
113
+ After creating specs, your project will have:
114
+
115
+ ```text
116
+ .specsmd/
117
+ ├── manifest.yaml # Installation manifest
118
+ └── simple/ # Simple flow resources
119
+ ├── agents/agent.md # Agent definition
120
+ ├── skills/ # Agent skills
121
+ │ ├── requirements.md # Phase 1
122
+ │ ├── design.md # Phase 2
123
+ │ ├── tasks.md # Phase 3
124
+ │ └── execute.md # Task execution
125
+ ├── templates/ # Document templates
126
+ ├── memory-bank.yaml # Storage schema
127
+ └── quick-start.md # This file
128
+
129
+ memory-bank/
130
+ └── specs/ # Your feature specs
131
+ └── {feature-name}/
132
+ ├── requirements.md # What to build
133
+ ├── design.md # How to build it
134
+ └── tasks.md # Step-by-step plan
135
+ ```
136
+
137
+ ---
138
+
139
+ ## EARS Format
140
+
141
+ Requirements use EARS (Easy Approach to Requirements Syntax):
142
+
143
+ | Pattern | Format |
144
+ |---------|--------|
145
+ | **Event-driven** | WHEN [trigger], THE [system] SHALL [response] |
146
+ | **State-driven** | WHILE [condition], THE [system] SHALL [response] |
147
+ | **Unwanted** | IF [condition], THEN THE [system] SHALL [response] |
148
+ | **Optional** | WHERE [option], THE [system] SHALL [response] |
149
+
150
+ Example:
151
+ ```
152
+ WHEN user submits login form, THE Auth_System SHALL validate credentials
153
+ IF password is invalid, THEN THE Auth_System SHALL display error message
154
+ ```
155
+
156
+ ---
157
+
158
+ ## Key Principles
159
+
160
+ ### Generate First, Ask Later
161
+ The agent generates a draft immediately. Your feedback refines it.
162
+
163
+ ### Explicit Approval Required
164
+ You must explicitly approve each phase before proceeding.
165
+
166
+ ### One Phase at a Time
167
+ Complete each phase before moving to the next.
168
+
169
+ ### One Task at a Time
170
+ During execution, only one task per interaction. Review before continuing.
171
+
172
+ ---
173
+
174
+ ## Tips for Success
175
+
176
+ 1. **Be specific** - "User auth with email/password and session management" beats "Login feature"
177
+ 2. **Use the glossary** - Define domain terms for consistent language
178
+ 3. **Check INCOSE rules** - Singular, Complete, Verifiable, Unambiguous, Consistent
179
+ 4. **Include edge cases** - Error scenarios in acceptance criteria
180
+ 5. **Review checkpoints** - Verify tests pass during execution
181
+
182
+ ---
183
+
184
+ ## Troubleshooting
185
+
186
+ ### Agent doesn't remember context
187
+ The agent is stateless. It reads spec files at startup. Ensure documents are saved.
188
+
189
+ ### Multiple specs exist
190
+ When you run `/specsmd-agent` without arguments, it lists existing specs and asks which to work on.
191
+
192
+ ### Want to start over
193
+ Delete the spec folder: `rm -rf memory-bank/specs/{feature-name}`
194
+
195
+ ### Get help
196
+ Ask the agent: `/specsmd-agent How do I add a new requirement?`
197
+
198
+ ---
199
+
200
+ ## When to Use Simple Flow vs AI-DLC
201
+
202
+ | Simple Flow | AI-DLC Flow |
203
+ |-------------|-------------|
204
+ | Quick feature specs | Full development lifecycle |
205
+ | Solo or small team | Multi-team coordination |
206
+ | Prototypes & MVPs | Production systems |
207
+ | Minimal overhead | Full traceability |
208
+ | 1 agent, 3 phases | 4 agents, full methodology |
209
+
210
+ ---
211
+
212
+ ## What's Next?
213
+
214
+ 1. Run `/specsmd-agent` with your feature idea
215
+ 2. Review and approve requirements → design → tasks
216
+ 3. Execute tasks one at a time
217
+ 4. Ship your feature!
218
+
219
+ Happy spec-driven development!
@@ -36,9 +36,20 @@ Execute implementation tasks from an approved tasks.md file. This is the post-sp
36
36
  If user specifies a task:
37
37
  - Execute that specific task
38
38
 
39
- If user asks for recommendation:
40
- - Find first unchecked task that has all prerequisites completed
41
- - Recommend it to user for confirmation
39
+ If user asks for recommendation ("what's next?", "continue", etc.):
40
+ - Use the Task Recommendation Algorithm below
41
+ - Present the recommended task to user for confirmation
42
+
43
+ ### Task Recommendation Algorithm
44
+
45
+ 1. Parse all tasks from tasks.md
46
+ 2. Build task list with status (complete/incomplete)
47
+ 3. For each incomplete task in order:
48
+ - If task has sub-tasks, check if all previous sub-tasks are complete
49
+ - If task has no sub-tasks, check if all previous numbered tasks are complete
50
+ - Skip optional tasks (`*`) unless user specifically asks
51
+ 4. Return first incomplete task with all prerequisites met
52
+ 5. If no incomplete tasks remain, announce completion (see Output section)
42
53
 
43
54
  ### Task Execution
44
55
 
@@ -50,12 +61,21 @@ If user asks for recommendation:
50
61
  - Interfaces to implement
51
62
  - Data models involved
52
63
  3. **Implement the task**:
53
- - Write/modify code as needed
64
+ - Write MINIMAL code needed to satisfy the task
54
65
  - Follow design specifications
55
66
  - Match coding standards if defined
56
- 4. **Mark task complete**:
67
+ 4. **Verify implementation**:
68
+ - Check code satisfies referenced requirements
69
+ - Run relevant tests if they exist for this component
70
+ - If tests fail, fix before proceeding
71
+ 5. **Mark task complete**:
57
72
  - Update tasks.md: `- [ ]` → `- [x]`
58
- 5. **STOP and wait for user review**
73
+ - Only mark complete AFTER verification passes
74
+ 6. **Recommend next task**:
75
+ - Parse remaining incomplete tasks
76
+ - Identify next task with all prerequisites met
77
+ - If no tasks remain, announce completion
78
+ 7. **STOP and wait for user review**
59
79
 
60
80
  ## Critical Rules
61
81
 
@@ -91,11 +111,29 @@ Changes made:
91
111
  - [File 1]: [What was done]
92
112
  - [File 2]: [What was done]
93
113
 
94
- The task satisfies requirements: [X.Y, X.Z]
114
+ Verification:
115
+ - Requirements [X.Y, X.Z]: ✓ Satisfied
116
+ - Tests: ✓ Passing (or N/A if no tests for this component)
117
+
118
+ Next recommended task: [X.Z] - [Task description]
95
119
 
96
120
  Ready for the next task? Or would you like to review the changes first?
97
121
  ```
98
122
 
123
+ When ALL tasks are complete:
124
+ ```
125
+ All tasks complete!
126
+
127
+ Summary:
128
+ - [X] tasks executed
129
+ - All requirements covered
130
+ - Tests passing
131
+
132
+ The feature implementation is complete. Consider:
133
+ - Manual testing of the feature
134
+ - Code review before merging
135
+ ```
136
+
99
137
  ## Task Execution Checklist
100
138
 
101
139
  Before executing:
@@ -108,7 +146,9 @@ Before executing:
108
146
 
109
147
  After executing:
110
148
  - [ ] Code changes complete
149
+ - [ ] Verification passed (requirements + tests)
111
150
  - [ ] Task marked `[x]` in tasks.md
151
+ - [ ] Next task recommended (or completion announced)
112
152
  - [ ] Summary provided to user
113
153
  - [ ] STOPPED - waiting for user
114
154
 
@@ -122,6 +162,17 @@ If task cannot be completed:
122
162
  - Design gap → Return to design phase
123
163
  - Requirement unclear → Return to requirements phase
124
164
 
165
+ ## Handling Repeated Failures
166
+
167
+ If implementation fails twice on the same task:
168
+ 1. STOP attempting the same approach
169
+ 2. Explain what has been tried and why it failed
170
+ 3. Suggest alternatives:
171
+ - Different implementation approach
172
+ - Breaking task into smaller sub-tasks
173
+ - Returning to design for clarification
174
+ 4. Ask user for guidance before proceeding
175
+
125
176
  ## Sub-task Handling
126
177
 
127
178
  For tasks with sub-tasks (e.g., 2.1, 2.2, 2.3):
@@ -54,13 +54,20 @@ Generate an implementation plan with coding tasks based on the approved design.
54
54
  3. **Incremental Progress**
55
55
  - Tasks build on previous tasks
56
56
  - No orphaned code that isn't integrated
57
- - Include "Checkpoint" tasks to verify tests pass
57
+ - Include "Checkpoint" tasks every 2-3 implementation tasks
58
58
 
59
- 4. **Task Format**
59
+ 4. **Checkpoint Tasks (REQUIRED)**
60
+ - Add checkpoint after every 2-3 implementation tasks
61
+ - Checkpoint MUST run the test suite
62
+ - If tests fail during checkpoint, fix before proceeding
63
+ - Checkpoints are BLOCKING (not optional) - do NOT mark with `*`
64
+ - Format: `- [ ] X. Checkpoint - Verify all tests pass`
65
+
66
+ 5. **Task Format**
60
67
  - `- [ ]` for pending, `- [x]` for done
61
68
  - `- [ ]*` for optional tasks
62
69
 
63
- 5. **Numbering Rules**
70
+ 6. **Numbering Rules**
64
71
  - Top-level tasks: `1.`, `2.`, `3.`
65
72
  - Sub-tasks: `2.1`, `2.2`, `2.3`
66
73
  - Maximum 2 levels (no `2.1.1`)
@@ -69,7 +76,7 @@ Generate an implementation plan with coding tasks based on the approved design.
69
76
  - Tasks without sub-tasks are directly executable
70
77
  - Use sub-tasks when a feature has 3+ related implementation steps
71
78
 
72
- 6. **Approval Gate**
79
+ 7. **Approval Gate**
73
80
  - Workflow COMPLETE when tasks approved
74
81
  - Inform user they can now execute tasks
75
82
 
@@ -63,6 +63,18 @@ EARS (Easy Approach to Requirements Syntax) patterns:
63
63
  | **Optional** | WHERE [option], THE [system] SHALL [response] | Feature flags |
64
64
  | **Complex** | [WHERE] [WHILE] [WHEN/IF] THE [system] SHALL [response] | Combined conditions |
65
65
 
66
+ ## INCOSE Quality Rules
67
+
68
+ Before finalizing requirements, verify each criterion passes these checks:
69
+
70
+ | Rule | Check | Bad Example | Good Example |
71
+ |------|-------|-------------|--------------|
72
+ | **Singular** | One capability per criterion (no "and") | "System SHALL log and notify" | "System SHALL log" + "System SHALL notify" |
73
+ | **Complete** | All conditions stated | "System SHALL respond quickly" | "System SHALL respond within 200ms" |
74
+ | **Verifiable** | Can be tested/measured | "System SHALL be user-friendly" | "System SHALL complete checkout in ≤3 clicks" |
75
+ | **Unambiguous** | Only one interpretation | "System SHALL handle large files" | "System SHALL handle files up to 100MB" |
76
+ | **Consistent** | No conflicts with other requirements | Req 1: "Always online" + Req 2: "Offline mode" | Reconcile or clarify conditions |
77
+
66
78
  ## Guidelines
67
79
 
68
80
  1. **Use glossary terms consistently** - Every system/component mentioned should be defined in glossary
package/lib/constants.js CHANGED
@@ -17,12 +17,10 @@ const FLOWS = {
17
17
  description: 'AI-Driven Development Life Cycle - Best for greenfield projects with AI-native development',
18
18
  path: 'aidlc'
19
19
  },
20
- agile: {
21
- name: 'Agile',
22
- description: 'Sprint-based Agile development - Best for iterative development with changing requirements',
23
- path: 'agile',
24
- disabled: true, // Not implemented yet
25
- message: '(Coming soon)'
20
+ simple: {
21
+ name: 'Simple',
22
+ description: 'Spec-driven development - Best for quick feature specs without full methodology overhead',
23
+ path: 'simple'
26
24
  }
27
25
  };
28
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specsmd",
3
- "version": "0.0.0-dev.25",
3
+ "version": "0.0.0-dev.27",
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": {