speccrew 0.1.9 → 0.1.10

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.
@@ -12,6 +12,18 @@ tools: Bash, Edit, Write, Glob, Grep, Read
12
12
 
13
13
  # Workflow
14
14
 
15
+ ## Absolute Constraints
16
+
17
+ > **These rules apply to Task Record document generation. Violation = task failure.**
18
+
19
+ 1. **FORBIDDEN: `create_file` for Task Record** — NEVER use `create_file` to write the Task Record document. It MUST be created by copying the template then filling sections with `search_replace`. `create_file` produces truncated output on large files.
20
+
21
+ 2. **FORBIDDEN: Full-file rewrite** — NEVER replace the entire Task Record content in a single operation. Always use targeted `search_replace` on specific sections.
22
+
23
+ 3. **MANDATORY: Template-first workflow** — Copy template MUST execute before fill sections. Skipping copy and writing content directly is FORBIDDEN.
24
+
25
+ 4. **CLARIFICATION: Source code is NOT template-filled** — Actual source code files are written directly based on design blueprints. The template-fill workflow applies ONLY to the Task Record document.
26
+
15
27
  ## Step 1: Read Design Documents
16
28
 
17
29
  Read in order:
@@ -29,11 +41,25 @@ Read in order:
29
41
 
30
42
  ## Step 2: Create Task Record File
31
43
 
32
- Before coding, create the task record:
44
+ Before coding, create the task record using template-fill workflow:
45
+
46
+ ### 2a Copy Template to Task Record Path
47
+
48
+ 1. **Read the template file**: `templates/TASK-RECORD-TEMPLATE.md`
49
+ 2. **Replace top-level placeholders** (module name, feature name, platform ID, iteration info)
50
+ 3. **Create the document** using `create_file`:
51
+ - Target path: `speccrew-workspace/iterations/{number}-{type}-{name}/04.development/{platform_id}/[module]-task.md`
52
+ - Content: Template with top-level placeholders replaced
53
+ 4. **Verify**: Document has complete section structure ready for filling
54
+
55
+ ### 2b Fill Task Record Sections Using search_replace
33
56
 
34
- **Path**: `speccrew-workspace/iterations/{number}-{type}-{name}/04.development/{platform_id}/[module]-task.md`
57
+ Fill each section with design metadata extracted from input documents.
35
58
 
36
- Initialize with design metadata and prepare task checklist structure.
59
+ > ⚠️ **CRITICAL CONSTRAINTS:**
60
+ > - **FORBIDDEN: `create_file` to rewrite the entire document**
61
+ > - **MUST use `search_replace` to fill each section individually**
62
+ > - **All section titles MUST be preserved**
37
63
 
38
64
  ## Step 3: Extract Task List
39
65
 
@@ -12,6 +12,18 @@ tools: Bash, Edit, Write, Glob, Grep, Read
12
12
 
13
13
  # Workflow
14
14
 
15
+ ## Absolute Constraints
16
+
17
+ > **These rules apply to Task Record document generation. Violation = task failure.**
18
+
19
+ 1. **FORBIDDEN: `create_file` for Task Record** — NEVER use `create_file` to write the Task Record document. It MUST be created by copying the template then filling sections with `search_replace`. `create_file` produces truncated output on large files.
20
+
21
+ 2. **FORBIDDEN: Full-file rewrite** — NEVER replace the entire Task Record content in a single operation. Always use targeted `search_replace` on specific sections.
22
+
23
+ 3. **MANDATORY: Template-first workflow** — Copy template MUST execute before fill sections. Skipping copy and writing content directly is FORBIDDEN.
24
+
25
+ 4. **CLARIFICATION: Source code is NOT template-filled** — Actual source code files are written directly based on design blueprints. The template-fill workflow applies ONLY to the Task Record document.
26
+
15
27
  ## Step 1: Read Design Documents
16
28
 
17
29
  Read in order:
@@ -43,15 +55,31 @@ Use Glob/Grep to understand current codebase:
43
55
 
44
56
  Document findings for reference in later steps.
45
57
 
46
- ## Step 3: Extract Task List
58
+ ## Step 3: Extract Task List and Create Task Record
47
59
 
48
- Create task record file:
60
+ ### 3.1 Create Task Record File Using Template-Fill Workflow
49
61
 
50
62
  **Path**: `speccrew-workspace/iterations/{number}-{type}-{name}/04.development/{platform_id}/[feature-name]-task.md`
51
63
 
