specsmd 0.0.0-dev.25 → 0.0.0-dev.26

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?" |
@@ -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/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.26",
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": {