@mind-fold/open-flow 0.1.10 → 0.1.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/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +25 -40
- package/dist/commands/init.js.map +1 -1
- package/dist/configurators/claude.js +6 -6
- package/dist/configurators/claude.js.map +1 -1
- package/dist/configurators/cursor.js +6 -6
- package/dist/configurators/cursor.js.map +1 -1
- package/dist/configurators/templates.d.ts.map +1 -1
- package/dist/configurators/templates.js +14 -995
- package/dist/configurators/templates.js.map +1 -1
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +25 -1549
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/templates/commands/before-backend-dev.txt +10 -0
- package/dist/templates/commands/before-frontend-dev.txt +10 -0
- package/dist/templates/commands/check-backend.txt +9 -0
- package/dist/templates/commands/check-frontend.txt +9 -0
- package/dist/templates/commands/create-command.txt +155 -0
- package/dist/templates/commands/generate-backend-structure.txt +341 -0
- package/dist/templates/commands/generate-frontend-structure.txt +297 -0
- package/dist/templates/commands/index.d.ts +18 -0
- package/dist/templates/commands/index.d.ts.map +1 -0
- package/dist/templates/commands/index.js +19 -0
- package/dist/templates/commands/index.js.map +1 -0
- package/dist/templates/commands/init-agent.txt +11 -0
- package/dist/templates/commands/onboard-developer.txt +34 -0
- package/dist/templates/commands/record-agent-flow.txt +64 -0
- package/dist/templates/commands/record-question.txt +38 -0
- package/dist/templates/commands/update-backend-structure.txt +16 -0
- package/dist/templates/commands/update-frontend-structure.txt +16 -0
- package/dist/templates/extract.d.ts +20 -0
- package/dist/templates/extract.d.ts.map +1 -0
- package/dist/templates/extract.js +34 -0
- package/dist/templates/extract.js.map +1 -0
- package/dist/templates/markdown/agent-progress-index.d.ts +2 -0
- package/dist/templates/markdown/agent-progress-index.d.ts.map +1 -0
- package/dist/templates/markdown/agent-progress-index.js +5 -0
- package/dist/templates/markdown/agent-progress-index.js.map +1 -0
- package/dist/templates/markdown/agent-progress-index.md.txt +124 -0
- package/dist/templates/markdown/backend-doc.d.ts +2 -0
- package/dist/templates/markdown/backend-doc.d.ts.map +1 -0
- package/dist/templates/markdown/backend-doc.js +5 -0
- package/dist/templates/markdown/backend-doc.js.map +1 -0
- package/dist/templates/markdown/backend-doc.md.txt +154 -0
- package/dist/templates/markdown/backend-index.d.ts +2 -0
- package/dist/templates/markdown/backend-index.d.ts.map +1 -0
- package/dist/templates/markdown/backend-index.js +5 -0
- package/dist/templates/markdown/backend-index.js.map +1 -0
- package/dist/templates/markdown/backend-index.md.txt +45 -0
- package/dist/templates/markdown/flow.d.ts +2 -0
- package/dist/templates/markdown/flow.d.ts.map +1 -0
- package/dist/templates/markdown/flow.js +5 -0
- package/dist/templates/markdown/flow.js.map +1 -0
- package/dist/templates/markdown/flow.md.txt +342 -0
- package/dist/templates/markdown/frontend-doc.d.ts +2 -0
- package/dist/templates/markdown/frontend-doc.d.ts.map +1 -0
- package/dist/templates/markdown/frontend-doc.js +5 -0
- package/dist/templates/markdown/frontend-doc.js.map +1 -0
- package/dist/templates/markdown/frontend-doc.md.txt +175 -0
- package/dist/templates/markdown/frontend-index.d.ts +2 -0
- package/dist/templates/markdown/frontend-index.d.ts.map +1 -0
- package/dist/templates/markdown/frontend-index.js +5 -0
- package/dist/templates/markdown/frontend-index.js.map +1 -0
- package/dist/templates/markdown/frontend-index.md.txt +46 -0
- package/dist/templates/markdown/gitignore.d.ts +2 -0
- package/dist/templates/markdown/gitignore.d.ts.map +1 -0
- package/dist/templates/markdown/gitignore.js +5 -0
- package/dist/templates/markdown/gitignore.js.map +1 -0
- package/dist/templates/markdown/gitignore.txt +3 -0
- package/dist/templates/markdown/index.d.ts +12 -0
- package/dist/templates/markdown/index.d.ts.map +1 -0
- package/dist/templates/markdown/index.js +13 -0
- package/dist/templates/markdown/index.js.map +1 -0
- package/dist/templates/scripts/add-session.d.ts +2 -0
- package/dist/templates/scripts/add-session.d.ts.map +1 -0
- package/dist/templates/scripts/add-session.js +5 -0
- package/dist/templates/scripts/add-session.js.map +1 -0
- package/dist/templates/scripts/add-session.sh.txt +257 -0
- package/dist/templates/scripts/extract-md-headings.d.ts +2 -0
- package/dist/templates/scripts/extract-md-headings.d.ts.map +1 -0
- package/dist/templates/scripts/extract-md-headings.js +5 -0
- package/dist/templates/scripts/extract-md-headings.js.map +1 -0
- package/dist/templates/scripts/extract-md-headings.sh.txt +260 -0
- package/dist/templates/scripts/feature.d.ts +2 -0
- package/dist/templates/scripts/feature.d.ts.map +1 -0
- package/dist/templates/scripts/feature.js +5 -0
- package/dist/templates/scripts/feature.js.map +1 -0
- package/dist/templates/scripts/feature.sh.txt +243 -0
- package/dist/templates/scripts/get-context.d.ts +2 -0
- package/dist/templates/scripts/get-context.d.ts.map +1 -0
- package/dist/templates/scripts/get-context.js +5 -0
- package/dist/templates/scripts/get-context.js.map +1 -0
- package/dist/templates/scripts/get-context.sh.txt +243 -0
- package/dist/templates/scripts/get-developer.d.ts +2 -0
- package/dist/templates/scripts/get-developer.d.ts.map +1 -0
- package/dist/templates/scripts/get-developer.js +5 -0
- package/dist/templates/scripts/get-developer.js.map +1 -0
- package/dist/templates/scripts/get-developer.sh.txt +16 -0
- package/dist/templates/scripts/index.d.ts +12 -0
- package/dist/templates/scripts/index.d.ts.map +1 -0
- package/dist/templates/scripts/index.js +13 -0
- package/dist/templates/scripts/index.js.map +1 -0
- package/dist/templates/scripts/init-developer.d.ts +2 -0
- package/dist/templates/scripts/init-developer.d.ts.map +1 -0
- package/dist/templates/scripts/init-developer.js +5 -0
- package/dist/templates/scripts/init-developer.js.map +1 -0
- package/dist/templates/scripts/init-developer.sh.txt +114 -0
- package/dist/templates/scripts/update-index.d.ts +2 -0
- package/dist/templates/scripts/update-index.d.ts.map +1 -0
- package/dist/templates/scripts/update-index.js +5 -0
- package/dist/templates/scripts/update-index.js.map +1 -0
- package/dist/templates/scripts/update-index.sh.txt +244 -0
- package/dist/utils/file-writer.d.ts +21 -0
- package/dist/utils/file-writer.d.ts.map +1 -0
- package/dist/utils/file-writer.js +93 -0
- package/dist/utils/file-writer.js.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
# Generate Frontend Structure Guidelines
|
|
2
|
+
|
|
3
|
+
## Task Description
|
|
4
|
+
|
|
5
|
+
Scan the project's frontend code, analyze existing code patterns and tech stack, then auto-generate `doc.md` (detailed guidelines) with section markers, then generate `index.md` (navigation index) using section IDs.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## ⚠️ CRITICAL: Requirements
|
|
10
|
+
|
|
11
|
+
1. **Language**: All documentation must be written in **English**
|
|
12
|
+
2. **Section Markers**: Use `@@@section:kebab-case-id` and `@@@/section:kebab-case-id` to mark sections
|
|
13
|
+
3. **Index**: Reference sections by ID, not line numbers
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Execution Steps
|
|
18
|
+
|
|
19
|
+
### Step 1: Identify Frontend Directory
|
|
20
|
+
|
|
21
|
+
Scan these possible frontend directories to determine the main frontend code location:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Common frontend directories
|
|
25
|
+
ls -la apps/web/ 2>/dev/null || \
|
|
26
|
+
ls -la src/ 2>/dev/null || \
|
|
27
|
+
ls -la frontend/ 2>/dev/null || \
|
|
28
|
+
ls -la client/ 2>/dev/null || \
|
|
29
|
+
ls -la packages/web/ 2>/dev/null
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Step 2: Identify Tech Stack
|
|
33
|
+
|
|
34
|
+
Analyze `package.json` and code files to identify:
|
|
35
|
+
|
|
36
|
+
**Frameworks and Libraries**:
|
|
37
|
+
- [ ] Framework: Next.js / React / Vue / Svelte / Angular
|
|
38
|
+
- [ ] State Management: React Query / Zustand / Redux / Jotai / Pinia
|
|
39
|
+
- [ ] UI Library: Shadcn / Radix / MUI / Ant Design / Chakra
|
|
40
|
+
- [ ] Styling: Tailwind / CSS Modules / Styled Components / Sass
|
|
41
|
+
- [ ] Types: TypeScript / JavaScript
|
|
42
|
+
- [ ] API Client: tRPC / oRPC / REST / GraphQL
|
|
43
|
+
|
|
44
|
+
**Toolchain**:
|
|
45
|
+
- [ ] Build Tool: Vite / Webpack / Turbopack
|
|
46
|
+
- [ ] Package Manager: pnpm / npm / yarn / bun
|
|
47
|
+
- [ ] Linter: Biome / ESLint / Prettier
|
|
48
|
+
|
|
49
|
+
### Step 3: Analyze Code Patterns
|
|
50
|
+
|
|
51
|
+
Scan frontend code to extract the following patterns:
|
|
52
|
+
|
|
53
|
+
**Directory Structure**:
|
|
54
|
+
```bash
|
|
55
|
+
# List main directory structure
|
|
56
|
+
find [frontend-dir] -type d -maxdepth 3 | head -50
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Component Patterns**:
|
|
60
|
+
- File naming convention (PascalCase / kebab-case)
|
|
61
|
+
- Component file structure (single file / folder)
|
|
62
|
+
- Export style (default / named)
|
|
63
|
+
|
|
64
|
+
**Hook Patterns**:
|
|
65
|
+
- Naming convention (useXxx)
|
|
66
|
+
- Query Hook patterns
|
|
67
|
+
- Mutation Hook patterns
|
|
68
|
+
- Custom Hook patterns
|
|
69
|
+
|
|
70
|
+
**Type Definition Patterns**:
|
|
71
|
+
- Type file locations
|
|
72
|
+
- Type import style
|
|
73
|
+
- Backend type reuse patterns
|
|
74
|
+
|
|
75
|
+
**API Call Patterns**:
|
|
76
|
+
- API client initialization
|
|
77
|
+
- Request/Response handling
|
|
78
|
+
- Error handling approach
|
|
79
|
+
|
|
80
|
+
**State Management Patterns**:
|
|
81
|
+
- Global state
|
|
82
|
+
- Local state
|
|
83
|
+
- URL state synchronization
|
|
84
|
+
|
|
85
|
+
### Step 4: Generate `doc.md` with Section Markers
|
|
86
|
+
|
|
87
|
+
Create directory and generate detailed guidelines:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
mkdir -p workflow/structure/frontend
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**doc.md template** (adjust based on project):
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
# Frontend Development Guidelines
|
|
97
|
+
|
|
98
|
+
These guidelines define the development standards and best practices for [Project Name] frontend modules.
|
|
99
|
+
|
|
100
|
+
@@@section:directory-structure
|
|
101
|
+
## 📁 Directory Structure Guidelines
|
|
102
|
+
|
|
103
|
+
@@@section:module-organization
|
|
104
|
+
### Module Organization
|
|
105
|
+
[Describe directory structure with tree diagram code block]
|
|
106
|
+
|
|
107
|
+
**Reference Example**:
|
|
108
|
+
- `[path]` - [description]
|
|
109
|
+
|
|
110
|
+
@@@/section:module-organization
|
|
111
|
+
|
|
112
|
+
@@@/section:directory-structure
|
|
113
|
+
|
|
114
|
+
@@@section:type-safety
|
|
115
|
+
## 🎯 Type Safety Guidelines
|
|
116
|
+
|
|
117
|
+
@@@section:backend-contract-types
|
|
118
|
+
### 1. Backend Contract Types vs Frontend View Models
|
|
119
|
+
|
|
120
|
+
#### ✅ Correct Approach - Import Types from Backend
|
|
121
|
+
[code example]
|
|
122
|
+
|
|
123
|
+
#### ❌ Wrong Approach
|
|
124
|
+
[anti-pattern code example]
|
|
125
|
+
|
|
126
|
+
@@@/section:backend-contract-types
|
|
127
|
+
|
|
128
|
+
@@@/section:type-safety
|
|
129
|
+
|
|
130
|
+
@@@section:hook-development
|
|
131
|
+
## 🪝 Hook Development Guidelines
|
|
132
|
+
|
|
133
|
+
@@@section:query-hook-guidelines
|
|
134
|
+
### 1. Query Hook Standards
|
|
135
|
+
|
|
136
|
+
#### ✅ Correct Query Hook Pattern
|
|
137
|
+
[code example]
|
|
138
|
+
|
|
139
|
+
@@@/section:query-hook-guidelines
|
|
140
|
+
|
|
141
|
+
@@@section:mutation-hook-guidelines
|
|
142
|
+
### 2. Mutation Hook Standards
|
|
143
|
+
|
|
144
|
+
#### ✅ Correct Mutation Hook Pattern
|
|
145
|
+
[code example]
|
|
146
|
+
|
|
147
|
+
@@@/section:mutation-hook-guidelines
|
|
148
|
+
|
|
149
|
+
@@@/section:hook-development
|
|
150
|
+
|
|
151
|
+
@@@section:api-calls
|
|
152
|
+
## 🔌 API Call Guidelines
|
|
153
|
+
|
|
154
|
+
### Basic Usage
|
|
155
|
+
[code example]
|
|
156
|
+
|
|
157
|
+
@@@/section:api-calls
|
|
158
|
+
|
|
159
|
+
@@@section:state-management
|
|
160
|
+
## 🏗️ State Management Guidelines
|
|
161
|
+
|
|
162
|
+
### 1. URL State Management
|
|
163
|
+
[code example]
|
|
164
|
+
|
|
165
|
+
### 2. React Context Standards
|
|
166
|
+
[code example]
|
|
167
|
+
|
|
168
|
+
@@@/section:state-management
|
|
169
|
+
|
|
170
|
+
@@@section:component-development
|
|
171
|
+
## 🎨 Component Development Guidelines
|
|
172
|
+
|
|
173
|
+
### 1. Component Structure
|
|
174
|
+
[code example]
|
|
175
|
+
|
|
176
|
+
### 2. Styling Standards
|
|
177
|
+
[code example]
|
|
178
|
+
|
|
179
|
+
@@@/section:component-development
|
|
180
|
+
|
|
181
|
+
@@@section:performance-optimization
|
|
182
|
+
## ⚡ Performance Optimization Guidelines
|
|
183
|
+
|
|
184
|
+
[performance rules]
|
|
185
|
+
|
|
186
|
+
@@@/section:performance-optimization
|
|
187
|
+
|
|
188
|
+
@@@section:code-quality
|
|
189
|
+
## 🔍 Code Quality Guidelines
|
|
190
|
+
|
|
191
|
+
### Lint and Formatting
|
|
192
|
+
[tool configuration and usage]
|
|
193
|
+
|
|
194
|
+
@@@/section:code-quality
|
|
195
|
+
|
|
196
|
+
@@@section:checklist
|
|
197
|
+
## ✅ Checklist
|
|
198
|
+
|
|
199
|
+
- [ ] Code passes lint check
|
|
200
|
+
- [ ] Type check passes
|
|
201
|
+
- [ ] [other check items...]
|
|
202
|
+
|
|
203
|
+
@@@/section:checklist
|
|
204
|
+
|
|
205
|
+
@@@section:reference-examples
|
|
206
|
+
## 📚 Reference Examples
|
|
207
|
+
|
|
208
|
+
| Feature | Reference File |
|
|
209
|
+
|---------|----------------|
|
|
210
|
+
| [Feature1] | `[path]` |
|
|
211
|
+
|
|
212
|
+
@@@/section:reference-examples
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Step 5: Generate `index.md` with Section IDs
|
|
216
|
+
|
|
217
|
+
```markdown
|
|
218
|
+
# Frontend Development Guidelines Index
|
|
219
|
+
|
|
220
|
+
> **Full Documentation**: See `./doc.md` for detailed guidelines
|
|
221
|
+
|
|
222
|
+
This index helps you quickly locate the guidelines you need based on your task type.
|
|
223
|
+
|
|
224
|
+
## Quick Navigation
|
|
225
|
+
|
|
226
|
+
| Development Task | Section to Read | Section ID |
|
|
227
|
+
|-----------------|-----------------|------------|
|
|
228
|
+
| **New feature module** | Directory Structure | `directory-structure` |
|
|
229
|
+
| **Write Query Hook** | Hook Guidelines > Query Hook | `query-hook-guidelines` |
|
|
230
|
+
| **Write Mutation Hook** | Hook Guidelines > Mutation Hook | `mutation-hook-guidelines` |
|
|
231
|
+
| **API calls** | API Call Guidelines | `api-calls` |
|
|
232
|
+
| **State management** | State Management Guidelines | `state-management` |
|
|
233
|
+
| **Write component** | Component Guidelines | `component-development` |
|
|
234
|
+
| **Performance optimization** | Performance Guidelines | `performance-optimization` |
|
|
235
|
+
| **Code quality check** | Code Quality Guidelines | `code-quality` |
|
|
236
|
+
|
|
237
|
+
## How to Read Sections
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
# Extract a specific section by ID
|
|
241
|
+
sed -n '/@@@section:query-hook-guidelines/,/@@@\/section:query-hook-guidelines/p' doc.md
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## By Development Scenario
|
|
245
|
+
|
|
246
|
+
### Scenario 1: Create a new Query Hook
|
|
247
|
+
|
|
248
|
+
**Required Reading**:
|
|
249
|
+
- Type Safety > Backend Contract Types (`backend-contract-types`)
|
|
250
|
+
- Hook Guidelines > Query Hook (`query-hook-guidelines`)
|
|
251
|
+
|
|
252
|
+
### Scenario 2: Create a new UI Component
|
|
253
|
+
|
|
254
|
+
**Required Reading**:
|
|
255
|
+
- Component Guidelines (`component-development`)
|
|
256
|
+
|
|
257
|
+
[... add more scenarios based on project needs ...]
|
|
258
|
+
|
|
259
|
+
## Core Rules Quick Reference
|
|
260
|
+
|
|
261
|
+
| Rule | Section ID |
|
|
262
|
+
|------|------------|
|
|
263
|
+
| Import types from backend, don't redefine | `backend-contract-types` |
|
|
264
|
+
| Query Hook patterns | `query-hook-guidelines` |
|
|
265
|
+
| [other core rules...] | `section-id` |
|
|
266
|
+
|
|
267
|
+
## Reference Example Files
|
|
268
|
+
|
|
269
|
+
| Feature | Reference File |
|
|
270
|
+
|---------|----------------|
|
|
271
|
+
| Query Hook | `[path]` |
|
|
272
|
+
| Mutation Hook | `[path]` |
|
|
273
|
+
| Component | `[path]` |
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## Output Requirements
|
|
279
|
+
|
|
280
|
+
1. **Create directory**: `mkdir -p workflow/structure/frontend`
|
|
281
|
+
2. **Write in English**: All documentation must be in English
|
|
282
|
+
3. **Add section markers**: Use `@@@section:id` and `@@@/section:id` format
|
|
283
|
+
4. **Generate index.md**: Reference sections by ID, not line numbers
|
|
284
|
+
5. **Use actual project code**: Examples should come from real project files
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## Completion Confirmation
|
|
289
|
+
|
|
290
|
+
- [ ] `doc.md` created with detailed guidelines in **English**
|
|
291
|
+
- [ ] Section markers added to all major sections
|
|
292
|
+
- [ ] `index.md` created with section IDs
|
|
293
|
+
- [ ] Example code from actual project files
|
|
294
|
+
- [ ] Covers all major patterns used in project
|
|
295
|
+
|
|
296
|
+
Report: "Frontend structure guidelines generated, please check `workflow/structure/frontend/` directory"
|
|
297
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command templates for open-flow workflow
|
|
3
|
+
* Each command is stored as a .txt file
|
|
4
|
+
*/
|
|
5
|
+
export declare const initAgentTemplate: string;
|
|
6
|
+
export declare const checkFrontendTemplate: string;
|
|
7
|
+
export declare const checkBackendTemplate: string;
|
|
8
|
+
export declare const recordAgentFlowTemplate: string;
|
|
9
|
+
export declare const recordQuestionTemplate: string;
|
|
10
|
+
export declare const onboardDeveloperTemplate: string;
|
|
11
|
+
export declare const generateFrontendStructureTemplate: string;
|
|
12
|
+
export declare const generateBackendStructureTemplate: string;
|
|
13
|
+
export declare const beforeFrontendDevTemplate: string;
|
|
14
|
+
export declare const beforeBackendDevTemplate: string;
|
|
15
|
+
export declare const updateFrontendStructureTemplate: string;
|
|
16
|
+
export declare const updateBackendStructureTemplate: string;
|
|
17
|
+
export declare const createCommandTemplate: string;
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command templates for open-flow workflow
|
|
3
|
+
* Each command is stored as a .txt file
|
|
4
|
+
*/
|
|
5
|
+
import { readCommand } from "../extract.js";
|
|
6
|
+
export const initAgentTemplate = readCommand("init-agent.txt");
|
|
7
|
+
export const checkFrontendTemplate = readCommand("check-frontend.txt");
|
|
8
|
+
export const checkBackendTemplate = readCommand("check-backend.txt");
|
|
9
|
+
export const recordAgentFlowTemplate = readCommand("record-agent-flow.txt");
|
|
10
|
+
export const recordQuestionTemplate = readCommand("record-question.txt");
|
|
11
|
+
export const onboardDeveloperTemplate = readCommand("onboard-developer.txt");
|
|
12
|
+
export const generateFrontendStructureTemplate = readCommand("generate-frontend-structure.txt");
|
|
13
|
+
export const generateBackendStructureTemplate = readCommand("generate-backend-structure.txt");
|
|
14
|
+
export const beforeFrontendDevTemplate = readCommand("before-frontend-dev.txt");
|
|
15
|
+
export const beforeBackendDevTemplate = readCommand("before-backend-dev.txt");
|
|
16
|
+
export const updateFrontendStructureTemplate = readCommand("update-frontend-structure.txt");
|
|
17
|
+
export const updateBackendStructureTemplate = readCommand("update-backend-structure.txt");
|
|
18
|
+
export const createCommandTemplate = readCommand("create-command.txt");
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Read the project root's init-agent.md file and follow the instructions to initialize the AI session.
|
|
2
|
+
|
|
3
|
+
Execute these steps:
|
|
4
|
+
1. Get full session context (one command):
|
|
5
|
+
```bash
|
|
6
|
+
./workflow/scripts/get-context.sh
|
|
7
|
+
```
|
|
8
|
+
2. If not initialized, guide the user to run: `./workflow/scripts/init-developer.sh <name>`
|
|
9
|
+
3. Read relevant structure guidelines based on the task
|
|
10
|
+
4. Report ready status and ask for the task
|
|
11
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
A new developer needs onboarding.
|
|
2
|
+
|
|
3
|
+
Execute these steps in order:
|
|
4
|
+
|
|
5
|
+
1. **Explain the workflow system** - Describe how open-flow works:
|
|
6
|
+
- `workflow/` directory structure
|
|
7
|
+
- Short commands available (/init-agent, /check-frontend, /check-backend, /record-agent-flow)
|
|
8
|
+
- Guidelines in `workflow/structure/`
|
|
9
|
+
- Progress tracking in `workflow/agent-progress/`
|
|
10
|
+
|
|
11
|
+
2. **Initialize their identity**:
|
|
12
|
+
```bash
|
|
13
|
+
./workflow/scripts/init-developer.sh <developer-name>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
3. **Guide them through first task**:
|
|
17
|
+
- Use `./workflow/scripts/get-context.sh` to get full context
|
|
18
|
+
- Use `./workflow/scripts/feature.sh list` to see active features
|
|
19
|
+
- Read relevant guidelines in `workflow/structure/`
|
|
20
|
+
- Start coding
|
|
21
|
+
|
|
22
|
+
4. **Key scripts to know**:
|
|
23
|
+
| Script | Purpose |
|
|
24
|
+
|--------|---------|
|
|
25
|
+
| `get-context.sh` | Get full session context |
|
|
26
|
+
| `feature.sh` | Manage features (create/archive/list) |
|
|
27
|
+
| `add-session.sh` | One-click session recording |
|
|
28
|
+
| `update-index.sh` | Auto-update index.md |
|
|
29
|
+
|
|
30
|
+
Key points to emphasize:
|
|
31
|
+
- AI should NOT execute `git commit` - human is responsible for testing and committing
|
|
32
|
+
- Each developer has their own progress directory
|
|
33
|
+
- Read guidelines before coding (mandatory)
|
|
34
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
⚠️ **Prerequisite**: This command should only be used AFTER the human has tested and committed the code.
|
|
2
|
+
|
|
3
|
+
**AI must NOT execute git commit** - only read history (`git log`, `git status`, `git diff`).
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Record Work Progress (Simplified - Only 2 Steps)
|
|
8
|
+
|
|
9
|
+
### Step 1: Get Context
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
./workflow/scripts/get-context.sh
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Step 2: One-Click Add Session
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Method 1: Simple parameters
|
|
19
|
+
./workflow/scripts/add-session.sh \
|
|
20
|
+
--title "Session Title" \
|
|
21
|
+
--commit "hash1,hash2" \
|
|
22
|
+
--summary "Brief summary of what was done"
|
|
23
|
+
|
|
24
|
+
# Method 2: Pass detailed content via stdin
|
|
25
|
+
cat << 'EOF' | ./workflow/scripts/add-session.sh --title "Title" --commit "hash"
|
|
26
|
+
| Feature | Description |
|
|
27
|
+
|---------|-------------|
|
|
28
|
+
| New API | Added user authentication endpoint |
|
|
29
|
+
| Frontend | Updated login form |
|
|
30
|
+
|
|
31
|
+
**Updated Files**:
|
|
32
|
+
- `packages/api/modules/auth/router.ts`
|
|
33
|
+
- `apps/web/modules/auth/components/login-form.tsx`
|
|
34
|
+
EOF
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Auto-completes**:
|
|
38
|
+
- ✅ Appends session to progress-N.md
|
|
39
|
+
- ✅ Auto-detects line count, creates new file if >2000 lines
|
|
40
|
+
- ✅ Updates index.md (Total Sessions +1, Last Active, line stats, history)
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Archive Completed Feature (if any)
|
|
45
|
+
|
|
46
|
+
If a feature was completed this session:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
./workflow/scripts/feature.sh archive <feature-name>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Script Command Reference
|
|
55
|
+
|
|
56
|
+
| Command | Purpose |
|
|
57
|
+
|---------|---------|
|
|
58
|
+
| `get-context.sh` | Get all context info |
|
|
59
|
+
| `add-session.sh --title "..." --commit "..."` | **One-click add session (recommended)** |
|
|
60
|
+
| `update-index.sh add-session` | Update index.md separately |
|
|
61
|
+
| `feature.sh create <name>` | Create new feature |
|
|
62
|
+
| `feature.sh archive <name>` | Archive completed feature |
|
|
63
|
+
| `feature.sh list` | List active features |
|
|
64
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
Record the problem you just solved in `workflow/big-question/` directory.
|
|
2
|
+
|
|
3
|
+
Create a new markdown file with a descriptive name (e.g., `issue-name.md`) that documents:
|
|
4
|
+
|
|
5
|
+
1. **Problem Description**: What was the issue?
|
|
6
|
+
2. **Initial Attempts**: What did you try first?
|
|
7
|
+
3. **Why Initial Attempts Failed**: Why didn't the first approaches work?
|
|
8
|
+
4. **Final Solution**: What ultimately solved the problem?
|
|
9
|
+
5. **Why It Worked**: What made this solution effective?
|
|
10
|
+
6. **Key Insight**: How did you arrive at this solution? What was the "aha" moment?
|
|
11
|
+
|
|
12
|
+
This creates a knowledge base of solved problems for future reference, helping you and other developers avoid the same pitfalls.
|
|
13
|
+
|
|
14
|
+
**Format**:
|
|
15
|
+
```markdown
|
|
16
|
+
# [Problem Title]
|
|
17
|
+
|
|
18
|
+
## Problem Description
|
|
19
|
+
[Describe the issue clearly]
|
|
20
|
+
|
|
21
|
+
## Initial Attempts
|
|
22
|
+
1. [First attempt]
|
|
23
|
+
2. [Second attempt]
|
|
24
|
+
...
|
|
25
|
+
|
|
26
|
+
## Why Initial Attempts Failed
|
|
27
|
+
[Explain why each attempt didn't work]
|
|
28
|
+
|
|
29
|
+
## Final Solution
|
|
30
|
+
[Describe what fixed the problem]
|
|
31
|
+
|
|
32
|
+
## Why It Worked
|
|
33
|
+
[Explain the root cause and why this solution addresses it]
|
|
34
|
+
|
|
35
|
+
## Key Insight
|
|
36
|
+
[What did you learn? How can this be applied in the future?]
|
|
37
|
+
```
|
|
38
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Check if the backend development guidelines need to be updated based on recent code changes.
|
|
2
|
+
|
|
3
|
+
Execute these steps:
|
|
4
|
+
1. Review recent commits: `git log --oneline -10`
|
|
5
|
+
2. Check if any new patterns or conventions were introduced
|
|
6
|
+
3. Read current guidelines: `workflow/structure/backend/doc.md`
|
|
7
|
+
4. If updates are needed:
|
|
8
|
+
- Update `doc.md` with new patterns or rules (in **English**)
|
|
9
|
+
- Add section markers: `@@@section:kebab-case-id` and `@@@/section:kebab-case-id`
|
|
10
|
+
- Update `index.md` with new section IDs
|
|
11
|
+
5. Report what was updated (if anything)
|
|
12
|
+
|
|
13
|
+
**Language requirement**: All documentation must be written in **English**.
|
|
14
|
+
|
|
15
|
+
Only update if there are genuine new patterns worth documenting.
|
|
16
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Check if the frontend development guidelines need to be updated based on recent code changes.
|
|
2
|
+
|
|
3
|
+
Execute these steps:
|
|
4
|
+
1. Review recent commits: `git log --oneline -10`
|
|
5
|
+
2. Check if any new patterns or conventions were introduced
|
|
6
|
+
3. Read current guidelines: `workflow/structure/frontend/doc.md`
|
|
7
|
+
4. If updates are needed:
|
|
8
|
+
- Update `doc.md` with new patterns or rules (in **English**)
|
|
9
|
+
- Add section markers: `@@@section:kebab-case-id` and `@@@/section:kebab-case-id`
|
|
10
|
+
- Update `index.md` with new section IDs
|
|
11
|
+
5. Report what was updated (if anything)
|
|
12
|
+
|
|
13
|
+
**Language requirement**: All documentation must be written in **English**.
|
|
14
|
+
|
|
15
|
+
Only update if there are genuine new patterns worth documenting.
|
|
16
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read template content from a .txt file
|
|
3
|
+
* @param category - Template category ('scripts' | 'markdown' | 'commands')
|
|
4
|
+
* @param filename - Template filename (e.g., 'init-developer.sh.txt')
|
|
5
|
+
* @returns File content as string
|
|
6
|
+
*/
|
|
7
|
+
export declare function readTemplate(category: "scripts" | "markdown" | "commands", filename: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* Helper to read script template
|
|
10
|
+
*/
|
|
11
|
+
export declare function readScript(filename: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Helper to read markdown template
|
|
14
|
+
*/
|
|
15
|
+
export declare function readMarkdown(filename: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Helper to read command template
|
|
18
|
+
*/
|
|
19
|
+
export declare function readCommand(filename: string): string;
|
|
20
|
+
//# sourceMappingURL=extract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/templates/extract.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,wBAAgB,YAAY,CAC3B,QAAQ,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,EAC7C,QAAQ,EAAE,MAAM,GACd,MAAM,CAGR;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
5
|
+
const __dirname = path.dirname(__filename);
|
|
6
|
+
/**
|
|
7
|
+
* Read template content from a .txt file
|
|
8
|
+
* @param category - Template category ('scripts' | 'markdown' | 'commands')
|
|
9
|
+
* @param filename - Template filename (e.g., 'init-developer.sh.txt')
|
|
10
|
+
* @returns File content as string
|
|
11
|
+
*/
|
|
12
|
+
export function readTemplate(category, filename) {
|
|
13
|
+
const templatePath = path.join(__dirname, category, filename);
|
|
14
|
+
return fs.readFileSync(templatePath, "utf-8");
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Helper to read script template
|
|
18
|
+
*/
|
|
19
|
+
export function readScript(filename) {
|
|
20
|
+
return readTemplate("scripts", filename);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Helper to read markdown template
|
|
24
|
+
*/
|
|
25
|
+
export function readMarkdown(filename) {
|
|
26
|
+
return readTemplate("markdown", filename);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Helper to read command template
|
|
30
|
+
*/
|
|
31
|
+
export function readCommand(filename) {
|
|
32
|
+
return readTemplate("commands", filename);
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=extract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../src/templates/extract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAC3B,QAA6C,EAC7C,QAAgB;IAEhB,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC9D,OAAO,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,QAAgB;IAC1C,OAAO,YAAY,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC5C,OAAO,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AAC3C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC3C,OAAO,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-progress-index.d.ts","sourceRoot":"","sources":["../../../src/templates/markdown/agent-progress-index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,yBAAyB,QAAyC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
const templatePath = path.join(__dirname, "agent-progress-index.md.txt");
|
|
4
|
+
export const agentProgressIndexContent = fs.readFileSync(templatePath, "utf-8");
|
|
5
|
+
//# sourceMappingURL=agent-progress-index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-progress-index.js","sourceRoot":"","sources":["../../../src/templates/markdown/agent-progress-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC"}
|