52
- **Read Template**: `speccrew-dev-desktop/templates/TASK-RECORD-TEMPLATE.md`
64
+ #### 3.1a Copy Template to Task Record Path
65
+
66
+ 1. **Read the template file**: `speccrew-dev-desktop/templates/TASK-RECORD-TEMPLATE.md`
67
+ 2. **Replace top-level placeholders** (feature name, platform ID, iteration info)
68
+ 3. **Create the document** using `create_file`:
69
+ - Target path: `speccrew-workspace/iterations/{number}-{type}-{name}/04.development/{platform_id}/[feature-name]-task.md`
70
+ - Content: Template with top-level placeholders replaced
71
+ 4. **Verify**: Document has complete section structure ready for filling
72
+
73
+ #### 3.1b Fill Task Record Sections Using search_replace
74
+
75
+ Fill each section with task checklist and design metadata extracted from input documents.
76
+
77
+ > ⚠️ **CRITICAL CONSTRAINTS:**
78
+ > - **FORBIDDEN: `create_file` to rewrite the entire document**
79
+ > - **MUST use `search_replace` to fill each section individually**
80
+ > - **All section titles MUST be preserved**
53
81
 
54
- ### Desktop-Specific Task Types
82
+ ### 3.2 Desktop-Specific Task Types
55
83
 
56
84
  | Task Type | Description | Example |
57
85
  |-----------|-------------|---------|
@@ -12,6 +12,18 @@ tools: Bash, Edit, Write, Glob, Grep, Read
12
12
 
13
13
  # Workflow
14
14
 
15
+ ## Absolute Constraints
16
+
17
+ > **These rules apply to Task Record document generation. Violation = task failure.**
18
+
19
+ 1. **FORBIDDEN: `create_file` for Task Record** — NEVER use `create_file` to write the Task Record document. It MUST be created by copying the template then filling sections with `search_replace`. `create_file` produces truncated output on large files.
20
+
21
+ 2. **FORBIDDEN: Full-file rewrite** — NEVER replace the entire Task Record content in a single operation. Always use targeted `search_replace` on specific sections.
22
+
23
+ 3. **MANDATORY: Template-first workflow** — Copy template MUST execute before fill sections. Skipping copy and writing content directly is FORBIDDEN.
24
+
25
+ 4. **CLARIFICATION: Source code is NOT template-filled** — Actual source code files are written directly based on design blueprints. The template-fill workflow applies ONLY to the Task Record document.
26
+
15
27
  ## Step 1: Read Design Documents
16
28
 
17
29
  Read in order:
@@ -66,9 +78,27 @@ Wait for user approval before writing any code.
66
78
 
67
79
  ### 3.4 Write Initial Task Record
68
80
 
69
- Write to: `speccrew-workspace/iterations/{number}-{type}-{name}/04.development/{platform_id}/{feature-name}-tasks.md`
81
+ Create the task record using template-fill workflow:
82
+
83
+ **Target Path**: `speccrew-workspace/iterations/{number}-{type}-{name}/04.development/{platform_id}/{feature-name}-tasks.md`
84
+
85
+ #### 3.4a Copy Template to Task Record Path
86
+
87
+ 1. **Read the template file**: `speccrew-dev-frontend/templates/TASK-RECORD-TEMPLATE.md` (from Step 1)
88
+ 2. **Replace top-level placeholders** (feature name, platform ID, iteration info)
89
+ 3. **Create the document** using `create_file`:
90
+ - Target path: `speccrew-workspace/iterations/{number}-{type}-{name}/04.development/{platform_id}/{feature-name}-tasks.md`
91
+ - Content: Template with top-level placeholders replaced
92
+ 4. **Verify**: Document has complete section structure ready for filling
93
+
94
+ #### 3.4b Fill Task Record Sections Using search_replace
95
+
96
+ Fill each section with task checklist and design metadata.
70
97
 
71
- Use template from Step 1.
98
+ > ⚠️ **CRITICAL CONSTRAINTS:**
99
+ > - **FORBIDDEN: `create_file` to rewrite the entire document**
100
+ > - **MUST use `search_replace` to fill each section individually**
101
+ > - **All section titles MUST be preserved**
72
102
 
73
103
  ## Step 4: Execute Tasks
74
104
 
@@ -12,6 +12,18 @@ tools: Bash, Edit, Write, Glob, Grep, Read
12
12
 
13
13
  # Workflow
14
14
 
