speccrew 0.1.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.
Files changed (153) hide show
  1. package/.speccrew/agents/speccrew-feature-designer.md +142 -0
  2. package/.speccrew/agents/speccrew-product-manager.md +61 -0
  3. package/.speccrew/agents/speccrew-system-designer.md +200 -0
  4. package/.speccrew/agents/speccrew-system-developer.md +238 -0
  5. package/.speccrew/agents/speccrew-task-worker.md +80 -0
  6. package/.speccrew/agents/speccrew-team-leader.md +92 -0
  7. package/.speccrew/agents/speccrew-test-manager.md +313 -0
  8. package/.speccrew/skills/speccrew-create-agents/SKILL.md +98 -0
  9. package/.speccrew/skills/speccrew-create-agents/templates/agents/designer-agent.md +54 -0
  10. package/.speccrew/skills/speccrew-create-agents/templates/agents/dev-agent.md +79 -0
  11. package/.speccrew/skills/speccrew-create-agents/templates/agents/test-agent.md +80 -0
  12. package/.speccrew/skills/speccrew-dev-backend/SKILL.md +205 -0
  13. package/.speccrew/skills/speccrew-dev-backend/templates/TASK-RECORD-TEMPLATE.md +118 -0
  14. package/.speccrew/skills/speccrew-dev-desktop/SKILL.md +258 -0
  15. package/.speccrew/skills/speccrew-dev-desktop/templates/TASK-RECORD-TEMPLATE.md +161 -0
  16. package/.speccrew/skills/speccrew-dev-frontend/SKILL.md +202 -0
  17. package/.speccrew/skills/speccrew-dev-frontend/templates/TASK-RECORD-TEMPLATE.md +115 -0
  18. package/.speccrew/skills/speccrew-dev-mobile/SKILL.md +200 -0
  19. package/.speccrew/skills/speccrew-dev-mobile/templates/TASK-RECORD-TEMPLATE.md +125 -0
  20. package/.speccrew/skills/speccrew-fd-api-contract/SKILL.md +73 -0
  21. package/.speccrew/skills/speccrew-fd-api-contract/templates/API-CONTRACT-TEMPLATE.md +96 -0
  22. package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +395 -0
  23. package/.speccrew/skills/speccrew-fd-feature-design/templates/FEATURE-SPEC-TEMPLATE.md +387 -0
  24. package/.speccrew/skills/speccrew-get-timestamp/SKILL.md +80 -0
  25. package/.speccrew/skills/speccrew-get-timestamp/scripts/get-timestamp.js +35 -0
  26. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/SKILL.md +1116 -0
  27. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-FASTAPI.md +462 -0
  28. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-JAVA.md +480 -0
  29. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-NET.md +464 -0
  30. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE.md +480 -0
  31. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/MODULE-OVERVIEW-TEMPLATE.md +367 -0
  32. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +667 -0
  33. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/STATUS-FORMATS.md +74 -0
  34. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/batch-orchestrator.js +176 -0
  35. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-next-batch.js +150 -0
  36. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-pending-features.js +106 -0
  37. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/mark-stale.js +249 -0
  38. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/process-batch-results.js +848 -0
  39. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/update-feature-status.js +226 -0
  40. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/SKILL.md +264 -0
  41. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/examples/features.json +34 -0
  42. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/generate-inventory.js +867 -0
  43. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/test-inventory.js +26 -0
  44. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/SKILL.md +165 -0
  45. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/apply-module-mapping.js +208 -0
  46. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/extract-module-summary.js +180 -0
  47. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/reindex-modules.js +358 -0
  48. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/SKILL.md +1055 -0
  49. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-DESKTOP.md +303 -0
  50. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-ELECTRON.md +327 -0
  51. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-MINIAPP.md +292 -0
  52. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-MOBILE.md +281 -0
  53. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI.md +324 -0
  54. package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/SKILL.md +270 -0
  55. package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/COMPONENT-PATTERN-TEMPLATE.md +33 -0
  56. package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/LAYOUT-PATTERN-TEMPLATE.md +33 -0
  57. package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/PAGE-TYPE-TEMPLATE.md +33 -0
  58. package/.speccrew/skills/speccrew-knowledge-graph-query/SKILL.md +229 -0
  59. package/.speccrew/skills/speccrew-knowledge-graph-query/scripts/graph-query.js +549 -0
  60. package/.speccrew/skills/speccrew-knowledge-graph-write/SKILL.md +181 -0
  61. package/.speccrew/skills/speccrew-knowledge-graph-write/scripts/graph-write.js +651 -0
  62. package/.speccrew/skills/speccrew-knowledge-module-summarize/SKILL.md +305 -0
  63. package/.speccrew/skills/speccrew-knowledge-module-summarize/templates/MODULE-OVERVIEW-TEMPLATE.md +400 -0
  64. package/.speccrew/skills/speccrew-knowledge-system-summarize/SKILL.md +351 -0
  65. package/.speccrew/skills/speccrew-knowledge-system-summarize/templates/SYSTEM-OVERVIEW-TEMPLATE.md +294 -0
  66. package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +683 -0
  67. package/.speccrew/skills/speccrew-knowledge-techs-dispatch/STATUS-FORMATS.md +550 -0
  68. package/.speccrew/skills/speccrew-knowledge-techs-dispatch/templates/techs-manifest-EXAMPLE.json +35 -0
  69. package/.speccrew/skills/speccrew-knowledge-techs-generate/SKILL.md +1087 -0
  70. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/ARCHITECTURE-TEMPLATE.md +240 -0
  71. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/COLOR-SYSTEM-TEMPLATE.md +68 -0
  72. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/COMPONENT-LIBRARY-TEMPLATE.md +86 -0
  73. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-BUILD-TEMPLATE.md +466 -0
  74. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DATA-TEMPLATE.md +432 -0
  75. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DESIGN-TEMPLATE.md +1209 -0
  76. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DEV-TEMPLATE.md +1433 -0
  77. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-SYSTEM-TEST-TEMPLATE.md +1052 -0
  78. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-UNIT-TEST-TEMPLATE.md +946 -0
  79. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/INDEX-TEMPLATE.md +29 -0
  80. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/PAGE-LAYOUTS-TEMPLATE.md +69 -0
  81. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/PAGE-TYPE-SUMMARY-TEMPLATE.md +74 -0
  82. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/TECH-STACK-TEMPLATE.md +232 -0
  83. package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions/SKILL.md +628 -0
  84. package/.speccrew/skills/speccrew-knowledge-techs-generate-ui-style/SKILL.md +392 -0
  85. package/.speccrew/skills/speccrew-knowledge-techs-index/SKILL.md +489 -0
  86. package/.speccrew/skills/speccrew-knowledge-techs-index/templates/INDEX-TEMPLATE.md +243 -0
  87. package/.speccrew/skills/speccrew-knowledge-techs-init/SKILL.md +269 -0
  88. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/SKILL.md +562 -0
  89. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/BUSINESS-COMPONENTS-TEMPLATE.md +171 -0
  90. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMMON-COMPONENTS-TEMPLATE.md +177 -0
  91. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMPONENT-INDIVIDUAL-TEMPLATE.md +80 -0
  92. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMPONENT-LIBRARY-TEMPLATE.md +118 -0
  93. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/LAYOUT-INDIVIDUAL-TEMPLATE.md +97 -0
  94. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/LAYOUT-PATTERNS-TEMPLATE.md +208 -0
  95. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/NAVIGATION-PATTERNS-TEMPLATE.md +157 -0
  96. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/PAGE-TYPE-INDIVIDUAL-TEMPLATE.md +123 -0
  97. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/PAGE-TYPE-SUMMARY-TEMPLATE.md +58 -0
  98. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/SPACING-TEMPLATE.md +119 -0
  99. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/STYLE-SYSTEM-TEMPLATE.md +117 -0
  100. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/TYPOGRAPHY-TEMPLATE.md +107 -0
  101. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/UI-STYLE-GUIDE-TEMPLATE.md +171 -0
  102. package/.speccrew/skills/speccrew-pm-requirement-analysis/SKILL.md +434 -0
  103. package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/BIZS-MODELING-TEMPLATE.md +332 -0
  104. package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/PRD-TEMPLATE.md +200 -0
  105. package/.speccrew/skills/speccrew-pm-requirement-assess/SKILL.md +195 -0
  106. package/.speccrew/skills/speccrew-project-diagnosis/SKILL.md +208 -0
  107. package/.speccrew/skills/speccrew-project-diagnosis/templates/DIAGNOSIS-REPORT-TEMPLATE.md +202 -0
  108. package/.speccrew/skills/speccrew-sd-backend/SKILL.md +188 -0
  109. package/.speccrew/skills/speccrew-sd-backend/templates/INDEX-TEMPLATE.md +85 -0
  110. package/.speccrew/skills/speccrew-sd-backend/templates/SD-BACKEND-TEMPLATE.md +269 -0
  111. package/.speccrew/skills/speccrew-sd-desktop/SKILL.md +192 -0
  112. package/.speccrew/skills/speccrew-sd-desktop/templates/INDEX-TEMPLATE.md +271 -0
  113. package/.speccrew/skills/speccrew-sd-desktop/templates/SD-DESKTOP-TEMPLATE.md +673 -0
  114. package/.speccrew/skills/speccrew-sd-frontend/SKILL.md +176 -0
  115. package/.speccrew/skills/speccrew-sd-frontend/templates/INDEX-TEMPLATE.md +184 -0
  116. package/.speccrew/skills/speccrew-sd-frontend/templates/SD-FRONTEND-TEMPLATE.md +382 -0
  117. package/.speccrew/skills/speccrew-sd-mobile/SKILL.md +189 -0
  118. package/.speccrew/skills/speccrew-sd-mobile/templates/INDEX-TEMPLATE.md +219 -0
  119. package/.speccrew/skills/speccrew-sd-mobile/templates/SD-MOBILE-TEMPLATE.md +534 -0
  120. package/.speccrew/skills/speccrew-test-case-design/SKILL.md +284 -0
  121. package/.speccrew/skills/speccrew-test-case-design/templates/TEST-CASE-DESIGN-TEMPLATE.md +263 -0
  122. package/.speccrew/skills/speccrew-test-code-gen/SKILL.md +313 -0
  123. package/.speccrew/skills/speccrew-test-code-gen/templates/TEST-CODE-PLAN-TEMPLATE.md +180 -0
  124. package/.speccrew/skills/speccrew-test-execute/SKILL.md +283 -0
  125. package/.speccrew/skills/speccrew-test-execute/templates/BUG-REPORT-TEMPLATE.md +50 -0
  126. package/.speccrew/skills/speccrew-test-execute/templates/TEST-REPORT-TEMPLATE.md +57 -0
  127. package/.speccrew/skills/speccrew-workflow-diagnose/SKILL.md +155 -0
  128. package/LICENSE +21 -0
  129. package/README.ar.md +318 -0
  130. package/README.en.md +318 -0
  131. package/README.es.md +318 -0
  132. package/README.md +340 -0
  133. package/bin/cli.js +62 -0
  134. package/lib/commands/doctor.js +138 -0
  135. package/lib/commands/init.js +231 -0
  136. package/lib/commands/list.js +114 -0
  137. package/lib/commands/uninstall.js +117 -0
  138. package/lib/commands/update.js +351 -0
  139. package/lib/ide-adapters.js +73 -0
  140. package/lib/utils.js +104 -0
  141. package/package.json +28 -0
  142. package/workspace-template/docs/configs/document-templates.json +667 -0
  143. package/workspace-template/docs/configs/platform-mapping.json +194 -0
  144. package/workspace-template/docs/configs/tech-stack-mappings.json +313 -0
  145. package/workspace-template/docs/configs/validation-rules.json +87 -0
  146. package/workspace-template/docs/rules/mermaid-rule.md +114 -0
  147. package/workspace-template/docs/solutions/Agent/346/212/200/350/203/275/345/256/232/344/271/211+/351/234/200/346/261/202/346/226/207/346/241/243+UML/344/275/277/347/224/250/346/250/241/346/235/277/357/274/210ISA-95/345/205/255/346/256/265/345/274/217/350/236/215/345/220/210/347/211/210/357/274/211.md +586 -0
  148. package/workspace-template/docs/solutions/agent-knowledge-map.md +238 -0
  149. package/workspace-template/docs/solutions/bizs-knowledge-pipeline.md +678 -0
  150. package/workspace-template/docs/solutions/harness.md +410 -0
  151. package/workspace-template/docs/solutions/knowledge-incremental-sync-spec.md +943 -0
  152. package/workspace-template/docs/solutions/techs-knowledge-pipeline.md +803 -0
  153. package/workspace-template/docs/solutions/workspace-structure.md +318 -0
