speccrew 0.3.13 → 0.4.0

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.
@@ -28,69 +28,45 @@ This skill applies ISA-95 Stages 1-3 in lightweight mode:
28
28
 
29
29
  ## PM Stage Content Boundary
30
30
 
31
- > **DO NOT include in PRD:** API definitions, class diagrams, ER diagrams, code snippets, technical metrics.
32
- > These belong to Feature Designer or System Designer.
31
+ > **PM Stage Content Boundary DO NOT include:**
32
+ > - API endpoint definitions, HTTP methods, request/response JSON
33
+ > - Design class diagrams, component diagrams, deployment diagrams
34
+ > - Database table structures, ER diagrams, SQL queries
35
+ > - Code snippets, pseudocode, implementation logic
36
+ > - Technical terminology (e.g., UUID, JWT, REST, Microservice, JSON)
37
+ > - Technical metrics (e.g., "code files", "latency < 100ms", "CPU usage")
38
+ >
39
+ > These belong to **Feature Designer** (interaction design, API contracts) or **System Designer** (technical architecture).
40
+ >
41
+ > **Required:** Use business language only. Describe WHAT business operation needs to happen, not HOW the system implements it.
42
+ > ✅ "Customer can search by name" ❌ "SELECT * FROM customers WHERE name LIKE '%keyword%'"
43
+ > ✅ "Show friendly error message" ❌ "return HTTP 400 Bad Request"
33
44
 
34
45
  ---
35
46
 
36
- ## Workflow
37
-
38
- ### Step 1: Quick Clarification
39
-
40
- **For simple requirements with 1-3 questions:**
41
- - Ask directly in chat (acceptable for very short clarifications)
42
-
43
- **For requirements needing 4+ questions:**
44
- - Use file-based clarification (same as complex skill):
45
- 1. Write questions to `.clarification-summary.md` in the iteration's `01.product-requirement/` directory
46
- 2. User fills answers in file after each "**Answer:**" marker
47
- 3. User notifies PM
48
- 4. PM reads and proceeds
49
-
50
- > **Default to chat-based** for simple requirements unless the clarification content is lengthy.
51
-
52
- Clarification topics:
47
+ ## Prerequisites
53
48
 
54
- 1. **What to change**: Which page/function/module is affected?
55
- 2. **What the change is**: Add field? Modify logic? New sub-feature?
56
- 3. **Business reason**: Why is this change needed?
57
- 4. **Acceptance criteria**: How to verify the change is correct?
49
+ > 🚨 MANDATORY: `.clarification-summary.md` MUST exist in the current iteration directory.
50
+ > This file is generated by the `speccrew-pm-requirement-clarify` skill.
51
+ > IF `.clarification-summary.md` is missing ABORT immediately.
58
52
 
59
- > **ISA-95 Stage 1 Thinking** — Confirm affected module boundary and impacted user roles. No formal glossary needed.
60
-
61
- If requirement is already clear, skip and proceed.
53
+ ---
62
54
 
63
- **If requirement is complex** (3+ modules, 10+ features, new system), **STOP and redirect**:
64
- ```
65
- ⚠️ This requirement appears complex. Switching to full requirement analysis.
66
- Invoking skill: speccrew-pm-requirement-analysis/SKILL.md
67
- ```
55
+ ## Workflow
68
56
 
69
- ### Step 2: Initialize Tracking
57
+ ### Step 1: Read Clarification Summary
70
58
 
71
- 1. **Determine iteration path**: Use existing or create `speccrew-workspace/iterations/{iteration-id}/`
59
+ **Actions:**
60
+ 1. Read `.clarification-summary.md` from `{iteration_path}/01.product-requirement/`
61
+ 2. Extract: complexity level, key decisions, clarification Q&A, sufficiency checks
72
62
 