15
+ ## Absolute Constraints
16
+
17
+ > **These rules apply to Task Record document generation. Violation = task failure.**
18
+
19
+ 1. **FORBIDDEN: `create_file` for Task Record** — NEVER use `create_file` to write the Task Record document. It MUST be created by copying the template then filling sections with `search_replace`. `create_file` produces truncated output on large files.
20
+
21
+ 2. **FORBIDDEN: Full-file rewrite** — NEVER replace the entire Task Record content in a single operation. Always use targeted `search_replace` on specific sections.
22
+
23
+ 3. **MANDATORY: Template-first workflow** — Copy template MUST execute before fill sections. Skipping copy and writing content directly is FORBIDDEN.
24
+
25
+ 4. **CLARIFICATION: Source code is NOT template-filled** — Actual source code files are written directly based on design blueprints. The template-fill workflow applies ONLY to the Task Record document.
26
+
15
27
  ## Step 1: Read Design Documents
16
28
 
17
29
  Read in order:
@@ -81,11 +93,27 @@ Use `MB-001`, `MB-002`, etc. for mobile tasks.
81
93
 
82
94
  ## Step 4: Create Task Record File
83
95
 
84
- Before writing code, create task record file:
96
+ Before writing code, create task record file using template-fill workflow:
85
97
 
86
98
  **Path**: `speccrew-workspace/iterations/{iteration}/04.development/{platform_id}/{module}-task.md`
87
99
 
88
- Use `TASK-RECORD-TEMPLATE.md` for structure.
100
+ ### 4a Copy Template to Task Record Path
101
+
102
+ 1. **Read the template file**: `speccrew-dev-mobile/templates/TASK-RECORD-TEMPLATE.md`
103
+ 2. **Replace top-level placeholders** (module name, feature name, platform ID, iteration info)
104
+ 3. **Create the document** using `create_file`:
105
+ - Target path: `speccrew-workspace/iterations/{iteration}/04.development/{platform_id}/{module}-task.md`
106
+ - Content: Template with top-level placeholders replaced
107
+ 4. **Verify**: Document has complete section structure ready for filling
108
+
109
+ ### 4b Fill Task Record Sections Using search_replace
110
+
111
+ Fill each section with task checklist and design metadata extracted from input documents.
112
+
113
+ > ⚠️ **CRITICAL CONSTRAINTS:**
114
+ > - **FORBIDDEN: `create_file` to rewrite the entire document**
115
+ > - **MUST use `search_replace` to fill each section individually**
116
+ > - **All section titles MUST be preserved**
89
117
 
90
118
  ## Step 5: Execute Task by Task
91
119
 
@@ -11,6 +11,16 @@ tools: Read, Write, Glob, Grep
11
11
 
12
12
  # Workflow
13
13
 
14
+ ## Absolute Constraints
15
+
16
+ > **These rules apply to ALL steps. Violation = task failure.**
17
+
18
+ 1. **FORBIDDEN: `create_file` for documents** — NEVER use `create_file` to write the API contract document. It MUST be created by copying the template (Step 4a) then filling sections with `search_replace` (Step 4b). `create_file` produces truncated output on large files.
19
+
20
+ 2. **FORBIDDEN: Full-file rewrite** — NEVER replace the entire document content in a single operation. Always use targeted `search_replace` on specific sections.
21
+
22
+ 3. **MANDATORY: Template-first workflow** — Step 4a (copy template) MUST execute before Step 4b (fill sections). Skipping Step 4a and writing content directly is FORBIDDEN.
23
+
14
24
  ## Step 1: Read Input
15
25
 
16
26
  1. Feature spec document: `speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/[feature-name]-feature-spec.md`
@@ -38,9 +48,35 @@ Complete definition for each API:
38
48
  - Success response example (JSON)
39
49
  - Error code list
40
50
 
41
- ## Step 4: Write to File
51
+ ## Step 4: Write API Contract Document
52
+
53
+ ### 4a Copy Template to Document Path
54
+
55
+ 1. **Read the template file**: `templates/API-CONTRACT-TEMPLATE.md`
56
+ 2. **Replace top-level placeholders** (feature name, date, etc.)
57
+ 3. **Create the document** using `create_file`:
58
+ - Target path: `speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/[feature-name]-api-contract.md`
59
+ - Content: Template with top-level placeholders replaced
60
+ 4. **Verify**: Document has complete section structure ready for filling
61
+
62
+ ### 4b Fill Each Section Using search_replace
63
+
64
+ Fill each section with API contract details from Step 2 and Step 3.
65
+
66
+ > ⚠️ **CRITICAL CONSTRAINTS:**
67
+ > - **FORBIDDEN: `create_file` to rewrite the entire document** — it destroys template structure
68
+ > - **MUST use `search_replace` to fill each section individually**
69
+ > - **All section titles MUST be preserved**
70
+
71
+ **Section Filling Order:**
72
+
73
+ | Section | Content Source |
74
+ |---------|---------------|
75
+ | **API List Overview** | API list table from Step 2 |
76
+ | **API Contract Details** | Full contract definitions from Step 3 (per API) |
77
+ | **Error Code Summary** | Aggregated error codes across all APIs |
42
78
 
