@mind-fold/open-flow 0.1.17 → 0.2.2
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/configurators/templates.d.ts.map +1 -1
- package/dist/configurators/templates.js +17 -6
- package/dist/configurators/templates.js.map +1 -1
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +82 -6
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/templates/commands/break-loop.txt +107 -0
- package/dist/templates/commands/check-cross-layer.txt +153 -0
- package/dist/templates/commands/finish-work.txt +129 -0
- package/dist/templates/commands/index.d.ts +9 -5
- package/dist/templates/commands/index.d.ts.map +1 -1
- package/dist/templates/commands/index.js +16 -5
- package/dist/templates/commands/index.js.map +1 -1
- package/dist/templates/commands/init-agent.txt +100 -9
- package/dist/templates/commands/sync-from-runtime.txt +140 -0
- package/dist/templates/markdown/flow.md.txt +96 -84
- package/dist/templates/markdown/index.d.ts +21 -4
- package/dist/templates/markdown/index.d.ts.map +1 -1
- package/dist/templates/markdown/index.js +27 -4
- package/dist/templates/markdown/index.js.map +1 -1
- package/dist/templates/markdown/structure/backend/database-guidelines.md.txt +247 -0
- package/dist/templates/markdown/structure/backend/directory-structure.md.txt +153 -0
- package/dist/templates/markdown/structure/backend/error-handling.md.txt +257 -0
- package/dist/templates/markdown/structure/backend/index.md.txt +88 -0
- package/dist/templates/markdown/structure/backend/logging-guidelines.md.txt +212 -0
- package/dist/templates/markdown/structure/backend/quality-guidelines.md.txt +219 -0
- package/dist/templates/markdown/structure/backend/type-safety.md.txt +192 -0
- package/dist/templates/markdown/structure/flows/code-reuse-thinking-guide.md.txt +343 -0
- package/dist/templates/markdown/structure/flows/cross-layer-thinking-guide.md.txt +283 -0
- package/dist/templates/markdown/structure/flows/index.md.txt +133 -0
- package/dist/templates/markdown/structure/flows/pre-implementation-checklist.md.txt +182 -0
- package/dist/templates/markdown/structure/flows/spec-flow-template.md.txt +145 -0
- package/dist/templates/markdown/structure/frontend/component-guidelines.md.txt +335 -0
- package/dist/templates/markdown/structure/frontend/directory-structure.md.txt +172 -0
- package/dist/templates/markdown/structure/frontend/hook-guidelines.md.txt +287 -0
- package/dist/templates/markdown/structure/frontend/index.md.txt +91 -0
- package/dist/templates/markdown/structure/frontend/quality-guidelines.md.txt +274 -0
- package/dist/templates/markdown/structure/frontend/state-management.md.txt +293 -0
- package/dist/templates/markdown/structure/frontend/type-safety.md.txt +275 -0
- package/package.json +2 -2
|
@@ -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,
|
|
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,yBAAyB;AACzB,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC;AAC/D,MAAM,CAAC,MAAM,uBAAuB,GAAG,WAAW,CAAC,uBAAuB,CAAC,CAAC;AAC5E,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAW,CAAC,uBAAuB,CAAC,CAAC;AAE7E,6BAA6B;AAC7B,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;AAE5E,2BAA2B;AAC3B,MAAM,CAAC,MAAM,yBAAyB,GAAG,WAAW,CAAC,yBAAyB,CAAC,CAAC;AAChF,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAW,CAAC,wBAAwB,CAAC,CAAC;AAE9E,gCAAgC;AAChC,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,+BAA+B,GAAG,WAAW,CACzD,+BAA+B,CAC/B,CAAC;AACF,MAAM,CAAC,MAAM,8BAA8B,GAAG,WAAW,CACxD,8BAA8B,CAC9B,CAAC;AAEF,2BAA2B;AAC3B,MAAM,CAAC,MAAM,kBAAkB,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC;AAE/D,mBAAmB;AACnB,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;AAC1E,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC,qBAAqB,CAAC,CAAC;AAEzE,0BAA0B;AAC1B,MAAM,CAAC,MAAM,uBAAuB,GAAG,WAAW,CAAC,uBAAuB,CAAC,CAAC"}
|
|
@@ -1,11 +1,102 @@
|
|
|
1
|
-
|
|
1
|
+
# Initialize AI Agent Session
|
|
2
2
|
|
|
3
|
-
|
|
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
|
|
3
|
+
Read project context and prepare for development work.
|
|
11
4
|
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Execution Steps
|
|
8
|
+
|
|
9
|
+
### Step 1: Get Session Context
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
./workflow/scripts/get-context.sh
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
This returns:
|
|
16
|
+
- Developer identity
|
|
17
|
+
- Git status (branch, uncommitted changes)
|
|
18
|
+
- Recent commits
|
|
19
|
+
- Active features
|
|
20
|
+
- Progress file status
|
|
21
|
+
|
|
22
|
+
### Step 2: Check Developer Identity
|
|
23
|
+
|
|
24
|
+
If `.developer` file doesn't exist, guide user:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
./workflow/scripts/init-developer.sh <name>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Step 3: Read Relevant Guidelines
|
|
31
|
+
|
|
32
|
+
Based on the upcoming task, read appropriate structure docs:
|
|
33
|
+
|
|
34
|
+
**For Frontend Work**:
|
|
35
|
+
```bash
|
|
36
|
+
cat workflow/structure/frontend/index.md
|
|
37
|
+
```
|
|
38
|
+
Then read specific docs based on task type.
|
|
39
|
+
|
|
40
|
+
**For Backend Work**:
|
|
41
|
+
```bash
|
|
42
|
+
cat workflow/structure/backend/index.md
|
|
43
|
+
```
|
|
44
|
+
Then read specific docs based on task type.
|
|
45
|
+
|
|
46
|
+
**For Cross-Layer Features**:
|
|
47
|
+
```bash
|
|
48
|
+
cat workflow/structure/flows/index.md
|
|
49
|
+
cat workflow/structure/flows/cross-layer-thinking-guide.md
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Step 4: Check Active Features
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
./workflow/scripts/feature.sh list
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
If continuing previous work, review the feature file.
|
|
59
|
+
|
|
60
|
+
### Step 5: Report Ready Status
|
|
61
|
+
|
|
62
|
+
Output a summary:
|
|
63
|
+
|
|
64
|
+
```markdown
|
|
65
|
+
## Session Initialized
|
|
66
|
+
|
|
67
|
+
| Item | Status |
|
|
68
|
+
|------|--------|
|
|
69
|
+
| Developer | {name} |
|
|
70
|
+
| Branch | {branch} |
|
|
71
|
+
| Uncommitted | {count} file(s) |
|
|
72
|
+
| Progress | {file} ({lines}/2000 lines) |
|
|
73
|
+
| Active Features | {count} |
|
|
74
|
+
|
|
75
|
+
### Available Commands
|
|
76
|
+
- `/before-frontend-dev` - Read frontend guidelines
|
|
77
|
+
- `/before-backend-dev` - Read backend guidelines
|
|
78
|
+
- `/check-cross-layer` - Cross-layer verification
|
|
79
|
+
- `/finish-work` - Pre-commit checklist
|
|
80
|
+
- `/record-agent-flow` - Record session progress
|
|
81
|
+
|
|
82
|
+
Ready for your task. What would you like to work on?
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Quick Reference
|
|
88
|
+
|
|
89
|
+
| Scenario | Next Step |
|
|
90
|
+
|----------|-----------|
|
|
91
|
+
| New feature | `./workflow/scripts/feature.sh create <name>` |
|
|
92
|
+
| Continue feature | Read feature file, continue work |
|
|
93
|
+
| Bug fix | Investigate, fix, then `/break-loop` |
|
|
94
|
+
| First time | `/onboard-developer` for full setup |
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Notes
|
|
99
|
+
|
|
100
|
+
- Always read structure guidelines before coding
|
|
101
|
+
- One feature at a time
|
|
102
|
+
- Record progress at session end with `/record-agent-flow`
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# Sync Knowledge from Runtime
|
|
2
|
+
|
|
3
|
+
Fetch and adapt knowledge documents from Runtime to enhance local workflow structure.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
- Runtime MCP server connected (`mcp__runtime-cloud__*` tools available)
|
|
10
|
+
- Local `workflow/structure/` directory exists
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Execution Steps
|
|
15
|
+
|
|
16
|
+
### Step 1: Get User Input
|
|
17
|
+
|
|
18
|
+
Ask the user:
|
|
19
|
+
|
|
20
|
+
1. **Source path on Runtime**: Where to fetch docs from?
|
|
21
|
+
- Example: `/dev/cloudflare worker/backend/`
|
|
22
|
+
- Example: `/dev/electron/frontend/`
|
|
23
|
+
|
|
24
|
+
2. **Target location**: Where to save locally?
|
|
25
|
+
- `workflow/structure/backend/` (backend docs)
|
|
26
|
+
- `workflow/structure/frontend/` (frontend docs)
|
|
27
|
+
- `workflow/structure/flows/` (cross-layer docs)
|
|
28
|
+
|
|
29
|
+
3. **Sync mode**:
|
|
30
|
+
- `merge` - Add new docs, keep existing (default)
|
|
31
|
+
- `replace` - Replace all docs in target directory
|
|
32
|
+
|
|
33
|
+
### Step 2: List Available Docs
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# List docs at source path
|
|
37
|
+
mcp__runtime-cloud__ls <source-path>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Show user what's available and let them confirm which docs to sync.
|
|
41
|
+
|
|
42
|
+
### Step 3: Fetch and Adapt
|
|
43
|
+
|
|
44
|
+
For each selected doc:
|
|
45
|
+
|
|
46
|
+
1. **Read from Runtime**:
|
|
47
|
+
```bash
|
|
48
|
+
mcp__runtime-cloud__cat <source-path>/<doc-name>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
2. **Adapt content** (if needed):
|
|
52
|
+
- Replace project-specific paths with generic placeholders
|
|
53
|
+
- Remove project-specific examples if too specific
|
|
54
|
+
- Keep the core patterns and guidelines
|
|
55
|
+
|
|
56
|
+
3. **Write to local**:
|
|
57
|
+
- Save to `workflow/structure/<target>/<doc-name>`
|
|
58
|
+
|
|
59
|
+
### Step 4: Update Index
|
|
60
|
+
|
|
61
|
+
After syncing, update `workflow/structure/<target>/index.md`:
|
|
62
|
+
- Add links to new docs
|
|
63
|
+
- Update the quick navigation table
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Example Usage
|
|
68
|
+
|
|
69
|
+
**User**: "Sync backend database guidelines from Runtime"
|
|
70
|
+
|
|
71
|
+
**AI executes**:
|
|
72
|
+
```
|
|
73
|
+
1. Ask: "What's the source path on Runtime?"
|
|
74
|
+
User: "/dev/cloudflare worker/backend/"
|
|
75
|
+
|
|
76
|
+
2. List available docs:
|
|
77
|
+
- database-guidelines.md
|
|
78
|
+
- logging-guidelines.md
|
|
79
|
+
- ...
|
|
80
|
+
|
|
81
|
+
3. Ask: "Which docs to sync? (all / specific names)"
|
|
82
|
+
User: "database-guidelines.md"
|
|
83
|
+
|
|
84
|
+
4. Fetch, adapt, save to workflow/structure/backend/
|
|
85
|
+
|
|
86
|
+
5. Update workflow/structure/backend/index.md
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Adaptation Guidelines
|
|
92
|
+
|
|
93
|
+
When adapting Runtime docs to local:
|
|
94
|
+
|
|
95
|
+
| Runtime-Specific | Replace With |
|
|
96
|
+
|------------------|--------------|
|
|
97
|
+
| Turso/libSQL specific | Generic SQLite/ORM |
|
|
98
|
+
| Cloudflare Workers specific | Generic serverless |
|
|
99
|
+
| Project-specific paths | `{your-path}` placeholders |
|
|
100
|
+
| Internal team references | Remove or generalize |
|
|
101
|
+
|
|
102
|
+
**Keep**:
|
|
103
|
+
- Core patterns (no await in loops, batch operations, etc.)
|
|
104
|
+
- Type safety guidelines
|
|
105
|
+
- Error handling patterns
|
|
106
|
+
- Logging best practices
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Output
|
|
111
|
+
|
|
112
|
+
After sync, report:
|
|
113
|
+
|
|
114
|
+
```markdown
|
|
115
|
+
## Sync Complete
|
|
116
|
+
|
|
117
|
+
**Source**: /dev/cloudflare worker/backend/
|
|
118
|
+
**Target**: workflow/structure/backend/
|
|
119
|
+
|
|
120
|
+
### Synced Docs
|
|
121
|
+
| Doc | Status | Notes |
|
|
122
|
+
|-----|--------|-------|
|
|
123
|
+
| database-guidelines.md | ✅ Added | Adapted from Turso to generic ORM |
|
|
124
|
+
| logging-guidelines.md | ✅ Added | No changes needed |
|
|
125
|
+
|
|
126
|
+
### Updated Files
|
|
127
|
+
- workflow/structure/backend/index.md (added links)
|
|
128
|
+
|
|
129
|
+
### Next Steps
|
|
130
|
+
- Review synced docs for project-specific adjustments
|
|
131
|
+
- Run `/check-backend` to verify guidelines work
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Notes
|
|
137
|
+
|
|
138
|
+
- Always review synced docs before committing
|
|
139
|
+
- Some Runtime docs may need significant adaptation
|
|
140
|
+
- Keep local customizations in separate sections (won't be overwritten on re-sync)
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
### Core Principles
|
|
21
21
|
|
|
22
22
|
1. **Read Before Write** - Understand context before starting
|
|
23
|
-
2. **Follow Standards** - ⚠️ **MUST read `workflow/structure/` guidelines
|
|
23
|
+
2. **Follow Standards** - ⚠️ **MUST read `workflow/structure/` guidelines before coding**
|
|
24
24
|
3. **Incremental Development** - Complete one feature at a time
|
|
25
25
|
4. **Record Promptly** - Update tracking files immediately after completion
|
|
26
26
|
5. **Document Limits** - ⚠️ **Max 2000 lines per agent-progress document**
|
|
@@ -44,12 +44,26 @@ workflow/
|
|
|
44
44
|
│ ├── features/ # Feature tracking
|
|
45
45
|
│ └── progress-N.md # Progress files (sequential numbering)
|
|
46
46
|
├── structure/ # ⚠️ MUST READ before coding
|
|
47
|
-
│ ├── frontend/
|
|
48
|
-
│ │ ├── index.md
|
|
49
|
-
│ │
|
|
50
|
-
│
|
|
51
|
-
│
|
|
52
|
-
│
|
|
47
|
+
│ ├── frontend/ # Frontend guidelines (multi-doc)
|
|
48
|
+
│ │ ├── index.md # Start here - guidelines index
|
|
49
|
+
│ │ ├── directory-structure.md # Directory layout
|
|
50
|
+
│ │ ├── type-safety.md # TypeScript patterns
|
|
51
|
+
│ │ ├── hook-guidelines.md # React Query hooks
|
|
52
|
+
│ │ ├── component-guidelines.md # Component patterns
|
|
53
|
+
│ │ ├── state-management.md # State patterns
|
|
54
|
+
│ │ └── quality-guidelines.md # Code standards
|
|
55
|
+
│ ├── backend/ # Backend guidelines (multi-doc)
|
|
56
|
+
│ │ ├── index.md # Start here - guidelines index
|
|
57
|
+
│ │ ├── directory-structure.md # Directory layout
|
|
58
|
+
│ │ ├── type-safety.md # Zod, TypeScript patterns
|
|
59
|
+
│ │ ├── database-guidelines.md # ORM, batch operations
|
|
60
|
+
│ │ ├── logging-guidelines.md # Structured logging
|
|
61
|
+
│ │ ├── error-handling.md # Error types, handling
|
|
62
|
+
│ │ └── quality-guidelines.md # Code standards
|
|
63
|
+
│ └── flows/ # Cross-layer specifications
|
|
64
|
+
│ ├── index.md # Flow specs index
|
|
65
|
+
│ ├── cross-layer-thinking-guide.md # Pre-implementation checklist
|
|
66
|
+
│ └── spec-flow-template.md # Template for new flows
|
|
53
67
|
└── flow.md # This document
|
|
54
68
|
```
|
|
55
69
|
|
|
@@ -69,51 +83,41 @@ Use the unified context script:
|
|
|
69
83
|
./workflow/scripts/get-context.sh --json
|
|
70
84
|
```
|
|
71
85
|
|
|
72
|
-
### Step 2: Read Development Guidelines
|
|
86
|
+
### Step 2: Read Development Guidelines ⚠️ REQUIRED
|
|
73
87
|
|
|
74
88
|
**⚠️ CRITICAL: MUST read guidelines before writing any code**
|
|
75
89
|
|
|
76
|
-
Based on what you'll develop (frontend/backend), read the corresponding guidelines
|
|
90
|
+
Based on what you'll develop (frontend/backend), read the corresponding guidelines:
|
|
77
91
|
|
|
78
92
|
**Frontend Development**:
|
|
79
93
|
```bash
|
|
94
|
+
# 1. Read index first
|
|
80
95
|
cat workflow/structure/frontend/index.md
|
|
96
|
+
|
|
97
|
+
# 2. Read specific doc based on task
|
|
98
|
+
cat workflow/structure/frontend/hook-guidelines.md # For hooks
|
|
99
|
+
cat workflow/structure/frontend/component-guidelines.md # For components
|
|
100
|
+
cat workflow/structure/frontend/type-safety.md # For types
|
|
81
101
|
```
|
|
82
|
-
- Find corresponding chapters based on task type (e.g., "New Query Hook", "Write Component")
|
|
83
|
-
- Note down chapter names and **section IDs** (e.g., `query-hook`)
|
|
84
|
-
- This is **mandatory**, not optional
|
|
85
102
|
|
|
86
103
|
**Backend Development**:
|
|
87
104
|
```bash
|
|
105
|
+
# 1. Read index first
|
|
88
106
|
cat workflow/structure/backend/index.md
|
|
89
|
-
```
|
|
90
|
-
- Find corresponding chapters based on scenario (e.g., "New API Module", "Write Batch Tasks")
|
|
91
|
-
- Note down chapter names and **section IDs** (e.g., `database-guidelines`)
|
|
92
|
-
- This is **mandatory**, not optional
|
|
93
|
-
|
|
94
|
-
### Step 3: Read Specific Guidelines ⚠️ REQUIRED
|
|
95
|
-
|
|
96
|
-
**⚠️ CRITICAL: Read detailed guidelines for your specific task**
|
|
97
107
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
# Extract specific section by ID
|
|
103
|
-
sed -n '/@@@section:query-hook/,/@@@\/section:query-hook/p' workflow/structure/frontend/doc.md
|
|
108
|
+
# 2. Read specific doc based on task
|
|
109
|
+
cat workflow/structure/backend/database-guidelines.md # For DB operations
|
|
110
|
+
cat workflow/structure/backend/type-safety.md # For Zod/types
|
|
111
|
+
cat workflow/structure/backend/logging-guidelines.md # For logging
|
|
104
112
|
```
|
|
105
|
-
- **MUST read** the sections relevant to your task
|
|
106
|
-
- Do NOT skip this step
|
|
107
113
|
|
|
108
|
-
**
|
|
114
|
+
**Cross-Layer Features**:
|
|
109
115
|
```bash
|
|
110
|
-
#
|
|
111
|
-
|
|
116
|
+
# For features spanning multiple layers
|
|
117
|
+
cat workflow/structure/flows/cross-layer-thinking-guide.md
|
|
112
118
|
```
|
|
113
|
-
- **MUST read** the sections relevant to your task
|
|
114
|
-
- Do NOT skip this step
|
|
115
119
|
|
|
116
|
-
### Step
|
|
120
|
+
### Step 3: Select Feature to Develop
|
|
117
121
|
|
|
118
122
|
Use the feature management script:
|
|
119
123
|
|
|
@@ -136,9 +140,10 @@ Use the feature management script:
|
|
|
136
140
|
└─> ./workflow/scripts/feature.sh create <name> or list
|
|
137
141
|
|
|
138
142
|
2. Write code according to guidelines
|
|
139
|
-
└─>
|
|
140
|
-
└─>
|
|
141
|
-
└─>
|
|
143
|
+
└─> Read workflow/structure/[frontend|backend]/ docs
|
|
144
|
+
└─> For cross-layer: read workflow/structure/flows/
|
|
145
|
+
└─> Frontend: Type safety, Hook standards, Component standards
|
|
146
|
+
└─> Backend: Directory structure, Type safety, Database, Logging
|
|
142
147
|
|
|
143
148
|
3. Self-test
|
|
144
149
|
└─> pnpm lint (must pass)
|
|
@@ -161,18 +166,17 @@ Use the feature management script:
|
|
|
161
166
|
- ✅ `pnpm type-check` - No type errors
|
|
162
167
|
- ✅ Manual feature testing passes
|
|
163
168
|
|
|
164
|
-
**Frontend-specific checks
|
|
169
|
+
**Frontend-specific checks** (see `frontend/quality-guidelines.md`):
|
|
165
170
|
- ✅ Use semantic HTML (`<button>` not `<div role="button">`)
|
|
166
171
|
- ✅ Use Next.js `<Image>` instead of `<img>`
|
|
167
172
|
- ✅ Import types from backend, don't redefine
|
|
168
173
|
- ✅ Avoid non-null assertions `!`
|
|
169
174
|
|
|
170
|
-
**Backend-specific checks
|
|
171
|
-
- ✅ Strictly avoid non-null assertion
|
|
175
|
+
**Backend-specific checks** (see `backend/quality-guidelines.md`):
|
|
176
|
+
- ✅ Strictly avoid non-null assertion `!`
|
|
172
177
|
- ✅ All API inputs/outputs have Zod Schema
|
|
173
178
|
- ✅ Use structured logging (`logger`), forbidden `console.log`
|
|
174
179
|
- ✅ Database operations avoid `await` in loops
|
|
175
|
-
- ✅ Update corresponding API documentation
|
|
176
180
|
|
|
177
181
|
---
|
|
178
182
|
|
|
@@ -197,10 +201,12 @@ This automatically:
|
|
|
197
201
|
|
|
198
202
|
### Pre-end Checklist
|
|
199
203
|
|
|
204
|
+
Use `/finish-work` command to run through:
|
|
200
205
|
1. ✅ All code committed, commit message follows convention
|
|
201
206
|
2. ✅ Session recorded via `add-session.sh`
|
|
202
207
|
3. ✅ No lint/type-check errors
|
|
203
208
|
4. ✅ Working directory clean (or WIP noted)
|
|
209
|
+
5. ✅ Structure docs updated if needed
|
|
204
210
|
|
|
205
211
|
---
|
|
206
212
|
|
|
@@ -225,24 +231,36 @@ agent-progress/
|
|
|
225
231
|
- ✅ Complete important feature
|
|
226
232
|
- ✅ Fix important bug
|
|
227
233
|
|
|
228
|
-
|
|
229
|
-
Use the `add-session.sh` script for automatic updates.
|
|
234
|
+
### 2. structure/ - Development Guidelines
|
|
230
235
|
|
|
231
|
-
|
|
236
|
+
**Purpose**: Documented standards for consistent development
|
|
232
237
|
|
|
233
|
-
**
|
|
238
|
+
**Structure** (Multi-doc format):
|
|
239
|
+
```
|
|
240
|
+
structure/
|
|
241
|
+
├── frontend/ # Frontend docs
|
|
242
|
+
│ ├── index.md # Start here
|
|
243
|
+
│ └── *.md # Topic-specific docs
|
|
244
|
+
├── backend/ # Backend docs
|
|
245
|
+
│ ├── index.md # Start here
|
|
246
|
+
│ └── *.md # Topic-specific docs
|
|
247
|
+
└── flows/ # Cross-layer specs
|
|
248
|
+
├── index.md # Start here
|
|
249
|
+
└── *.md # Flow-specific docs
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
**When to update**:
|
|
253
|
+
- ✅ New pattern discovered
|
|
254
|
+
- ✅ Bug fixed that reveals missing guidance
|
|
255
|
+
- ✅ New convention established
|
|
256
|
+
|
|
257
|
+
### 3. Features - Feature Tracking
|
|
234
258
|
|
|
235
259
|
**Commands**:
|
|
236
260
|
```bash
|
|
237
|
-
# Create new feature
|
|
238
261
|
./workflow/scripts/feature.sh create <name>
|
|
239
|
-
|
|
240
|
-
# Archive completed feature
|
|
241
262
|
./workflow/scripts/feature.sh archive <name>
|
|
242
|
-
|
|
243
|
-
# List features
|
|
244
263
|
./workflow/scripts/feature.sh list
|
|
245
|
-
./workflow/scripts/feature.sh list-archive [YYYY-MM]
|
|
246
264
|
```
|
|
247
265
|
|
|
248
266
|
---
|
|
@@ -253,31 +271,29 @@ Use the `add-session.sh` script for automatic updates.
|
|
|
253
271
|
|
|
254
272
|
1. **Before session start**:
|
|
255
273
|
- Run `./workflow/scripts/get-context.sh` for full context
|
|
256
|
-
- ⚠️ **MUST read** `workflow/structure
|
|
257
|
-
- ⚠️ **MUST read** specific sections in doc.md based on task
|
|
274
|
+
- ⚠️ **MUST read** relevant `workflow/structure/` docs
|
|
258
275
|
|
|
259
276
|
2. **During development**:
|
|
260
|
-
- ⚠️ **
|
|
277
|
+
- ⚠️ **Follow** `workflow/structure/` guidelines
|
|
278
|
+
- For cross-layer features, use `/check-cross-layer`
|
|
261
279
|
- Develop only one feature at a time
|
|
262
|
-
- Run lint and type-check
|
|
280
|
+
- Run lint and type-check frequently
|
|
263
281
|
|
|
264
|
-
3. **After development complete
|
|
265
|
-
-
|
|
282
|
+
3. **After development complete**:
|
|
283
|
+
- Use `/finish-work` for completion checklist
|
|
284
|
+
- After fix bug, use `/break-loop` for deep analysis
|
|
266
285
|
- Human commits after testing passes
|
|
267
|
-
-
|
|
286
|
+
- Use `add-session.sh` to record progress
|
|
268
287
|
|
|
269
288
|
### ❌ DON'T - Should Not Do
|
|
270
289
|
|
|
271
|
-
1. ⚠️ **Don't** skip reading `workflow/structure/` guidelines
|
|
290
|
+
1. ⚠️ **Don't** skip reading `workflow/structure/` guidelines
|
|
272
291
|
2. ⚠️ **Don't** let agent-progress single file exceed 2000 lines
|
|
273
|
-
3. **Don't**
|
|
274
|
-
4. **Don't**
|
|
275
|
-
5. **Don't**
|
|
276
|
-
6. **Don't**
|
|
277
|
-
7.
|
|
278
|
-
- Only allowed: `git log`, `git status`, `git diff`
|
|
279
|
-
- Human is responsible for testing and committing
|
|
280
|
-
8. **Don't** write `workflow/structure/` docs in Chinese - **English only**
|
|
292
|
+
3. **Don't** develop multiple unrelated features simultaneously
|
|
293
|
+
4. **Don't** commit code with lint/type-check errors
|
|
294
|
+
5. **Don't** forget to update structure docs after learning something
|
|
295
|
+
6. ⚠️ **Don't** execute `git commit` - AI should not commit code
|
|
296
|
+
7. **Don't** write `workflow/structure/` docs in Chinese - **English only**
|
|
281
297
|
|
|
282
298
|
---
|
|
283
299
|
|
|
@@ -285,13 +301,13 @@ Use the `add-session.sh` script for automatic updates.
|
|
|
285
301
|
|
|
286
302
|
### Must-read Before Development
|
|
287
303
|
|
|
288
|
-
| Task Type | Must-read Document |
|
|
289
|
-
|
|
290
|
-
| New
|
|
291
|
-
| New
|
|
292
|
-
| New
|
|
293
|
-
|
|
|
294
|
-
|
|
|
304
|
+
| Task Type | Must-read Document |
|
|
305
|
+
|-----------|-------------------|
|
|
306
|
+
| New Query Hook | `frontend/hook-guidelines.md` |
|
|
307
|
+
| New Component | `frontend/component-guidelines.md` |
|
|
308
|
+
| New Backend API | `backend/directory-structure.md`, `backend/type-safety.md` |
|
|
309
|
+
| Database Operations | `backend/database-guidelines.md` |
|
|
310
|
+
| Cross-Layer Feature | `flows/cross-layer-thinking-guide.md` |
|
|
295
311
|
|
|
296
312
|
### Commit Convention
|
|
297
313
|
|
|
@@ -301,7 +317,6 @@ git commit -m "type(scope): description"
|
|
|
301
317
|
|
|
302
318
|
**Type**: feat, fix, docs, refactor, test, chore
|
|
303
319
|
**Scope**: Module name (e.g., mail, auth, api)
|
|
304
|
-
**Description**: Brief description
|
|
305
320
|
|
|
306
321
|
### Common Commands
|
|
307
322
|
|
|
@@ -316,15 +331,13 @@ git commit -m "type(scope): description"
|
|
|
316
331
|
|
|
317
332
|
# Development
|
|
318
333
|
pnpm dev # Start dev server
|
|
319
|
-
pnpm build # Production build
|
|
320
334
|
pnpm lint # Lint check
|
|
321
|
-
pnpm format # Format code
|
|
322
335
|
pnpm type-check # Type check
|
|
323
336
|
|
|
324
|
-
#
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
337
|
+
# Slash commands
|
|
338
|
+
/finish-work # Pre-commit checklist
|
|
339
|
+
/break-loop # Post-debug analysis
|
|
340
|
+
/check-cross-layer # Cross-layer verification
|
|
328
341
|
```
|
|
329
342
|
|
|
330
343
|
---
|
|
@@ -335,8 +348,7 @@ Following this workflow ensures:
|
|
|
335
348
|
- ✅ Continuity across multiple sessions
|
|
336
349
|
- ✅ Consistent code quality
|
|
337
350
|
- ✅ Trackable progress
|
|
338
|
-
- ✅
|
|
351
|
+
- ✅ Knowledge accumulation in structure docs
|
|
339
352
|
- ✅ Transparent team collaboration
|
|
340
353
|
|
|
341
|
-
**Core Philosophy**: Read before write, follow standards, record promptly,
|
|
342
|
-
|
|
354
|
+
**Core Philosophy**: Read before write, follow standards, record promptly, capture learnings
|
|
@@ -3,10 +3,27 @@
|
|
|
3
3
|
* Each template is stored as a .txt file
|
|
4
4
|
*/
|
|
5
5
|
export declare const agentProgressIndexContent: string;
|
|
6
|
-
export declare const frontendIndexContent: string;
|
|
7
|
-
export declare const frontendDocContent: string;
|
|
8
|
-
export declare const backendIndexContent: string;
|
|
9
|
-
export declare const backendDocContent: string;
|
|
10
6
|
export declare const flowMdContent: string;
|
|
11
7
|
export declare const workflowGitignoreContent: string;
|
|
8
|
+
export declare const backendIndexContent: string;
|
|
9
|
+
export declare const backendDirectoryStructureContent: string;
|
|
10
|
+
export declare const backendTypeSafetyContent: string;
|
|
11
|
+
export declare const backendDatabaseGuidelinesContent: string;
|
|
12
|
+
export declare const backendLoggingGuidelinesContent: string;
|
|
13
|
+
export declare const backendQualityGuidelinesContent: string;
|
|
14
|
+
export declare const backendErrorHandlingContent: string;
|
|
15
|
+
export declare const frontendIndexContent: string;
|
|
16
|
+
export declare const frontendDirectoryStructureContent: string;
|
|
17
|
+
export declare const frontendTypeSafetyContent: string;
|
|
18
|
+
export declare const frontendHookGuidelinesContent: string;
|
|
19
|
+
export declare const frontendComponentGuidelinesContent: string;
|
|
20
|
+
export declare const frontendQualityGuidelinesContent: string;
|
|
21
|
+
export declare const frontendStateManagementContent: string;
|
|
22
|
+
export declare const flowsIndexContent: string;
|
|
23
|
+
export declare const flowsCrossLayerThinkingGuideContent: string;
|
|
24
|
+
export declare const flowsSpecFlowTemplateContent: string;
|
|
25
|
+
export declare const flowsPreImplementationChecklistContent: string;
|
|
26
|
+
export declare const flowsCodeReuseThinkingGuideContent: string;
|
|
27
|
+
export declare const backendDocContent: string;
|
|
28
|
+
export declare const frontendDocContent: string;
|
|
12
29
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/markdown/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/markdown/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,eAAO,MAAM,yBAAyB,QAErC,CAAC;AAGF,eAAO,MAAM,aAAa,QAA8B,CAAC;AACzD,eAAO,MAAM,wBAAwB,QAAgC,CAAC;AAGtE,eAAO,MAAM,mBAAmB,QAE/B,CAAC;AACF,eAAO,MAAM,gCAAgC,QAE5C,CAAC;AACF,eAAO,MAAM,wBAAwB,QAEpC,CAAC;AACF,eAAO,MAAM,gCAAgC,QAE5C,CAAC;AACF,eAAO,MAAM,+BAA+B,QAE3C,CAAC;AACF,eAAO,MAAM,+BAA+B,QAE3C,CAAC;AACF,eAAO,MAAM,2BAA2B,QAEvC,CAAC;AAGF,eAAO,MAAM,oBAAoB,QAEhC,CAAC;AACF,eAAO,MAAM,iCAAiC,QAE7C,CAAC;AACF,eAAO,MAAM,yBAAyB,QAErC,CAAC;AACF,eAAO,MAAM,6BAA6B,QAEzC,CAAC;AACF,eAAO,MAAM,kCAAkC,QAE9C,CAAC;AACF,eAAO,MAAM,gCAAgC,QAE5C,CAAC;AACF,eAAO,MAAM,8BAA8B,QAE1C,CAAC;AAGF,eAAO,MAAM,iBAAiB,QAA+C,CAAC;AAC9E,eAAO,MAAM,mCAAmC,QAE/C,CAAC;AACF,eAAO,MAAM,4BAA4B,QAExC,CAAC;AACF,eAAO,MAAM,sCAAsC,QAElD,CAAC;AACF,eAAO,MAAM,kCAAkC,QAE9C,CAAC;AAGF,eAAO,MAAM,iBAAiB,QAAqC,CAAC;AACpE,eAAO,MAAM,kBAAkB,QAAsC,CAAC"}
|
|
@@ -3,11 +3,34 @@
|
|
|
3
3
|
* Each template is stored as a .txt file
|
|
4
4
|
*/
|
|
5
5
|
import { readMarkdown } from "../extract.js";
|
|
6
|
+
// Agent progress
|
|
6
7
|
export const agentProgressIndexContent = readMarkdown("agent-progress-index.md.txt");
|
|
7
|
-
|
|
8
|
-
export const frontendDocContent = readMarkdown("frontend-doc.md.txt");
|
|
9
|
-
export const backendIndexContent = readMarkdown("backend-index.md.txt");
|
|
10
|
-
export const backendDocContent = readMarkdown("backend-doc.md.txt");
|
|
8
|
+
// Flow documentation
|
|
11
9
|
export const flowMdContent = readMarkdown("flow.md.txt");
|
|
12
10
|
export const workflowGitignoreContent = readMarkdown("gitignore.txt");
|
|
11
|
+
// Backend structure (multi-doc format)
|
|
12
|
+
export const backendIndexContent = readMarkdown("structure/backend/index.md.txt");
|
|
13
|
+
export const backendDirectoryStructureContent = readMarkdown("structure/backend/directory-structure.md.txt");
|
|
14
|
+
export const backendTypeSafetyContent = readMarkdown("structure/backend/type-safety.md.txt");
|
|
15
|
+
export const backendDatabaseGuidelinesContent = readMarkdown("structure/backend/database-guidelines.md.txt");
|
|
16
|
+
export const backendLoggingGuidelinesContent = readMarkdown("structure/backend/logging-guidelines.md.txt");
|
|
17
|
+
export const backendQualityGuidelinesContent = readMarkdown("structure/backend/quality-guidelines.md.txt");
|
|
18
|
+
export const backendErrorHandlingContent = readMarkdown("structure/backend/error-handling.md.txt");
|
|
19
|
+
// Frontend structure (multi-doc format)
|
|
20
|
+
export const frontendIndexContent = readMarkdown("structure/frontend/index.md.txt");
|
|
21
|
+
export const frontendDirectoryStructureContent = readMarkdown("structure/frontend/directory-structure.md.txt");
|
|
22
|
+
export const frontendTypeSafetyContent = readMarkdown("structure/frontend/type-safety.md.txt");
|
|
23
|
+
export const frontendHookGuidelinesContent = readMarkdown("structure/frontend/hook-guidelines.md.txt");
|
|
24
|
+
export const frontendComponentGuidelinesContent = readMarkdown("structure/frontend/component-guidelines.md.txt");
|
|
25
|
+
export const frontendQualityGuidelinesContent = readMarkdown("structure/frontend/quality-guidelines.md.txt");
|
|
26
|
+
export const frontendStateManagementContent = readMarkdown("structure/frontend/state-management.md.txt");
|
|
27
|
+
// Flows structure
|
|
28
|
+
export const flowsIndexContent = readMarkdown("structure/flows/index.md.txt");
|
|
29
|
+
export const flowsCrossLayerThinkingGuideContent = readMarkdown("structure/flows/cross-layer-thinking-guide.md.txt");
|
|
30
|
+
export const flowsSpecFlowTemplateContent = readMarkdown("structure/flows/spec-flow-template.md.txt");
|
|
31
|
+
export const flowsPreImplementationChecklistContent = readMarkdown("structure/flows/pre-implementation-checklist.md.txt");
|
|
32
|
+
export const flowsCodeReuseThinkingGuideContent = readMarkdown("structure/flows/code-reuse-thinking-guide.md.txt");
|
|
33
|
+
// Legacy single-doc format (kept for backward compatibility)
|
|
34
|
+
export const backendDocContent = readMarkdown("backend-doc.md.txt");
|
|
35
|
+
export const frontendDocContent = readMarkdown("frontend-doc.md.txt");
|
|
13
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/markdown/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,CAAC,MAAM,yBAAyB,GAAG,YAAY,CACpD,6BAA6B,CAC7B,CAAC;AACF,MAAM,CAAC,MAAM,oBAAoB,GAAG,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/markdown/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,iBAAiB;AACjB,MAAM,CAAC,MAAM,yBAAyB,GAAG,YAAY,CACpD,6BAA6B,CAC7B,CAAC;AAEF,qBAAqB;AACrB,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;AACzD,MAAM,CAAC,MAAM,wBAAwB,GAAG,YAAY,CAAC,eAAe,CAAC,CAAC;AAEtE,uCAAuC;AACvC,MAAM,CAAC,MAAM,mBAAmB,GAAG,YAAY,CAC9C,gCAAgC,CAChC,CAAC;AACF,MAAM,CAAC,MAAM,gCAAgC,GAAG,YAAY,CAC3D,8CAA8C,CAC9C,CAAC;AACF,MAAM,CAAC,MAAM,wBAAwB,GAAG,YAAY,CACnD,sCAAsC,CACtC,CAAC;AACF,MAAM,CAAC,MAAM,gCAAgC,GAAG,YAAY,CAC3D,8CAA8C,CAC9C,CAAC;AACF,MAAM,CAAC,MAAM,+BAA+B,GAAG,YAAY,CAC1D,6CAA6C,CAC7C,CAAC;AACF,MAAM,CAAC,MAAM,+BAA+B,GAAG,YAAY,CAC1D,6CAA6C,CAC7C,CAAC;AACF,MAAM,CAAC,MAAM,2BAA2B,GAAG,YAAY,CACtD,yCAAyC,CACzC,CAAC;AAEF,wCAAwC;AACxC,MAAM,CAAC,MAAM,oBAAoB,GAAG,YAAY,CAC/C,iCAAiC,CACjC,CAAC;AACF,MAAM,CAAC,MAAM,iCAAiC,GAAG,YAAY,CAC5D,+CAA+C,CAC/C,CAAC;AACF,MAAM,CAAC,MAAM,yBAAyB,GAAG,YAAY,CACpD,uCAAuC,CACvC,CAAC;AACF,MAAM,CAAC,MAAM,6BAA6B,GAAG,YAAY,CACxD,2CAA2C,CAC3C,CAAC;AACF,MAAM,CAAC,MAAM,kCAAkC,GAAG,YAAY,CAC7D,gDAAgD,CAChD,CAAC;AACF,MAAM,CAAC,MAAM,gCAAgC,GAAG,YAAY,CAC3D,8CAA8C,CAC9C,CAAC;AACF,MAAM,CAAC,MAAM,8BAA8B,GAAG,YAAY,CACzD,4CAA4C,CAC5C,CAAC;AAEF,kBAAkB;AAClB,MAAM,CAAC,MAAM,iBAAiB,GAAG,YAAY,CAAC,8BAA8B,CAAC,CAAC;AAC9E,MAAM,CAAC,MAAM,mCAAmC,GAAG,YAAY,CAC9D,mDAAmD,CACnD,CAAC;AACF,MAAM,CAAC,MAAM,4BAA4B,GAAG,YAAY,CACvD,2CAA2C,CAC3C,CAAC;AACF,MAAM,CAAC,MAAM,sCAAsC,GAAG,YAAY,CACjE,qDAAqD,CACrD,CAAC;AACF,MAAM,CAAC,MAAM,kCAAkC,GAAG,YAAY,CAC7D,kDAAkD,CAClD,CAAC;AAEF,6DAA6D;AAC7D,MAAM,CAAC,MAAM,iBAAiB,GAAG,YAAY,CAAC,oBAAoB,CAAC,CAAC;AACpE,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAC,qBAAqB,CAAC,CAAC"}
|