@mind-fold/open-flow 0.2.10 → 0.2.12
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.
- package/dist/templates/commands/break-loop.txt +1 -1
- package/dist/templates/commands/check-cross-layer.txt +3 -3
- package/dist/templates/commands/create-command.txt +5 -5
- package/dist/templates/commands/extract-llm-docs.txt +18 -18
- package/dist/templates/commands/extract-to-rules.txt +38 -38
- package/dist/templates/commands/finish-work.txt +5 -5
- package/dist/templates/commands/generate-backend-structure.txt +27 -27
- package/dist/templates/commands/generate-frontend-structure.txt +15 -15
- package/dist/templates/commands/integrate-skill.txt +30 -30
- package/dist/templates/commands/onboard-developer.txt +487 -39
- package/dist/templates/commands/record-agent-flow.txt +4 -4
- package/dist/templates/commands/sync-from-runtime.txt +2 -2
- package/dist/templates/markdown/agent-progress-index.md.txt +9 -9
- package/dist/templates/markdown/backend-doc.md.txt +12 -12
- package/dist/templates/markdown/flow.md.txt +99 -99
- package/dist/templates/markdown/frontend-doc.md.txt +11 -11
- package/dist/templates/markdown/structure/backend/database-guidelines.md.txt +6 -6
- package/dist/templates/markdown/structure/backend/directory-structure.md.txt +28 -28
- package/dist/templates/markdown/structure/backend/index.md.txt +10 -10
- package/dist/templates/markdown/structure/backend/logging-guidelines.md.txt +4 -4
- package/dist/templates/markdown/structure/backend/quality-guidelines.md.txt +12 -12
- package/dist/templates/markdown/structure/backend/type-safety.md.txt +6 -6
- package/dist/templates/markdown/structure/flows/code-reuse-thinking-guide.md.txt +17 -17
- package/dist/templates/markdown/structure/flows/cross-layer-thinking-guide.md.txt +96 -96
- package/dist/templates/markdown/structure/flows/index.md.txt +31 -31
- package/dist/templates/markdown/structure/flows/pre-implementation-checklist.md.txt +19 -19
- package/dist/templates/markdown/structure/flows/spec-flow-template.md.txt +20 -20
- package/dist/templates/markdown/structure/frontend/component-guidelines.md.txt +12 -12
- package/dist/templates/markdown/structure/frontend/directory-structure.md.txt +61 -61
- package/dist/templates/markdown/structure/frontend/hook-guidelines.md.txt +5 -5
- package/dist/templates/markdown/structure/frontend/index.md.txt +13 -13
- package/dist/templates/markdown/structure/frontend/quality-guidelines.md.txt +21 -21
- package/dist/templates/markdown/structure/frontend/state-management.md.txt +12 -12
- package/dist/templates/markdown/structure/frontend/type-safety.md.txt +11 -11
- package/dist/templates/scripts/add-session.sh.txt +5 -5
- package/dist/templates/scripts/extract-md-headings.sh.txt +3 -3
- package/dist/templates/scripts/get-context.sh.txt +1 -1
- package/dist/templates/scripts/init-developer.sh.txt +1 -1
- package/dist/templates/scripts/update-index.sh.txt +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Break the Loop - Deep Bug Analysis
|
|
2
2
|
|
|
3
|
-
When debug is complete, use this command for deep analysis to break the "fix bug
|
|
3
|
+
When debug is complete, use this command for deep analysis to break the "fix bug -> forget -> repeat" cycle.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -45,8 +45,8 @@ Based on your change type, execute relevant checks below:
|
|
|
45
45
|
| Utility | `utils/`, `lib/` |
|
|
46
46
|
|
|
47
47
|
**Checklist**:
|
|
48
|
-
- [ ] Read flow: Database
|
|
49
|
-
- [ ] Write flow: Component
|
|
48
|
+
- [ ] Read flow: Database -> Service -> API -> Hook -> Component
|
|
49
|
+
- [ ] Write flow: Component -> Hook -> API -> Service -> Database
|
|
50
50
|
- [ ] Types correctly passed between layers?
|
|
51
51
|
- [ ] Errors properly propagated to UI?
|
|
52
52
|
- [ ] Loading states handled at each layer?
|
|
@@ -69,7 +69,7 @@ Based on your change type, execute relevant checks below:
|
|
|
69
69
|
```bash
|
|
70
70
|
grep -r "value-to-change" --include="*.ts" --include="*.tsx"
|
|
71
71
|
```
|
|
72
|
-
- [ ] If 2+ places define same value
|
|
72
|
+
- [ ] If 2+ places define same value -> Should extract to shared constant
|
|
73
73
|
- [ ] After modification, all usage sites updated?
|
|
74
74
|
- [ ] If creating utility: Does similar utility already exist?
|
|
75
75
|
|
|
@@ -68,7 +68,7 @@ Create in both directories:
|
|
|
68
68
|
|
|
69
69
|
Output result:
|
|
70
70
|
```
|
|
71
|
-
|
|
71
|
+
[OK] Created Slash Command: /<command-name>
|
|
72
72
|
|
|
73
73
|
File paths:
|
|
74
74
|
- .cursor/commands/<command-name>.md
|
|
@@ -83,14 +83,14 @@ Description:
|
|
|
83
83
|
|
|
84
84
|
## Command Content Guidelines
|
|
85
85
|
|
|
86
|
-
###
|
|
86
|
+
### [OK] Good command content
|
|
87
87
|
|
|
88
88
|
1. **Clear and concise**: Immediately understandable
|
|
89
89
|
2. **Executable**: AI can follow steps directly
|
|
90
90
|
3. **Well-scoped**: Clear boundaries of what to do and not do
|
|
91
91
|
4. **Has output**: Specifies expected output format (if needed)
|
|
92
92
|
|
|
93
|
-
###
|
|
93
|
+
### [X] Avoid
|
|
94
94
|
|
|
95
95
|
1. **Too vague**: e.g., "optimize code"
|
|
96
96
|
2. **Too complex**: Single command should not exceed 100 lines
|
|
@@ -146,8 +146,8 @@ Format:
|
|
|
146
146
|
- [file list]
|
|
147
147
|
|
|
148
148
|
### Check Results
|
|
149
|
-
-
|
|
150
|
-
-
|
|
149
|
+
- [OK] Passed items
|
|
150
|
+
- [X] Issues found
|
|
151
151
|
|
|
152
152
|
### Suggestions
|
|
153
153
|
- [improvement suggestions]
|
|
@@ -17,11 +17,11 @@ Extract development guidelines from external service llms.txt or other LLM-frien
|
|
|
17
17
|
|
|
18
18
|
## Core Principle
|
|
19
19
|
|
|
20
|
-
>
|
|
20
|
+
> [!] **Important**: The extracted content should be **development guidelines**, not direct project code.
|
|
21
21
|
>
|
|
22
|
-
> - Guidelines content
|
|
23
|
-
> - Code examples
|
|
24
|
-
> - Example files
|
|
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
25
|
>
|
|
26
26
|
> Where `{target}` is `frontend` or `backend`, determined by service type.
|
|
27
27
|
|
|
@@ -100,7 +100,7 @@ Add a new section to the corresponding `doc.md`:
|
|
|
100
100
|
|
|
101
101
|
```markdown
|
|
102
102
|
@@@section:service-<service-name>
|
|
103
|
-
##
|
|
103
|
+
## # <Service Name> Integration Guide
|
|
104
104
|
|
|
105
105
|
### Overview
|
|
106
106
|
[Core functionality and use cases of the service]
|
|
@@ -139,14 +139,14 @@ See `examples/services/<service-name>/`
|
|
|
139
139
|
|
|
140
140
|
```bash
|
|
141
141
|
workflow/structure/{target}/
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
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
150
|
```
|
|
151
151
|
|
|
152
152
|
#### 5.3 Update Index File
|
|
@@ -163,12 +163,12 @@ Add to the Quick Navigation table in `index.md`:
|
|
|
163
163
|
|
|
164
164
|
## LLM Document Extraction Report: `<service-name>`
|
|
165
165
|
|
|
166
|
-
###
|
|
166
|
+
### # Source
|
|
167
167
|
- **Document URL**: [llms.txt](url)
|
|
168
168
|
- **Service Type**: [Frontend/Backend/Full-stack]
|
|
169
169
|
- **Integration Target**: `workflow/structure/{target}/`
|
|
170
170
|
|
|
171
|
-
###
|
|
171
|
+
### # Extracted Content
|
|
172
172
|
|
|
173
173
|
| Category | Content |
|
|
174
174
|
|----------|---------|
|
|
@@ -177,7 +177,7 @@ Add to the Quick Navigation table in `index.md`:
|
|
|
177
177
|
| Type Definitions | [Type import methods] |
|
|
178
178
|
| Best Practices | [Recommended approaches] |
|
|
179
179
|
|
|
180
|
-
###
|
|
180
|
+
### # Integration Locations
|
|
181
181
|
|
|
182
182
|
| Type | Path |
|
|
183
183
|
|------|------|
|
|
@@ -185,14 +185,14 @@ Add to the Quick Navigation table in `index.md`:
|
|
|
185
185
|
| Code examples | `workflow/structure/{target}/examples/services/<name>/` |
|
|
186
186
|
| Index update | `workflow/structure/{target}/index.md` |
|
|
187
187
|
|
|
188
|
-
###
|
|
188
|
+
### [OK] Completed Changes
|
|
189
189
|
|
|
190
190
|
- [ ] Added `@@@section:service-<name>` section to `doc.md`
|
|
191
191
|
- [ ] Added index entry to `index.md`
|
|
192
192
|
- [ ] Created example files in `examples/services/<name>/`
|
|
193
193
|
- [ ] Example files use `.template` suffix
|
|
194
194
|
|
|
195
|
-
###
|
|
195
|
+
### # External Links
|
|
196
196
|
|
|
197
197
|
- [Official Documentation](url)
|
|
198
198
|
- [API Reference](url)
|
|
@@ -43,30 +43,30 @@ cat <source-file-path>
|
|
|
43
43
|
- [ ] All reference links/files
|
|
44
44
|
- [ ] All edge cases/gotchas
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
**[!] CRITICAL**: Extract **EVERYTHING** - do not summarize or omit details!
|
|
47
47
|
|
|
48
48
|
### Step 3: Determine Integration Target
|
|
49
49
|
|
|
50
50
|
Based on the content, determine where to add in the guideline structure:
|
|
51
51
|
|
|
52
52
|
**For Frontend**:
|
|
53
|
-
- Component patterns
|
|
54
|
-
- Hook patterns
|
|
55
|
-
- State management
|
|
56
|
-
- Performance tips
|
|
57
|
-
- New category
|
|
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
58
|
|
|
59
59
|
**For Backend**:
|
|
60
|
-
- API patterns
|
|
61
|
-
- Database patterns
|
|
62
|
-
- Type safety
|
|
63
|
-
- Performance patterns
|
|
64
|
-
- New category
|
|
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
65
|
|
|
66
66
|
**Decision Rules**:
|
|
67
|
-
1. If content fits existing section
|
|
68
|
-
2. If content is new domain
|
|
69
|
-
3. If content has multiple aspects
|
|
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
70
|
|
|
71
71
|
### Step 4: Read Current Guidelines
|
|
72
72
|
|
|
@@ -116,7 +116,7 @@ cat workflow/structure/<target>/doc.md
|
|
|
116
116
|
@@@/section:<section-id>
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
**[!] IMPORTANT**:
|
|
120
120
|
1. Include ALL examples from source
|
|
121
121
|
2. Include ALL code snippets from source
|
|
122
122
|
3. Include ALL best practices from source
|
|
@@ -148,11 +148,11 @@ cat workflow/structure/<target>/doc.md
|
|
|
148
148
|
|
|
149
149
|
```
|
|
150
150
|
<target>/doc.md (approx. XXXX lines)
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
|-- ...
|
|
152
|
+
|-- <emoji> <Title> (`<section-id>`)
|
|
153
|
+
| |-- Subsection 1 (`<subsection-id>`)
|
|
154
|
+
| \-- Subsection 2 (`<subsection-id>`)
|
|
155
|
+
\-- ...
|
|
156
156
|
```
|
|
157
157
|
|
|
158
158
|
### Step 7: Update doc.md
|
|
@@ -191,12 +191,12 @@ cat workflow/structure/<target>/doc.md
|
|
|
191
191
|
|
|
192
192
|
<detailed-content>
|
|
193
193
|
|
|
194
|
-
**Anti-Pattern**
|
|
194
|
+
**Anti-Pattern** [X]:
|
|
195
195
|
```<language>
|
|
196
196
|
<bad-code>
|
|
197
197
|
```
|
|
198
198
|
|
|
199
|
-
**Correct**
|
|
199
|
+
**Correct** [OK]:
|
|
200
200
|
```<language>
|
|
201
201
|
<good-code>
|
|
202
202
|
```
|
|
@@ -245,7 +245,7 @@ Expected: Complete section content is displayed
|
|
|
245
245
|
Output a summary:
|
|
246
246
|
|
|
247
247
|
```markdown
|
|
248
|
-
|
|
248
|
+
[OK] Knowledge Extracted and Integrated
|
|
249
249
|
|
|
250
250
|
**Source**: <source-file-path>
|
|
251
251
|
**Target**: workflow/structure/<target>/
|
|
@@ -256,11 +256,11 @@ Output a summary:
|
|
|
256
256
|
- Location: Line XXX in doc.md
|
|
257
257
|
|
|
258
258
|
**Updates**:
|
|
259
|
-
-
|
|
260
|
-
-
|
|
261
|
-
-
|
|
262
|
-
-
|
|
263
|
-
-
|
|
259
|
+
- [OK] index.md - Added to Quick Navigation
|
|
260
|
+
- [OK] index.md - Added to Scenario X
|
|
261
|
+
- [OK] index.md - Added to Core Rules
|
|
262
|
+
- [OK] index.md - Updated Document Structure
|
|
263
|
+
- [OK] doc.md - Added complete section with X subsections
|
|
264
264
|
|
|
265
265
|
**Content Included**:
|
|
266
266
|
- X paragraphs of explanation
|
|
@@ -279,7 +279,7 @@ sed -n '/@@@section:<section-id>/,/@@@\/section:<section-id>/p' workflow/structu
|
|
|
279
279
|
|
|
280
280
|
## Critical Rules
|
|
281
281
|
|
|
282
|
-
###
|
|
282
|
+
### [OK] DO
|
|
283
283
|
|
|
284
284
|
1. **Extract EVERYTHING** from source document
|
|
285
285
|
- All explanations
|
|
@@ -311,7 +311,7 @@ sed -n '/@@@section:<section-id>/,/@@@\/section:<section-id>/p' workflow/structu
|
|
|
311
311
|
- Include keywords in content
|
|
312
312
|
- Add to relevant scenarios
|
|
313
313
|
|
|
314
|
-
###
|
|
314
|
+
### [X] DON'T
|
|
315
315
|
|
|
316
316
|
1. **Don't summarize** - Extract complete content
|
|
317
317
|
2. **Don't skip examples** - Include all code examples
|
|
@@ -402,9 +402,9 @@ Before completing, verify:
|
|
|
402
402
|
|
|
403
403
|
**Solution**:
|
|
404
404
|
1. Compare with existing section
|
|
405
|
-
2. If identical
|
|
406
|
-
3. If complementary
|
|
407
|
-
4. If different approach
|
|
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
408
|
|
|
409
409
|
### Issue: Too much content
|
|
410
410
|
|
|
@@ -426,8 +426,8 @@ Before completing, verify:
|
|
|
426
426
|
|
|
427
427
|
Integration is complete when:
|
|
428
428
|
|
|
429
|
-
1.
|
|
430
|
-
2.
|
|
431
|
-
3.
|
|
432
|
-
4.
|
|
433
|
-
5.
|
|
429
|
+
1. [OK] All source content is in doc.md
|
|
430
|
+
2. [OK] Index.md accurately reflects new content
|
|
431
|
+
3. [OK] Section can be extracted with sed command
|
|
432
|
+
4. [OK] New developers can find and use the knowledge
|
|
433
|
+
5. [OK] No information loss from source document
|
|
@@ -37,7 +37,7 @@ pnpm test
|
|
|
37
37
|
**Key Question**:
|
|
38
38
|
> "If I fixed a bug or discovered something non-obvious, should I document it so future me (or others) won't hit the same issue?"
|
|
39
39
|
|
|
40
|
-
If YES
|
|
40
|
+
If YES -> Update the relevant structure doc.
|
|
41
41
|
|
|
42
42
|
### 3. API Changes
|
|
43
43
|
|
|
@@ -106,13 +106,13 @@ git diff --name-only
|
|
|
106
106
|
|
|
107
107
|
```
|
|
108
108
|
Development Flow:
|
|
109
|
-
Write code
|
|
110
|
-
|
|
109
|
+
Write code -> Test -> /finish-work -> git commit -> /record-agent-flow
|
|
110
|
+
| |
|
|
111
111
|
Ensure completeness Record progress
|
|
112
112
|
|
|
113
113
|
Debug Flow:
|
|
114
|
-
Hit bug
|
|
115
|
-
|
|
114
|
+
Hit bug -> Fix -> /break-loop -> Knowledge capture
|
|
115
|
+
|
|
|
116
116
|
Deep analysis
|
|
117
117
|
```
|
|
118
118
|
|
|
@@ -6,7 +6,7 @@ Scan the project's backend code, analyze existing code patterns and tech stack,
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## [!] CRITICAL: Requirements
|
|
10
10
|
|
|
11
11
|
1. **Language**: All documentation must be written in **English**
|
|
12
12
|
2. **Section Markers**: Use `@@@section:kebab-case-id` and `@@@/section:kebab-case-id` to mark sections
|
|
@@ -104,7 +104,7 @@ mkdir -p workflow/structure/backend
|
|
|
104
104
|
These guidelines define the development standards and best practices for [Project Name] backend modules.
|
|
105
105
|
|
|
106
106
|
@@@section:directory-structure
|
|
107
|
-
##
|
|
107
|
+
## # Directory Structure Guidelines
|
|
108
108
|
|
|
109
109
|
### Module Organization
|
|
110
110
|
[describe directory structure]
|
|
@@ -112,31 +112,31 @@ These guidelines define the development standards and best practices for [Projec
|
|
|
112
112
|
@@@/section:directory-structure
|
|
113
113
|
|
|
114
114
|
@@@section:type-safety
|
|
115
|
-
##
|
|
115
|
+
## # Type Safety Guidelines
|
|
116
116
|
|
|
117
117
|
@@@section:non-null-assertion
|
|
118
118
|
### 1. TypeScript Non-null Assertion Rules
|
|
119
119
|
|
|
120
120
|
**Never use non-null assertion operator (`!`), use local variable extraction instead**
|
|
121
121
|
|
|
122
|
-
####
|
|
122
|
+
#### [X] Wrong Approach
|
|
123
123
|
|
|
124
124
|
```typescript
|
|
125
125
|
if (user.profileId) {
|
|
126
126
|
await db.update(profiles)
|
|
127
127
|
.set({ name: newName })
|
|
128
|
-
.where(eq(profiles.id, user.profileId!)); //
|
|
128
|
+
.where(eq(profiles.id, user.profileId!)); // [X] non-null assertion
|
|
129
129
|
}
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
-
####
|
|
132
|
+
#### [OK] Correct Approach
|
|
133
133
|
|
|
134
134
|
```typescript
|
|
135
135
|
if (user.profileId) {
|
|
136
136
|
const profileId = user.profileId; // type narrowed to string
|
|
137
137
|
await db.update(profiles)
|
|
138
138
|
.set({ name: newName })
|
|
139
|
-
.where(eq(profiles.id, profileId)); //
|
|
139
|
+
.where(eq(profiles.id, profileId)); // [OK] type safe
|
|
140
140
|
}
|
|
141
141
|
```
|
|
142
142
|
|
|
@@ -177,7 +177,7 @@ if (user.profileId) {
|
|
|
177
177
|
@@@/section:type-safety
|
|
178
178
|
|
|
179
179
|
@@@section:logging
|
|
180
|
-
##
|
|
180
|
+
## # Logging Guidelines
|
|
181
181
|
|
|
182
182
|
### Use Structured Logging
|
|
183
183
|
|
|
@@ -188,10 +188,10 @@ if (user.profileId) {
|
|
|
188
188
|
@@@/section:logging
|
|
189
189
|
|
|
190
190
|
@@@section:database-operations
|
|
191
|
-
##
|
|
191
|
+
## # Database Operation Guidelines
|
|
192
192
|
|
|
193
193
|
@@@section:no-loops
|
|
194
|
-
###
|
|
194
|
+
### [!] Never Execute Database Operations in Loops
|
|
195
195
|
|
|
196
196
|
[anti-pattern and correct pattern examples]
|
|
197
197
|
|
|
@@ -206,7 +206,7 @@ if (user.profileId) {
|
|
|
206
206
|
@@@/section:database-operations
|
|
207
207
|
|
|
208
208
|
@@@section:error-handling
|
|
209
|
-
##
|
|
209
|
+
## # Error Handling
|
|
210
210
|
|
|
211
211
|
### Graceful Degradation
|
|
212
212
|
[code example]
|
|
@@ -217,7 +217,7 @@ if (user.profileId) {
|
|
|
217
217
|
@@@/section:error-handling
|
|
218
218
|
|
|
219
219
|
@@@section:router-guidelines
|
|
220
|
-
##
|
|
220
|
+
## # Router Guidelines
|
|
221
221
|
|
|
222
222
|
### Hono Router Example
|
|
223
223
|
[code example]
|
|
@@ -228,7 +228,7 @@ if (user.profileId) {
|
|
|
228
228
|
@@@/section:router-guidelines
|
|
229
229
|
|
|
230
230
|
@@@section:checklist
|
|
231
|
-
##
|
|
231
|
+
## [OK] Checklist
|
|
232
232
|
|
|
233
233
|
Before committing, confirm:
|
|
234
234
|
|
|
@@ -246,7 +246,7 @@ Before committing, confirm:
|
|
|
246
246
|
@@@/section:checklist
|
|
247
247
|
|
|
248
248
|
@@@section:reference-examples
|
|
249
|
-
##
|
|
249
|
+
## # Reference Examples
|
|
250
250
|
|
|
251
251
|
| Feature | Reference File |
|
|
252
252
|
|---------|----------------|
|
|
@@ -268,13 +268,13 @@ This index helps you quickly locate the sections needed for backend tasks.
|
|
|
268
268
|
|
|
269
269
|
| Section | Key Content | Section ID |
|
|
270
270
|
|---------|-------------|------------|
|
|
271
|
-
|
|
|
272
|
-
|
|
|
273
|
-
|
|
|
274
|
-
|
|
|
275
|
-
|
|
|
276
|
-
|
|
|
277
|
-
|
|
|
271
|
+
| # Directory Structure | Module directory template, examples | `directory-structure` |
|
|
272
|
+
| # Type Safety Guidelines | TypeScript rules, Zod Schema | `type-safety` |
|
|
273
|
+
| # Logging Guidelines | Structured logging, no console | `logging` |
|
|
274
|
+
| # Database Operations | Query directory, batch operations | `database-operations` |
|
|
275
|
+
| # Error Handling | Graceful degradation, response format | `error-handling` |
|
|
276
|
+
| # Router Guidelines | Route definitions, middleware | `router-guidelines` |
|
|
277
|
+
| [OK] Checklist | Pre-commit checks | `checklist` |
|
|
278
278
|
|
|
279
279
|
## How to Read Sections
|
|
280
280
|
|
|
@@ -286,16 +286,16 @@ sed -n '/@@@section:database-operations/,/@@@\/section:database-operations/p' do
|
|
|
286
286
|
## By Scenario
|
|
287
287
|
|
|
288
288
|
### Scenario 1: Create New API Module
|
|
289
|
-
- Required:
|
|
290
|
-
- Also read:
|
|
289
|
+
- Required: # Directory Structure (`directory-structure`)
|
|
290
|
+
- Also read: # Type Safety Guidelines (`type-safety`)
|
|
291
291
|
|
|
292
292
|
### Scenario 2: Write Database Operations
|
|
293
|
-
- Required:
|
|
294
|
-
- Reference:
|
|
293
|
+
- Required: # Database Operations (`database-operations`)
|
|
294
|
+
- Reference: # Error Handling (`error-handling`)
|
|
295
295
|
|
|
296
296
|
### Scenario 3: Add New Endpoint
|
|
297
|
-
- Required:
|
|
298
|
-
- Reference:
|
|
297
|
+
- Required: # Router Guidelines (`router-guidelines`)
|
|
298
|
+
- Reference: # Type Safety Guidelines (`type-safety`)
|
|
299
299
|
|
|
300
300
|
[... add more scenarios based on project needs ...]
|
|
301
301
|
|
|
@@ -6,7 +6,7 @@ Scan the project's frontend code, analyze existing code patterns and tech stack,
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## [!] CRITICAL: Requirements
|
|
10
10
|
|
|
11
11
|
1. **Language**: All documentation must be written in **English**
|
|
12
12
|
2. **Section Markers**: Use `@@@section:kebab-case-id` and `@@@/section:kebab-case-id` to mark sections
|
|
@@ -98,7 +98,7 @@ mkdir -p workflow/structure/frontend
|
|
|
98
98
|
These guidelines define the development standards and best practices for [Project Name] frontend modules.
|
|
99
99
|
|
|
100
100
|
@@@section:directory-structure
|
|
101
|
-
##
|
|
101
|
+
## # Directory Structure Guidelines
|
|
102
102
|
|
|
103
103
|
@@@section:module-organization
|
|
104
104
|
### Module Organization
|
|
@@ -112,15 +112,15 @@ These guidelines define the development standards and best practices for [Projec
|
|
|
112
112
|
@@@/section:directory-structure
|
|
113
113
|
|
|
114
114
|
@@@section:type-safety
|
|
115
|
-
##
|
|
115
|
+
## # Type Safety Guidelines
|
|
116
116
|
|
|
117
117
|
@@@section:backend-contract-types
|
|
118
118
|
### 1. Backend Contract Types vs Frontend View Models
|
|
119
119
|
|
|
120
|
-
####
|
|
120
|
+
#### [OK] Correct Approach - Import Types from Backend
|
|
121
121
|
[code example]
|
|
122
122
|
|
|
123
|
-
####
|
|
123
|
+
#### [X] Wrong Approach
|
|
124
124
|
[anti-pattern code example]
|
|
125
125
|
|
|
126
126
|
@@@/section:backend-contract-types
|
|
@@ -128,12 +128,12 @@ These guidelines define the development standards and best practices for [Projec
|
|
|
128
128
|
@@@/section:type-safety
|
|
129
129
|
|
|
130
130
|
@@@section:hook-development
|
|
131
|
-
##
|
|
131
|
+
## # Hook Development Guidelines
|
|
132
132
|
|
|
133
133
|
@@@section:query-hook-guidelines
|
|
134
134
|
### 1. Query Hook Standards
|
|
135
135
|
|
|
136
|
-
####
|
|
136
|
+
#### [OK] Correct Query Hook Pattern
|
|
137
137
|
[code example]
|
|
138
138
|
|
|
139
139
|
@@@/section:query-hook-guidelines
|
|
@@ -141,7 +141,7 @@ These guidelines define the development standards and best practices for [Projec
|
|
|
141
141
|
@@@section:mutation-hook-guidelines
|
|
142
142
|
### 2. Mutation Hook Standards
|
|
143
143
|
|
|
144
|
-
####
|
|
144
|
+
#### [OK] Correct Mutation Hook Pattern
|
|
145
145
|
[code example]
|
|
146
146
|
|
|
147
147
|
@@@/section:mutation-hook-guidelines
|
|
@@ -149,7 +149,7 @@ These guidelines define the development standards and best practices for [Projec
|
|
|
149
149
|
@@@/section:hook-development
|
|
150
150
|
|
|
151
151
|
@@@section:api-calls
|
|
152
|
-
##
|
|
152
|
+
## # API Call Guidelines
|
|
153
153
|
|
|
154
154
|
### Basic Usage
|
|
155
155
|
[code example]
|
|
@@ -157,7 +157,7 @@ These guidelines define the development standards and best practices for [Projec
|
|
|
157
157
|
@@@/section:api-calls
|
|
158
158
|
|
|
159
159
|
@@@section:state-management
|
|
160
|
-
##
|
|
160
|
+
## # State Management Guidelines
|
|
161
161
|
|
|
162
162
|
### 1. URL State Management
|
|
163
163
|
[code example]
|
|
@@ -168,7 +168,7 @@ These guidelines define the development standards and best practices for [Projec
|
|
|
168
168
|
@@@/section:state-management
|
|
169
169
|
|
|
170
170
|
@@@section:component-development
|
|
171
|
-
##
|
|
171
|
+
## # Component Development Guidelines
|
|
172
172
|
|
|
173
173
|
### 1. Component Structure
|
|
174
174
|
[code example]
|
|
@@ -179,14 +179,14 @@ These guidelines define the development standards and best practices for [Projec
|
|
|
179
179
|
@@@/section:component-development
|
|
180
180
|
|
|
181
181
|
@@@section:performance-optimization
|
|
182
|
-
##
|
|
182
|
+
## # Performance Optimization Guidelines
|
|
183
183
|
|
|
184
184
|
[performance rules]
|
|
185
185
|
|
|
186
186
|
@@@/section:performance-optimization
|
|
187
187
|
|
|
188
188
|
@@@section:code-quality
|
|
189
|
-
##
|
|
189
|
+
## # Code Quality Guidelines
|
|
190
190
|
|
|
191
191
|
### Lint and Formatting
|
|
192
192
|
[tool configuration and usage]
|
|
@@ -194,7 +194,7 @@ These guidelines define the development standards and best practices for [Projec
|
|
|
194
194
|
@@@/section:code-quality
|
|
195
195
|
|
|
196
196
|
@@@section:checklist
|
|
197
|
-
##
|
|
197
|
+
## [OK] Checklist
|
|
198
198
|
|
|
199
199
|
- [ ] Code passes lint check
|
|
200
200
|
- [ ] Type check passes
|
|
@@ -203,7 +203,7 @@ These guidelines define the development standards and best practices for [Projec
|
|
|
203
203
|
@@@/section:checklist
|
|
204
204
|
|
|
205
205
|
@@@section:reference-examples
|
|
206
|
-
##
|
|
206
|
+
## # Reference Examples
|
|
207
207
|
|
|
208
208
|
| Feature | Reference File |
|
|
209
209
|
|---------|----------------|
|