43
- Write path: `speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/[feature-name]-api-contract.md`
79
+ For each API, locate its section anchor in the template and use `search_replace` to fill request parameters, response structure, success example, and error codes.
44
80
 
45
81
  ## Step 5: Joint Confirmation
46
82
 
@@ -12,6 +12,16 @@ tools: Read, Write, Glob, Grep
12
12
 
13
13
  # Workflow
14
14
 
15
+ ## Absolute Constraints
16
+
17
+ > **These rules apply to ALL steps. Violation = task failure.**
18
+
19
+ 1. **FORBIDDEN: `create_file` for documents** — NEVER use `create_file` to write the feature spec document. Documents MUST be created by copying the template (Step 10.2a) then filling sections with `search_replace` (Step 10.2b). `create_file` produces truncated output on large files.
20
+
21
+ 2. **FORBIDDEN: Full-file rewrite** — NEVER replace the entire document content in a single operation. Always use targeted `search_replace` on specific sections.
22
+
23
+ 3. **MANDATORY: Template-first workflow** — Step 10.2a (copy template) MUST execute before Step 10.2b (fill sections). Skipping Step 10.2a and writing content directly is FORBIDDEN.
24
+
15
25
  ## Step 1: Read PRD Input
16
26
 
17
27
  Read in order:
@@ -408,16 +418,42 @@ speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/
408
418
 
409
419
  If the iteration directory does not exist, refer to the `000-sample` directory structure to create it.
410
420
 
411
- ### 10.2 Write Feature Spec Documents
421
+ ### 10.2a Copy Template to Document Path
422
+
423
+ 1. **Read the template file**: `templates/FEATURE-SPEC-TEMPLATE.md`
424
+ 2. **Replace top-level placeholders** in the template content:
425
+ - `{Feature Name}` → actual feature name
426
+ - Other top-level identifiers from PRD input
427
+ 3. **Create the document file** using `create_file`:
428
+ - Target path: determined in Step 10.1
429
+ - Content: Template with top-level placeholders replaced
430
+ 4. **Verify**: Document should have complete section structure ready for filling
431
+
432
+ ### 10.2b Fill Each Section Using search_replace
433
+
434
+ Fill each section of the document with actual data from analysis steps.
435
+
436
+ > ⚠️ **CRITICAL CONSTRAINTS:**
437
+ > - **FORBIDDEN: `create_file` to rewrite the entire document** — it destroys template structure
438
+ > - **MUST use `search_replace` to fill each section individually**
439
+ > - **All section titles and numbering MUST be preserved** — do not delete or renumber
440
+ > - If a section has no applicable content, keep the section title and replace placeholder with "N/A"
441
+
442
+ **Section Filling Order:**
443
+
444
+ Fill sections sequentially using `search_replace` for each content block:
445
+
446
+ | Section | Content Source |
447
+ |---------|---------------|
448
+ | **Feature Overview** | One paragraph explaining what this feature does |
449
+ | **Function Breakdown** | All functions with [EXISTING]/[MODIFIED]/[NEW] markers |
450
+ | **Frontend Design** | ASCII wireframes, interaction flows, API mapping |
451
+ | **Backend Design** | Interface list, logic flows, data access schemes |
452
+ | **Data Model** | Entity definitions, relationships, modifications |
453
+ | **Business Rules** | Permissions, validation, business logic rules |
454
+ | **Cross-Module Interactions** | **[If applicable]** Interface contracts between modules |
412
455
 
413
- Fill in according to template structure, requirements:
414
- - **Feature Overview**: One paragraph explaining what this feature does
415
- - **Function Breakdown**: All functions with [EXISTING]/[MODIFIED]/[NEW] markers
416
- - **Frontend Design**: ASCII wireframes, interaction flows, API mapping
417
- - **Backend Design**: Interface list, logic flows, data access schemes
418
- - **Data Model**: Entity definitions, relationships, modifications
419
- - **Business Rules**: Permissions, validation, business logic rules
420
- - **Cross-Module Interactions**: **[If applicable]** Interface contracts between modules
456
+ For Master-Sub specs, repeat Step 10.2a + 10.2b for each sub-spec document.
421
457
 
422
458
  ### 10.3 Mermaid Diagram Requirements
423
459
 
@@ -56,6 +56,16 @@ Extract and aggregate **UI design patterns** from bizs pipeline analyzed feature
56
56
  └── ...
