@mind-fold/open-flow 0.2.12 → 0.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,519 +1,406 @@
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
- - Guidelines in `workflow/structure/`
8
- - Progress tracking in `workflow/agent-progress/`
9
-
10
- 2. **Initialize their identity**:
11
- ```bash
12
- ./workflow/scripts/init-developer.sh <developer-name>
13
- ```
14
-
15
- 3. **Guide them through first task**:
16
- - Use `./workflow/scripts/get-context.sh` to get full context
17
- - Use `./workflow/scripts/feature.sh list` to see active features
18
- - Read relevant guidelines in `workflow/structure/`
19
- - Start coding
20
-
21
- 4. **Key scripts to know**:
22
- | Script | Purpose |
23
- |--------|---------|
24
- | `get-context.sh` | Get full session context |
25
- | `feature.sh` | Manage features (create/archive/list) |
26
- | `add-session.sh` | One-click session recording |
27
- | `update-index.sh` | Auto-update index.md |
1
+ You are a senior developer onboarding a new team member to this project's AI-assisted workflow system.
28
2
 
29
- ---
30
-
31
- ## Slash Commands Detailed Guide
32
-
33
- ### Core Workflow Commands
34
-
35
- #### `/init-agent` - Initialize AI Session
36
-
37
- **What it does**:
38
- Reads project context and prepares AI for development work. This is the FIRST command to run at the start of every session.
39
-
40
- **What AI will do**:
41
- 1. Run `./workflow/scripts/get-context.sh` to get:
42
- - Developer identity (who am I?)
43
- - Git status (which branch? uncommitted changes?)
44
- - Recent commits (what happened recently?)
45
- - Active features (what's in progress?)
46
- - Progress file status (where to record work?)
47
- 2. Check if developer identity exists, guide initialization if not
48
- 3. Read relevant structure guidelines based on upcoming task
49
- 4. Report ready status with a summary table
50
-
51
- **Benefits**:
52
- - AI understands the current state before making changes
53
- - Avoids conflicts with ongoing work from other developers
54
- - Knows which guidelines to follow for this project
55
- - Can continue previous work seamlessly
56
-
57
- **If skipped**:
58
- - AI may work on wrong branch or conflict with others' work
59
- - AI doesn't know project conventions, writes inconsistent code
60
- - AI can't find previous context, asks redundant questions
61
- - Progress tracking breaks, work history is lost
3
+ YOUR ROLE: Be a mentor and teacher. Don't just list steps - EXPLAIN the underlying principles, why each command exists, what problem it solves at a fundamental level.
62
4
 
63
5
  ---
64
6
 
65
- #### `/record-agent-flow` - Record Work Progress
66
-
67
- **What it does**:
68
- Records completed work to progress files AFTER human has tested and committed code.
7
+ ## CORE PHILOSOPHY: Why This Workflow Exists
69
8
 
70
- **What AI will do**:
71
- 1. Get current context with `get-context.sh`
72
- 2. Run `add-session.sh` with session details:
73
- - Title: Brief description of work done
74
- - Commit: Git commit hash(es)
75
- - Summary/Content: Detailed changes, lessons learned
76
- 3. Auto-update index.md with new session count and history
9
+ AI-assisted development has three fundamental challenges:
77
10
 
78
- **Benefits**:
79
- - Creates searchable history for future sessions
80
- - Next AI session can understand what was done before
81
- - Tracks lessons learned and patterns discovered
82
- - Enables multi-developer collaboration without conflicts
11
+ ### Challenge 1: AI Has No Memory
83
12
 
84
- **If skipped**:
85
- - Next session starts from zero, no context
86
- - Same bugs may be re-investigated
87
- - Lessons learned are forgotten
88
- - Team loses visibility into AI-assisted work
13
+ Every AI session starts with a blank slate. Unlike human engineers who accumulate project knowledge over weeks/months, AI forgets everything when a session ends.
89
14
 
90
- ---
91
-
92
- #### `/onboard-developer` - Guide New Developer
15
+ **The Problem**: Without memory, AI asks the same questions repeatedly, makes the same mistakes, and can't build on previous work.
93
16
 
94
- **What it does**:
95
- Walks a new developer (human or AI) through the complete setup process.
17
+ **The Solution**: The `workflow/agent-progress/` system captures what happened in each session - what was done, what was learned, what problems were solved. The `/init-agent` command reads this history at session start, giving AI "artificial memory."
96
18
 
97
- **What AI will do**:
98
- 1. Explain workflow system structure
99
- 2. Run `init-developer.sh` to create identity
100
- 3. Demonstrate key scripts and commands
101
- 4. Guide through first task with examples
19
+ ### Challenge 2: AI Has Generic Knowledge, Not Project-Specific Knowledge
102
20
 
103
- ---
21
+ AI models are trained on millions of codebases - they know general patterns for React, TypeScript, databases, etc. But they don't know YOUR project's conventions.
104
22
 
105
- ### Before Coding Commands
23
+ **The Problem**: AI writes code that "works" but doesn't match your project's style. It uses patterns that conflict with existing code. It makes decisions that violate unwritten team rules.
106
24
 
107
- #### `/before-frontend-dev` - Read Frontend Guidelines
25
+ **The Solution**: The `workflow/structure/` directory contains project-specific guidelines. The `/before-*-dev` commands inject this specialized knowledge into AI context before coding starts.
108
26
 
109
- **What it does**:
110
- Reads frontend development guidelines BEFORE writing any frontend code.
27
+ ### Challenge 3: AI Context Window Is Limited
111
28
 
112
- **What AI will do**:
113
- 1. Read `workflow/structure/frontend/index.md` to find relevant sections
114
- 2. Extract specific guideline sections based on task type:
115
- - Component guidelines for UI work
116
- - Hook guidelines for data fetching
117
- - State management for complex state
118
- 3. Understand coding standards and patterns to follow
119
- 4. Identify reference examples to learn from
29
+ Even after injecting guidelines, AI has limited context window. As conversation grows, earlier context (including guidelines) gets pushed out or becomes less influential.
120
30
 
121
- **Benefits**:
122
- - Code follows project conventions from the start
123
- - Avoids common mistakes documented in guidelines
124
- - Uses established patterns instead of inventing new ones
125
- - Reduces review cycles and rework
31
+ **The Problem**: AI starts following guidelines, but as the session progresses and context fills up, it "forgets" the rules and reverts to generic patterns.
126
32
 
127
- **If skipped**:
128
- - Code style inconsistent with rest of codebase
129
- - Reinvents patterns that already exist
130
- - Makes mistakes that guidelines warn against
131
- - Requires significant refactoring after review
33
+ **The Solution**: The `/check-*` commands re-verify code against guidelines AFTER writing, catching drift that occurred during development. The `/finish-work` command does a final holistic review.
132
34
 
133
35
  ---
134
36
 
135
- #### `/before-backend-dev` - Read Backend Guidelines
136
-
137
- **What it does**:
138
- Reads backend development guidelines BEFORE writing any backend code.
139
-
140
- **What AI will do**:
141
- 1. Read `workflow/structure/backend/index.md` to find relevant sections
142
- 2. Extract specific guideline sections:
143
- - Database operations for DB work
144
- - Type safety for API contracts
145
- - Error handling patterns
146
- - Logging standards
147
- 3. Understand project-specific conventions
37
+ ## SYSTEM STRUCTURE
148
38
 
149
- **Benefits**:
150
- - Database queries follow established patterns
151
- - Error handling is consistent across codebase
152
- - Logging provides useful debugging information
153
- - API contracts are type-safe
154
-
155
- **If skipped**:
156
- - N+1 query problems in database code
157
- - Inconsistent error handling
158
- - Missing or unhelpful logs
159
- - Type safety holes in APIs
39
+ ```
40
+ workflow/
41
+ |-- .developer # Your identity (gitignored)
42
+ |-- flow.md # Complete workflow documentation
43
+ |-- agent-progress/ # "AI Memory" - session history
44
+ | |-- index.md # All developers' progress
45
+ | \-- {developer}/ # Per-developer directory
46
+ | |-- index.md # Personal progress index
47
+ | |-- features/ # Active feature tracking
48
+ | \-- progress-N.md # Session records (max 2000 lines)
49
+ |-- structure/ # "AI Training Data" - project knowledge
50
+ | |-- frontend/ # Frontend conventions
51
+ | |-- backend/ # Backend conventions
52
+ | \-- flows/ # Cross-layer patterns
53
+ \-- scripts/ # Automation tools
54
+ ```
160
55
 
161
56
  ---
162
57
 
163
- ### Code Check Commands
164
-
165
- #### `/check-frontend` - Check Frontend Code
58
+ ## COMMAND DEEP DIVE
166
59
 
167
- **What it does**:
168
- Verifies frontend code against guidelines AFTER writing code, BEFORE committing.
60
+ ### /init-agent - Restore AI Memory
169
61
 
170
- **What AI will do**:
171
- 1. Run type check (`tsc --noEmit`)
172
- 2. Run linter and check for errors
173
- 3. Review code against frontend guidelines
174
- 4. Check for common issues:
175
- - Semantic HTML usage
176
- - Accessibility compliance
177
- - Performance patterns
178
- 5. Report violations and suggest fixes
62
+ **WHY IT EXISTS**:
63
+ When a human engineer joins a project, they spend days/weeks learning: What is this project? What's been built? What's in progress? What's the current state?
179
64
 
180
- **Benefits**:
181
- - Catches errors before human review
182
- - Ensures consistent code quality
183
- - Documents what was checked for transparency
65
+ AI needs the same onboarding - but compressed into seconds at session start.
184
66
 
185
- **If skipped**:
186
- - Type errors slip into codebase
187
- - Lint errors accumulate
188
- - Accessibility issues go unnoticed
189
- - Review cycles increase
67
+ **WHAT IT ACTUALLY DOES**:
68
+ 1. Reads developer identity (who am I in this project?)
69
+ 2. Checks git status (what branch? uncommitted changes?)
70
+ 3. Reads recent session history from `agent-progress/` (what happened before?)
71
+ 4. Identifies active features (what's in progress?)
72
+ 5. Understands current project state before making any changes
190
73
 
191
- ---
192
-
193
- #### `/check-backend` - Check Backend Code
194
-
195
- **What it does**:
196
- Verifies backend code against guidelines AFTER writing code, BEFORE committing.
197
-
198
- **What AI will do**:
199
- 1. Run type check
200
- 2. Run linter
201
- 3. Review against backend guidelines:
202
- - No non-null assertions (`!`)
203
- - All inputs/outputs have Zod schemas
204
- - Structured logging (no console.log)
205
- - No await in loops
206
- 4. Check API documentation is updated
207
- 5. Report issues and fixes
208
-
209
- **Benefits**:
210
- - Catches type safety issues early
211
- - Ensures API documentation stays in sync
212
- - Validates database operation patterns
74
+ **WHY THIS MATTERS**:
75
+ - Without init-agent: AI is blind. It might work on wrong branch, conflict with others' work, or redo already-completed work.
76
+ - With init-agent: AI knows project context, can continue where previous session left off, avoids conflicts.
213
77
 
214
- **If skipped**:
215
- - Runtime errors from type mismatches
216
- - API docs become outdated
217
- - Performance issues from N+1 queries
78
+ **ANALOGY**: Like a human engineer reading their notes from yesterday before starting today's work.
218
79
 
219
80
  ---
220
81
 
221
- #### `/check-cross-layer` - Cross-Layer Verification
222
-
223
- **What it does**:
224
- Verifies consistency between frontend and backend when changes span multiple layers.
225
-
226
- **What AI will do**:
227
- 1. Identify all layers touched by the change
228
- 2. Verify type contracts match across layers
229
- 3. Check data flow consistency
230
- 4. Validate API request/response alignment
231
-
232
- **Benefits**:
233
- - Catches integration issues early
234
- - Ensures frontend and backend stay in sync
235
- - Prevents runtime type mismatches
236
-
237
- **If skipped**:
238
- - Frontend expects data backend doesn't provide
239
- - Type mismatches cause runtime errors
240
- - Integration bugs found late in testing
82
+ ### /before-frontend-dev and /before-backend-dev - Inject Specialized Knowledge
241
83
 
242
- ---
243
-
244
- ### Work Completion Commands
84
+ **WHY IT EXISTS**:
85
+ AI models have "pre-trained knowledge" - general patterns from millions of codebases. But YOUR project has specific conventions that differ from generic patterns.
245
86
 
246
- #### `/finish-work` - Pre-Commit Checklist
87
+ Human engineers learn project conventions by:
88
+ - Reading existing code
89
+ - Getting mentored by teammates
90
+ - Reading internal documentation
247
91
 
248
- **What it does**:
249
- Final verification before human commits. Ensures nothing is forgotten.
92
+ AI needs the same "training" - but injected at runtime before each coding task.
250
93
 
251
- **What AI will do**:
252
- 1. Run all relevant checks (type, lint)
253
- 2. Verify all changes are intentional
254
- 3. Check documentation is updated
255
- 4. Prepare commit message suggestion
256
- 5. List files to be committed
257
- 6. Confirm ready for human review
94
+ **WHAT IT ACTUALLY DOES**:
95
+ 1. Reads `workflow/structure/frontend/` or `workflow/structure/backend/` index
96
+ 2. Extracts relevant guideline sections based on the task
97
+ 3. Loads project-specific patterns into AI's working context:
98
+ - Component naming conventions
99
+ - State management patterns
100
+ - Database query patterns
101
+ - Error handling standards
102
+ - Logging formats
103
+ - Type safety rules
258
104
 
259
- **Benefits**:
260
- - Nothing is forgotten before commit
261
- - Clean commit history
262
- - Documentation stays in sync
263
- - Human knows exactly what to review
105
+ **WHY THIS MATTERS**:
106
+ - Without before-*-dev: AI writes generic code. It "works" but doesn't match project style. Other engineers can't read it. It creates inconsistency.
107
+ - With before-*-dev: AI writes code that looks like the rest of the codebase. It follows established patterns. It's consistent.
264
108
 
265
- **If skipped**:
266
- - Partial commits with missing files
267
- - Documentation drift
268
- - Unclear what changed for reviewer
109
+ **ANALOGY**: Like a human engineer reading the team's coding standards document before writing their first PR.
269
110
 
270
111
  ---
271
112
 
272
- #### `/break-loop` - End Investigation Loop
273
-
274
- **What it does**:
275
- Stops an investigation/debugging loop and summarizes findings. Use when debugging or researching, BEFORE `/finish-work`.
113
+ ### /check-frontend and /check-backend - Combat Context Drift
276
114
 
277
- **What AI will do**:
278
- 1. Summarize what was investigated
279
- 2. Document root cause (if found)
280
- 3. List temporary vs permanent fixes
281
- 4. Record lessons learned
282
- 5. Suggest next steps or follow-up tasks
283
- 6. Prepare knowledge for `/record-question` if applicable
115
+ **WHY IT EXISTS**:
116
+ AI context window has limited capacity. As conversation progresses:
117
+ - New messages push older context (including guidelines) toward the edge
118
+ - AI attention becomes diluted across more content
119
+ - Guidelines injected at session start become less influential
284
120
 
285
- **Benefits**:
286
- - Prevents endless investigation loops
287
- - Captures debugging knowledge
288
- - Creates actionable next steps
289
- - Knowledge is preserved for future
121
+ This causes "context drift" - AI starts following guidelines but gradually reverts to generic patterns.
290
122
 
291
- **If skipped**:
292
- - Investigation goes in circles
293
- - Findings are lost when session ends
294
- - Same debugging repeated later
295
- - No clear resolution or next steps
296
-
297
- ---
123
+ **WHAT IT ACTUALLY DOES**:
124
+ 1. Re-reads the guidelines that were injected earlier
125
+ 2. Compares written code against those guidelines
126
+ 3. Runs type checker and linter
127
+ 4. Identifies violations:
128
+ - Style inconsistencies
129
+ - Pattern violations
130
+ - Type safety issues
131
+ - Logic bugs
132
+ 5. Reports findings and suggests fixes
298
133
 
299
- ### Utility Commands
134
+ **WHY THIS MATTERS**:
135
+ - Without check-*: Context drift goes unnoticed. Code that seemed right during writing violates guidelines when reviewed.
136
+ - With check-*: Drift is caught and corrected before commit. Code quality is verified, not assumed.
300
137
 
301
- #### `/create-command` - Create New Slash Command
302
-
303
- **What it does**:
304
- Creates a new slash command when a repeated workflow pattern is identified.
305
-
306
- **What AI will do**:
307
- 1. Analyze the workflow pattern
308
- 2. Design command structure
309
- 3. Create command file in `.cursor/commands/` or `.claude/commands/`
310
- 4. Document usage and examples
138
+ **ANALOGY**: Like code review, but automated and immediate. Catches what the "tired" AI missed.
311
139
 
312
140
  ---
313
141
 
314
- #### `/record-question` - Document Solved Problems
315
-
316
- **What it does**:
317
- Documents a solved problem for future reference when a tricky issue is resolved.
318
-
319
- **What AI will do**:
320
- 1. Summarize the problem
321
- 2. Document the root cause
322
- 3. Record the solution
323
- 4. Add to appropriate location (big-question/ or guidelines)
324
-
325
- **Benefits**:
326
- - Knowledge is preserved
327
- - Same problem won't need re-investigation
328
- - Team learns from each other's discoveries
142
+ ### /finish-work - Holistic Pre-Commit Review
143
+
144
+ **WHY IT EXISTS**:
145
+ The `/check-*` commands focus on code quality within a layer (frontend OR backend). But real changes often have cross-cutting concerns:
146
+ - Does frontend change break backend contract?
147
+ - Does backend change require frontend update?
148
+ - Does infrastructure change need documentation?
149
+ - Are there side effects on other features?
150
+
151
+ **WHAT IT ACTUALLY DOES**:
152
+ 1. Reviews all changes holistically (not just one layer)
153
+ 2. Checks cross-layer consistency:
154
+ - API contracts match between frontend/backend
155
+ - Type definitions are synchronized
156
+ - Data flow is consistent end-to-end
157
+ 3. Identifies broader impacts:
158
+ - Will this change affect other features?
159
+ - Are there edge cases not considered?
160
+ - Is documentation needed?
161
+ 4. **CRITICAL**: If there are significant infrastructure or pattern changes:
162
+ - Checks if these should be documented in `workflow/structure/`
163
+ - Ensures future `/before-*-dev` commands will include this new knowledge
164
+ - Prevents knowledge from being lost
165
+
166
+ **WHY THIS MATTERS**:
167
+ - Without finish-work: Individual layers pass checks, but integration fails. New patterns aren't documented. Knowledge is lost.
168
+ - With finish-work: Cross-layer issues caught before commit. New patterns documented for future sessions.
169
+
170
+ **ANALOGY**: Like the final review before merging a PR - checking not just code quality, but overall impact and documentation.
329
171
 
330
172
  ---
331
173
 
332
- #### `/integrate-skill` - Integrate Claude Skills
174
+ ### /record-agent-flow - Persist Memory for Future
333
175
 
334
- **What it does**:
335
- Integrates external Claude skills into project guidelines.
176
+ **WHY IT EXISTS**:
177
+ All the context AI built during this session - what was done, what was learned, what problems were solved - will be lost when session ends.
336
178
 
337
- ---
179
+ The next session's `/init-agent` needs this information to avoid starting from zero.
338
180
 
339
- #### `/extract-llm-docs` - Extract from LLM Documentation
181
+ **WHAT IT ACTUALLY DOES**:
182
+ 1. Records session summary to `agent-progress/{developer}/progress-N.md`
183
+ 2. Captures:
184
+ - What task was worked on
185
+ - What commits were made (for code sessions)
186
+ - What was learned (patterns discovered, bugs found)
187
+ - What's remaining (if work continues next session)
188
+ 3. Updates index files for quick lookup
340
189
 
341
- **What it does**:
342
- Extracts useful patterns from LLM documentation (like llms.txt files) into project guidelines.
190
+ **WHY THIS MATTERS**:
191
+ - Without record-agent-flow: Next session starts blind. Same bugs re-investigated. Same patterns re-discovered.
192
+ - With record-agent-flow: Next session has context. AI can continue work. Knowledge compounds over time.
343
193
 
344
- ---
194
+ **ANALOGY**: Like writing notes at end of workday for tomorrow's you (or your colleague taking over).
345
195
 
346
- #### `/extract-to-rules` - Extract Rules from Source
196
+ ---
347
197
 
348
- **What it does**:
349
- Extracts coding rules and patterns from existing source code into guidelines.
198
+ ### /break-loop - Stop Investigation, Capture Findings
350
199
 
351
- ---
200
+ **WHY IT EXISTS**:
201
+ Debugging and investigation can spiral - AI keeps trying things without concluding. Findings get scattered across conversation. When session ends, insights are lost.
352
202
 
353
- #### `/sync-from-runtime` - Sync Knowledge
203
+ **WHAT IT ACTUALLY DOES**:
204
+ 1. Forces a stop point in investigation
205
+ 2. Summarizes:
206
+ - What was investigated
207
+ - What was the root cause (if found)
208
+ - What fixes were tried (temporary vs permanent)
209
+ - What follow-up is needed
210
+ 3. Prepares findings for `/record-agent-flow`
354
211
 
355
- **What it does**:
356
- Syncs knowledge and patterns from runtime documentation.
212
+ **WHY THIS MATTERS**:
213
+ - Without break-loop: Investigation spirals endlessly. Findings scattered. Same debugging repeated next time.
214
+ - With break-loop: Investigation has clear conclusion. Findings documented. Future sessions have context.
357
215
 
358
216
  ---
359
217
 
360
- ## Real-World Workflow Examples
218
+ ## REAL-WORLD WORKFLOW EXAMPLES
361
219
 
362
220
  ### Example 1: Bug Fix Session
363
221
 
364
222
  **Scenario**: UI component missing after refactor
365
223
 
366
- ```
367
- 1. /init-agent
368
- -> See context: Branch "main", 2 uncommitted files
369
- -> Active feature: none
370
-
371
- 2. Create feature:
372
- ./workflow/scripts/feature.sh create fix-sync-indicator
373
-
374
- 3. /before-frontend-dev
375
- -> Read component guidelines
376
-
377
- 4. Investigate and fix:
378
- - Analyze old vs new architecture
379
- - Import missing component
380
- - Add CSS styles
224
+ **[1/9] /init-agent**
225
+ - PRINCIPLE: AI needs project context before touching code
226
+ - WHAT HAPPENS: AI reads session history, sees this is a React project, understands current branch/state
227
+ - IF SKIPPED: AI might not know project conventions, could work on wrong branch
228
+
229
+ **[2/9] ./workflow/scripts/feature.sh create fix-sync-indicator**
230
+ - PRINCIPLE: Track work for future reference
231
+ - WHAT HAPPENS: Creates feature record linking all subsequent work
232
+ - IF SKIPPED: Work scattered, hard to trace what changed and why
233
+
234
+ **[3/9] /before-frontend-dev**
235
+ - PRINCIPLE: Inject project-specific frontend knowledge
236
+ - WHAT HAPPENS: AI learns YOUR component patterns, not generic React patterns
237
+ - IF SKIPPED: AI writes generic code that doesn't match project style
238
+
239
+ **[4/9] Investigate and fix the bug**
240
+ - PRINCIPLE: Actual development work
241
+ - WHAT HAPPENS: AI has context + guidelines, writes consistent code
242
+
243
+ **[5/9] /check-frontend**
244
+ - PRINCIPLE: Combat context drift
245
+ - WHAT HAPPENS: Re-verifies code against guidelines, catches style violations, type errors
246
+ - IF SKIPPED: Drift goes unnoticed, code quality degrades
247
+
248
+ **[6/9] /finish-work**
249
+ - PRINCIPLE: Holistic cross-layer review
250
+ - WHAT HAPPENS: Checks if this frontend change has backend implications, documentation needs
251
+ - IF SKIPPED: Integration issues missed, patterns undocumented
252
+
253
+ **[7/9] Human tests and commits**
254
+ - PRINCIPLE: Human-in-the-loop verification
255
+ - WHAT HAPPENS: AI NEVER commits - human validates before code enters repo
256
+ - IF SKIPPED: Untested code in production
257
+
258
+ **[8/9] /record-agent-flow**
259
+ - PRINCIPLE: Persist memory for future
260
+ - WHAT HAPPENS: Records what was done, learned patterns, commit hashes
261
+ - IF SKIPPED: Next session starts from zero
262
+
263
+ **[9/9] ./workflow/scripts/feature.sh archive**
264
+ - PRINCIPLE: Clean tracking state
265
+ - WHAT HAPPENS: Moves completed feature to archive
381
266
 
382
- 5. /check-frontend
383
- -> Type check: [OK] passed
384
- -> Lint: [OK] 0 errors
385
-
386
- 6. /finish-work
387
- -> Pre-commit checklist
388
- -> Confirm all changes are ready
389
-
390
- 7. Human tests and commits:
391
- git commit -m "fix(ui): restore SyncIndicator to TabBar"
392
-
393
- 8. /record-agent-flow
394
- -> ./workflow/scripts/add-session.sh --title "Fix SyncIndicator" --commit "abc123"
395
-
396
- 9. Archive feature:
397
- ./workflow/scripts/feature.sh archive fix-sync-indicator
398
- ```
267
+ ---
399
268
 
400
269
  ### Example 2: Planning Session (No Code)
401
270
 
402
271
  **Scenario**: Audit migration docs and plan consolidation
403
272
 
404
- ```
405
- 1. /init-agent
406
- -> Understand current state
273
+ **[1/4] /init-agent**
274
+ - PRINCIPLE: Context needed even for non-coding work
275
+ - WHAT HAPPENS: AI sees what planning was done before, avoids duplicate work
407
276
 
408
- 2. Create feature:
409
- ./workflow/scripts/feature.sh create migration-docs-consolidation
277
+ **[2/4] ./workflow/scripts/feature.sh create migration-docs-consolidation**
278
+ - PRINCIPLE: Planning is valuable work worth tracking
279
+ - WHAT HAPPENS: Creates record for this planning effort
410
280
 
411
- 3. Review docs, compare with existing guidelines
281
+ **[3/4] Review docs, create subtask list**
282
+ - PRINCIPLE: Actual planning work
283
+ - WHAT HAPPENS: Compare docs, identify gaps, prioritize tasks
412
284
 
413
- 4. Create subtask list in feature.json:
414
- - Critical: Update outdated timestamp format
415
- - High: Add missing validation rules
416
- - Medium: Consolidate scattered docs
285
+ **[4/4] /record-agent-flow (with --summary, no --commit)**
286
+ - PRINCIPLE: Planning decisions must be recorded
287
+ - WHAT HAPPENS: Uses --summary flag since no code commits
288
+ - IF SKIPPED: Planning decisions lost, team doesn't know what was decided
417
289
 
418
- 5. /record-agent-flow (no commit)
419
- -> ./workflow/scripts/add-session.sh --title "Migration Docs Planning" --summary "Created 14 subtasks"
420
- ```
290
+ ---
421
291
 
422
292
  ### Example 3: Code Review Fixes
423
293
 
424
294
  **Scenario**: Fix issues from CR round 2
425
295
 
426
- ```
427
- 1. /init-agent
428
- -> Continue feature: entity-filesystem-refactor
296
+ **[1/6] /init-agent**
297
+ - PRINCIPLE: Resume context from previous session
298
+ - WHAT HAPPENS: AI sees this feature is in progress, reads CR feedback context
429
299
 
430
- 2. /before-backend-dev
431
- -> Read database and error handling guidelines
300
+ **[2/6] /before-backend-dev**
301
+ - PRINCIPLE: Re-inject guidelines before fixes
302
+ - WHAT HAPPENS: CR comments often point to guideline violations - AI needs guidelines fresh in context
432
303
 
433
- 3. Fix each CR issue:
434
- - Add missing workspaceId filter (data isolation)
435
- - Fix meta double-stringify bug
436
- - Add LWW conflict resolution
304
+ **[3/6] Fix each CR issue**
305
+ - PRINCIPLE: Address feedback with guidelines in context
306
+ - WHAT HAPPENS: Fixes follow project conventions, not generic patterns
437
307
 
438
- 4. /check-backend
439
- -> All checks passed
308
+ **[4/6] /check-backend**
309
+ - PRINCIPLE: Verify fixes didn't introduce new issues
310
+ - WHAT HAPPENS: Each fix could break something else - this catches it
440
311
 
441
- 5. /finish-work
442
- -> Pre-commit checklist
443
- -> Document lessons learned:
444
- - "All queries with workspaceId column must include WHERE clause"
445
- - "buildXxxValues must match *DataSchema types"
312
+ **[5/6] /finish-work**
313
+ - PRINCIPLE: Document lessons from CR
314
+ - WHAT HAPPENS: CR feedback reveals patterns worth documenting
315
+ - KEY: If CR revealed a pattern violation, consider adding to workflow/structure/ so future /before-*-dev catches it
446
316
 
447
- 6. Human commits, then /record-agent-flow
448
- ```
317
+ **[6/6] Human commits, then /record-agent-flow**
318
+ - PRINCIPLE: Preserve CR lessons
319
+ - WHAT HAPPENS: Next time AI writes similar code, it has this context
320
+
321
+ ---
449
322
 
450
323
  ### Example 4: Large Refactoring
451
324
 
452
325
  **Scenario**: Adapt workflow system for monorepo
453
326
 
454
- ```
455
- 1. /init-agent
456
- -> Create feature: workflow-monorepo-adaptation
327
+ **[1/5] /init-agent**
328
+ - PRINCIPLE: Clear baseline before major changes
329
+ - WHAT HAPPENS: Large refactors need documented starting point
457
330
 
458
- 2. Plan phases:
459
- - Phase 1: Root directory restructure
460
- - Phase 2: Sub-project workflow cleanup
461
- - Phase 3: Slash commands rewrite
462
- - Phase 4: Core docs update
331
+ **[2/5] Plan phases**
332
+ - PRINCIPLE: Break into verifiable chunks
333
+ - WHAT HAPPENS: Define phases that can each be checked independently
463
334
 
464
- 3. Execute phase by phase, running /check-* after each
335
+ **[3/5] Execute phase by phase with /check-* after each**
336
+ - PRINCIPLE: Incremental verification
337
+ - WHAT HAPPENS: Catch issues early, don't let drift compound across phases
465
338
 
466
- 4. /finish-work
467
- -> Final verification checklist
339
+ **[4/5] /finish-work**
340
+ - PRINCIPLE: Major refactor likely needs documentation update
341
+ - WHAT HAPPENS: Check if new patterns should be added to workflow/structure/
342
+ - KEY: This ensures future /before-*-dev commands include the new patterns
468
343
 
469
- 5. Human commits multiple times, record with multiple commit hashes:
470
- ./workflow/scripts/add-session.sh --title "Monorepo Adaptation" --commit "hash1,hash2,hash3"
471
- ```
344
+ **[5/5] Record with multiple commit hashes**
345
+ - PRINCIPLE: Link all commits to one logical feature
346
+ - COMMAND: ./workflow/scripts/add-session.sh --title "Monorepo Adaptation" --commit "hash1,hash2,hash3"
347
+
348
+ ---
472
349
 
473
350
  ### Example 5: Debug Session with Break Loop
474
351
 
475
352
  **Scenario**: Investigating a complex sync bug
476
353
 
477
- ```
478
- 1. /init-agent
479
- -> Continue feature: fix-sync-data-inconsistency
480
-
481
- 2. /before-backend-dev
482
- -> Read sync and database guidelines
354
+ **[1/7] /init-agent**
355
+ - PRINCIPLE: See if this bug was investigated before
356
+ - WHAT HAPPENS: Previous investigation attempts might have clues
483
357
 
484
- 3. Investigation loop:
485
- - Analyze cloud vs local data
486
- - Check sync event timestamps
487
- - Review applyEvent logic
488
- - Add debug logging
358
+ **[2/7] /before-backend-dev**
359
+ - PRINCIPLE: Guidelines often document known gotchas
360
+ - WHAT HAPPENS: Sync-related guidelines might hint at common issues
489
361
 
490
- 4. /check-backend
491
- -> All checks passed
362
+ **[3/7] Investigation loop**
363
+ - PRINCIPLE: Actual debugging work
364
+ - WHAT HAPPENS: Analyze data, check logs, form hypotheses, test fixes
492
365
 
493
- 5. /break-loop (when investigation is complete)
494
- -> Summarize findings:
495
- - Root cause: Transaction failure without error logging
496
- - Temporary fix: Manual SQL update
497
- - Permanent fix: Add detailed logging in applyEvent
498
- -> Document for future reference
366
+ **[4/7] /check-backend**
367
+ - PRINCIPLE: Debug code can be sloppy
368
+ - WHAT HAPPENS: Verify debug changes don't break other things
499
369
 
500
- 6. /finish-work
501
- -> Pre-commit checklist
370
+ **[5/7] /break-loop**
371
+ - PRINCIPLE: CRITICAL - Force conclusion to investigation
372
+ - WHAT HAPPENS: Stop spiraling, document findings:
373
+ - Root cause identified?
374
+ - Temporary fix vs permanent fix?
375
+ - Follow-up needed?
376
+ - IF SKIPPED: Investigation goes in circles, findings scattered and lost
502
377
 
503
- 7. Human tests and commits
378
+ **[6/7] /finish-work**
379
+ - PRINCIPLE: Debug findings might need documentation
380
+ - WHAT HAPPENS: If this was a common bug pattern, add to guidelines
504
381
 
505
- 8. /record-agent-flow
506
- -> Include lessons learned in session record
507
- ```
382
+ **[7/7] Human commits, then /record-agent-flow**
383
+ - PRINCIPLE: Debug knowledge is valuable
384
+ - WHAT HAPPENS: Next time same bug appears, AI has context
508
385
 
509
386
  ---
510
387
 
511
- ## Key Points to Emphasize
388
+ ## KEY RULES TO EMPHASIZE
389
+
390
+ 1. **AI NEVER commits** - Human tests and approves. AI prepares, human validates.
391
+
392
+ 2. **Guidelines before code** - /before-*-dev commands inject project knowledge. Without them, AI writes generic code.
393
+
394
+ 3. **Check after code** - /check-* commands catch context drift. Without them, drift goes unnoticed.
395
+
396
+ 4. **Finish-work updates guidelines** - If you discover new patterns or fix pattern violations, consider updating workflow/structure/ so future sessions benefit.
397
+
398
+ 5. **Record everything** - /record-agent-flow persists memory. Without it, next session starts blind.
399
+
400
+ ---
512
401
 
513
- - AI should NOT execute `git commit` - human is responsible for testing and committing
514
- - Each developer has their own progress directory
515
- - Read guidelines before coding (mandatory)
516
- - Use `/record-question` to document solved problems for future reference
517
- - Planning sessions (no code) are valid - record with `--summary` instead of `--commit`
518
- - `/break-loop` is for ending debug/investigation loops, use BEFORE `/finish-work`
402
+ After explaining, ask the developer:
403
+ 1. What kind of work will they be doing? (frontend/backend/full-stack)
404
+ 2. Do they have a specific task to start with?
519
405
 
406
+ Then guide them through their first task using the appropriate workflow.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mind-fold/open-flow",
3
- "version": "0.2.12",
3
+ "version": "0.2.14",
4
4
  "description": "AI-assisted development workflow initializer for Cursor, Claude Code and more",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",