73
- 2. **Create checkpoint file** at `01.product-requirement/.checkpoints.json`:
74
- ```json
75
- {
76
- "stage": "01_prd",
77
- "complexity": "simple",
78
- "checkpoints": {
79
- "requirement_clarification": { "passed": true, "confirmed_at": "{REAL_TIMESTAMP}", "description": "Quick clarification completed" },
80
- "prd_review": { "passed": false, "confirmed_at": null, "description": "User review and confirmation" }
81
- }
82
- }
83
- ```
84
- Get real timestamp via: `node -e "console.log(new Date().toISOString())"`
63
+ **Verify complexity:**
64
+ - IF complexity = "complex" → STOP and redirect to `speccrew-pm-requirement-analysis`
65
+ - IF complexity = "simple" → proceed
85
66
 
86
- 3. **Update WORKFLOW-PROGRESS.json** (if exists):
87
- ```bash
88
- node speccrew-workspace/scripts/update-progress.js update-workflow \
89
- --file speccrew-workspace/iterations/{iteration}/WORKFLOW-PROGRESS.json \
90
- --stage 01_prd --status in_progress
91
- ```
67
+ > **ISA-95 Stage 1 Thinking** Scope boundary already confirmed in clarification. Extract module boundary and impacted roles from summary.
92
68
 
93
- ### Step 3: Read PRD Template
69
+ ### Step 2: Read PRD Template
94
70
 
95
71
  **Locate and read the PRD template:**
96
72
 
@@ -106,7 +82,7 @@ node speccrew-workspace/scripts/update-progress.js update-workflow \
106
82
  > The template is ALWAYS located in the skill's own `templates/` subfolder.
107
83
  > If glob returns no results, check if speccrew was properly initialized (`speccrew init`).
108
84
 
109
- ### Step 4: Generate Single PRD
85
+ ### Step 3: Generate Single PRD
110
86
 
111
87
  Create PRD at: `speccrew-workspace/iterations/{iteration}/01.product-requirement/{feature-name}-prd.md`
112
88
 
@@ -128,71 +104,57 @@ Create PRD at: `speccrew-workspace/iterations/{iteration}/01.product-requirement
128
104
  | 6. Boundary | Clear in/out scope. |
129
105
  | 7. Assumptions | Only if there are assumptions to document. |
130
106
 
107
+ > ⚠️ **Content Boundary Reminder for each section:**
108
+ > - Background & Goals → Business reason only, NO technical architecture
109
+ > - User Stories → "As a [role] I want [business action]" — NOT implementation method
110
+ > - Functional Requirements → WHAT changes, not HOW to implement
111
+ > - Feature List/Breakdown → Feature description is business outcome, NOT technical solution
112
+ > - Acceptance Criteria → Business acceptance (e.g., "User can see result"), NOT technical tests (e.g., "API returns 200")
113
+
131
114
  > **ISA-95 Stage 3 Thinking** — All identified features are Must-have (P0). No MoSCoW filtering needed.
132
115
 
133
- ### Step 5: Present for User Review
116
+ ### Step 4: Return to PM Agent
134
117
 
135
- Display PRD summary:
118
+ **Output:**
136
119
  ```
137
120
  📄 PRD Generated: {feature-name}-prd.md
138
121
 
139
122
  Summary:
140
- - Scope: {brief scope}
123
+ - Scope: {brief scope from clarification summary}
141
124
  - Features: {count} features
142
125
  - Modules affected: {module names}
126
+ - Complexity: simple
143
127
 