57
57
  ```
58
58
 
59
+ ## Absolute Constraints
60
+
61
+ > **These rules apply to ALL document generation steps. Violation = task failure.**
62
+
63
+ 1. **FORBIDDEN: `create_file` for pattern documents** — NEVER use `create_file` to write pattern documents. Each document MUST be created by copying the appropriate template then filling sections with `search_replace`.
64
+
65
+ 2. **FORBIDDEN: Full-file rewrite** — NEVER replace the entire document content in a single operation. Always use targeted `search_replace` on specific sections.
66
+
67
+ 3. **MANDATORY: Template-first workflow** — Copy template MUST execute before filling sections for every pattern document.
68
+
59
69
  ## Workflow Overview
60
70
 
61
71
  ```mermaid
@@ -156,23 +166,34 @@ graph TB
156
166
 
157
167
  ## Step 5: Generate Pattern Documents
158
168
 
159
- **Goal**: Create pattern documents for each identified pattern.
169
+ **Goal**: Create pattern documents for each identified pattern using template-fill workflow.
160
170
 
161
- **Action**:
162
- - For each identified pattern, generate a `.md` document using the appropriate template
163
- - Place documents in corresponding subdirectories:
164
- - Page types → `{output_path}/page-types/`
165
- - Component patterns `{output_path}/components/`
166
- - Layout patterns `{output_path}/layouts/`
171
+ ### 5.1 Template Selection
172
+
173
+ | Pattern Category | Template File | Output Directory |
174
+ |-----------------|---------------|------------------|
175
+ | Page types | `templates/PAGE-TYPE-TEMPLATE.md` | `{output_path}/page-types/` |
176
+ | Component patterns | `templates/COMPONENT-PATTERN-TEMPLATE.md` | `{output_path}/components/` |
177
+ | Layout patterns | `templates/LAYOUT-PATTERN-TEMPLATE.md` | `{output_path}/layouts/` |
167
178
 
168
179
  **File Naming Convention**:
169
180
  - Use `kebab-case` for pattern names
170
181
  - Examples: `list-page.md`, `search-filter-bar.md`, `sidebar-content.md`
171
182
 
172
- **Template Application**:
173
- - Use `PAGE-TYPE-TEMPLATE.md` for page type patterns
174
- - Use `COMPONENT-PATTERN-TEMPLATE.md` for component patterns
175
- - Use `LAYOUT-PATTERN-TEMPLATE.md` for layout patterns
183
+ ### 5.2 For Each Pattern: Copy Template to Document Path
184
+
185
+ For each identified pattern:
186
+ 1. **Select the appropriate template** based on pattern category
187
+ 2. **Replace top-level placeholders** (pattern name, category, etc.)
188
+ 3. **Create the document** using `create_file` at the corresponding output path
189
+ 4. **Verify**: Document has complete section structure ready for filling
190
+
191
+ ### 5.3 For Each Pattern: Fill Sections Using search_replace
192
+
193
+ > ⚠️ **CRITICAL CONSTRAINTS:**
194
+ > - **FORBIDDEN: `create_file` to rewrite the entire document**
195
+ > - **MUST use `search_replace` to fill each section individually**
196
+ > - **All section titles MUST be preserved**
176
197
 
177
198
  **Content Requirements**:
178
199
  1. **ASCII wireframes**: Must be generalized versions (not direct copies from specific features)
@@ -49,6 +49,16 @@ flowchart TD
49
49
  Step6 --> End([End])