@@ -0,0 +1,395 @@
1
+ ---
2
+ name: speccrew-fd-feature-design
3
+ description: Feature Design SOP. Guide Feature Designer Agent to transform PRD requirements into system feature specifications, including frontend prototypes, backend interface logic, and data model design. Does not involve specific technology implementation details. Use when Feature Designer needs to create feature spec from confirmed PRD.
4
+ tools: Read, Write, Glob, Grep
5
+ ---
6
+
7
+ # Trigger Scenarios
8
+
9
+ - PRD has been confirmed, user requests to start feature design
10
+ - User asks "Design this feature" or "Create feature specification" or "How should this feature work"
11
+ - Feature Designer Agent receives task to design system features from PRD
12
+
13
+ # Workflow
14
+
15
+ ## Step 1: Read PRD Input
16
+
17
+ Read in order:
18
+
19
+ 1. **Current iteration PRD**: `speccrew-workspace/iterations/{number}-{type}-{name}/01.product-requirement/[feature-name]-prd.md`
20
+ 2. **Feature spec template**: `speccrew-fd-feature-design/templates/FEATURE-SPEC-TEMPLATE.md`
21
+
22
+ **[Master-Sub PRD structure]** If master PRD exists, also read all sub PRDs:
23
+ - Master PRD: `[feature-name]-prd.md`
24
+ - Sub PRDs: `[feature-name]-sub-[module1].md`, `[feature-name]-sub-[module2].md`, etc.
25
+
26
+ ## Step 2: Load System Knowledge
27
+
28
+ ### 2.1 Read System Overview
29
+
30
+ Read the file to understand system context:
31
+ ```
32
+ speccrew-workspace/knowledges/bizs/system-overview.md
33
+ ```
34
+
35
+ ### 2.2 Load Related Module Overviews
36
+
37
+ Based on PRD content, identify related modules and read their overview files:
38
+ ```
39
+ speccrew-workspace/knowledges/bizs/{module-name}/{module-name}-overview.md
40
+ ```
41
+
42
+ ### 2.3 Query Knowledge Graph (Optional)
43
+
44
+ If cross-module relationships need analysis, use `speccrew-knowledge-graph-query` skill:
45
+
46
+ | Action | Use Case |
47
+ |--------|----------|
48
+ | `query-nodes` | Find all nodes in a module |
49
+ | `search` | Find related entities by keyword |
50
+ | `trace-upstream` | Impact analysis for existing entities |
51
+ | `trace-downstream` | Dependency analysis |
52
+
53
+ ## Step 3: Function Breakdown
54
+
55
+ Break down PRD functional requirements into implementable system functions.
56
+
57
+ For each function, identify:
58
+
59
+ | Aspect | Analysis Content |
60
+ |--------|------------------|
61
+ | **Frontend Changes** | New pages, components, or modifications to existing UI |
62
+ | **Backend Changes** | New interfaces or modifications to existing logic |
63
+ | **Data Changes** | New data structures or modifications to existing data |
64
+ | **System Relationship** | How this relates to existing system capabilities |
65
+
66
+ ### Mark Relationship to Existing System
67
+
68
+ | Marker | Meaning | Example |
69
+ |--------|---------|---------|
70
+ | `[EXISTING]` | Reuse current system capability | `[EXISTING] User authentication system` |
71
+ | `[MODIFIED]` | Enhance/change existing feature | `[MODIFIED] Add validation to user profile form` |
72
+ | `[NEW]` | Create brand new functionality | `[NEW] Order management module` |
73
+
74
+ **Checkpoint A: Present function breakdown to user for confirmation before proceeding.**
75
+
76
+ Ask: "Here is the function breakdown with [EXISTING]/[MODIFIED]/[NEW] markers. Does this align with your understanding of the requirements?"
77
+
78
+ ## Step 4: Determine Output Structure
79
+
80
+ Based on PRD structure, determine feature spec output structure:
81
+
82
+ | PRD Structure | Feature Spec Structure |
83
+ |---------------|------------------------|
84
+ | **Single PRD** | Single Feature Spec |
85
+ | **Master-Sub PRD** | Master Feature Spec + Sub Feature Specs (one per module) |
86
+
87
+ ### Master Feature Spec Structure
88
+
89
+ ```
90
+ 02.feature-design/
91
+ ├── [feature-name]-feature-spec.md # Master Feature Spec (overview + cross-module)
92
+ ├── [feature-name]-sub-[module1]-spec.md # Sub Feature Spec: Module 1
93
+ ├── [feature-name]-sub-[module2]-spec.md # Sub Feature Spec: Module 2
94
+ └── ...
95
+ ```
96
+
97
+ **Master Feature Spec MUST include:**
98
+ - Overall feature overview and goals
99
+ - Cross-module interaction diagram
100
+ - Module list with scope boundaries
101
+ - Cross-module interface contracts
102
+ - Shared data structures
103
+
104
+ **Each Sub Feature Spec covers ONE module:**
105
+ - Module-specific frontend design
106
+ - Module-specific backend interfaces
107
+ - Module-internal data model
108
+ - Interface contracts with other modules
109
+
110
+ ## Step 5: Frontend Design (Per Function)
111
+
112
+ For each function requiring frontend changes:
113
+
114
+ ### 5.1 UI Prototype
115
+
116
+ Create ASCII wireframes showing:
117
+ - Page/component layout
118
+ - Key UI elements and their positions
119
+ - Navigation structure
120
+
121
+ **Example ASCII Wireframe:**
122
+ ```
123
+ +--------------------------------------------------+
124
+ | Header: User Management |
125
+ +--------------------------------------------------+
126
+ | [Search] [Filter v] [+ New User] |
127
+ +--------------------------------------------------+
128
+ | +---------------------------------------------+ |
129
+ | | ID | Username | Email | Status | Actions | |
130
+ | |----|----------|----------|--------|---------| |
131
+ | | 1 | john_doe | john@... | Active | [Edit] | |
132
+ | | 2 | jane_smith|jane@... | Active | [Edit] | |
133
+ | +---------------------------------------------+ |
134
+ | [Previous] Page 1 of 5 [Next] |
135
+ +--------------------------------------------------+
136
+ ```
137
+
138
+ ### 5.2 Interface Element Descriptions
139
+
140
+ | Element | Type | Behavior |
141
+ |---------|------|----------|
142
+ | {element name} | {component type} | {description of behavior} |
143
+
144
+ ### 5.3 Interaction Flow
145
+
146
+ Document user actions and system responses:
147
+
148
+ ```
149
+ User Action → Frontend Response → Backend API Call
150
+ ```
151
+
152
+ **Example:**
153
+ ```
154
+ 1. User clicks "New User" button
155
+ → Frontend displays modal form
156
+ → No API call yet
157
+
158
+ 2. User fills form and clicks "Save"
159
+ → Frontend validates input
160
+ → Calls POST /api/users
161
+ → On success: closes modal, refreshes list
162
+ → On error: displays error message
163
+ ```
164
+
165
+ ### 5.4 Backend API Mapping
166
+
167
+ | Frontend Action | Backend API | Purpose |
168
+ |-----------------|-------------|---------|
169
+ | {action} | {API endpoint} | {what data is exchanged} |
170
+
171
+ ## Step 6: Backend Design (Per Function)
172
+
173
+ For each function requiring backend changes:
174
+
175
+ ### 6.1 API/Interface List
176
+
177
+ | Interface | Method | Description |
178
+ |-----------|--------|-------------|
179
+ | {name} | {GET/POST/PUT/DELETE} | {purpose, no technical implementation details} |
180
+
181
+ ### 6.2 Processing Logic Flow
182
+
183
+ For each interface, document:
184
+
185
+ | Stage | Description |
186
+ |-------|-------------|
187
+ | **Input Validation** | What business rules validate the input |
188
+ | **Business Logic** | Core processing steps (conceptual, not code) |
189
+ | **Data Operations** | What data to read/write |
190
+ | **Response** | What data to return |
191
+
192
+ **Example:**
193
+ ```
194
+ Interface: Create Order
195
+
196
+ Input Validation:
197
+ - User must be authenticated
198
+ - Product must be available
199
+ - Quantity must be positive
200
+
201
+ Business Logic:
202
+ 1. Check product inventory
203
+ 2. Calculate total price
204
+ 3. Create order record
205
+ 4. Reserve inventory
206
+
207
+ Data Operations:
208
+ - Read: product info, inventory count
209
+ - Write: order record, inventory reservation
210
+
211
+ Response:
212
+ - Order ID, status, estimated delivery
213
+ ```
214
+
215
+ ### 6.3 Data Access Scheme
216
+
217
+ | Operation | Data Target | Type |
218
+ |-----------|-------------|------|
219
+ | Read | {existing/new data} | [EXISTING]/[NEW] |
220
+ | Write | {existing/new data} | [EXISTING]/[NEW] |
221
+
222
+ ### 6.4 Cross-Module Interactions
223
+
224
+ **[Cross-module functions only]**
225
+
226
+ | This Module | Interacts With | Interface | Data Exchanged |
227
+ |-------------|----------------|-----------|----------------|
228
+ | {module} | {other module} | {API/Event} | {what data} |
229
+
230
+ ## Step 7: Data Model Design
231
+
232
+ ### 7.1 New Data Structures
233
+
234
+ For each new entity:
235
+
236
+ | Field | Type | Constraints | Description |
237
+ |-------|------|-------------|-------------|
238
+ | {field name} | {data type} | {required/unique/etc} | {purpose} |
239
+
240
+ ### 7.2 Modifications to Existing Data Structures
241
+
242
+ | Entity | Change Type | Details | Impact |
243
+ |--------|-------------|---------|--------|
244
+ | {entity} | Add field / Modify field / Remove field | {description} | {affected areas} |
245
+
246
+ ### 7.3 Data Relationships
247
+
248
+ **New Entity Relationships:**
249
+ ```
250
+ EntityA --1:N--> EntityB
251
+ EntityA --N:1--> EntityC
252
+ ```
253
+
254
+ **Relationships with Existing Entities:**
255
+ | New Entity | Existing Entity | Relationship |
256
+ |------------|-----------------|--------------|
257
+ | {new} | {existing} | {1:1 / 1:N / N:M} |
258
+
259
+ ### 7.4 Data Source Descriptions
260
+
261
+ | Data | Source | Update Frequency |
262
+ |------|--------|------------------|
263
+ | {data item} | {internal system / external API / user input} | {real-time / periodic / on-demand} |
264
+
265
+ ## Step 8: Business Rules and Constraints
266
+
267
+ ### 8.1 Permission Rules
268
+
269
+ | Function | Required Permission | Scope |
270
+ |----------|---------------------|-------|
271
+ | {function} | {permission name} | {global / module-specific / resource-specific} |
272
+
273
+ ### 8.2 Business Logic Rules
274
+
275
+ | Rule ID | Description | Trigger | Action |
276
+ |---------|-------------|---------|--------|
277
+ | BR-{number} | {rule description} | {when it applies} | {what happens} |
278
+
279
+ ### 8.3 Validation Rules
280
+
281
+ | Field | Frontend Validation | Backend Validation |
282
+ |-------|---------------------|---------------------|
283
+ | {field} | {client-side rules} | {server-side rules} |
284
+
285
+ ## Step 9: Present Complete Feature Spec for Confirmation (Checkpoint B)
286
+
287
+ Present summary to user before writing files:
288
+
289
+ ### Summary Structure
290
+
291
+ ```
292
+ Feature Design Summary for: {feature-name}
293
+
294
+ Functions Designed: {count}
295
+ ├── [EXISTING] {count} functions reuse existing capabilities
296
+ ├── [MODIFIED] {count} functions enhance existing features
297
+ └── [NEW] {count} functions are brand new
298
+
299
+ Frontend Components: {count} pages/components
300
+ Backend Interfaces: {count} APIs
301
+ Data Entities: {count} new, {count} modified
302
+
303
+ [Master-Sub] Output Structure:
304
+ - Master Feature Spec: {filename}
305
+ - Sub Feature Specs: {list of filenames}
306
+ ```
307
+
308
+ **Ask user to confirm:**
309
+ 1. Is the frontend prototype appropriate for user needs?
310
+ 2. Is the backend logic flow correct and complete?
311
+ 3. Is the data model reasonable and extensible?
312
+ 4. Are all business rules and constraints captured?
313
+ 5. **[Master-Sub]** Is the module breakdown appropriate?
314
+
315
+ ## Step 10: Write Files
316
+
317
+ ### 10.1 Determine Output Paths
318
+
319
+ **Single Feature Spec:**
320
+ ```
321
+ speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/[feature-name]-feature-spec.md
322
+ ```
323
+
324
+ **Master-Sub Feature Specs:**
325
+ ```
326
+ speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/
327
+ ├── [feature-name]-feature-spec.md
328
+ ├── [feature-name]-sub-[module1]-spec.md
329
+ ├── [feature-name]-sub-[module2]-spec.md
330
+ └── ...
331
+ ```
332
+
333
+ If the iteration directory does not exist, refer to the `000-sample` directory structure to create it.
334
+
335
+ ### 10.2 Write Feature Spec Documents
336
+
337
+ Fill in according to template structure, requirements:
338
+ - **Feature Overview**: One paragraph explaining what this feature does
339
+ - **Function Breakdown**: All functions with [EXISTING]/[MODIFIED]/[NEW] markers
340
+ - **Frontend Design**: ASCII wireframes, interaction flows, API mapping
341
+ - **Backend Design**: Interface list, logic flows, data access schemes
342
+ - **Data Model**: Entity definitions, relationships, modifications
343
+ - **Business Rules**: Permissions, validation, business logic rules
344
+ - **Cross-Module Interactions**: **[If applicable]** Interface contracts between modules
345
+
346
+ ### 10.3 Mermaid Diagram Requirements
347
+
348
+ When generating Mermaid diagrams (architecture diagrams, flow diagrams, etc.), you **MUST** follow the compatibility guidelines defined in:
349
+ - **Reference**: `speccrew-workspace/docs/rules/mermaid-rule.md`
350
+
351
+ Key requirements:
352
+ - Use only basic node definitions: `A[text content]`
353
+ - No HTML tags (e.g., `<br/>`)
354
+ - No nested subgraphs
355
+ - No `direction` keyword
356
+ - No `style` definitions
357
+ - No special characters in node text
358
+ - Use standard `graph TB/LR` or `sequenceDiagram` syntax only
359
+
360
+ ### 10.4 Call API Contract Skill
361
+
362
+ After feature spec documents are complete, call `speccrew-fd-api-contract/SKILL.md` to generate API contract document.
363
+
364
+ # Key Rules
365
+
366
+ | Rule | Description |
367
+ |------|-------------|
368
+ | **No Technology Decisions** | Do NOT specify frameworks, databases, or implementation technologies |
369
+ | **Focus on WHAT not HOW** | Describe what the system does, not how it's technically implemented |
370
+ | **ASCII Wireframes Only** | Use ASCII art for UI prototypes, not specific design tools |
371
+ | **Mermaid Compatibility** | All diagrams must follow mermaid-rule.md guidelines |
372
+ | **Clear Markers** | Always use [EXISTING]/[MODIFIED]/[NEW] to indicate system relationship |
373
+ | **Checkpoint Before Write** | Always get user confirmation at Checkpoint B before writing files |
374
+
375
+ # Checklist
376
+
377
+ - [ ] PRD has been read, all P0 requirements covered
378
+ - [ ] **[Master-Sub]** All sub PRDs have been read
379
+ - [ ] System overview loaded for context
380
+ - [ ] Related module overviews loaded
381
+ - [ ] **[Cross-module]** Knowledge graph queried for relationship analysis
382
+ - [ ] Function breakdown completed with [EXISTING]/[MODIFIED]/[NEW] markers
383
+ - [ ] Checkpoint A passed: function breakdown confirmed with user
384
+ - [ ] Output structure determined (single vs master-sub)
385
+ - [ ] Frontend design includes ASCII wireframes and interaction flows
386
+ - [ ] Backend design includes interface list and logic flows
387
+ - [ ] Data model includes new entities and modifications to existing
388
+ - [ ] Business rules and constraints documented
389
+ - [ ] Checkpoint B passed: complete feature spec confirmed with user
390
+ - [ ] **[Master-Sub]** Master spec includes cross-module overview and contracts
391
+ - [ ] **[Master-Sub]** Each sub spec covers exactly one module
392
+ - [ ] All Mermaid diagrams follow mermaid-rule.md
393
+ - [ ] No specific technology decisions included
394
+ - [ ] Files written to correct paths
395
+ - [ ] API contract skill called after writing