144
- Please review and confirm the scope, acceptance criteria, and completeness.
145
- ```
146
-
147
- ⚠️ **HARD STOP — WAIT FOR USER CONFIRMATION**
148
-
149
- ```
150
- DO NOT proceed until user explicitly confirms.
151
- IF user requests changes → update PRD, then re-present.
152
- ONLY after user confirms → proceed to Step 6.
153
- ```
154
-
155
- ### Step 6: Finalize PRD Stage
156
-
157
- After user confirms:
158
-
159
- 1. **Update checkpoint** — set `prd_review.passed = true` with real timestamp
160
-
161
- 2. **Update WORKFLOW-PROGRESS.json**:
162
- ```bash
163
- node speccrew-workspace/scripts/update-progress.js update-workflow \
164
- --file speccrew-workspace/iterations/{iteration}/WORKFLOW-PROGRESS.json \
165
- --stage 01_prd --status confirmed \
166
- --output "01.product-requirement/{feature-name}-prd.md"
128
+ Returning to PM Agent for review and confirmation.
167
129
  ```
168
130
 
169
- 3. **Output**: `✅ PRD confirmed. PRD stage is complete. Next: Start Feature Design in a new conversation.`
170
-
171
- 4. **END** — Do not proceed further.
131
+ > **DO NOT wait for user confirmation in this skill.**
132
+ > Verification and confirmation are handled by PM Agent Phase 5.
172
133
 
173
134
  ---
174
135
 
175
136
  ## Output Checklist
176
137
 
138
+ - [ ] `.clarification-summary.md` read and complexity verified
177
139
  - [ ] PRD file created at correct path
178
140
  - [ ] All relevant sections filled (skip empty optional sections)
179
141
  - [ ] No technical implementation details (no API, no code, no class diagrams)
180
142
  - [ ] Feature Breakdown table present with at least 1 feature
181
143
  - [ ] Acceptance criteria are concrete and testable
182
- - [ ] .checkpoints.json created with requirement_clarification passed
183
144
  - [ ] Business language only — no technical jargon
184
145
 
185
146
  ## Constraints
186
147
 
187
148
  **Must do:**
149
+ - Verify `.clarification-summary.md` exists before proceeding
188
150
  - Keep PRD concise — 1-3 page PRDs
189
151
  - Use business language throughout
190
- - Verify with user before finalizing
191
- - Use real timestamps from `node -e "console.log(new Date().toISOString())"`
152
+ - Extract key decisions from clarification summary into PRD
192
153
 
193
154
  **Must not do:**
194
- - Do not generate Master-Sub PRD structure
195
- - Do not dispatch worker agents
196
- - Do not generate API definitions, class diagrams, or technical artifacts
197
- - Do not skip user confirmation
198
- - Do not auto-transition to Feature Design stage
155
+ - Proceed without `.clarification-summary.md`
156
+ - Generate Master-Sub PRD structure
157
+ - Dispatch worker agents
158
+ - Generate API definitions, class diagrams, or technical artifacts
159
+ - Wait for user confirmation (handled by PM Agent)
160
+ - Auto-transition to Feature Design stage
@@ -4,6 +4,23 @@ description: Generate a single Sub-PRD document for one module. Used by PM Agent
4
4
  tools: Read, Write, Glob, Grep
5
5
  ---
6
6
 
7
+ ## PM Stage Content Boundary
8
+
9
+ > ⚠️ **This Sub-PRD MUST adhere to PM Stage Content Boundary:**
10
+ > - NO API endpoint definitions, HTTP methods, request/response JSON
11
+ > - NO Database table structures, ER diagrams, SQL queries
12
+ > - NO Design class diagrams, component diagrams, deployment diagrams
13
+ > - NO Code snippets, pseudocode, implementation logic
14
+ > - NO Technical terminology (e.g., UUID, JWT, REST, Microservice, JSON)
15
+ > - NO Technical metrics (e.g., "code files", "latency < 100ms", "CPU usage")
16
+ >
17
+ > **Required:** Use BUSINESS LANGUAGE ONLY.
18
+ > Describe WHAT business operation needs to happen, not HOW the system implements it.
19
+ >
20
+ > **ABORT CONDITIONS:**
21
+ > - IF any section being generated contains SQL, API definitions, or code → STOP
22
+ > - IF inherited module_requirements contain technical details → Strip them, use business descriptions only
23
+
7
24
  # Trigger Scenarios
8
25
 
9
26
  - PM Agent dispatches worker to generate Sub-PRD for a specific module
@@ -62,17 +79,17 @@ Fill each section using `search_replace`:
62
79
  - 2.2 User Scenarios: Module-specific user stories in "As a / I want / So that" format
63
80
 
64
81
  ### 3.3 Section 3: Functional Requirements
65
- - 3.1 Use Case Diagram: Module-specific use case diagram (Mermaid flowchart TB)
66
- - 3.2 Business Process Flow: Module-internal process flow
67
- - 3.3 Feature List: Module features with P0/P1/P2 priority
82
+ - 3.1 Use Case Diagram: Module-specific use case diagram (Mermaid flowchart TB) — **Business use cases showing user interactions — NOT system APIs or technical components**
83
+ - 3.2 Business Process Flow: Module-internal process flow — **Business process steps — NOT database operations or API calls**
84
+ - 3.3 Feature List: Module features with P0/P1/P2 priority — **Business feature descriptions — NOT technical implementation**
68
85
  - 3.4 Feature Breakdown: **REQUIRED** — Fill with `{module_features}` data:
69
86
  - Feature ID, Feature Name, Type (User Interaction / Backend Process), Scope, Description
70
87
  - Feature Dependencies table
71
88
  - 3.5 Feature Details: Detailed descriptions for each feature including:
72
- - Requirement Description
73
- - Interaction Flow
74
- - Boundary Conditions table
75
- - Exception Scenarios
89
+ - Requirement Description — **Business requirements in business language**
90
+ - Interaction Flow — **User interaction steps in business terms**
91
+ - Boundary Conditions table — **Business scenarios and business handling rules**
92
+ - Exception Scenarios — **Business exception handling in business language**
76
93
 
77
94
  ### 3.4 Section 4: Non-functional Requirements
78
95
  - Module-specific performance, security, compatibility requirements
@@ -93,6 +110,14 @@ Fill each section using `search_replace`:
93
110
 
94
111
  > ⚠️ **FORBIDDEN: `create_file` to rewrite the entire document. MUST use `search_replace` per section.**
95
112
 
113
+ ### ⚠️ Content Boundary Validation
114
+
115
+ Before filling each section, verify:
116
+ - Feature descriptions use BUSINESS language (✅ "Customer can view order history" ❌ "GET /api/orders returns JSON")
117
+ - Boundary conditions describe BUSINESS scenarios (✅ "Customer name is empty" ❌ "null pointer exception")
118
+ - Exception handling describes BUSINESS rules (✅ "Show friendly error message" ❌ "return HTTP 400")
119
+ - Process flows show BUSINESS steps (✅ "Customer submits order" ❌ "POST request to order service")
120
+
96
121
  ## Step 4: Verify Output
97
122
 
98
123
  1. Read the generated file to verify:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speccrew",
3
- "version": "0.3.13",
3
+ "version": "0.4.0",
4
4
  "description": "Spec-Driven Development toolkit for AI-powered IDEs",
5
5
  "author": "charlesmu99",
6
6
  "repository": {
@@ -67,6 +67,19 @@ graph TB
67
67
  | `/` | File paths (`/pages/index`) | Remove leading `/` or use parentheses: `pages/index` |
68
68
  | `(` `)` | Function calls (`handleQuery()`) | Remove parentheses: `handleQuery` |
69
69
 
70
+ **When Special Characters Must Be Preserved:**
71
+
72
+ If node text must contain parentheses `()`, curly braces `{}`, square brackets `[]`, or colons `:`, wrap the entire text in double quotes to prevent Mermaid from misinterpreting them as shape definitions or syntax elements.
73
+
74
+ | Wrong (Parse Error) | Correct (Quoted) |
75
+ |---------------------|------------------|
76
+ | `P1[选择对比组(如:面部左脸)]` | `P1["选择对比组(如:面部左脸)"]` |
77
+ | `P2[上传图片(1-N张)]` | `P2["上传图片(1-N张)"]` |
78
+ | `A[Task{ urgent }]` | `A["Task{ urgent }"]` |
79
+ | `B[Array[0]]` | `B["Array[0]"]` |
80
+
81
+ **Important:** The rule "Quoted node text [\"text\"]" in the Prohibited list refers to unnecessary quoting of plain text. When special characters are present, quoting becomes **required** for correct parsing.
82
+
70
83
  ### 5. Multi-line Text Handling
71
84
 
72
85
  ```