50
50
  ```
51
51
 
52
+ ### Absolute Constraints
53
+
54
+ > **These rules apply to ALL steps. Violation = task failure.**
55
+
56
+ 1. **FORBIDDEN: `create_file` for overview document** — NEVER use `create_file` to write the module overview document. If the initial skeleton exists, use `search_replace` to fill sections. If no skeleton exists, copy the template first then fill with `search_replace`.
57
+
58
+ 2. **FORBIDDEN: Full-file rewrite** — NEVER replace the entire document content in a single operation. Always use targeted `search_replace` on specific sections.
59
+
60
+ 3. **MANDATORY: Template-first workflow** — Template (or existing skeleton) MUST be in place before filling sections. Writing content without a template base is FORBIDDEN.
61
+
52
62
  ### Step 1: Read Prerequisites
53
63
 
54
64
  Before processing, read all required files:
@@ -129,16 +139,35 @@ Collect all business rules from feature details:
129
139
  1. **Read Configuration**:
130
140
  - Read `speccrew-workspace/docs/rules/mermaid-rule.md` - Get Mermaid diagram compatibility guidelines
131
141
 
132
- 2. **Use template `templates/MODULE-OVERVIEW-TEMPLATE.md`, fill all sections**:
133
- - Follow [Mermaid Diagram Guide](#mermaid-diagram-guide) for diagram generation
142
+ 2. **Prepare document file (if not already exists)**:
143
+ - If the initial skeleton from Step 1 exists at `module_path/module_name-overview.md`:
144
+ - Use the existing file as the base (sections 1-2 already populated)
145
+ - If no skeleton exists:
146
+ - **Read template**: `templates/MODULE-OVERVIEW-TEMPLATE.md`
147
+ - **Replace top-level placeholders** (module name, language, etc.)
148
+ - **Create document** using `create_file` at `module_path/module_name-overview.md`
149
+
150
+ 3. **Fill each section using search_replace**:
151
+
152
+ > ⚠️ **CRITICAL CONSTRAINTS:**
153
+ > - **FORBIDDEN: `create_file` to rewrite the entire document** — it destroys template/skeleton structure
154
+ > - **MUST use `search_replace` to fill each section individually**
155
+ > - **All section titles and numbering MUST be preserved**
156
+ > - If a section has no applicable content, keep the section title and replace placeholder with "N/A"
157
+
158
+ **Locate and fill via `search_replace`:**
134
159
 
135
160
  **Section 1: Module Basic Info** (from initial version)
136
161
  - Keep existing information
137
162
 
163
+ **Locate and fill via `search_replace`:**
164
+
138
165
  **Section 2: Feature List** (from initial version)
139
166
  - Keep feature list table
140
167
  - Ensure all links to {{feature_name}}.md are correct
141
168
 
169
+ **Locate and fill via `search_replace`:**
170
+
142
171
  **Section 3: Business Entities** (NEW)
143
172
 
144
173
  **Backend example:**
@@ -154,6 +183,8 @@ Collect all business rules from feature details:
154
183
 
155
184
  Include ER diagram based on entity relationships.
156
185
 
186
+ **Locate and fill via `search_replace`:**
187
+
157
188
  **Section 4: Dependencies** (NEW)
158
189
 
159
190
  **Backend example:**
@@ -167,6 +198,8 @@ Include ER diagram based on entity relationships.
167
198
  | Imports | UserStore | Get user state | Store injection |
168
199
  | Imports | UserCard | Display user info | Component import |
169
200
 
201
+ **Locate and fill via `search_replace`:**
202
+
170
203
  **Section 5: Core Business Flows** (NEW)
171
204
 
172
205
  Based on feature interactions, identify core flows:
@@ -177,6 +210,8 @@ Create Order: Validate params → Calculate amount → Save to DB → Notify dow
177
210
  **Frontend example:**
178
211
  Order List: Load data → Display list → User selects → Load detail → Display detail → Edit → Submit → Update state
179
212
 
213
+ **Locate and fill via `search_replace`:**
214
+
180
215
  **Section 6: Business Rules** (NEW)
181
216
 
182
217
  | Rule ID | Rule Name | Description | Related Features |
@@ -40,6 +40,16 @@ Worker Agent (speccrew-task-worker)
40
40
 
41
41
  ## Workflow
42
42
 
43
+ ### Absolute Constraints
44
+
45
+ > **These rules apply to ALL steps. Violation = task failure.**
46
+
47
+ 1. **FORBIDDEN: `create_file` for documents** — NEVER use `create_file` to write the system overview document. It MUST be created by copying the template (Step 7a) then filling sections with `search_replace` (Step 7b). `create_file` produces truncated output on large files.
48
+
49
+ 2. **FORBIDDEN: Full-file rewrite** — NEVER replace the entire document content in a single operation. Always use targeted `search_replace` on specific sections.
50
+
51
+ 3. **MANDATORY: Template-first workflow** — Step 7a (copy template) MUST execute before Step 7b (fill sections). Skipping Step 7a and writing content directly is FORBIDDEN.
52
+
43
53
  ### Prerequisites
44
54
 
45
55
  Before starting, verify:
@@ -219,8 +229,21 @@ Create flow-module mapping matrix:
219
229
  - **CRITICAL**: Use the Skill tool to invoke `speccrew-get-timestamp` (no parameters needed, uses default format `YYYY-MM-DD-HHmmss`, returns timestamp string e.g. `2026-03-17-132645`)
220
230
  - Use the returned timestamp as generation timestamp in document
221
231
 
222
- 3. **Use template `templates/SYSTEM-OVERVIEW-TEMPLATE.md`, fill all sections**:
223
- - Follow [Mermaid Diagram Guide](#mermaid-diagram-guide) for diagram generation
232
+ 4. **Copy template to document path (Step 7a)**:
233
+ - Read template: `templates/SYSTEM-OVERVIEW-TEMPLATE.md` (already loaded in Step 0)
234
+ - Replace top-level placeholders (system name, generation timestamp, tech stack info)
235
+ - Create document using `create_file` at: `output_path/system-overview.md`
236
+ - Verify: Document has complete section structure ready for filling
237
+
238
+ 5. **Fill each section using search_replace (Step 7b)**:
239
+
240
+ > ⚠️ **CRITICAL CONSTRAINTS:**
241
+ > - **FORBIDDEN: `create_file` to rewrite the entire document** — it destroys template structure
242
+ > - **MUST use `search_replace` to fill each section individually**
243
+ > - **All section titles MUST be preserved**
244
+ > - If a section has no applicable content, keep the section title and replace placeholder with "N/A"
245
+
246
+ **Fill via `search_replace`:**
224
247
 
225
248
  **Section: Index and Overview** (NEW)
226
249
  - Generation timestamp (from get-timestamp skill)
@@ -228,27 +251,37 @@ Create flow-module mapping matrix:
228
251
  - Statistics: module count, entity count, API count, flow count
229
252
  - Module quick index table
230
253
 
254
+ **Fill via `search_replace`:**
255
+
231
256
  **Section 1: System Overview**
232
257
  - System name from project config
233
258
  - Core positioning
234
259
  - Target users
235
260
  - Deployment type
236
261
 
262
+ **Fill via `search_replace`:**
263
+
237
264
  **Section 2: Module Topology**
238
265
  - Business domain diagram
239
266
  - Module hierarchy diagram
240
267
  - Module dependency diagram
241
268
  - Module index table (from Step 3)
242
269
 
270
+ **Fill via `search_replace`:**
271
+
243
272
  **Section 3: End-to-End Business Flows**
244
273
  - Core business process list
245
274
  - Flow-module mapping matrix (from Step 6)
246
275
  - Typical flow diagrams
247
276
 
277
+ **Fill via `search_replace`:**
278
+
248
279
  **Section 4: System Boundaries and Integration**
249
280
  - External system integration diagram
250
281
  - Integration interface list
251
282
 
283
+ **Fill via `search_replace`:**
284
+
252
285
  **Section 5: Requirement Assessment Guide**
253
286
  - Reference to `speccrew-pm-requirement-assess` skill
254
287
  - Quick location guide (which section to reference)
@@ -74,6 +74,16 @@ Generate the following documents in `{output_path}/`:
74
74
 
75
75
  ## Workflow
76
76
 
77
+ ### Absolute Constraints
78
+
79
+ > **These rules apply to ALL document generation steps. Violation = task failure.**
80
+
81
+ 1. **FORBIDDEN: `create_file` for analysis documents** — NEVER use `create_file` to write any UI analysis document. Each document MUST be created by copying the appropriate template then filling sections with `search_replace`. `create_file` produces truncated output on large files.
82
+
83
+ 2. **FORBIDDEN: Full-file rewrite** — NEVER replace the entire document content in a single operation. Always use targeted `search_replace` on specific sections.
84
+
85
+ 3. **MANDATORY: Template-first workflow** — For every output document, the corresponding template MUST be copied to the target path first, then sections filled with `search_replace`. Skipping copy and writing content directly is FORBIDDEN.
86
+
77
87
  ### Step 0: Read All Templates
78
88
 
79
89
  Before analysis, read all template files to understand document structures and required content:
@@ -187,6 +197,16 @@ For each identified page type, extract according to `PAGE-TYPE-INDIVIDUAL-TEMPLA
187
197
 
