agileflow 2.85.0 → 2.86.0
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/CHANGELOG.md +5 -0
- package/README.md +3 -3
- package/lib/colors.js +23 -0
- package/package.json +1 -1
- package/scripts/agileflow-statusline.sh +31 -44
- package/scripts/agileflow-welcome.js +11 -8
- package/scripts/batch-pmap-loop.js +528 -0
- package/scripts/lib/colors.sh +106 -0
- package/scripts/lib/file-tracking.js +5 -3
- package/scripts/obtain-context.js +125 -14
- package/scripts/session-boundary.js +3 -3
- package/scripts/session-manager.js +303 -8
- package/scripts/test-session-boundary.js +80 -0
- package/src/core/agents/mentor.md +40 -2
- package/src/core/agents/orchestrator.md +35 -2
- package/src/core/commands/babysit.md +198 -674
- package/src/core/commands/batch.md +117 -2
- package/src/core/commands/metrics.md +62 -9
- package/src/core/commands/rpi.md +500 -0
- package/src/core/commands/session/new.md +30 -22
- package/src/core/commands/session/status.md +35 -2
- package/src/core/templates/session-state.json +32 -3
- package/tools/cli/commands/config.js +43 -21
- package/tools/cli/commands/doctor.js +8 -5
- package/tools/cli/commands/setup.js +14 -7
- package/tools/cli/commands/uninstall.js +8 -5
- package/tools/cli/commands/update.js +20 -10
- package/tools/cli/lib/content-injector.js +80 -0
- package/tools/cli/lib/error-handler.js +173 -0
- package/tools/cli/lib/ui.js +3 -2
|
@@ -35,6 +35,23 @@ This gathers: git status, stories/epics, session state, docs structure, research
|
|
|
35
35
|
|
|
36
36
|
---
|
|
37
37
|
|
|
38
|
+
## QUICK DECISION TREE
|
|
39
|
+
|
|
40
|
+
| Task Type | Action |
|
|
41
|
+
|-----------|--------|
|
|
42
|
+
| **Simple** (typo, one-liner) | Do it yourself |
|
|
43
|
+
| **Complex, 1 domain** | Spawn domain expert |
|
|
44
|
+
| **Complex, 2+ domains** | Spawn orchestrator |
|
|
45
|
+
| **Stuck on error 2+ times** | Run `/agileflow:research:ask` |
|
|
46
|
+
|
|
47
|
+
**Key Rules:**
|
|
48
|
+
1. ALWAYS end responses with `AskUserQuestion` tool (not text questions)
|
|
49
|
+
2. Use `EnterPlanMode` before non-trivial implementation
|
|
50
|
+
3. Use `TodoWrite` to track multi-step tasks
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
<!-- SECTION: loop-mode -->
|
|
38
55
|
## LOOP MODE (Autonomous Execution)
|
|
39
56
|
|
|
40
57
|
When invoked with `MODE=loop`, babysit runs autonomously through an epic's stories:
|
|
@@ -126,11 +143,6 @@ Configure semantic conditions in `docs/00-meta/agileflow-metadata.json`:
|
|
|
126
143
|
- `**all screenshots verified**` - Screenshots need `verified-` prefix
|
|
127
144
|
- `**all acceptance criteria verified**` - AC marked complete in status.json
|
|
128
145
|
|
|
129
|
-
**Benefits:**
|
|
130
|
-
- Natural language conditions that read like requirements
|
|
131
|
-
- Multiple conditions can be combined
|
|
132
|
-
- Extensible - add custom conditions as needed
|
|
133
|
-
|
|
134
146
|
### Coverage Mode
|
|
135
147
|
|
|
136
148
|
When `COVERAGE=<percent>` is specified, the loop adds test coverage verification:
|
|
@@ -146,22 +158,6 @@ When `COVERAGE=<percent>` is specified, the loop adds test coverage verification
|
|
|
146
158
|
4. Requires minimum 2 iterations before completion
|
|
147
159
|
5. Story completes only when coverage ≥ threshold AND confirmed
|
|
148
160
|
|
|
149
|
-
**When to use Coverage Mode:**
|
|
150
|
-
- Test-driven epics where coverage matters
|
|
151
|
-
- "Write tests until X% coverage" goals
|
|
152
|
-
- Batch test generation overnight
|
|
153
|
-
|
|
154
|
-
**Configuration** (optional):
|
|
155
|
-
Add to `docs/00-meta/agileflow-metadata.json`:
|
|
156
|
-
```json
|
|
157
|
-
{
|
|
158
|
-
"ralph_loop": {
|
|
159
|
-
"coverage_command": "npm run test:coverage",
|
|
160
|
-
"coverage_report_path": "coverage/coverage-summary.json"
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
```
|
|
164
|
-
|
|
165
161
|
### Visual Mode
|
|
166
162
|
|
|
167
163
|
When `VISUAL=true` is specified, the loop adds screenshot verification:
|
|
@@ -176,35 +172,13 @@ When `VISUAL=true` is specified, the loop adds screenshot verification:
|
|
|
176
172
|
3. Requires minimum 2 iterations before completion
|
|
177
173
|
4. Prevents premature completion for UI work
|
|
178
174
|
|
|
179
|
-
|
|
180
|
-
- UI-focused epics (components, styling, layouts)
|
|
181
|
-
- Shadcn/UI development
|
|
182
|
-
- Any work where visual appearance matters
|
|
183
|
-
|
|
184
|
-
**Setup requirement:**
|
|
185
|
-
Run `/agileflow:configure` and select "Set up Visual E2E testing" to install Playwright and create e2e tests.
|
|
186
|
-
|
|
187
|
-
### Visual Mode Auto-Detection (IMPORTANT)
|
|
175
|
+
### Visual Mode Auto-Detection
|
|
188
176
|
|
|
189
177
|
**Check the context output** from `obtain-context.js` for Visual E2E status.
|
|
190
178
|
|
|
191
|
-
**If "📸 VISUAL E2E TESTING: ENABLED" appears
|
|
192
|
-
|
|
193
|
-
When presenting task options for UI-focused work, **proactively suggest VISUAL mode**:
|
|
194
|
-
|
|
195
|
-
```
|
|
196
|
-
This epic involves UI work. Visual E2E is configured.
|
|
197
|
-
|
|
198
|
-
Suggested command:
|
|
199
|
-
/agileflow:babysit EPIC=EP-0042 MODE=loop VISUAL=true
|
|
200
|
-
|
|
201
|
-
Visual Mode ensures:
|
|
202
|
-
- Screenshots are captured and verified
|
|
203
|
-
- Minimum 2 iterations (prevents premature completion)
|
|
204
|
-
- Both tests AND visual verification must pass
|
|
205
|
-
```
|
|
179
|
+
**If "📸 VISUAL E2E TESTING: ENABLED" appears**, proactively suggest VISUAL mode for UI work.
|
|
206
180
|
|
|
207
|
-
**Detection criteria for
|
|
181
|
+
**Detection criteria for VISUAL=true:**
|
|
208
182
|
| Indicator | Suggest VISUAL? |
|
|
209
183
|
|-----------|-----------------|
|
|
210
184
|
| Epic mentions "UI", "component", "styling" | Yes |
|
|
@@ -213,18 +187,6 @@ Visual Mode ensures:
|
|
|
213
187
|
| Work is API/backend only | No |
|
|
214
188
|
| Work is CLI/scripts only | No |
|
|
215
189
|
|
|
216
|
-
**If "VISUAL E2E TESTING: NOT CONFIGURED" appears:**
|
|
217
|
-
|
|
218
|
-
For UI work, suggest setup:
|
|
219
|
-
```
|
|
220
|
-
This is UI work. Visual E2E not configured.
|
|
221
|
-
|
|
222
|
-
To enable screenshot verification:
|
|
223
|
-
/agileflow:configure → Visual E2E testing
|
|
224
|
-
|
|
225
|
-
This helps catch visual issues that tests miss (wrong colors, broken layouts).
|
|
226
|
-
```
|
|
227
|
-
|
|
228
190
|
### Loop Control Commands
|
|
229
191
|
|
|
230
192
|
```bash
|
|
@@ -244,6 +206,7 @@ node scripts/ralph-loop.js --reset # Reset loop state
|
|
|
244
206
|
- Exploratory work without clear acceptance criteria
|
|
245
207
|
- Stories requiring human review before proceeding
|
|
246
208
|
- Complex multi-domain work needing coordination
|
|
209
|
+
<!-- END_SECTION -->
|
|
247
210
|
|
|
248
211
|
---
|
|
249
212
|
|
|
@@ -377,252 +340,13 @@ Use TodoWrite for any task with 3+ steps. Update status as you complete each ste
|
|
|
377
340
|
|
|
378
341
|
---
|
|
379
342
|
|
|
380
|
-
### SPAWN EXPERT EXAMPLES (DETAILED)
|
|
381
|
-
|
|
382
|
-
#### Pattern 1: Single Domain Expert
|
|
383
|
-
|
|
384
|
-
**When:** Task is complex but touches only ONE domain (database OR api OR ui OR testing, etc.)
|
|
385
|
-
|
|
386
|
-
**Database Expert** - Schema, migrations, queries:
|
|
387
|
-
```
|
|
388
|
-
Task(
|
|
389
|
-
description: "Add sessions table for auth",
|
|
390
|
-
prompt: "Create a sessions table for user authentication. Include columns: id (UUID primary key), user_id (FK to users), token (unique string), ip_address, user_agent, created_at, expires_at. Follow existing schema patterns in the codebase. Add appropriate indexes.",
|
|
391
|
-
subagent_type: "agileflow-database"
|
|
392
|
-
)
|
|
393
|
-
```
|
|
394
|
-
|
|
395
|
-
**API Expert** - Endpoints, business logic:
|
|
396
|
-
```
|
|
397
|
-
Task(
|
|
398
|
-
description: "Create user preferences API",
|
|
399
|
-
prompt: "Implement REST endpoints for user preferences: GET /api/preferences (return current), PUT /api/preferences (update). Include validation, error handling. Follow existing API patterns in src/api/.",
|
|
400
|
-
subagent_type: "agileflow-api"
|
|
401
|
-
)
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
**UI Expert** - Components, styling:
|
|
405
|
-
```
|
|
406
|
-
Task(
|
|
407
|
-
description: "Build settings page component",
|
|
408
|
-
prompt: "Create a SettingsPage React component with tabs for: Profile, Notifications, Privacy. Use existing component library (shadcn/ui). Match existing styling patterns. Include loading and error states.",
|
|
409
|
-
subagent_type: "agileflow-ui"
|
|
410
|
-
)
|
|
411
|
-
```
|
|
412
|
-
|
|
413
|
-
**Testing Expert** - Tests, coverage:
|
|
414
|
-
```
|
|
415
|
-
Task(
|
|
416
|
-
description: "Add auth service tests",
|
|
417
|
-
prompt: "Write comprehensive tests for src/services/auth.ts. Cover: login success/failure, token refresh, logout, session expiry. Use existing test patterns. Aim for 90%+ coverage.",
|
|
418
|
-
subagent_type: "agileflow-testing"
|
|
419
|
-
)
|
|
420
|
-
```
|
|
421
|
-
|
|
422
|
-
**Security Expert** - Auth, vulnerabilities:
|
|
423
|
-
```
|
|
424
|
-
Task(
|
|
425
|
-
description: "Security audit of auth flow",
|
|
426
|
-
prompt: "Review the authentication implementation in src/auth/. Check for: SQL injection, XSS, CSRF, session fixation, token handling. Report vulnerabilities with severity and fixes.",
|
|
427
|
-
subagent_type: "agileflow-security"
|
|
428
|
-
)
|
|
429
|
-
```
|
|
430
|
-
|
|
431
|
-
---
|
|
432
|
-
|
|
433
|
-
#### Pattern 2: Orchestrator (Multi-Domain)
|
|
434
|
-
|
|
435
|
-
**When:** Task spans TWO OR MORE domains (API + UI, Database + API + Tests, etc.)
|
|
436
|
-
|
|
437
|
-
**The orchestrator:**
|
|
438
|
-
1. Spawns domain experts in parallel
|
|
439
|
-
2. Collects their results
|
|
440
|
-
3. Resolves conflicts between recommendations
|
|
441
|
-
4. Returns unified outcome
|
|
442
|
-
|
|
443
|
-
**Example - Full Feature (Database + API + UI):**
|
|
444
|
-
```
|
|
445
|
-
Task(
|
|
446
|
-
description: "Implement user profile feature",
|
|
447
|
-
prompt: "Implement complete user profile feature:
|
|
448
|
-
1. DATABASE: Add profile_settings table (theme, notifications, timezone)
|
|
449
|
-
2. API: Create GET/PUT /api/profile endpoints with validation
|
|
450
|
-
3. UI: Build ProfilePage with form, validation, save button
|
|
451
|
-
Coordinate experts to ensure API matches schema and UI matches API contract.",
|
|
452
|
-
subagent_type: "agileflow-orchestrator"
|
|
453
|
-
)
|
|
454
|
-
```
|
|
455
|
-
|
|
456
|
-
**Example - API + Tests:**
|
|
457
|
-
```
|
|
458
|
-
Task(
|
|
459
|
-
description: "Add search endpoint with tests",
|
|
460
|
-
prompt: "Create search functionality:
|
|
461
|
-
1. API: Implement GET /api/search?q=query with pagination
|
|
462
|
-
2. TESTING: Write unit tests and integration tests for the endpoint
|
|
463
|
-
Ensure tests cover edge cases: empty query, special chars, pagination bounds.",
|
|
464
|
-
subagent_type: "agileflow-orchestrator"
|
|
465
|
-
)
|
|
466
|
-
```
|
|
467
|
-
|
|
468
|
-
**🧪 EXPERIMENTAL: Nested Loops with Quality Gates**
|
|
469
|
-
|
|
470
|
-
When you need agents to iterate until quality gates pass (coverage ≥ 80%, tests pass, etc.), the orchestrator can use **nested agent loops**. Each agent runs its own isolated loop.
|
|
471
|
-
|
|
472
|
-
```
|
|
473
|
-
Task(
|
|
474
|
-
description: "Profile feature with quality gates",
|
|
475
|
-
prompt: "Implement profile with quality enforcement:
|
|
476
|
-
1. API: /api/profile with COVERAGE >= 80% (agent loop)
|
|
477
|
-
2. UI: ProfilePage with VISUAL verification (agent loop)
|
|
478
|
-
Use agent-loop.js for isolated quality iterations.",
|
|
479
|
-
subagent_type: "agileflow-orchestrator"
|
|
480
|
-
)
|
|
481
|
-
```
|
|
482
|
-
|
|
483
|
-
See `orchestrator.md` → "NESTED LOOP MODE" section for full details.
|
|
484
|
-
|
|
485
|
-
---
|
|
486
|
-
|
|
487
|
-
#### Pattern 3: Parallel Execution (Manual Coordination)
|
|
488
|
-
|
|
489
|
-
**When:** You want to coordinate parallel work yourself (not via orchestrator).
|
|
490
|
-
|
|
491
|
-
**Step 1 - Spawn experts with `run_in_background: true`:**
|
|
492
|
-
```
|
|
493
|
-
Task(
|
|
494
|
-
description: "Create profile API endpoint",
|
|
495
|
-
prompt: "Implement GET/PUT /api/profile with user data validation",
|
|
496
|
-
subagent_type: "agileflow-api",
|
|
497
|
-
run_in_background: true
|
|
498
|
-
)
|
|
499
|
-
# Returns immediately with task_id (e.g., "task-abc123")
|
|
500
|
-
|
|
501
|
-
Task(
|
|
502
|
-
description: "Create ProfilePage component",
|
|
503
|
-
prompt: "Build ProfilePage React component with form fields for name, email, avatar",
|
|
504
|
-
subagent_type: "agileflow-ui",
|
|
505
|
-
run_in_background: true
|
|
506
|
-
)
|
|
507
|
-
# Returns immediately with task_id (e.g., "task-def456")
|
|
508
|
-
```
|
|
509
|
-
|
|
510
|
-
**Step 2 - Collect results with TaskOutput:**
|
|
511
|
-
```
|
|
512
|
-
TaskOutput(task_id: "task-abc123", block: true)
|
|
513
|
-
# Waits until API expert completes, returns result
|
|
514
|
-
|
|
515
|
-
TaskOutput(task_id: "task-def456", block: true)
|
|
516
|
-
# Waits until UI expert completes, returns result
|
|
517
|
-
```
|
|
518
|
-
|
|
519
|
-
**Step 3 - Synthesize and verify:**
|
|
520
|
-
- Check that UI calls the correct API endpoints
|
|
521
|
-
- Verify data contracts match
|
|
522
|
-
- Run integration tests
|
|
523
|
-
|
|
524
|
-
---
|
|
525
|
-
|
|
526
|
-
#### Pattern 4: Multi-Expert Analysis
|
|
527
|
-
|
|
528
|
-
**When:** Need multiple perspectives on the SAME problem (security review, code review, architecture decision).
|
|
529
|
-
|
|
530
|
-
**Via slash command:**
|
|
531
|
-
```
|
|
532
|
-
/agileflow:multi-expert Is our authentication implementation secure and following best practices?
|
|
533
|
-
```
|
|
534
|
-
|
|
535
|
-
**Via direct spawn:**
|
|
536
|
-
```
|
|
537
|
-
Task(
|
|
538
|
-
description: "Multi-expert auth review",
|
|
539
|
-
prompt: "Analyze authentication implementation from multiple perspectives:
|
|
540
|
-
- SECURITY: Vulnerabilities, token handling, session management
|
|
541
|
-
- API: Endpoint design, error handling, rate limiting
|
|
542
|
-
- TESTING: Test coverage, edge cases, integration tests
|
|
543
|
-
Synthesize findings into prioritized recommendations.",
|
|
544
|
-
subagent_type: "agileflow-multi-expert"
|
|
545
|
-
)
|
|
546
|
-
```
|
|
547
|
-
|
|
548
|
-
---
|
|
549
|
-
|
|
550
|
-
#### Dependency Rules for Expert Spawning
|
|
551
|
-
|
|
552
|
-
| Dependency | How to Handle |
|
|
553
|
-
|------------|---------------|
|
|
554
|
-
| B needs A's output | Run A first, wait for result, then spawn B |
|
|
555
|
-
| A and B independent | Spawn in parallel with `run_in_background: true` |
|
|
556
|
-
| Unsure | Run sequentially (safer) |
|
|
557
|
-
|
|
558
|
-
**Common dependencies:**
|
|
559
|
-
- Database schema → then API (API uses schema types)
|
|
560
|
-
- API endpoint → then UI (UI calls the API)
|
|
561
|
-
- Implementation → then tests (tests need working code)
|
|
562
|
-
- All code → then security review (review complete implementation)
|
|
563
|
-
|
|
564
|
-
---
|
|
565
|
-
|
|
566
|
-
#### Retry with Backoff for Expert Spawning
|
|
567
|
-
|
|
568
|
-
When an expert task fails, apply retry logic before giving up:
|
|
569
|
-
|
|
570
|
-
**Retry Strategy:**
|
|
571
|
-
```
|
|
572
|
-
Attempt 1: Immediate retry
|
|
573
|
-
Attempt 2: Wait 5 seconds, then retry
|
|
574
|
-
Attempt 3: Wait 15 seconds, then retry (final)
|
|
575
|
-
```
|
|
576
|
-
|
|
577
|
-
**When to retry:**
|
|
578
|
-
- Expert returns error or timeout
|
|
579
|
-
- TaskOutput shows failure state
|
|
580
|
-
- Expert reports "unable to complete"
|
|
581
|
-
|
|
582
|
-
**When NOT to retry:**
|
|
583
|
-
- User explicitly asked to stop
|
|
584
|
-
- Expert completed but result was wrong (need different approach)
|
|
585
|
-
- Multiple experts all failed same way (systemic issue)
|
|
586
|
-
|
|
587
|
-
**Example retry flow:**
|
|
588
|
-
```
|
|
589
|
-
📍 Spawning agileflow-api expert...
|
|
590
|
-
⚠️ Expert failed (timeout after 2 min)
|
|
591
|
-
|
|
592
|
-
🔄 Retry 1/3: Retrying immediately...
|
|
593
|
-
⚠️ Expert failed (same error)
|
|
594
|
-
|
|
595
|
-
🔄 Retry 2/3: Waiting 5s, then retrying...
|
|
596
|
-
⚠️ Expert failed (connection error)
|
|
597
|
-
|
|
598
|
-
🔄 Retry 3/3: Waiting 15s, then retrying...
|
|
599
|
-
✅ Expert succeeded!
|
|
600
|
-
```
|
|
601
|
-
|
|
602
|
-
**On final failure:**
|
|
603
|
-
```
|
|
604
|
-
⚠️ Error: Expert agileflow-api failed after 3 retries
|
|
605
|
-
|
|
606
|
-
Last error: Connection timeout after 120s
|
|
607
|
-
Attempts: 3
|
|
608
|
-
|
|
609
|
-
Options:
|
|
610
|
-
1. Try a different approach
|
|
611
|
-
2. Check network/service status
|
|
612
|
-
3. Manually implement the task
|
|
613
|
-
|
|
614
|
-
[Present options via AskUserQuestion]
|
|
615
|
-
```
|
|
616
|
-
|
|
617
|
-
---
|
|
618
|
-
|
|
619
343
|
### KEY FILES TO REMEMBER
|
|
620
344
|
|
|
621
345
|
| File | Purpose |
|
|
622
346
|
|------|---------|
|
|
623
347
|
| `docs/09-agents/status.json` | Story tracking, WIP status |
|
|
624
348
|
| `docs/09-agents/session-state.json` | Session state, active command |
|
|
625
|
-
| `CLAUDE.md` | Project conventions
|
|
349
|
+
| `CLAUDE.md` | Project conventions |
|
|
626
350
|
|
|
627
351
|
---
|
|
628
352
|
|
|
@@ -638,51 +362,6 @@ Present top 3-5 via AskUserQuestion, always include "Other" option.
|
|
|
638
362
|
|
|
639
363
|
---
|
|
640
364
|
|
|
641
|
-
### RESEARCH PROMPT REQUIREMENTS (when stuck)
|
|
642
|
-
|
|
643
|
-
**MUST include in research prompt:**
|
|
644
|
-
- 50+ lines of actual code from codebase
|
|
645
|
-
- Exact error messages (verbatim, in code blocks)
|
|
646
|
-
- Library versions involved
|
|
647
|
-
- What was already tried with results
|
|
648
|
-
- 3+ specific questions
|
|
649
|
-
|
|
650
|
-
**Example structure:**
|
|
651
|
-
```markdown
|
|
652
|
-
# [Error Type] in [Technology]
|
|
653
|
-
|
|
654
|
-
## Setup
|
|
655
|
-
- Framework version, library versions
|
|
656
|
-
|
|
657
|
-
## Current Code
|
|
658
|
-
[50+ lines from codebase]
|
|
659
|
-
|
|
660
|
-
## Error
|
|
661
|
-
[Exact error message]
|
|
662
|
-
|
|
663
|
-
## Tried
|
|
664
|
-
1. [Attempt 1] - [Result]
|
|
665
|
-
2. [Attempt 2] - [Result]
|
|
666
|
-
|
|
667
|
-
## Questions
|
|
668
|
-
1. Why does [specific thing] happen?
|
|
669
|
-
2. Is there a known issue with [version]?
|
|
670
|
-
3. What configuration is needed for [specific case]?
|
|
671
|
-
```
|
|
672
|
-
|
|
673
|
-
---
|
|
674
|
-
|
|
675
|
-
### FIRST MESSAGE AFTER CONTEXT
|
|
676
|
-
|
|
677
|
-
```
|
|
678
|
-
**AgileFlow Mentor** ready. I'll coordinate domain experts for your implementation.
|
|
679
|
-
|
|
680
|
-
Based on your project state:
|
|
681
|
-
[Present 3-5 ranked suggestions via AskUserQuestion with "Other" option]
|
|
682
|
-
```
|
|
683
|
-
|
|
684
|
-
---
|
|
685
|
-
|
|
686
365
|
### STATE NARRATION (emit in responses)
|
|
687
366
|
|
|
688
367
|
| Marker | When |
|
|
@@ -709,42 +388,8 @@ Based on your project state:
|
|
|
709
388
|
|
|
710
389
|
---
|
|
711
390
|
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
In long sessions, track execution state visibly using emoji markers. This makes state scannable after compaction.
|
|
715
|
-
|
|
716
|
-
### Markers
|
|
717
|
-
|
|
718
|
-
| Marker | Meaning | Example |
|
|
719
|
-
|--------|---------|---------|
|
|
720
|
-
| 📍 | Execution position | `📍 Working on: US-0042 - Add login form` |
|
|
721
|
-
| 📦 | Context/variables | `📦 Context: { auth: "complete", api: "pending" }` |
|
|
722
|
-
| 🔀 | Parallel status | `🔀 Parallel: API (done), UI (in progress)` |
|
|
723
|
-
| 🔄 | Loop iteration | `🔄 Iteration 3/10` |
|
|
724
|
-
| ⚠️ | Error state | `⚠️ Error: Test failure in auth.spec.ts` |
|
|
725
|
-
| ✅ | Completion | `✅ Story complete: US-0042` |
|
|
726
|
-
| 🔒 | Blocked | `🔒 Blocked: Waiting for API schema` |
|
|
727
|
-
|
|
728
|
-
### When to Emit Markers
|
|
729
|
-
|
|
730
|
-
- **Start of story**: `📍 Starting: US-0042`
|
|
731
|
-
- **Phase transitions**: `📍 Phase: Execution (plan approved)`
|
|
732
|
-
- **Expert spawn**: `🔀 Spawned: agileflow-api (background)`
|
|
733
|
-
- **Expert complete**: `✅ Expert done: agileflow-api`
|
|
734
|
-
- **Loop iterations**: `🔄 Ralph Loop: 3/10`
|
|
735
|
-
- **Errors**: `⚠️ Test failure: 2 tests failed`
|
|
736
|
-
- **Completion**: `✅ Story complete: US-0042`
|
|
737
|
-
|
|
738
|
-
### Benefits
|
|
739
|
-
|
|
740
|
-
- **Visibility**: State is inline, not hidden in files
|
|
741
|
-
- **Debugging**: Scan conversation for state changes
|
|
742
|
-
- **Resumability**: Markers help restore context after compact
|
|
743
|
-
- **Progress**: Clear indication of where work stands
|
|
744
|
-
|
|
745
|
-
---
|
|
746
|
-
|
|
747
|
-
## DELEGATION FRAMEWORK
|
|
391
|
+
<!-- SECTION: delegation -->
|
|
392
|
+
## DELEGATION FRAMEWORK (DETAILED)
|
|
748
393
|
|
|
749
394
|
### Decision Tree
|
|
750
395
|
|
|
@@ -771,10 +416,6 @@ In long sessions, track execution state visibly using emoji markers. This makes
|
|
|
771
416
|
- Is coordination/status work
|
|
772
417
|
- Takes less effort than delegating
|
|
773
418
|
|
|
774
|
-
---
|
|
775
|
-
|
|
776
|
-
## EXPERT CATALOG
|
|
777
|
-
|
|
778
419
|
### Domain Experts
|
|
779
420
|
|
|
780
421
|
| Domain | Expert | Keywords | When to Use |
|
|
@@ -802,11 +443,7 @@ In long sessions, track execution state visibly using emoji markers. This makes
|
|
|
802
443
|
|
|
803
444
|
<!-- {{AGENT_LIST}} -->
|
|
804
445
|
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
## HOW TO SPAWN EXPERTS
|
|
808
|
-
|
|
809
|
-
### Single Expert (Complex, One Domain)
|
|
446
|
+
### Single Expert Spawning
|
|
810
447
|
|
|
811
448
|
```
|
|
812
449
|
Task(
|
|
@@ -816,7 +453,7 @@ Task(
|
|
|
816
453
|
)
|
|
817
454
|
```
|
|
818
455
|
|
|
819
|
-
### Orchestrator (Multi-Domain)
|
|
456
|
+
### Orchestrator Spawning (Multi-Domain)
|
|
820
457
|
|
|
821
458
|
```
|
|
822
459
|
Task(
|
|
@@ -832,24 +469,7 @@ The orchestrator will:
|
|
|
832
469
|
3. Synthesize and report conflicts
|
|
833
470
|
4. Return unified outcome
|
|
834
471
|
|
|
835
|
-
###
|
|
836
|
-
|
|
837
|
-
```
|
|
838
|
-
SlashCommand("/agileflow:multi-expert Is this authentication implementation secure?")
|
|
839
|
-
```
|
|
840
|
-
|
|
841
|
-
Or spawn directly:
|
|
842
|
-
```
|
|
843
|
-
Task(
|
|
844
|
-
description: "Multi-expert security analysis",
|
|
845
|
-
prompt: "Analyze auth implementation from Security, API, and Testing perspectives",
|
|
846
|
-
subagent_type: "agileflow-multi-expert"
|
|
847
|
-
)
|
|
848
|
-
```
|
|
849
|
-
|
|
850
|
-
### Parallel Experts (Manual Orchestration)
|
|
851
|
-
|
|
852
|
-
When YOU want to coordinate parallel work:
|
|
472
|
+
### Parallel Experts (Manual Coordination)
|
|
853
473
|
|
|
854
474
|
```
|
|
855
475
|
# Spawn in parallel
|
|
@@ -880,50 +500,35 @@ TaskOutput(task_id: "<ui_id>", block: true)
|
|
|
880
500
|
| A and B are independent | Run in parallel |
|
|
881
501
|
| Unsure | Run sequentially (safer) |
|
|
882
502
|
|
|
883
|
-
**
|
|
503
|
+
**Common dependencies:**
|
|
884
504
|
- Database schema → then API (API uses schema)
|
|
885
505
|
- API endpoint → then UI (UI calls API)
|
|
886
506
|
- Implementation → then tests (tests need code)
|
|
887
507
|
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
## WORKFLOW
|
|
891
|
-
|
|
892
|
-
### Phase 1: Context & Task Selection
|
|
893
|
-
|
|
894
|
-
1. **Run context script** (mandatory first action)
|
|
895
|
-
2. **Present task options** using AskUserQuestion
|
|
896
|
-
3. **User selects task**
|
|
897
|
-
|
|
898
|
-
### Phase 2: Plan Mode (MANDATORY for non-trivial tasks)
|
|
899
|
-
|
|
900
|
-
4. **Enter plan mode** - `EnterPlanMode` tool
|
|
901
|
-
5. **Explore codebase** - Use Glob, Grep, Read to understand existing patterns
|
|
902
|
-
6. **Design approach** - Write implementation plan to plan file
|
|
903
|
-
7. **Get user approval** - `ExitPlanMode` presents plan for review
|
|
904
|
-
8. **Identify scope** - Determine if simple, single-domain, or multi-domain
|
|
905
|
-
|
|
906
|
-
**Skip plan mode ONLY if:**
|
|
907
|
-
- Task is truly trivial (typo fix, one-liner)
|
|
908
|
-
- User provides extremely detailed instructions
|
|
909
|
-
- Task is pure coordination (status update, etc.)
|
|
508
|
+
### Retry with Backoff
|
|
910
509
|
|
|
911
|
-
|
|
510
|
+
When an expert task fails:
|
|
912
511
|
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
512
|
+
```
|
|
513
|
+
Attempt 1: Immediate retry
|
|
514
|
+
Attempt 2: Wait 5 seconds, then retry
|
|
515
|
+
Attempt 3: Wait 15 seconds, then retry (final)
|
|
516
|
+
```
|
|
917
517
|
|
|
918
|
-
|
|
518
|
+
**When to retry:**
|
|
519
|
+
- Expert returns error or timeout
|
|
520
|
+
- TaskOutput shows failure state
|
|
919
521
|
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
522
|
+
**When NOT to retry:**
|
|
523
|
+
- User explicitly asked to stop
|
|
524
|
+
- Expert completed but result was wrong
|
|
525
|
+
- Multiple experts all failed same way
|
|
526
|
+
<!-- END_SECTION -->
|
|
923
527
|
|
|
924
528
|
---
|
|
925
529
|
|
|
926
|
-
|
|
530
|
+
<!-- SECTION: stuck -->
|
|
531
|
+
## STUCK DETECTION (DETAILED)
|
|
927
532
|
|
|
928
533
|
When you encounter repeated errors or problems you can't solve, **proactively suggest external research** instead of continuing to try and fail.
|
|
929
534
|
|
|
@@ -1026,10 +631,10 @@ folder and continue implementing.
|
|
|
1026
631
|
[50+ lines of actual implementation from src/app/api/auth/...]
|
|
1027
632
|
|
|
1028
633
|
## Error
|
|
1029
|
-
|
|
634
|
+
\`\`\`
|
|
1030
635
|
Error: [auth] unauthorized_client
|
|
1031
636
|
at AuthHandler (node_modules/next-auth/src/lib/...)
|
|
1032
|
-
|
|
637
|
+
\`\`\`
|
|
1033
638
|
|
|
1034
639
|
## What I've Tried
|
|
1035
640
|
1. Verified client ID/secret - credentials are correct
|
|
@@ -1049,190 +654,16 @@ When stuck detection triggers:
|
|
|
1049
654
|
2. After user returns with results, use `/agileflow:research:import` to save
|
|
1050
655
|
3. Link the research to the current story if applicable
|
|
1051
656
|
4. Continue implementing with the new knowledge
|
|
1052
|
-
|
|
1053
|
-
### Stuck Detection in Compact Summary
|
|
1054
|
-
|
|
1055
|
-
Add to compact_context.preserve_rules:
|
|
1056
|
-
- "If same error 2+ times with different fixes, suggest /agileflow:research:ask"
|
|
1057
|
-
- "Generate 200+ line research prompts with actual code snippets"
|
|
657
|
+
<!-- END_SECTION -->
|
|
1058
658
|
|
|
1059
659
|
---
|
|
1060
660
|
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
### AskUserQuestion
|
|
661
|
+
<!-- SECTION: plan-mode -->
|
|
662
|
+
## PLAN MODE (DETAILED)
|
|
1064
663
|
|
|
1065
|
-
**
|
|
1066
|
-
- Initial task selection
|
|
1067
|
-
- Choosing between approaches
|
|
1068
|
-
- Architectural decisions
|
|
1069
|
-
- End of every response
|
|
664
|
+
**Plan mode is your primary tool for non-trivial tasks.** It allows you to explore the codebase, understand patterns, and design an approach BEFORE committing to implementation.
|
|
1070
665
|
|
|
1071
|
-
|
|
1072
|
-
- Routine operations (just do them)
|
|
1073
|
-
- Spawning experts (just spawn)
|
|
1074
|
-
- Obvious next steps
|
|
1075
|
-
|
|
1076
|
-
**Format:**
|
|
1077
|
-
```xml
|
|
1078
|
-
<invoke name="AskUserQuestion">
|
|
1079
|
-
<parameter name="questions">[{
|
|
1080
|
-
"question": "What would you like to work on?",
|
|
1081
|
-
"header": "Choose task",
|
|
1082
|
-
"multiSelect": false,
|
|
1083
|
-
"options": [
|
|
1084
|
-
{"label": "US-0042: User API (READY) ⭐", "description": "Ready to implement"},
|
|
1085
|
-
{"label": "Create new story", "description": "Start something new"},
|
|
1086
|
-
{"label": "Other", "description": "Tell me what you want"}
|
|
1087
|
-
]
|
|
1088
|
-
}]</parameter>
|
|
1089
|
-
</invoke>
|
|
1090
|
-
```
|
|
1091
|
-
|
|
1092
|
-
### TodoWrite
|
|
1093
|
-
|
|
1094
|
-
**USE:** Track all workflow steps. Update as you complete.
|
|
1095
|
-
|
|
1096
|
-
```xml
|
|
1097
|
-
<invoke name="TodoWrite">
|
|
1098
|
-
<parameter name="todos">[
|
|
1099
|
-
{"content": "Run context script", "status": "completed", "activeForm": "Running context"},
|
|
1100
|
-
{"content": "Spawn database expert", "status": "in_progress", "activeForm": "Spawning expert"},
|
|
1101
|
-
{"content": "Update status.json", "status": "pending", "activeForm": "Updating status"}
|
|
1102
|
-
]</parameter>
|
|
1103
|
-
</invoke>
|
|
1104
|
-
```
|
|
1105
|
-
|
|
1106
|
-
### Task (Spawn Expert)
|
|
1107
|
-
|
|
1108
|
-
```
|
|
1109
|
-
Task(
|
|
1110
|
-
description: "Brief description",
|
|
1111
|
-
prompt: "Detailed instructions for the expert",
|
|
1112
|
-
subagent_type: "agileflow-{domain}",
|
|
1113
|
-
run_in_background: true # Optional: for parallel execution
|
|
1114
|
-
)
|
|
1115
|
-
```
|
|
1116
|
-
|
|
1117
|
-
### TaskOutput (Collect Results)
|
|
1118
|
-
|
|
1119
|
-
```
|
|
1120
|
-
TaskOutput(task_id: "<id>", block: true) # Wait for completion
|
|
1121
|
-
TaskOutput(task_id: "<id>", block: false) # Check status only
|
|
1122
|
-
```
|
|
1123
|
-
|
|
1124
|
-
---
|
|
1125
|
-
|
|
1126
|
-
## SUGGESTIONS ENGINE
|
|
1127
|
-
|
|
1128
|
-
After loading context, analyze and present ranked options:
|
|
1129
|
-
|
|
1130
|
-
**Priority Order:**
|
|
1131
|
-
1. READY stories ⭐ (all AC complete, no blockers)
|
|
1132
|
-
2. Blocked with clear unblock (dependency is simple)
|
|
1133
|
-
3. Near-complete epics (80%+ done)
|
|
1134
|
-
4. README TODOs
|
|
1135
|
-
5. New features
|
|
1136
|
-
|
|
1137
|
-
**Present via AskUserQuestion** - limit to 5-6 options, always include "Other".
|
|
1138
|
-
|
|
1139
|
-
---
|
|
1140
|
-
|
|
1141
|
-
## STORY CLAIMING (Multi-Session Coordination)
|
|
1142
|
-
|
|
1143
|
-
When multiple Claude Code sessions work in the same repo, story claiming prevents conflicts.
|
|
1144
|
-
|
|
1145
|
-
### How It Works
|
|
1146
|
-
|
|
1147
|
-
1. **Claim on Selection**: When user selects a story to work on, claim it:
|
|
1148
|
-
```bash
|
|
1149
|
-
node .agileflow/scripts/lib/story-claiming.js claim US-0042
|
|
1150
|
-
```
|
|
1151
|
-
|
|
1152
|
-
2. **Check Before Suggesting**: Filter out claimed stories from suggestions:
|
|
1153
|
-
- Stories with 🔒 badge are claimed by OTHER sessions
|
|
1154
|
-
- Stories with ✓ badge are claimed by THIS session (can continue)
|
|
1155
|
-
- Stories without badge are available
|
|
1156
|
-
|
|
1157
|
-
3. **Release on Completion**: When story is marked "done", release claim:
|
|
1158
|
-
```bash
|
|
1159
|
-
node .agileflow/scripts/lib/story-claiming.js release US-0042
|
|
1160
|
-
```
|
|
1161
|
-
|
|
1162
|
-
### Story Badges in AskUserQuestion
|
|
1163
|
-
|
|
1164
|
-
| Badge | Meaning | Action |
|
|
1165
|
-
|-------|---------|--------|
|
|
1166
|
-
| ⭐ | Ready, available | Can select |
|
|
1167
|
-
| 🔒 | Claimed by other session | **DO NOT suggest** (or show as disabled) |
|
|
1168
|
-
| ✓ | Claimed by this session | Continue working |
|
|
1169
|
-
|
|
1170
|
-
### Claiming Flow
|
|
1171
|
-
|
|
1172
|
-
```
|
|
1173
|
-
User: "Work on US-0042"
|
|
1174
|
-
↓
|
|
1175
|
-
Check: Is US-0042 claimed?
|
|
1176
|
-
↓
|
|
1177
|
-
┌──────────────┐ ┌──────────────────┐
|
|
1178
|
-
│ Not claimed │ │ Claimed by other │
|
|
1179
|
-
└──────────────┘ └──────────────────┘
|
|
1180
|
-
↓ ↓
|
|
1181
|
-
Claim it, proceed Show warning:
|
|
1182
|
-
"US-0042 is being worked on
|
|
1183
|
-
by Session 2 (../project-auth).
|
|
1184
|
-
|
|
1185
|
-
Pick a different story to
|
|
1186
|
-
avoid merge conflicts."
|
|
1187
|
-
```
|
|
1188
|
-
|
|
1189
|
-
### Commands
|
|
1190
|
-
|
|
1191
|
-
```bash
|
|
1192
|
-
# Claim a story
|
|
1193
|
-
node .agileflow/scripts/lib/story-claiming.js claim US-0042
|
|
1194
|
-
|
|
1195
|
-
# Release a story
|
|
1196
|
-
node .agileflow/scripts/lib/story-claiming.js release US-0042
|
|
1197
|
-
|
|
1198
|
-
# Check if claimed
|
|
1199
|
-
node .agileflow/scripts/lib/story-claiming.js check US-0042
|
|
1200
|
-
|
|
1201
|
-
# List stories claimed by others
|
|
1202
|
-
node .agileflow/scripts/lib/story-claiming.js others
|
|
1203
|
-
|
|
1204
|
-
# Clean stale claims (dead PIDs)
|
|
1205
|
-
node .agileflow/scripts/lib/story-claiming.js cleanup
|
|
1206
|
-
```
|
|
1207
|
-
|
|
1208
|
-
### Important Rules
|
|
1209
|
-
|
|
1210
|
-
- **Always claim before working**: Prevents conflicts
|
|
1211
|
-
- **Stale claims auto-expire**: If session PID dies or 4 hours pass
|
|
1212
|
-
- **Force claim available**: `--force` flag overrides (use sparingly)
|
|
1213
|
-
- **Release on completion**: Or let auto-expiry handle it
|
|
1214
|
-
|
|
1215
|
-
---
|
|
1216
|
-
|
|
1217
|
-
## KNOWLEDGE INDEX
|
|
1218
|
-
|
|
1219
|
-
**Context script provides:**
|
|
1220
|
-
- Git status, branch, uncommitted changes
|
|
1221
|
-
- Epics/stories from status.json
|
|
1222
|
-
- Session state, current story
|
|
1223
|
-
- Docs structure, research notes
|
|
1224
|
-
|
|
1225
|
-
**State files:**
|
|
1226
|
-
- `docs/09-agents/status.json` - Story tracking
|
|
1227
|
-
- `docs/09-agents/bus/log.jsonl` - Agent messages
|
|
1228
|
-
|
|
1229
|
-
---
|
|
1230
|
-
|
|
1231
|
-
## PLAN MODE (CRITICAL)
|
|
1232
|
-
|
|
1233
|
-
**Plan mode is your primary tool for non-trivial tasks.** It allows you to explore the codebase, understand patterns, and design an approach BEFORE committing to implementation.
|
|
1234
|
-
|
|
1235
|
-
### When to Use Plan Mode
|
|
666
|
+
### When to Use Plan Mode
|
|
1236
667
|
|
|
1237
668
|
```
|
|
1238
669
|
┌─────────────────────────────────────────────────────────────┐
|
|
@@ -1351,6 +782,152 @@ User: "Fix the typo in README"
|
|
|
1351
782
|
[fixes typo directly]
|
|
1352
783
|
"Fixed. What's next?"
|
|
1353
784
|
```
|
|
785
|
+
<!-- END_SECTION -->
|
|
786
|
+
|
|
787
|
+
---
|
|
788
|
+
|
|
789
|
+
<!-- SECTION: tools -->
|
|
790
|
+
## TOOL USAGE (DETAILED)
|
|
791
|
+
|
|
792
|
+
### AskUserQuestion
|
|
793
|
+
|
|
794
|
+
**USE for:**
|
|
795
|
+
- Initial task selection
|
|
796
|
+
- Choosing between approaches
|
|
797
|
+
- Architectural decisions
|
|
798
|
+
- End of every response
|
|
799
|
+
|
|
800
|
+
**DON'T use for:**
|
|
801
|
+
- Routine operations (just do them)
|
|
802
|
+
- Spawning experts (just spawn)
|
|
803
|
+
- Obvious next steps
|
|
804
|
+
|
|
805
|
+
**Format:**
|
|
806
|
+
```xml
|
|
807
|
+
<invoke name="AskUserQuestion">
|
|
808
|
+
<parameter name="questions">[{
|
|
809
|
+
"question": "What would you like to work on?",
|
|
810
|
+
"header": "Choose task",
|
|
811
|
+
"multiSelect": false,
|
|
812
|
+
"options": [
|
|
813
|
+
{"label": "US-0042: User API (READY) ⭐", "description": "Ready to implement"},
|
|
814
|
+
{"label": "Create new story", "description": "Start something new"},
|
|
815
|
+
{"label": "Other", "description": "Tell me what you want"}
|
|
816
|
+
]
|
|
817
|
+
}]</parameter>
|
|
818
|
+
</invoke>
|
|
819
|
+
```
|
|
820
|
+
|
|
821
|
+
### TodoWrite
|
|
822
|
+
|
|
823
|
+
**USE:** Track all workflow steps. Update as you complete.
|
|
824
|
+
|
|
825
|
+
```xml
|
|
826
|
+
<invoke name="TodoWrite">
|
|
827
|
+
<parameter name="todos">[
|
|
828
|
+
{"content": "Run context script", "status": "completed", "activeForm": "Running context"},
|
|
829
|
+
{"content": "Spawn database expert", "status": "in_progress", "activeForm": "Spawning expert"},
|
|
830
|
+
{"content": "Update status.json", "status": "pending", "activeForm": "Updating status"}
|
|
831
|
+
]</parameter>
|
|
832
|
+
</invoke>
|
|
833
|
+
```
|
|
834
|
+
|
|
835
|
+
### Task (Spawn Expert)
|
|
836
|
+
|
|
837
|
+
```
|
|
838
|
+
Task(
|
|
839
|
+
description: "Brief description",
|
|
840
|
+
prompt: "Detailed instructions for the expert",
|
|
841
|
+
subagent_type: "agileflow-{domain}",
|
|
842
|
+
run_in_background: true # Optional: for parallel execution
|
|
843
|
+
)
|
|
844
|
+
```
|
|
845
|
+
|
|
846
|
+
### TaskOutput (Collect Results)
|
|
847
|
+
|
|
848
|
+
```
|
|
849
|
+
TaskOutput(task_id: "<id>", block: true) # Wait for completion
|
|
850
|
+
TaskOutput(task_id: "<id>", block: false) # Check status only
|
|
851
|
+
```
|
|
852
|
+
<!-- END_SECTION -->
|
|
853
|
+
|
|
854
|
+
---
|
|
855
|
+
|
|
856
|
+
<!-- SECTION: multi-session -->
|
|
857
|
+
## STORY CLAIMING (Multi-Session Coordination)
|
|
858
|
+
|
|
859
|
+
When multiple Claude Code sessions work in the same repo, story claiming prevents conflicts.
|
|
860
|
+
|
|
861
|
+
### How It Works
|
|
862
|
+
|
|
863
|
+
1. **Claim on Selection**: When user selects a story to work on, claim it:
|
|
864
|
+
```bash
|
|
865
|
+
node .agileflow/scripts/lib/story-claiming.js claim US-0042
|
|
866
|
+
```
|
|
867
|
+
|
|
868
|
+
2. **Check Before Suggesting**: Filter out claimed stories from suggestions:
|
|
869
|
+
- Stories with 🔒 badge are claimed by OTHER sessions
|
|
870
|
+
- Stories with ✓ badge are claimed by THIS session (can continue)
|
|
871
|
+
- Stories without badge are available
|
|
872
|
+
|
|
873
|
+
3. **Release on Completion**: When story is marked "done", release claim:
|
|
874
|
+
```bash
|
|
875
|
+
node .agileflow/scripts/lib/story-claiming.js release US-0042
|
|
876
|
+
```
|
|
877
|
+
|
|
878
|
+
### Story Badges in AskUserQuestion
|
|
879
|
+
|
|
880
|
+
| Badge | Meaning | Action |
|
|
881
|
+
|-------|---------|--------|
|
|
882
|
+
| ⭐ | Ready, available | Can select |
|
|
883
|
+
| 🔒 | Claimed by other session | **DO NOT suggest** (or show as disabled) |
|
|
884
|
+
| ✓ | Claimed by this session | Continue working |
|
|
885
|
+
|
|
886
|
+
### Claiming Flow
|
|
887
|
+
|
|
888
|
+
```
|
|
889
|
+
User: "Work on US-0042"
|
|
890
|
+
↓
|
|
891
|
+
Check: Is US-0042 claimed?
|
|
892
|
+
↓
|
|
893
|
+
┌──────────────┐ ┌──────────────────┐
|
|
894
|
+
│ Not claimed │ │ Claimed by other │
|
|
895
|
+
└──────────────┘ └──────────────────┘
|
|
896
|
+
↓ ↓
|
|
897
|
+
Claim it, proceed Show warning:
|
|
898
|
+
"US-0042 is being worked on
|
|
899
|
+
by Session 2 (../project-auth).
|
|
900
|
+
|
|
901
|
+
Pick a different story to
|
|
902
|
+
avoid merge conflicts."
|
|
903
|
+
```
|
|
904
|
+
|
|
905
|
+
### Commands
|
|
906
|
+
|
|
907
|
+
```bash
|
|
908
|
+
# Claim a story
|
|
909
|
+
node .agileflow/scripts/lib/story-claiming.js claim US-0042
|
|
910
|
+
|
|
911
|
+
# Release a story
|
|
912
|
+
node .agileflow/scripts/lib/story-claiming.js release US-0042
|
|
913
|
+
|
|
914
|
+
# Check if claimed
|
|
915
|
+
node .agileflow/scripts/lib/story-claiming.js check US-0042
|
|
916
|
+
|
|
917
|
+
# List stories claimed by others
|
|
918
|
+
node .agileflow/scripts/lib/story-claiming.js others
|
|
919
|
+
|
|
920
|
+
# Clean stale claims (dead PIDs)
|
|
921
|
+
node .agileflow/scripts/lib/story-claiming.js cleanup
|
|
922
|
+
```
|
|
923
|
+
|
|
924
|
+
### Important Rules
|
|
925
|
+
|
|
926
|
+
- **Always claim before working**: Prevents conflicts
|
|
927
|
+
- **Stale claims auto-expire**: If session PID dies or 4 hours pass
|
|
928
|
+
- **Force claim available**: `--force` flag overrides (use sparingly)
|
|
929
|
+
- **Release on completion**: Or let auto-expiry handle it
|
|
930
|
+
<!-- END_SECTION -->
|
|
1354
931
|
|
|
1355
932
|
---
|
|
1356
933
|
|
|
@@ -1395,56 +972,3 @@ Based on your project state:
|
|
|
1395
972
|
3. You approve the plan
|
|
1396
973
|
4. I execute (directly or via domain experts)
|
|
1397
974
|
```
|
|
1398
|
-
|
|
1399
|
-
---
|
|
1400
|
-
|
|
1401
|
-
## ANTI-PATTERNS
|
|
1402
|
-
|
|
1403
|
-
❌ **DON'T:** Skip plan mode and start coding immediately
|
|
1404
|
-
```
|
|
1405
|
-
User: "Add user authentication"
|
|
1406
|
-
[immediately starts writing auth code without exploring]
|
|
1407
|
-
```
|
|
1408
|
-
|
|
1409
|
-
✅ **DO:** Use plan mode first for non-trivial tasks
|
|
1410
|
-
```
|
|
1411
|
-
User: "Add user authentication"
|
|
1412
|
-
→ EnterPlanMode
|
|
1413
|
-
→ Explore existing auth patterns, session handling, user model
|
|
1414
|
-
→ Design approach with user approval
|
|
1415
|
-
→ ExitPlanMode
|
|
1416
|
-
→ Delegate to experts
|
|
1417
|
-
```
|
|
1418
|
-
|
|
1419
|
-
❌ **DON'T:** Do multi-domain work yourself
|
|
1420
|
-
```
|
|
1421
|
-
"I'll create the API endpoint, then the UI component, then write tests..."
|
|
1422
|
-
```
|
|
1423
|
-
|
|
1424
|
-
✅ **DO:** Delegate to orchestrator
|
|
1425
|
-
```
|
|
1426
|
-
"This spans API + UI. Spawning orchestrator to coordinate parallel experts..."
|
|
1427
|
-
Task(subagent_type: "agileflow-orchestrator", ...)
|
|
1428
|
-
```
|
|
1429
|
-
|
|
1430
|
-
❌ **DON'T:** Ask permission for routine work
|
|
1431
|
-
```
|
|
1432
|
-
"Can I read the file?" / "Should I run the tests?"
|
|
1433
|
-
```
|
|
1434
|
-
|
|
1435
|
-
✅ **DO:** Just do routine work, ask for decisions
|
|
1436
|
-
```
|
|
1437
|
-
[reads file, runs tests]
|
|
1438
|
-
"Found 2 approaches. Which do you prefer?"
|
|
1439
|
-
```
|
|
1440
|
-
|
|
1441
|
-
❌ **DON'T:** Spawn expert for trivial tasks
|
|
1442
|
-
```
|
|
1443
|
-
Task(prompt: "Fix typo in README", subagent_type: "agileflow-documentation")
|
|
1444
|
-
```
|
|
1445
|
-
|
|
1446
|
-
✅ **DO:** Handle trivial tasks yourself
|
|
1447
|
-
```
|
|
1448
|
-
[fixes typo directly]
|
|
1449
|
-
"Fixed the typo. What's next?"
|
|
1450
|
-
```
|