@mind-fold/open-flow 0.1.15 → 0.1.17

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.
@@ -1 +1 @@
1
- {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/configurators/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmBH,MAAM,WAAW,gBAAgB;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACtB;AAED,wBAAgB,mBAAmB,IAAI,gBAAgB,CAiBtD"}
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/configurators/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqBH,MAAM,WAAW,gBAAgB;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACtB;AAED,wBAAgB,mBAAmB,IAAI,gBAAgB,CAmBtD"}
@@ -2,7 +2,7 @@
2
2
  * Short command templates for AI assistants
3
3
  * These are the core commands that enable AI-assisted development workflow
4
4
  */
5
- import { initAgentTemplate, checkFrontendTemplate, checkBackendTemplate, recordAgentFlowTemplate, recordQuestionTemplate, onboardDeveloperTemplate, generateFrontendStructureTemplate, generateBackendStructureTemplate, beforeFrontendDevTemplate, beforeBackendDevTemplate, updateFrontendStructureTemplate, updateBackendStructureTemplate, createCommandTemplate, integrateSkillTemplate, } from "../templates/commands/index.js";
5
+ import { initAgentTemplate, checkFrontendTemplate, checkBackendTemplate, recordAgentFlowTemplate, recordQuestionTemplate, onboardDeveloperTemplate, generateFrontendStructureTemplate, generateBackendStructureTemplate, beforeFrontendDevTemplate, beforeBackendDevTemplate, updateFrontendStructureTemplate, updateBackendStructureTemplate, createCommandTemplate, integrateSkillTemplate, extractLlmDocsTemplate, extractToRulesTemplate, } from "../templates/commands/index.js";
6
6
  export function getCommandTemplates() {
7
7
  return {
8
8
  "init-agent": initAgentTemplate,
@@ -19,6 +19,8 @@ export function getCommandTemplates() {
19
19
  "update-backend-structure": updateBackendStructureTemplate,
20
20
  "create-command": createCommandTemplate,
21
21
  "integrate-skill": integrateSkillTemplate,
22
+ "extract-llm-docs": extractLlmDocsTemplate,
23
+ "extract-to-rules": extractToRulesTemplate,
22
24
  };
23
25
  }
24
26
  //# sourceMappingURL=templates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/configurators/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACxB,iCAAiC,EACjC,gCAAgC,EAChC,yBAAyB,EACzB,wBAAwB,EACxB,+BAA+B,EAC/B,8BAA8B,EAC9B,qBAAqB,EACrB,sBAAsB,GACtB,MAAM,gCAAgC,CAAC;AAMxC,MAAM,UAAU,mBAAmB;IAClC,OAAO;QACN,YAAY,EAAE,iBAAiB;QAC/B,gBAAgB,EAAE,qBAAqB;QACvC,eAAe,EAAE,oBAAoB;QACrC,mBAAmB,EAAE,uBAAuB;QAC5C,iBAAiB,EAAE,sBAAsB;QACzC,mBAAmB,EAAE,wBAAwB;QAC7C,6BAA6B,EAAE,iCAAiC;QAChE,4BAA4B,EAAE,gCAAgC;QAC9D,qBAAqB,EAAE,yBAAyB;QAChD,oBAAoB,EAAE,wBAAwB;QAC9C,2BAA2B,EAAE,+BAA+B;QAC5D,0BAA0B,EAAE,8BAA8B;QAC1D,gBAAgB,EAAE,qBAAqB;QACvC,iBAAiB,EAAE,sBAAsB;KACzC,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/configurators/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACxB,iCAAiC,EACjC,gCAAgC,EAChC,yBAAyB,EACzB,wBAAwB,EACxB,+BAA+B,EAC/B,8BAA8B,EAC9B,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,GACtB,MAAM,gCAAgC,CAAC;AAMxC,MAAM,UAAU,mBAAmB;IAClC,OAAO;QACN,YAAY,EAAE,iBAAiB;QAC/B,gBAAgB,EAAE,qBAAqB;QACvC,eAAe,EAAE,oBAAoB;QACrC,mBAAmB,EAAE,uBAAuB;QAC5C,iBAAiB,EAAE,sBAAsB;QACzC,mBAAmB,EAAE,wBAAwB;QAC7C,6BAA6B,EAAE,iCAAiC;QAChE,4BAA4B,EAAE,gCAAgC;QAC9D,qBAAqB,EAAE,yBAAyB;QAChD,oBAAoB,EAAE,wBAAwB;QAC9C,2BAA2B,EAAE,+BAA+B;QAC5D,0BAA0B,EAAE,8BAA8B;QAC1D,gBAAgB,EAAE,qBAAqB;QACvC,iBAAiB,EAAE,sBAAsB;QACzC,kBAAkB,EAAE,sBAAsB;QAC1C,kBAAkB,EAAE,sBAAsB;KAC1C,CAAC;AACH,CAAC"}
@@ -0,0 +1,218 @@
1
+ # Extract Development Guidelines from LLM Documents
2
+
3
+ Extract development guidelines from external service llms.txt or other LLM-friendly documentation and integrate them into your project's structure documentation.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /extract-llm-docs <url-or-service-name>
9
+ ```
10
+
11
+ **Examples**:
12
+ ```
13
+ /extract-llm-docs https://docs.stripe.com/llms.txt
14
+ /extract-llm-docs vercel
15
+ /extract-llm-docs https://supabase.com/llms.txt
16
+ ```
17
+
18
+ ## Core Principle
19
+
20
+ > ⚠️ **Important**: The extracted content should be **development guidelines**, not direct project code.
21
+ >
22
+ > - Guidelines content → Write to `workflow/structure/{target}/doc.md`
23
+ > - Code examples → Place in `workflow/structure/{target}/examples/services/<service-name>/`
24
+ > - Example files → Use `.template` suffix to avoid IDE errors
25
+ >
26
+ > Where `{target}` is `frontend` or `backend`, determined by service type.
27
+
28
+ ## Execution Steps
29
+
30
+ ### 1. Fetch LLM Documentation
31
+
32
+ **Method A: Direct URL**
33
+ ```bash
34
+ curl <url>
35
+ ```
36
+
37
+ **Method B: Common service llms.txt locations**
38
+
39
+ | Service | llms.txt URL |
40
+ |---------|-------------|
41
+ | Vercel | `https://vercel.com/llms.txt` |
42
+ | Supabase | `https://supabase.com/llms.txt` |
43
+ | Stripe | `https://docs.stripe.com/llms.txt` |
44
+ | Cloudflare | `https://developers.cloudflare.com/llms.txt` |
45
+ | Resend | `https://resend.com/llms.txt` |
46
+
47
+ **Method C: Guess URL**
48
+ ```
49
+ https://<service>.com/llms.txt
50
+ https://docs.<service>.com/llms.txt
51
+ https://developers.<service>.com/llms.txt
52
+ ```
53
+
54
+ ### 2. Parse Document Structure
55
+
56
+ llms.txt standard format:
57
+ ```markdown
58
+ # Project Name
59
+
60
+ > Brief description
61
+
62
+ ## Core Documentation
63
+ - [Quick Start](url): Getting started guide
64
+ - [API Reference](url): API documentation
65
+
66
+ ## Optional
67
+ - [Blog](url): Optional content
68
+ ```
69
+
70
+ ### 3. Determine Integration Target
71
+
72
+ Based on service type, determine where to write:
73
+
74
+ | Service Type | Integration Target |
75
+ |--------------|-------------------|
76
+ | UI components (shadcn, radix) | `workflow/structure/frontend/` |
77
+ | Backend services (supabase, stripe) | `workflow/structure/backend/` |
78
+ | Full-stack frameworks (vercel, next.js) | May involve both |
79
+ | Email services (resend) | `workflow/structure/backend/` |
80
+ | Storage services (cloudflare r2) | `workflow/structure/backend/` |
81
+
82
+ ### 4. Extract Key Guidelines
83
+
84
+ Extract the following from documentation:
85
+
86
+ | Category | Content to Extract |
87
+ |----------|-------------------|
88
+ | **Initialization** | Install commands, configuration methods |
89
+ | **Core API** | Main function/method usage patterns |
90
+ | **Type Definitions** | TypeScript type import methods |
91
+ | **Best Practices** | Recommended usage patterns |
92
+ | **Common Errors** | Error handling, edge cases |
93
+ | **Project Adaptation** | How to integrate with existing project conventions |
94
+
95
+ ### 5. Execute Integration
96
+
97
+ #### 5.1 Update Guidelines Document
98
+
99
+ Add a new section to the corresponding `doc.md`:
100
+
101
+ ```markdown
102
+ @@@section:service-<service-name>
103
+ ## 🔌 <Service Name> Integration Guide
104
+
105
+ ### Overview
106
+ [Core functionality and use cases of the service]
107
+
108
+ ### Installation & Configuration
109
+ [Install commands and environment configuration]
110
+
111
+ ### Usage Patterns
112
+
113
+ #### Basic Usage
114
+ [Code examples]
115
+
116
+ #### Advanced Usage
117
+ [Code examples]
118
+
119
+ ### Type Definitions
120
+ [How to import and use types]
121
+
122
+ ### Error Handling
123
+ [Common errors and how to handle them]
124
+
125
+ ### Project Adaptation
126
+ - [Integration points with existing conventions]
127
+ - [Notable differences to be aware of]
128
+
129
+ ### Reference Examples
130
+ See `examples/services/<service-name>/`
131
+
132
+ ### External Documentation
133
+ - [Official Docs](url)
134
+
135
+ @@@/section:service-<service-name>
136
+ ```
137
+
138
+ #### 5.2 Create Examples Directory (if code examples exist)
139
+
140
+ ```bash
141
+ workflow/structure/{target}/
142
+ ├── doc.md # Add service-related section
143
+ ├── index.md # Update index
144
+ └── examples/
145
+ └── services/
146
+ └── <service-name>/
147
+ ├── README.md # Example documentation
148
+ ├── basic-usage.ts.template
149
+ └── advanced-usage.ts.template
150
+ ```
151
+
152
+ #### 5.3 Update Index File
153
+
154
+ Add to the Quick Navigation table in `index.md`:
155
+
156
+ ```markdown
157
+ | Using <Service> | <Section name> | `service-<service-name>` |
158
+ ```
159
+
160
+ ### 6. Generate Integration Report
161
+
162
+ ---
163
+
164
+ ## LLM Document Extraction Report: `<service-name>`
165
+
166
+ ### 📋 Source
167
+ - **Document URL**: [llms.txt](url)
168
+ - **Service Type**: [Frontend/Backend/Full-stack]
169
+ - **Integration Target**: `workflow/structure/{target}/`
170
+
171
+ ### 📚 Extracted Content
172
+
173
+ | Category | Content |
174
+ |----------|---------|
175
+ | Initialization | [Install and config methods] |
176
+ | Core API | [Main usage patterns] |
177
+ | Type Definitions | [Type import methods] |
178
+ | Best Practices | [Recommended approaches] |
179
+
180
+ ### 📁 Integration Locations
181
+
182
+ | Type | Path |
183
+ |------|------|
184
+ | Guidelines doc | `workflow/structure/{target}/doc.md` (section: `service-<name>`) |
185
+ | Code examples | `workflow/structure/{target}/examples/services/<name>/` |
186
+ | Index update | `workflow/structure/{target}/index.md` |
187
+
188
+ ### ✅ Completed Changes
189
+
190
+ - [ ] Added `@@@section:service-<name>` section to `doc.md`
191
+ - [ ] Added index entry to `index.md`
192
+ - [ ] Created example files in `examples/services/<name>/`
193
+ - [ ] Example files use `.template` suffix
194
+
195
+ ### 🔗 External Links
196
+
197
+ - [Official Documentation](url)
198
+ - [API Reference](url)
199
+
200
+ ---
201
+
202
+ ## Common Services Reference
203
+
204
+ | Service | Type | llms.txt |
205
+ |---------|------|----------|
206
+ | Vercel | Deployment | `vercel.com/llms.txt` |
207
+ | Supabase | Backend | `supabase.com/llms.txt` |
208
+ | Stripe | Payments | `docs.stripe.com/llms.txt` |
209
+ | Resend | Email | `resend.com/llms.txt` |
210
+ | Cloudflare | CDN/Storage | `developers.cloudflare.com/llms.txt` |
211
+ | Upstash | Redis/Kafka | `upstash.com/llms.txt` |
212
+
213
+ ## Notes
214
+
215
+ 1. **Prefer llms.txt**: More concise than full documentation, better suited for LLM context
216
+ 2. **Focus on relevant content**: Only extract parts related to your project's tech stack
217
+ 3. **Avoid duplication**: Check if a related section already exists before adding
218
+ 4. **Keep updated**: Record document version or date for future updates
@@ -0,0 +1,433 @@
1
+ # Extract Knowledge to Development Rules
2
+
3
+ Extract knowledge from a source document and integrate it **completely** into the corresponding development guidelines (`frontend` or `backend` structure).
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /extract-to-rules <source-file-path> <target: frontend|backend>
9
+ ```
10
+
11
+ **Examples**:
12
+ ```
13
+ /extract-to-rules docs/api-module-pattern.md backend
14
+ /extract-to-rules docs/react-hooks-guide.md frontend
15
+ /extract-to-rules workflow/big-question/turbopack-webpack-flexbox.md frontend
16
+ ```
17
+
18
+ ---
19
+
20
+ ## Execution Steps
21
+
22
+ ### Step 1: Validate Input
23
+
24
+ 1. Check source file exists
25
+ 2. Validate target is either `frontend` or `backend`
26
+ 3. Determine target paths:
27
+ - Frontend: `workflow/structure/frontend/`
28
+ - Backend: `workflow/structure/backend/`
29
+
30
+ ### Step 2: Read and Analyze Source Document
31
+
32
+ **Read the source document COMPLETELY**:
33
+ ```bash
34
+ cat <source-file-path>
35
+ ```
36
+
37
+ **Analyze and extract**:
38
+ - [ ] Main topic/concept
39
+ - [ ] All key patterns/practices
40
+ - [ ] All code examples (DO NOT skip any)
41
+ - [ ] All rules/constraints
42
+ - [ ] All common mistakes/anti-patterns
43
+ - [ ] All reference links/files
44
+ - [ ] All edge cases/gotchas
45
+
46
+ **⚠️ CRITICAL**: Extract **EVERYTHING** - do not summarize or omit details!
47
+
48
+ ### Step 3: Determine Integration Target
49
+
50
+ Based on the content, determine where to add in the guideline structure:
51
+
52
+ **For Frontend**:
53
+ - Component patterns → Add to "Component Development" section
54
+ - Hook patterns → Add to "Hook Guidelines" section
55
+ - State management → Add to "State Management" section
56
+ - Performance tips → Add to "Performance Optimization" section
57
+ - New category → Create new section
58
+
59
+ **For Backend**:
60
+ - API patterns → Add to "Directory Structure" section
61
+ - Database patterns → Add to "Database Operations" section
62
+ - Type safety → Add to "Type Safety" section
63
+ - Performance patterns → Add to "Performance Patterns" section
64
+ - New category → Create new section
65
+
66
+ **Decision Rules**:
67
+ 1. If content fits existing section → Add as subsection
68
+ 2. If content is new domain → Create new top-level section
69
+ 3. If content has multiple aspects → Consider splitting
70
+
71
+ ### Step 4: Read Current Guidelines
72
+
73
+ **Read the current index**:
74
+ ```bash
75
+ cat workflow/structure/<target>/index.md
76
+ ```
77
+
78
+ **Read the current doc** (to understand structure):
79
+ ```bash
80
+ cat workflow/structure/<target>/doc.md
81
+ ```
82
+
83
+ **Identify**:
84
+ - [ ] Existing sections and their line numbers
85
+ - [ ] Section ID naming pattern
86
+ - [ ] Appropriate insertion point
87
+ - [ ] Potential conflicts/duplications
88
+
89
+ ### Step 5: Prepare New Content
90
+
91
+ **Create section ID**:
92
+ - Use pattern: `kebab-case-descriptive-name`
93
+ - Examples: `api-module-pattern`, `react-hooks-advanced`, `cursor-pagination-best-practices`
94
+
95
+ **Structure the content** (follow existing format):
96
+
97
+ ```markdown
98
+ @@@section:<section-id>
99
+ ## <emoji> Section Title
100
+
101
+ ### Subsection 1
102
+ <content>
103
+
104
+ ### Subsection 2
105
+ <content>
106
+
107
+ **Examples**:
108
+ <code-examples>
109
+
110
+ **Anti-Patterns**:
111
+ <anti-patterns>
112
+
113
+ **Reference**:
114
+ <references>
115
+
116
+ @@@/section:<section-id>
117
+ ```
118
+
119
+ **⚠️ IMPORTANT**:
120
+ 1. Include ALL examples from source
121
+ 2. Include ALL code snippets from source
122
+ 3. Include ALL best practices from source
123
+ 4. Include ALL anti-patterns from source
124
+ 5. Preserve all technical details
125
+ 6. Add section markers (`@@@section` / `@@@/section`)
126
+
127
+ ### Step 6: Update index.md
128
+
129
+ **Add to Quick Navigation table**:
130
+
131
+ | Section | Key Content | Section ID |
132
+ |---------|-------------|------------|
133
+ | <emoji> <Title> | <brief-description> | `<section-id>` |
134
+
135
+ **Add to appropriate scenario** (if applicable):
136
+
137
+ ### Scenario X: <scenario-name>
138
+ - **Must Read**: <emoji> <Title> (`<section-id>`)
139
+ - **Reference**: ...
140
+
141
+ **Add to Core Rules** (if applicable):
142
+
143
+ | Rule | Section ID |
144
+ |------|------------|
145
+ | **<rule-summary>** | `<section-id>` |
146
+
147
+ **Update Document Structure Overview**:
148
+
149
+ ```
150
+ <target>/doc.md (approx. XXXX lines)
151
+ ├── ...
152
+ ├── <emoji> <Title> (`<section-id>`)
153
+ │ ├── Subsection 1 (`<subsection-id>`)
154
+ │ └── Subsection 2 (`<subsection-id>`)
155
+ └── ...
156
+ ```
157
+
158
+ ### Step 7: Update doc.md
159
+
160
+ **Insert new section at appropriate location**:
161
+
162
+ 1. Find insertion point (after related sections, before reference examples)
163
+ 2. Add complete section with all markers
164
+ 3. Ensure proper nesting and formatting
165
+
166
+ **Template**:
167
+ ```markdown
168
+ @@@section:<section-id>
169
+ ## <emoji> Section Title
170
+
171
+ <overview-paragraph>
172
+
173
+ @@@section:<subsection-id-1>
174
+ ### Subsection 1
175
+
176
+ <detailed-content>
177
+
178
+ **Example**:
179
+ ```<language>
180
+ <code-example>
181
+ ```
182
+
183
+ **Why?**
184
+ - <reason-1>
185
+ - <reason-2>
186
+
187
+ @@@/section:<subsection-id-1>
188
+
189
+ @@@section:<subsection-id-2>
190
+ ### Subsection 2
191
+
192
+ <detailed-content>
193
+
194
+ **Anti-Pattern** ❌:
195
+ ```<language>
196
+ <bad-code>
197
+ ```
198
+
199
+ **Correct** ✅:
200
+ ```<language>
201
+ <good-code>
202
+ ```
203
+
204
+ @@@/section:<subsection-id-2>
205
+
206
+ @@@/section:<section-id>
207
+ ```
208
+
209
+ ### Step 8: Verify Integration
210
+
211
+ **Check completeness**:
212
+ - [ ] All content from source is included
213
+ - [ ] All code examples are preserved
214
+ - [ ] All anti-patterns are included
215
+ - [ ] All references are added
216
+ - [ ] Section markers are correct (`@@@section` / `@@@/section`)
217
+ - [ ] Index is updated with new section
218
+ - [ ] Scenarios are updated (if relevant)
219
+ - [ ] Core rules are updated (if relevant)
220
+ - [ ] Document structure overview is updated
221
+
222
+ **Check formatting**:
223
+ - [ ] Consistent emoji usage
224
+ - [ ] Proper markdown formatting
225
+ - [ ] Code blocks have language tags
226
+ - [ ] Section IDs are kebab-case
227
+ - [ ] Proper nesting (subsections inside main section)
228
+
229
+ **Check no duplication**:
230
+ - [ ] No existing section covers the same content
231
+ - [ ] No conflicting guidelines
232
+ - [ ] Merged with existing section if overlap
233
+
234
+ ### Step 9: Test Extraction
235
+
236
+ **Verify section can be extracted**:
237
+ ```bash
238
+ sed -n '/@@@section:<section-id>/,/@@@\/section:<section-id>/p' workflow/structure/<target>/doc.md
239
+ ```
240
+
241
+ Expected: Complete section content is displayed
242
+
243
+ ### Step 10: Create Summary
244
+
245
+ Output a summary:
246
+
247
+ ```markdown
248
+ ✅ Knowledge Extracted and Integrated
249
+
250
+ **Source**: <source-file-path>
251
+ **Target**: workflow/structure/<target>/
252
+
253
+ **New Section**:
254
+ - Section ID: `<section-id>`
255
+ - Title: <emoji> <title>
256
+ - Location: Line XXX in doc.md
257
+
258
+ **Updates**:
259
+ - ✅ index.md - Added to Quick Navigation
260
+ - ✅ index.md - Added to Scenario X
261
+ - ✅ index.md - Added to Core Rules
262
+ - ✅ index.md - Updated Document Structure
263
+ - ✅ doc.md - Added complete section with X subsections
264
+
265
+ **Content Included**:
266
+ - X paragraphs of explanation
267
+ - X code examples
268
+ - X anti-patterns
269
+ - X best practices
270
+ - X references
271
+
272
+ **Extraction Command**:
273
+ ```bash
274
+ sed -n '/@@@section:<section-id>/,/@@@\/section:<section-id>/p' workflow/structure/<target>/doc.md
275
+ ```
276
+ ```
277
+
278
+ ---
279
+
280
+ ## Critical Rules
281
+
282
+ ### ✅ DO
283
+
284
+ 1. **Extract EVERYTHING** from source document
285
+ - All explanations
286
+ - All code examples
287
+ - All edge cases
288
+ - All anti-patterns
289
+ - All references
290
+
291
+ 2. **Follow existing format**
292
+ - Use same emoji style
293
+ - Use same heading levels
294
+ - Use same code block format
295
+ - Use section markers
296
+
297
+ 3. **Update ALL affected parts**
298
+ - index.md Quick Navigation
299
+ - index.md Scenarios (if applicable)
300
+ - index.md Core Rules (if applicable)
301
+ - index.md Document Structure
302
+ - doc.md new section
303
+
304
+ 4. **Preserve technical accuracy**
305
+ - Keep exact code examples
306
+ - Keep exact error messages
307
+ - Keep exact command syntax
308
+
309
+ 5. **Make it searchable**
310
+ - Use descriptive section IDs
311
+ - Include keywords in content
312
+ - Add to relevant scenarios
313
+
314
+ ### ❌ DON'T
315
+
316
+ 1. **Don't summarize** - Extract complete content
317
+ 2. **Don't skip examples** - Include all code examples
318
+ 3. **Don't omit details** - Keep all technical specifics
319
+ 4. **Don't forget markers** - Always add `@@@section` tags
320
+ 5. **Don't skip index** - Always update index.md
321
+ 6. **Don't duplicate** - Check for existing similar content first
322
+
323
+ ---
324
+
325
+ ## Examples
326
+
327
+ ### Example 1: Adding API Module Pattern to Backend
328
+
329
+ **Input**:
330
+ ```
331
+ /extract-to-rules docs/api-module-pattern.md backend
332
+ ```
333
+
334
+ **Process**:
335
+ 1. Read `docs/api-module-pattern.md` completely
336
+ 2. Analyze: This is about directory structure and organization
337
+ 3. Determine: Should enhance "Directory Structure" section
338
+ 4. Read current backend structure guidelines
339
+ 5. Create section ID: `api-module-pattern-detailed`
340
+ 6. Extract all content, examples, anti-patterns
341
+ 7. Update index.md:
342
+ - Add to Quick Navigation
343
+ - Add to Scenario 1 (Create New API Module)
344
+ - Update Document Structure
345
+ 8. Update doc.md:
346
+ - Insert after existing Directory Structure
347
+ - Add all subsections with markers
348
+ 9. Verify extraction works
349
+ 10. Output summary
350
+
351
+ ### Example 2: Adding React Hook Pattern to Frontend
352
+
353
+ **Input**:
354
+ ```
355
+ /extract-to-rules docs/react-hooks-advanced.md frontend
356
+ ```
357
+
358
+ **Process**:
359
+ 1. Read `docs/react-hooks-advanced.md` completely
360
+ 2. Analyze: Advanced hook patterns and best practices
361
+ 3. Determine: Should add to "Hook Guidelines" section
362
+ 4. Read current frontend structure guidelines
363
+ 5. Create section ID: `hook-patterns-advanced`
364
+ 6. Extract all patterns, examples, gotchas
365
+ 7. Update index.md:
366
+ - Add to Quick Navigation
367
+ - Add to Scenario (Hook Development)
368
+ - Add key rules to Core Rules
369
+ - Update Document Structure
370
+ 8. Update doc.md:
371
+ - Add new subsection under Hook Guidelines
372
+ - Include all examples and anti-patterns
373
+ 9. Verify extraction works
374
+ 10. Output summary
375
+
376
+ ---
377
+
378
+ ## Quality Checklist
379
+
380
+ Before completing, verify:
381
+
382
+ - [ ] Source document read COMPLETELY
383
+ - [ ] ALL content extracted (not summarized)
384
+ - [ ] ALL code examples included
385
+ - [ ] ALL anti-patterns included
386
+ - [ ] Section ID is descriptive and unique
387
+ - [ ] Section markers added (`@@@section` / `@@@/section`)
388
+ - [ ] index.md Quick Navigation updated
389
+ - [ ] index.md Scenarios updated (if relevant)
390
+ - [ ] index.md Core Rules updated (if relevant)
391
+ - [ ] index.md Document Structure updated
392
+ - [ ] doc.md section added with proper formatting
393
+ - [ ] No duplication with existing content
394
+ - [ ] Extraction command tested and works
395
+ - [ ] Summary provided with all details
396
+
397
+ ---
398
+
399
+ ## Troubleshooting
400
+
401
+ ### Issue: Content already exists
402
+
403
+ **Solution**:
404
+ 1. Compare with existing section
405
+ 2. If identical → Skip, note in summary
406
+ 3. If complementary → Merge into existing section
407
+ 4. If different approach → Add as alternative pattern
408
+
409
+ ### Issue: Too much content
410
+
411
+ **Solution**:
412
+ 1. Split into multiple related sections
413
+ 2. Use clear subsection hierarchy
414
+ 3. Link sections together in index
415
+
416
+ ### Issue: Unclear target section
417
+
418
+ **Solution**:
419
+ 1. Create new top-level section
420
+ 2. Add clear description of scope
421
+ 3. Update index with new category
422
+
423
+ ---
424
+
425
+ ## Success Criteria
426
+
427
+ Integration is complete when:
428
+
429
+ 1. ✅ All source content is in doc.md
430
+ 2. ✅ Index.md accurately reflects new content
431
+ 3. ✅ Section can be extracted with sed command
432
+ 4. ✅ New developers can find and use the knowledge
433
+ 5. ✅ No information loss from source document
@@ -16,4 +16,6 @@ export declare const updateFrontendStructureTemplate: string;
16
16
  export declare const updateBackendStructureTemplate: string;
17
17
  export declare const createCommandTemplate: string;
18
18
  export declare const integrateSkillTemplate: string;
19
+ export declare const extractLlmDocsTemplate: string;
20
+ export declare const extractToRulesTemplate: string;
19
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/commands/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,eAAO,MAAM,iBAAiB,QAAgC,CAAC;AAC/D,eAAO,MAAM,qBAAqB,QAAoC,CAAC;AACvE,eAAO,MAAM,oBAAoB,QAAmC,CAAC;AACrE,eAAO,MAAM,uBAAuB,QAAuC,CAAC;AAC5E,eAAO,MAAM,sBAAsB,QAAqC,CAAC;AACzE,eAAO,MAAM,wBAAwB,QAAuC,CAAC;AAC7E,eAAO,MAAM,iCAAiC,QAE7C,CAAC;AACF,eAAO,MAAM,gCAAgC,QAE5C,CAAC;AACF,eAAO,MAAM,yBAAyB,QAAyC,CAAC;AAChF,eAAO,MAAM,wBAAwB,QAAwC,CAAC;AAC9E,eAAO,MAAM,+BAA+B,QAE3C,CAAC;AACF,eAAO,MAAM,8BAA8B,QAE1C,CAAC;AACF,eAAO,MAAM,qBAAqB,QAAoC,CAAC;AACvE,eAAO,MAAM,sBAAsB,QAAqC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/commands/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,eAAO,MAAM,iBAAiB,QAAgC,CAAC;AAC/D,eAAO,MAAM,qBAAqB,QAAoC,CAAC;AACvE,eAAO,MAAM,oBAAoB,QAAmC,CAAC;AACrE,eAAO,MAAM,uBAAuB,QAAuC,CAAC;AAC5E,eAAO,MAAM,sBAAsB,QAAqC,CAAC;AACzE,eAAO,MAAM,wBAAwB,QAAuC,CAAC;AAC7E,eAAO,MAAM,iCAAiC,QAE7C,CAAC;AACF,eAAO,MAAM,gCAAgC,QAE5C,CAAC;AACF,eAAO,MAAM,yBAAyB,QAAyC,CAAC;AAChF,eAAO,MAAM,wBAAwB,QAAwC,CAAC;AAC9E,eAAO,MAAM,+BAA+B,QAE3C,CAAC;AACF,eAAO,MAAM,8BAA8B,QAE1C,CAAC;AACF,eAAO,MAAM,qBAAqB,QAAoC,CAAC;AACvE,eAAO,MAAM,sBAAsB,QAAqC,CAAC;AACzE,eAAO,MAAM,sBAAsB,QAAsC,CAAC;AAC1E,eAAO,MAAM,sBAAsB,QAAsC,CAAC"}
@@ -17,4 +17,6 @@ export const updateFrontendStructureTemplate = readCommand("update-frontend-stru
17
17
  export const updateBackendStructureTemplate = readCommand("update-backend-structure.txt");
18
18
  export const createCommandTemplate = readCommand("create-command.txt");
19
19
  export const integrateSkillTemplate = readCommand("integrate-skill.txt");
20
+ export const extractLlmDocsTemplate = readCommand("extract-llm-docs.txt");
21
+ export const extractToRulesTemplate = readCommand("extract-to-rules.txt");
20
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/commands/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC;AAC/D,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAAC;AACvE,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,CAAC,mBAAmB,CAAC,CAAC;AACrE,MAAM,CAAC,MAAM,uBAAuB,GAAG,WAAW,CAAC,uBAAuB,CAAC,CAAC;AAC5E,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC,qBAAqB,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAW,CAAC,uBAAuB,CAAC,CAAC;AAC7E,MAAM,CAAC,MAAM,iCAAiC,GAAG,WAAW,CAC3D,iCAAiC,CACjC,CAAC;AACF,MAAM,CAAC,MAAM,gCAAgC,GAAG,WAAW,CAC1D,gCAAgC,CAChC,CAAC;AACF,MAAM,CAAC,MAAM,yBAAyB,GAAG,WAAW,CAAC,yBAAyB,CAAC,CAAC;AAChF,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAW,CAAC,wBAAwB,CAAC,CAAC;AAC9E,MAAM,CAAC,MAAM,+BAA+B,GAAG,WAAW,CACzD,+BAA+B,CAC/B,CAAC;AACF,MAAM,CAAC,MAAM,8BAA8B,GAAG,WAAW,CACxD,8BAA8B,CAC9B,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAAC;AACvE,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC,qBAAqB,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/commands/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC;AAC/D,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAAC;AACvE,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,CAAC,mBAAmB,CAAC,CAAC;AACrE,MAAM,CAAC,MAAM,uBAAuB,GAAG,WAAW,CAAC,uBAAuB,CAAC,CAAC;AAC5E,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC,qBAAqB,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAW,CAAC,uBAAuB,CAAC,CAAC;AAC7E,MAAM,CAAC,MAAM,iCAAiC,GAAG,WAAW,CAC3D,iCAAiC,CACjC,CAAC;AACF,MAAM,CAAC,MAAM,gCAAgC,GAAG,WAAW,CAC1D,gCAAgC,CAChC,CAAC;AACF,MAAM,CAAC,MAAM,yBAAyB,GAAG,WAAW,CAAC,yBAAyB,CAAC,CAAC;AAChF,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAW,CAAC,wBAAwB,CAAC,CAAC;AAC9E,MAAM,CAAC,MAAM,+BAA+B,GAAG,WAAW,CACzD,+BAA+B,CAC/B,CAAC;AACF,MAAM,CAAC,MAAM,8BAA8B,GAAG,WAAW,CACxD,8BAA8B,CAC9B,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAAC;AACvE,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC,qBAAqB,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC,sBAAsB,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC,sBAAsB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mind-fold/open-flow",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "AI-assisted development workflow initializer for Cursor, Claude Code and more",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",