188
198
  **Generate**: `page-types/[type]-pages.md` for each discovered type
189
199
 
200
+ #### Document Generation (per document)
201
+
202
+ **For `page-types/page-type-summary.md`:**
203
+ 1. Copy template `templates/PAGE-TYPE-SUMMARY-TEMPLATE.md` → `{output_path}/page-types/page-type-summary.md`
204
+ 2. Fill each section using `search_replace` (FORBIDDEN: `create_file` rewrite)
205
+
206
+ **For each `page-types/[type]-pages.md`:**
207
+ 1. Copy template `templates/PAGE-TYPE-INDIVIDUAL-TEMPLATE.md` → `{output_path}/page-types/[type]-pages.md`
208
+ 2. Fill each section using `search_replace` (FORBIDDEN: `create_file` rewrite)
209
+
190
210
  ### Step 3: Extract Component Usage
191
211
 
192
212
  **Purpose**: Generate component documentation in `components/` directory
@@ -243,6 +263,20 @@ Analyze component imports and usage:
243
263
  - Props and event definitions
244
264
  - Business logic integration patterns
245
265
 
266
+ #### Document Generation (per document)
267
+
268
+ **For `components/component-library.md`:**
269
+ 1. Copy template `templates/COMPONENT-LIBRARY-TEMPLATE.md` → `{output_path}/components/component-library.md`
270
+ 2. Fill each section using `search_replace` (FORBIDDEN: `create_file` rewrite)
271
+
272
+ **For `components/common-components.md`:**
273
+ 1. Copy template `templates/COMMON-COMPONENTS-TEMPLATE.md` → `{output_path}/components/common-components.md`
274
+ 2. Fill each section using `search_replace` (FORBIDDEN: `create_file` rewrite)
275
+
276
+ **For `components/business-components.md`:**
277
+ 1. Copy template `templates/BUSINESS-COMPONENTS-TEMPLATE.md` → `{output_path}/components/business-components.md`
278
+ 2. Fill each section using `search_replace` (FORBIDDEN: `create_file` rewrite)
279
+
246
280
  #### Generate Individual Component Documents
247
281
 
248
282
  For each component discovered during analysis:
@@ -328,6 +362,16 @@ Identify common layout patterns:
328
362
  - Route configuration conventions
329
363
  - Navigation state management
330
364
 
365
+ #### Document Generation (per document)
366
+
367
+ **For `layouts/page-layouts.md`:**
368
+ 1. Copy template `templates/LAYOUT-PATTERNS-TEMPLATE.md` → `{output_path}/layouts/page-layouts.md`
369
+ 2. Fill each section using `search_replace` (FORBIDDEN: `create_file` rewrite)
370
+
371
+ **For `layouts/navigation-patterns.md`:**
372
+ 1. Copy template `templates/NAVIGATION-PATTERNS-TEMPLATE.md` → `{output_path}/layouts/navigation-patterns.md`
373
+ 2. Fill each section using `search_replace` (FORBIDDEN: `create_file` rewrite)
374
+
331
375
  #### Generate Individual Layout Documents
332
376
 
333
377
  For each distinct layout pattern discovered:
@@ -403,6 +447,20 @@ Analyze style files to extract:
403
447
  - Container and breakpoint definitions
404
448
  - Spacing application guidelines
405
449
 
450
+ #### Document Generation (per document)
451
+
452
+ **For `styles/color-system.md`:**
453
+ 1. Copy template `templates/STYLE-SYSTEM-TEMPLATE.md` → `{output_path}/styles/color-system.md`
454
+ 2. Fill each section using `search_replace` (FORBIDDEN: `create_file` rewrite)
455
+
456
+ **For `styles/typography.md`:**
457
+ 1. Copy template `templates/TYPOGRAPHY-TEMPLATE.md` → `{output_path}/styles/typography.md`
458
+ 2. Fill each section using `search_replace` (FORBIDDEN: `create_file` rewrite)
459
+
460
+ **For `styles/spacing-system.md`:**
461
+ 1. Copy template `templates/SPACING-TEMPLATE.md` → `{output_path}/styles/spacing-system.md`
462
+ 2. Fill each section using `search_replace` (FORBIDDEN: `create_file` rewrite)
463
+
406
464
  ### Step 6: Generate Documentation
407
465
 
408
466
  **Purpose**: Create all documentation files using extracted data and templates
@@ -411,11 +469,18 @@ Analyze style files to extract:
411
469
 
412
470
  For each document, follow this process:
413
471
 
414
- 1. **Read the corresponding template** from `templates/` directory
472
+ 1. **Copy the corresponding template** from `templates/` directory to target path
415
473
  2. **Review extracted data** from Steps 1-5
416
- 3. **Map data to template sections** - ensure all template placeholders are filled
417
- 4. **Generate document** with actual values
418
- 5. **Write output** to `{output_path}/`
474
+ 3. **Fill template sections** using `search_replace` - map data to template placeholders
475
+ 4. **Verify** all template placeholders are filled
476
+
477
+ **Note**: NEVER use `create_file` to generate documents. Always copy template first, then use `search_replace` to fill sections.
478
+
479
+ #### Document Generation (per document)
480
+
481
+ **For `ui-style-guide.md`:**
482
+ 1. Copy template `templates/UI-STYLE-GUIDE-TEMPLATE.md` → `{output_path}/ui-style-guide.md`
483
+ 2. Fill each section using `search_replace` (FORBIDDEN: `create_file` rewrite)
419
484
 
420
485
  #### Document Generation Order and Dependencies
421
486