@crewx/wbs 0.1.1 → 0.1.3

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/SKILL.md ADDED
@@ -0,0 +1,1196 @@
1
+ ---
2
+ name: wbs
3
+ description: Work Breakdown Structure (WBS) management skill. Enables AI coordinators to decompose complex tasks into 30-minute timeboxed jobs and execute them via worker agents.
4
+ version: 0.3.0
5
+ ---
6
+
7
+ # WBS Skill
8
+
9
+ Provides state management and worker execution for Work Breakdown Structure based task decomposition.
10
+
11
+ ## Core Principle
12
+
13
+ **System provides state management, AI agent makes intelligent decisions.**
14
+
15
+ ```
16
+ User Request
17
+
18
+
19
+ ┌─────────────────────────────────────────────────────┐
20
+ │ Coordinator Agent (with WBS skill) │
21
+ │ - Analyze request (AI judgment) │
22
+ │ - Decompose into 30-min Jobs (AI judgment) │
23
+ │ - Execute workers: crewx x "@agent action" │
24
+ │ - Track state: wbs.js │
25
+ └─────────────────────────────────────────────────────┘
26
+
27
+ ├──────────────┬──────────────┐
28
+ ▼ ▼ ▼
29
+ ┌─────────┐ ┌─────────┐ ┌─────────┐
30
+ │ Worker1 │ │ Worker2 │ │ Worker3 │
31
+ │ @claude │ │ @gemini │ │ @copilot│
32
+ └─────────┘ └─────────┘ └─────────┘
33
+ ```
34
+
35
+ ## What is WBS Skill?
36
+
37
+ The WBS (Work Breakdown Structure) skill is a **project management system for complex AI-driven tasks**. It enables coordinator agents to:
38
+
39
+ 1. **Decompose complex tasks** into manageable 30-minute jobs
40
+ 2. **Track progress** with state management (pending → running → completed/failed)
41
+ 3. **Coordinate multiple agents** by assigning different jobs to specialized workers
42
+ 4. **Manage context** through detail documents and structured workflow
43
+ 5. **Execute in parallel** by distributing jobs across multiple worker agents
44
+
45
+ ### Key Characteristics
46
+
47
+ - **Structured Approach**: Projects are broken down into jobs with clear status tracking
48
+ - **Time-Boxed Execution**: Each job targets 15-45 minutes (optimal: 25-30 min)
49
+ - **Multi-Agent Coordination**: Different jobs can be assigned to different AI agents
50
+ - **State Persistence**: All project data, jobs, and execution history are tracked in `.wbs-data.json`
51
+ - **Automated Workflow**: Git branching, PR templates, and issue tracking integration
52
+ - **Job Slug System**: Jobs are identified by intuitive slugs (`wbs-5-1`, `wbs-5-2`) computed from `wbs_id + seq`
53
+ - **Auto-generated Detail Files**: `job add` automatically generates/updates `wbs-details/wbs-{N}-detail.md` with job metadata
54
+
55
+ ## Job Slug System
56
+
57
+ Each job gets a **slug** computed from its WBS ID and sequence number: `wbs-{N}-{seq}`
58
+
59
+ | Internal ID | Slug | Meaning |
60
+ |------------|------|---------|
61
+ | `job-15` | `wbs-5-1` | WBS-5의 1번째 Job |
62
+ | `job-16` | `wbs-5-2` | WBS-5의 2번째 Job |
63
+ | `job-17` | `wbs-5-3` | WBS-5의 3번째 Job |
64
+
65
+ - Slugs are **computed values** (not stored in DB) — derived from `wbs_id` + `seq`
66
+ - All commands accepting `<job-id>` also accept `<slug>`: `wbs job update wbs-5-1 --status completed`
67
+ - Git branches use slug naming: `feature/wbs-5-1`
68
+ - Worktree directories align with slug naming
69
+
70
+ ## When to Use WBS Skill
71
+
72
+ ### Use WBS When
73
+
74
+ Choose WBS for tasks that meet **any** of these criteria:
75
+
76
+ - **Complex multi-step tasks** (> 45 minutes total)
77
+ - Feature implementations spanning multiple files/modules
78
+ - Large-scale refactoring projects
79
+ - Bug fix sprints with multiple related issues
80
+
81
+ - **30-minute timeboxing needed**
82
+ - Tasks prone to context loss (LLM "Lost in the Middle" problem)
83
+ - Work requiring periodic checkpoints and validation
84
+ - Projects where partial progress needs to be tracked
85
+
86
+ - **Parallel execution beneficial**
87
+ - Jobs that can be distributed across multiple worker agents
88
+ - Tasks where different agents excel at different subtasks
89
+ - Work that benefits from concurrent execution
90
+
91
+ - **Progress tracking important**
92
+ - Team collaboration requiring visibility into task status
93
+ - Projects with external stakeholders needing updates
94
+ - Work where partial failure recovery is critical
95
+
96
+ - **GitHub integration needed**
97
+ - Tasks linked to GitHub issues
98
+ - Projects requiring structured PR workflows
99
+ - Work following standardized git branching strategies
100
+
101
+ ### Use Direct Delegation When
102
+
103
+ Skip WBS for simpler scenarios:
104
+
105
+ - Single-step tasks (< 15 minutes)
106
+ - One-off file modifications
107
+ - Quick code analysis or queries
108
+ - Rapid prototyping without tracking needs
109
+ - Tasks with no need for state persistence
110
+
111
+ ### Decision Flow
112
+
113
+ ```
114
+ Task received
115
+
116
+
117
+ Expected duration?
118
+
119
+ ├─── < 15 min ──────────────────────► Direct Delegation
120
+
121
+ ├─── 15-45 min ─┬─ Single step ──────► Direct Delegation
122
+ │ └─ Multi-step ────────► WBS Skill
123
+
124
+ └─── > 45 min ──────────────────────► WBS Skill (required)
125
+ ```
126
+
127
+ ## Use Case Examples
128
+
129
+ ### 1. Complex Feature Implementation
130
+
131
+ **Scenario**: Implement user authentication system
132
+
133
+ ```bash
134
+ # WBS approach - structured and tracked
135
+ wbs.js create "User Authentication Implementation"
136
+ wbs.js job add wbs-1 --title "Design User model" --agent "@claude:sonnet" --seq 1
137
+ wbs.js job add wbs-1 --title "Implement login API" --agent "@copilot" --seq 2
138
+ wbs.js job add wbs-1 --title "Add JWT handling" --agent "@copilot" --seq 3
139
+ wbs.js job add wbs-1 --title "Write unit tests" --agent "@claude:sonnet" --seq 4
140
+ wbs.js job run wbs-1
141
+ ```
142
+
143
+ **Why WBS**: Multi-step process, multiple agents, progress tracking needed
144
+
145
+ ### 2. Bug Fix Sprint
146
+
147
+ **Scenario**: Fix multiple related authentication bugs
148
+
149
+ ```bash
150
+ # WBS approach - organized issue resolution
151
+ wbs.js create "Bug Fix Sprint"
152
+ wbs.js job add wbs-2 --title "Fix login bug" --agent "@claude" --issue 42 --seq 1
153
+ wbs.js job add wbs-2 --title "Fix session timeout" --agent "@claude" --issue 43 --seq 2
154
+ wbs.js job add wbs-2 --title "Fix password reset" --agent "@claude" --issue 44 --seq 3
155
+ wbs.js job run wbs-2
156
+ ```
157
+
158
+ **Why WBS**: Multiple issues, GitHub integration, failure recovery important
159
+
160
+ ### 3. Large Refactoring
161
+
162
+ **Scenario**: Refactor API layer across multiple modules
163
+
164
+ ```bash
165
+ # WBS approach - context preservation across modules
166
+ wbs.js create "API Refactoring"
167
+ wbs.js job add wbs-3 --title "Refactor auth module" --agent "@claude" --seq 1
168
+ wbs.js job add wbs-3 --title "Refactor user module" --agent "@claude" --seq 2
169
+ wbs.js job add wbs-3 --title "Update tests" --agent "@copilot" --seq 3
170
+ wbs.js job run wbs-3
171
+ ```
172
+
173
+ **Why WBS**: Context preservation critical, step-by-step validation needed
174
+
175
+ ### 4. Simple Code Fix (No WBS)
176
+
177
+ **Scenario**: Fix a typo in documentation
178
+
179
+ ```bash
180
+ # Direct delegation - immediate execution
181
+ crewx x "@claude Fix typo in README.md line 42"
182
+ ```
183
+
184
+ **Why Direct**: Single-step, < 15 minutes, no tracking needed
185
+
186
+ ## 30-Minute Timeboxing
187
+
188
+ | Category | Time | Description |
189
+ |----------|------|-------------|
190
+ | Minimum | 15 min | Below this → don't separate as Job |
191
+ | Optimal | 25-30 min | Target duration |
192
+ | Maximum | 45 min | Above this → re-decompose |
193
+
194
+ **Rationale**: LLM context limits (Lost in the Middle, Context Rot) + Pomodoro Technique
195
+
196
+ ## ⚠️ Job Description Template (MANDATORY)
197
+
198
+ **모든 Job은 반드시 아래 템플릿을 따라야 합니다.** 모호한 Job Description은 미완성 작업의 주요 원인입니다.
199
+
200
+ ### 템플릿
201
+
202
+ ```markdown
203
+ **산출물 (Deliverables):**
204
+ 1. path/to/file1.tsx - 설명
205
+ 2. path/to/file2.ts - 설명
206
+ 3. 기존 파일 수정: path/to/existing.tsx
207
+
208
+ **완료 기준 (Done Criteria):**
209
+ - [ ] 컴포넌트 렌더링 확인
210
+ - [ ] Store 연동 동작 확인
211
+ - [ ] 라우트 추가 및 네비게이션 확인
212
+
213
+ **참고 문서:**
214
+ - docs/ui-screens/screens/XX.md
215
+ - 와이어프레임/디자인 링크
216
+ ```
217
+
218
+ ### 사용 예시
219
+
220
+ ```bash
221
+ # ❌ BAD - 모호한 Job Description
222
+ node wbs.js job add wbs-1 \
223
+ --title "에이전트 설정 화면" \
224
+ --desc "crewx.yaml 에이전트 목록 표시. 모델/프로바이더/프롬프트 편집 UI." \
225
+ --agent "@launcher_gemini_dev"
226
+
227
+ # ✅ GOOD - 명확한 산출물과 완료 기준
228
+ node wbs.js job add wbs-1 \
229
+ --title "에이전트 설정 화면" \
230
+ --desc "**산출물:**
231
+ 1. src/renderer/components/AgentConfig/AgentConfigPage.tsx - 에이전트 목록 페이지
232
+ 2. src/renderer/components/AgentConfig/AgentEditModal.tsx - 편집 모달
233
+ 3. src/renderer/App.tsx - /agents 라우트 추가
234
+ 4. src/renderer/components/Layout/Sidebar.tsx - 메뉴 추가
235
+
236
+ **완료 기준:**
237
+ - [ ] /agents 경로 접근 시 에이전트 목록 표시
238
+ - [ ] 편집 버튼 클릭 시 모달 열림
239
+ - [ ] 저장 시 crewx.yaml 반영
240
+
241
+ **참고:** docs/ui-screens/screens/03-agent.md" \
242
+ --agent "@launcher_gemini_dev"
243
+ ```
244
+
245
+ ### 왜 필수인가?
246
+
247
+ | 문제 | 모호한 Job Description | 템플릿 사용 시 |
248
+ |------|----------------------|---------------|
249
+ | **범위 해석** | 에이전트가 임의로 해석 | 명확한 파일 목록 |
250
+ | **완료 판단** | 수동으로 "완료" 처리 | 체크리스트 검증 |
251
+ | **누락 방지** | UI 없이 Store만 구현 | 모든 산출물 명시 |
252
+ | **리뷰 용이** | 뭘 확인해야 하는지 불명확 | 체크리스트 기반 리뷰 |
253
+
254
+ ### 통합 테스트 Job 템플릿
255
+
256
+ 통합 테스트 Job은 특별히 검증 항목을 상세히 명시해야 합니다:
257
+
258
+ ```bash
259
+ node wbs.js job add wbs-1 \
260
+ --title "통합 테스트" \
261
+ --desc "**검증 시나리오:**
262
+ 1. 온보딩 → 프리셋 선택 → 설치 완료
263
+ 2. 대시보드 → 에이전트 목록 표시
264
+ 3. 에이전트 설정 → 편집 → 저장
265
+
266
+ **검증 방법:**
267
+ - [ ] 각 시나리오 수동 실행
268
+ - [ ] 스크린샷 캡처 (skills/playwright-python 사용)
269
+ - [ ] 에러 로그 확인
270
+
271
+ **통과 기준:**
272
+ - 모든 시나리오 정상 동작
273
+ - 콘솔 에러 없음" \
274
+ --agent "@launcher_codex_dev"
275
+ ```
276
+
277
+ ## Installation
278
+
279
+ ```bash
280
+ cd skills/wbs
281
+ npm install
282
+ ```
283
+
284
+ Requires Node.js 16+.
285
+
286
+ ## Commands Reference
287
+
288
+ ### Project Management Commands
289
+
290
+ | Command | Syntax | Description |
291
+ |---------|--------|-------------|
292
+ | **create** | `wbs.js create "Title" [--detail path]` | Create new WBS project with sequential ID (wbs-1, wbs-2, ...) |
293
+ | **list** | `wbs.js list [--json]` | List all projects with status and progress |
294
+ | **status** | `wbs.js status <wbs-id> [--json]` | Get detailed project info including all jobs and summary stats |
295
+ | **delete** | `wbs.js delete <wbs-id>` | Delete project and all associated jobs/executions (irreversible) |
296
+
297
+ ### Job Management Commands
298
+
299
+ | Command | Syntax | Description |
300
+ |---------|--------|-------------|
301
+ | **job add** | `wbs.js job add <wbs-id> --title "Title" --agent "@agent" [options]` | Add new job to project. Options: `--desc`, `--seq`, `--issue` |
302
+ | **job list** | `wbs.js job list <wbs-id> [--json]` | List all jobs ordered by sequence number |
303
+ | **job update** | `wbs.js job update <job-id\|slug> [options]` | Update job properties. Options: `--status`, `--title`, `--desc`, `--agent`, `--seq`, `--issue` |
304
+ | **job run** | `wbs.js job run <wbs-id>` | Execute all pending jobs sequentially (30-min timeout each) |
305
+ | **job next** | `wbs.js job next <wbs-id>` | Execute only the next pending job (manual step-by-step) |
306
+ | **job retry** | `wbs.js job retry <job-id\|slug>` | Retry a failed or completed job |
307
+
308
+ ### Execution Management Commands
309
+
310
+ | Command | Syntax | Description |
311
+ |---------|--------|-------------|
312
+ | **exec list** | `wbs.js exec list <job-id\|slug> [--json]` | List execution history for a job |
313
+ | **exec status** | `wbs.js exec status <exec-id> [--json]` | Get detailed execution info |
314
+ | **exec kill** | `wbs.js exec kill <exec-id>` | Kill a running execution |
315
+ | **exec running** | `wbs.js exec running [--json]` | List all currently running executions |
316
+
317
+ ### Coordinator Commands (Natural Language)
318
+
319
+ | Command | Syntax | Description |
320
+ |---------|--------|-------------|
321
+ | **q** | `wbs.js q "질문"` | Ask coordinator a question (via `@wbs_coordinator`) |
322
+ | **x** | `wbs.js x "요청"` | Request coordinator to execute an action |
323
+
324
+ ### Daemon Commands (Background Scheduler)
325
+
326
+ | Command | Syntax | Description |
327
+ |---------|--------|-------------|
328
+ | **daemon start** | `wbs.js daemon start` | Start background scheduler |
329
+ | **daemon stop** | `wbs.js daemon stop` | Stop running daemon |
330
+ | **daemon status** | `wbs.js daemon status` | Check daemon status |
331
+ | **daemon tick** | `wbs.js daemon tick` | Manual tick for testing |
332
+
333
+ ### Common Usage Patterns
334
+
335
+ ```bash
336
+ # Create and run a complete project
337
+ wbs.js create "User Authentication"
338
+ wbs.js job add wbs-1 --title "Design schema" --agent "@claude:sonnet" --seq 1
339
+ wbs.js job add wbs-1 --title "Implement API" --agent "@copilot" --seq 2
340
+ wbs.js job add wbs-1 --title "Write tests" --agent "@claude:sonnet" --seq 3
341
+ wbs.js job run wbs-1
342
+
343
+ # Check progress
344
+ wbs.js status wbs-1
345
+
346
+ # Handle failures (use job-id or slug)
347
+ wbs.js job list wbs-1 --json | jq '.[] | select(.status=="failed")'
348
+ wbs.js job retry wbs-1-3 # by slug
349
+ wbs.js job retry job-5 # by job-id
350
+
351
+ # Issue-based workflow
352
+ wbs.js job add wbs-2 --title "Fix bug" --agent "@claude" --issue 42
353
+ ```
354
+
355
+ ### Output Formats
356
+
357
+ - **Default**: Human-readable tables with emoji status icons
358
+ - **--json**: Machine-parseable JSON for scripting and automation
359
+
360
+ For detailed command documentation, see:
361
+ - [COMMANDS.md](./COMMANDS.md) - Complete project commands reference
362
+ - [job-management.md](./job-management.md) - Comprehensive job management guide
363
+
364
+ ## Practical Usage Examples
365
+
366
+ This section provides comprehensive real-world examples of using the WBS skill effectively.
367
+
368
+ ### Example 1: Simple Workflow (Create → Add Jobs → Run)
369
+
370
+ The most basic WBS workflow involves creating a project, adding jobs, and running them sequentially.
371
+
372
+ **Scenario**: Build a simple REST API for a todo application
373
+
374
+ ```bash
375
+ # 1. Create the project
376
+ node wbs.js create "Todo REST API"
377
+ ```
378
+
379
+ **Expected output:**
380
+ ```json
381
+ {
382
+ "id": "wbs-1",
383
+ "title": "Todo REST API",
384
+ "status": "planning",
385
+ "detailPath": "skills/wbs/details/wbs-1-detail.md",
386
+ "created_at": "2025-12-18T08:00:00.000Z"
387
+ }
388
+ ```
389
+
390
+ ```bash
391
+ # 2. Add jobs for implementation
392
+ node wbs.js job add wbs-1 \
393
+ --title "Design database schema" \
394
+ --agent "@claude:sonnet" \
395
+ --seq 1 \
396
+ --desc "Create SQLite schema for todos table with id, title, completed, created_at fields"
397
+
398
+ node wbs.js job add wbs-1 \
399
+ --title "Implement CRUD endpoints" \
400
+ --agent "@copilot" \
401
+ --seq 2 \
402
+ --desc "Create Express routes: GET /todos, POST /todos, PUT /todos/:id, DELETE /todos/:id"
403
+
404
+ node wbs.js job add wbs-1 \
405
+ --title "Add input validation" \
406
+ --agent "@claude:sonnet" \
407
+ --seq 3 \
408
+ --desc "Implement request validation middleware using express-validator"
409
+
410
+ node wbs.js job add wbs-1 \
411
+ --title "Write integration tests" \
412
+ --agent "@copilot" \
413
+ --seq 4 \
414
+ --desc "Create test suite covering all CRUD operations using supertest"
415
+ ```
416
+
417
+ ```bash
418
+ # 3. Review the planned jobs
419
+ node wbs.js status wbs-1
420
+ ```
421
+
422
+ **Expected output:**
423
+ ```
424
+ 📋 Todo REST API (wbs-1)
425
+ Status: planning | Progress: 0% (0/4)
426
+ Detail: skills/wbs/details/wbs-1-detail.md
427
+
428
+ Jobs:
429
+ | 상태 | # | Slug | ID | 작업명 | 담당 |
430
+ |------|----|-----------|-------|--------------------------|-----------------|
431
+ | ⬜️ | 1 | wbs-1-1 | job-1 | Design database schema | @claude:sonnet |
432
+ | ⬜️ | 2 | wbs-1-2 | job-2 | Implement CRUD endpoints | @copilot |
433
+ | ⬜️ | 3 | wbs-1-3 | job-3 | Add input validation | @claude:sonnet |
434
+ | ⬜️ | 4 | wbs-1-4 | job-4 | Write integration tests | @copilot |
435
+ ```
436
+
437
+ ```bash
438
+ # 4. Run all jobs
439
+ node wbs.js job run wbs-1
440
+ ```
441
+
442
+ **Expected output:**
443
+ ```
444
+ ══════════════════════════════════════════════════
445
+ [WBS] Starting project: Todo REST API
446
+ ══════════════════════════════════════════════════
447
+
448
+ [WBS] Running job: Design database schema
449
+ [WBS] Agent: @claude:sonnet
450
+ [WBS] Description: Create SQLite schema for todos table...
451
+ [WBS] Timeout: 30 minutes
452
+ ──────────────────────────────────────────────────
453
+ [Agent executes and produces output...]
454
+ ──────────────────────────────────────────────────
455
+ [WBS] Job completed: Design database schema
456
+
457
+ [WBS] Running job: Implement CRUD endpoints
458
+ [WBS] Agent: @copilot
459
+ [WBS] Timeout: 30 minutes
460
+ ──────────────────────────────────────────────────
461
+ [Agent executes and produces output...]
462
+ ──────────────────────────────────────────────────
463
+ [WBS] Job completed: Implement CRUD endpoints
464
+
465
+ [... continues for remaining jobs ...]
466
+
467
+ ══════════════════════════════════════════════════
468
+ [WBS] Project completed: Todo REST API
469
+ [WBS] Completed: 4, Failed: 0
470
+ ══════════════════════════════════════════════════
471
+ ```
472
+
473
+ ```bash
474
+ # 5. Verify completion
475
+ node wbs.js status wbs-1
476
+ ```
477
+
478
+ **Final output:**
479
+ ```
480
+ 📋 Todo REST API (wbs-1)
481
+ Status: completed | Progress: 100% (4/4)
482
+ Detail: skills/wbs/details/wbs-1-detail.md
483
+
484
+ Jobs:
485
+ | 상태 | # | Slug | ID | 작업명 | 담당 | Status |
486
+ |------|----|-----------|-------|--------------------------|-----------------|-----------|
487
+ | ✅ | 1 | wbs-1-1 | job-1 | Design database schema | @claude:sonnet | completed |
488
+ | ✅ | 2 | wbs-1-2 | job-2 | Implement CRUD endpoints | @copilot | completed |
489
+ | ✅ | 3 | wbs-1-3 | job-3 | Add input validation | @claude:sonnet | completed |
490
+ | ✅ | 4 | wbs-1-4 | job-4 | Write integration tests | @copilot | completed |
491
+ ```
492
+
493
+ ---
494
+
495
+ ### Example 2: Issue-Based Workflow
496
+
497
+ Use WBS to manage multiple GitHub issues systematically.
498
+
499
+ **Scenario**: Fix authentication-related bugs tracked in GitHub
500
+
501
+ ```bash
502
+ # 1. Create project for bug fixes
503
+ node wbs.js create "Authentication Bug Fixes"
504
+ ```
505
+
506
+ **Output:**
507
+ ```json
508
+ {
509
+ "id": "wbs-2",
510
+ "title": "Authentication Bug Fixes",
511
+ "status": "planning"
512
+ }
513
+ ```
514
+
515
+ ```bash
516
+ # 2. Add jobs linked to GitHub issues
517
+ node wbs.js job add wbs-2 \
518
+ --title "Fix: Login fails with special characters in password" \
519
+ --agent "@claude:sonnet" \
520
+ --issue 123 \
521
+ --seq 1
522
+
523
+ node wbs.js job add wbs-2 \
524
+ --title "Fix: Session timeout not working" \
525
+ --agent "@claude:sonnet" \
526
+ --issue 124 \
527
+ --seq 2
528
+
529
+ node wbs.js job add wbs-2 \
530
+ --title "Fix: Password reset email not sent" \
531
+ --agent "@claude:sonnet" \
532
+ --issue 125 \
533
+ --seq 3
534
+ ```
535
+
536
+ **What happens during execution:**
537
+
538
+ When you run `node wbs.js job run wbs-2`, each job receives these instructions:
539
+
540
+ ```
541
+ ## 작업 지시
542
+ GitHub Issue #123를 처리하세요.
543
+
544
+ **당신의 기존 개발 프로세스를 따르세요:**
545
+ 1. `gh issue view 123`로 이슈 확인
546
+ 2. 브랜치 생성 및 작업
547
+ 3. PR 생성
548
+ 4. 이슈에 결과 코멘트
549
+
550
+ WBS 추적 정보:
551
+ - WBS: wbs-2
552
+ - Job: job-1
553
+ ```
554
+
555
+ **Advantages:**
556
+ - Automatic issue-branch-PR linking
557
+ - Agent follows its own development workflow
558
+ - Easy progress tracking via GitHub
559
+ - Issue comments document resolution
560
+
561
+ ---
562
+
563
+ ### Example 3: Step-by-Step Execution
564
+
565
+ Execute jobs manually one at a time with review between each step.
566
+
567
+ **Scenario**: Refactoring legacy code where each step needs verification
568
+
569
+ ```bash
570
+ # 1. Create project
571
+ node wbs.js create "Legacy Code Refactoring"
572
+
573
+ # 2. Add jobs
574
+ node wbs.js job add wbs-3 \
575
+ --title "Extract UserService from monolithic controller" \
576
+ --agent "@claude:opus" \
577
+ --seq 1 \
578
+ --desc "Move user-related logic from AppController to new UserService class"
579
+
580
+ node wbs.js job add wbs-3 \
581
+ --title "Add dependency injection" \
582
+ --agent "@claude:sonnet" \
583
+ --seq 2 \
584
+ --desc "Refactor UserService to use constructor injection for database"
585
+
586
+ node wbs.js job add wbs-3 \
587
+ --title "Update unit tests" \
588
+ --agent "@copilot" \
589
+ --seq 3 \
590
+ --desc "Modify tests to work with new UserService architecture"
591
+
592
+ node wbs.js job add wbs-3 \
593
+ --title "Verify integration tests pass" \
594
+ --agent "@copilot" \
595
+ --seq 4 \
596
+ --desc "Run full test suite and fix any integration issues"
597
+ ```
598
+
599
+ ```bash
600
+ # 3. Execute first job only
601
+ node wbs.js job next wbs-3
602
+ ```
603
+
604
+ **Output:**
605
+ ```
606
+ [WBS] Running job: Extract UserService from monolithic controller
607
+ [WBS] Agent: @claude:opus
608
+ [WBS] Timeout: 30 minutes
609
+ ──────────────────────────────────────────────────
610
+ [Agent output...]
611
+ ──────────────────────────────────────────────────
612
+ [WBS] Job completed: Extract UserService from monolithic controller
613
+
614
+ {
615
+ "success": true,
616
+ "execId": "exec-1"
617
+ }
618
+ ```
619
+
620
+ ```bash
621
+ # 4. Review changes before continuing
622
+ git diff
623
+ npm test
624
+
625
+ # 5. If satisfied, run next job
626
+ node wbs.js job next wbs-3
627
+ ```
628
+
629
+ **Output:**
630
+ ```
631
+ [WBS] Running job: Add dependency injection
632
+ [WBS] Agent: @claude:sonnet
633
+ ...
634
+ ```
635
+
636
+ ```bash
637
+ # 6. Continue step by step
638
+ node wbs.js status wbs-3 # Check progress
639
+ node wbs.js job next wbs-3 # Run next job
640
+ ```
641
+
642
+ **Use cases for step-by-step execution:**
643
+ - Code reviews between steps
644
+ - Testing after each change
645
+ - Learning/understanding the codebase
646
+ - High-risk refactoring
647
+ - Debugging job configurations
648
+
649
+ ---
650
+
651
+ ### Example 4: Handling Failures
652
+
653
+ Recover from failed jobs and retry with updated configurations.
654
+
655
+ **Scenario**: API implementation where initial attempts fail
656
+
657
+ ```bash
658
+ # 1. Create project and add jobs
659
+ node wbs.js create "Payment API Integration"
660
+
661
+ node wbs.js job add wbs-4 \
662
+ --title "Integrate Stripe SDK" \
663
+ --agent "@copilot" \
664
+ --seq 1
665
+
666
+ node wbs.js job add wbs-4 \
667
+ --title "Implement payment endpoint" \
668
+ --agent "@claude:sonnet" \
669
+ --seq 2
670
+
671
+ node wbs.js job add wbs-4 \
672
+ --title "Add webhook handler" \
673
+ --agent "@claude:sonnet" \
674
+ --seq 3
675
+
676
+ # 2. Run all jobs
677
+ node wbs.js job run wbs-4
678
+ ```
679
+
680
+ **Suppose job-2 fails:**
681
+
682
+ ```
683
+ [WBS] Running job: Implement payment endpoint
684
+ [WBS] Agent: @claude:sonnet
685
+ ──────────────────────────────────────────────────
686
+ Error: Missing API key configuration
687
+ ──────────────────────────────────────────────────
688
+ [WBS] Job failed: Implement payment endpoint
689
+ ```
690
+
691
+ ```bash
692
+ # 3. Check which jobs failed
693
+ node wbs.js job list wbs-4 --json | jq '.[] | select(.status=="failed")'
694
+ ```
695
+
696
+ **Output:**
697
+ ```json
698
+ {
699
+ "id": "job-2",
700
+ "wbs_id": "wbs-4",
701
+ "title": "Implement payment endpoint",
702
+ "status": "failed",
703
+ "agent": "@claude:sonnet",
704
+ "seq": 2
705
+ }
706
+ ```
707
+
708
+ ```bash
709
+ # 4. Review execution history
710
+ node wbs.js exec list job-2
711
+ ```
712
+
713
+ **Output:**
714
+ ```
715
+ 📋 Executions for job-2
716
+
717
+ | 상태 | ID | PID | 시작 | 종료 | 코드 |
718
+ |------|---------|-------|---------------------|---------------------|------|
719
+ | ❌ | exec-2 | 45678 | 2025-12-18 09:15:00 | 2025-12-18 09:18:00 | 1 |
720
+ ```
721
+
722
+ ```bash
723
+ # 5. Fix the issue (add environment variable or update job description)
724
+ node wbs.js job update job-2 \
725
+ --desc "Implement payment endpoint. Use STRIPE_API_KEY from .env file. Handle both test and production modes."
726
+
727
+ # 6. Retry the failed job
728
+ node wbs.js job retry job-2
729
+ ```
730
+
731
+ **Output:**
732
+ ```
733
+ [WBS] Retrying job: Implement payment endpoint
734
+ [WBS] Running job: Implement payment endpoint
735
+ [WBS] Agent: @claude:sonnet
736
+ [WBS] Timeout: 30 minutes
737
+ ──────────────────────────────────────────────────
738
+ [Agent output...]
739
+ ──────────────────────────────────────────────────
740
+ [WBS] Job completed: Implement payment endpoint
741
+
742
+ {
743
+ "success": true,
744
+ "execId": "exec-5"
745
+ }
746
+ ```
747
+
748
+ ```bash
749
+ # 7. Continue with remaining jobs
750
+ node wbs.js job run wbs-4
751
+ ```
752
+
753
+ **Final status:**
754
+ ```
755
+ 📋 Payment API Integration (wbs-4)
756
+ Status: completed | Progress: 100% (3/3)
757
+
758
+ Jobs:
759
+ | 상태 | # | ID | 작업명 | Status |
760
+ |------|----|----|--------------------------|-----------|
761
+ | ✅ | 1 | job-1 | Integrate Stripe SDK | completed |
762
+ | ✅ | 2 | job-2 | Implement payment endpoint| completed |
763
+ | ✅ | 3 | job-3 | Add webhook handler | completed |
764
+ ```
765
+
766
+ **Batch retry all failed jobs:**
767
+ ```bash
768
+ # Find and retry all failed jobs in a project
769
+ for job in $(node wbs.js job list wbs-4 --json | jq -r '.[] | select(.status=="failed") | .id'); do
770
+ echo "Retrying $job..."
771
+ node wbs.js job retry $job
772
+ done
773
+ ```
774
+
775
+ ---
776
+
777
+ ### Example 5: Complex Multi-Agent Coordination
778
+
779
+ Distribute work across different AI agents based on their strengths.
780
+
781
+ **Scenario**: Build a full-stack feature with frontend, backend, and tests
782
+
783
+ ```bash
784
+ # 1. Create project
785
+ node wbs.js create "User Profile Feature"
786
+
787
+ # 2. Add jobs with appropriate agent selection
788
+ # Backend work - @claude:sonnet for complex logic
789
+ node wbs.js job add wbs-5 \
790
+ --title "Design User Profile data model" \
791
+ --agent "@claude:sonnet" \
792
+ --seq 1 \
793
+ --desc "Create schema with fields: avatar, bio, social_links, preferences"
794
+
795
+ # Implementation - @copilot for straightforward coding
796
+ node wbs.js job add wbs-5 \
797
+ --title "Implement profile CRUD API" \
798
+ --agent "@copilot" \
799
+ --seq 2 \
800
+ --desc "REST endpoints for profile operations with validation"
801
+
802
+ # Complex architecture - @claude:opus for advanced decisions
803
+ node wbs.js job add wbs-5 \
804
+ --title "Design avatar upload system" \
805
+ --agent "@claude:opus" \
806
+ --seq 3 \
807
+ --desc "S3 integration with image processing, CDN, and caching strategy"
808
+
809
+ # Implementation again
810
+ node wbs.js job add wbs-5 \
811
+ --title "Implement avatar upload" \
812
+ --agent "@copilot" \
813
+ --seq 4 \
814
+ --desc "File upload endpoint with S3 SDK and image optimization"
815
+
816
+ # Frontend - @claude:sonnet for React components
817
+ node wbs.js job add wbs-5 \
818
+ --title "Create profile edit form" \
819
+ --agent "@claude:sonnet" \
820
+ --seq 5 \
821
+ --desc "React component with form validation and avatar preview"
822
+
823
+ # Testing - @copilot excels at test generation
824
+ node wbs.js job add wbs-5 \
825
+ --title "Write comprehensive tests" \
826
+ --agent "@copilot" \
827
+ --seq 6 \
828
+ --desc "Unit tests for API, integration tests, and React Testing Library tests"
829
+
830
+ # 3. Run the entire pipeline
831
+ node wbs.js job run wbs-5
832
+ ```
833
+
834
+ **Agent selection rationale:**
835
+ - `@claude:sonnet`: Complex logic, architecture, React components
836
+ - `@claude:opus`: Very complex architectural decisions
837
+ - `@copilot`: Straightforward implementation, test generation
838
+ - `@gemini`: Performance optimization, data analysis (not shown here)
839
+
840
+ ---
841
+
842
+ ### Example 6: Working with Detail Documents
843
+
844
+ Use detail documents to provide comprehensive context to all jobs.
845
+
846
+ ```bash
847
+ # 1. Create project with detail document
848
+ node wbs.js create "E-commerce Checkout Flow" --detail ./docs/checkout-spec.md
849
+
850
+ # The system creates: skills/wbs/details/wbs-6-detail.md
851
+ ```
852
+
853
+ **Edit the detail document:**
854
+
855
+ ```bash
856
+ # Edit skills/wbs/details/wbs-6-detail.md
857
+ ```
858
+
859
+ **Content:**
860
+ ```markdown
861
+ # E-commerce Checkout Flow
862
+
863
+ ## Overview
864
+ Implement a secure checkout process for our e-commerce platform.
865
+
866
+ ## Requirements
867
+
868
+ ### Functional Requirements
869
+ 1. Multi-step checkout (cart → shipping → payment → confirmation)
870
+ 2. Address validation with autocomplete
871
+ 3. Multiple payment methods (credit card, PayPal)
872
+ 4. Order summary with promo codes
873
+ 5. Email confirmation
874
+
875
+ ### Technical Requirements
876
+ - Payment processing via Stripe
877
+ - Address validation via Google Maps API
878
+ - Session management for cart persistence
879
+ - Transactional email via SendGrid
880
+
881
+ ### Security
882
+ - PCI compliance for credit card handling
883
+ - HTTPS only
884
+ - CSRF protection
885
+ - Rate limiting on payment endpoints
886
+
887
+ ### Performance
888
+ - Checkout flow should complete in < 3 seconds
889
+ - Optimize for mobile devices
890
+
891
+ ## References
892
+ - [Stripe API Docs](https://stripe.com/docs/api)
893
+ - [Design Mockups](./figma-link)
894
+ ```
895
+
896
+ **Add jobs:**
897
+ ```bash
898
+ node wbs.js job add wbs-6 \
899
+ --title "Implement multi-step form navigation" \
900
+ --agent "@claude:sonnet" \
901
+ --seq 1
902
+
903
+ node wbs.js job add wbs-6 \
904
+ --title "Integrate Stripe payment" \
905
+ --agent "@copilot" \
906
+ --seq 2
907
+
908
+ # ... more jobs
909
+ ```
910
+
911
+ **When jobs run, they automatically receive the detail document content as context.**
912
+
913
+ ---
914
+
915
+ ### Example 7: Monitoring and JSON Output
916
+
917
+ Automate WBS monitoring and integrate with other tools.
918
+
919
+ **Check project status programmatically:**
920
+ ```bash
921
+ # Get JSON output for scripting
922
+ node wbs.js status wbs-1 --json | jq '.summary'
923
+ ```
924
+
925
+ **Output:**
926
+ ```json
927
+ {
928
+ "total_jobs": 4,
929
+ "completed": 4,
930
+ "failed": 0,
931
+ "pending": 0,
932
+ "running": 0,
933
+ "progress": 100
934
+ }
935
+ ```
936
+
937
+ **Create a monitoring script:**
938
+ ```bash
939
+ #!/bin/bash
940
+ # monitor-wbs.sh
941
+
942
+ WBS_ID="wbs-7"
943
+
944
+ while true; do
945
+ clear
946
+ echo "═══════════════════════════════════════"
947
+ echo " WBS Monitor - $WBS_ID"
948
+ echo "═══════════════════════════════════════"
949
+
950
+ node wbs.js status $WBS_ID
951
+
952
+ PROGRESS=$(node wbs.js status $WBS_ID --json | jq -r '.summary.progress')
953
+
954
+ if [ "$PROGRESS" -eq 100 ]; then
955
+ echo ""
956
+ echo "✅ Project complete!"
957
+ break
958
+ fi
959
+
960
+ echo ""
961
+ echo "⏳ Checking again in 60 seconds..."
962
+ sleep 60
963
+ done
964
+ ```
965
+
966
+ **Run monitor:**
967
+ ```bash
968
+ chmod +x monitor-wbs.sh
969
+ ./monitor-wbs.sh
970
+ ```
971
+
972
+ **Export jobs to CSV:**
973
+ ```bash
974
+ # Export job list
975
+ echo "ID,Title,Status,Agent,Seq" > jobs-export.csv
976
+ node wbs.js job list wbs-1 --json | \
977
+ jq -r '.[] | [.id,.title,.status,.agent,.seq] | @csv' >> jobs-export.csv
978
+ ```
979
+
980
+ **Check specific job execution history:**
981
+ ```bash
982
+ # List all executions for a job
983
+ node wbs.js exec list job-5 --json | jq '.'
984
+ ```
985
+
986
+ ---
987
+
988
+ ### Example 8: Recovering from Interruptions
989
+
990
+ Handle scenarios where execution is interrupted.
991
+
992
+ **Scenario**: Long-running project interrupted by system crash
993
+
994
+ ```bash
995
+ # 1. Check current status
996
+ node wbs.js list
997
+ ```
998
+
999
+ **Output:**
1000
+ ```
1001
+ 📋 WBS Projects (3)
1002
+
1003
+ | ID | 제목 | 상태 | 진행 |
1004
+ |-------|-----------------------|----------|----------|
1005
+ | wbs-1 | Todo REST API | completed| 100% 4/4 |
1006
+ | wbs-2 | Bug Fixes | running | 50% 2/4 |
1007
+ | wbs-3 | Refactoring | planning | 0% 0/5 |
1008
+ ```
1009
+
1010
+ ```bash
1011
+ # 2. Check which jobs were running
1012
+ node wbs.js status wbs-2
1013
+ ```
1014
+
1015
+ **Output:**
1016
+ ```
1017
+ 📋 Bug Fixes (wbs-2)
1018
+ Status: running | Progress: 50% (2/4)
1019
+
1020
+ Jobs:
1021
+ | 상태 | # | ID | 작업명 | Status |
1022
+ |------|----|----|---------------|-----------|
1023
+ | ✅ | 1 | job-1 | Fix bug #123 | completed |
1024
+ | ✅ | 2 | job-2 | Fix bug #124 | completed |
1025
+ | 🟡 | 3 | job-3 | Fix bug #125 | running |
1026
+ | ⬜️ | 4 | job-4 | Fix bug #126 | pending |
1027
+ ```
1028
+
1029
+ ```bash
1030
+ # 3. Check if the running job actually completed
1031
+ node wbs.js exec list job-3
1032
+ ```
1033
+
1034
+ **If the execution failed or timed out:**
1035
+ ```
1036
+ | 상태 | ID | PID | 시작 | 종료 | 코드 |
1037
+ |------|---------|-------|---------------------|---------------------|------|
1038
+ | ❌ | exec-7 | 23456 | 2025-12-18 10:30:00 | N/A (timeout) | -1 |
1039
+ ```
1040
+
1041
+ ```bash
1042
+ # 4. Reset the job and retry
1043
+ node wbs.js job update job-3 --status pending
1044
+ node wbs.js job retry job-3
1045
+
1046
+ # 5. Continue with remaining jobs
1047
+ node wbs.js job run wbs-2
1048
+ ```
1049
+
1050
+ ---
1051
+
1052
+ ### Summary: Quick Command Reference
1053
+
1054
+ **Basic workflow:**
1055
+ ```bash
1056
+ # Create → Add → Run → Check
1057
+ node wbs.js create "Project Name"
1058
+ node wbs.js job add wbs-X --title "Task" --agent "@agent" --seq N
1059
+ node wbs.js job run wbs-X
1060
+ node wbs.js status wbs-X
1061
+ ```
1062
+
1063
+ **Issue-based workflow:**
1064
+ ```bash
1065
+ node wbs.js create "Bug Fixes"
1066
+ node wbs.js job add wbs-X --title "Fix bug" --agent "@agent" --issue 123
1067
+ node wbs.js job run wbs-X
1068
+ ```
1069
+
1070
+ **Step-by-step workflow:**
1071
+ ```bash
1072
+ node wbs.js job next wbs-X # Run one job
1073
+ # Review changes...
1074
+ node wbs.js job next wbs-X # Run next
1075
+ ```
1076
+
1077
+ **Handle failures (job-id or slug):**
1078
+ ```bash
1079
+ node wbs.js job list wbs-X --json | jq '.[] | select(.status=="failed")'
1080
+ node wbs.js job update wbs-X-Y --desc "Updated instructions" # by slug
1081
+ node wbs.js job retry wbs-X-Y # by slug
1082
+ node wbs.js job retry job-Y # by job-id
1083
+ ```
1084
+
1085
+ **Monitoring:**
1086
+ ```bash
1087
+ node wbs.js list
1088
+ node wbs.js status wbs-X
1089
+ node wbs.js status wbs-X --json | jq '.summary'
1090
+ ```
1091
+
1092
+ For more examples, see:
1093
+ - [EXAMPLE.md](./EXAMPLE.md) - Korean language detailed walkthrough
1094
+ - [job-management.md](./job-management.md) - Job-specific examples and patterns
1095
+
1096
+ ## Usage in Coordinator Agent
1097
+
1098
+ The coordinator agent uses this skill programmatically:
1099
+
1100
+ ```javascript
1101
+ const wbs = require('./wbs.js');
1102
+
1103
+ // 1. Create project
1104
+ const id = wbs.create('User Authentication Implementation');
1105
+
1106
+ // 2. Add jobs (AI decomposed)
1107
+ wbs.addJob(id, { title: 'Design User model', agent: '@claude:sonnet', seq: 1 });
1108
+ wbs.addJob(id, { title: 'Implement login API', agent: '@copilot', seq: 2 });
1109
+ wbs.addJob(id, { title: 'Write tests', agent: '@claude:sonnet', seq: 3 });
1110
+
1111
+ // 3. Execute
1112
+ await wbs.run(id);
1113
+
1114
+ // 4. Check status
1115
+ console.log(wbs.status(id));
1116
+ ```
1117
+
1118
+ ## Job Status Flow
1119
+
1120
+ ```
1121
+ pending → running → completed
1122
+ → failed
1123
+ ```
1124
+
1125
+ ## Key Design Decisions
1126
+
1127
+ 1. **AI makes intelligent decisions** - Complexity analysis, job decomposition
1128
+ 2. **Code handles state only** - wbs.js does DB CRUD + worker execution
1129
+ 3. **30-minute timeboxing** - Each job is 15-45 minutes
1130
+ 4. **Start simple, improve iteratively** - MVP first
1131
+
1132
+ ## API Reference
1133
+
1134
+ ### Project Management
1135
+
1136
+ #### `wbs.create(title, options?)`
1137
+ Create a new WBS project. Returns project ID.
1138
+ - `options.detailPath`: Path to detail document (auto-created if not specified)
1139
+
1140
+ #### `wbs.list()`
1141
+ List all WBS projects.
1142
+
1143
+ #### `wbs.status(wbsId)`
1144
+ Get project and all jobs status.
1145
+
1146
+ #### `wbs.delete(wbsId)`
1147
+ Delete a project and all associated jobs/executions.
1148
+
1149
+ ### Job Management
1150
+
1151
+ #### `wbs.addJob(wbsId, { title, description?, agent, seq?, issue_number? })`
1152
+ Add a job to the project. Returns job ID.
1153
+ - `title`: Job title (short name)
1154
+ - `description`: Detailed instructions for the agent
1155
+ - `agent`: Worker agent mention (e.g., `@crewx_claude_dev`)
1156
+ - `seq`: Execution order (default: 0)
1157
+ - `issue_number`: Related GitHub issue number
1158
+
1159
+ #### `wbs.getNextJob(wbsId)`
1160
+ Get the next pending job. Returns job object or null.
1161
+
1162
+ #### `wbs.updateJob(jobId, status)`
1163
+ Update job status. Status: `pending`, `running`, `completed`, `failed`.
1164
+
1165
+ #### `wbs.runWorker(job)`
1166
+ Execute a single worker. Returns `{ success, error?, execId }`.
1167
+
1168
+ #### `wbs.run(wbsId)`
1169
+ Execute all pending jobs sequentially.
1170
+
1171
+ ### Execution Management
1172
+
1173
+ #### `wbs.createExecution(jobId, pid)`
1174
+ Create a new execution record. Returns execution ID.
1175
+
1176
+ #### `wbs.updateExecution(execId, status, options?)`
1177
+ Update execution status.
1178
+ - `options.exitCode`: Process exit code
1179
+ - `options.error`: Error message
1180
+
1181
+ #### `wbs.getExecution(execId)`
1182
+ Get execution by ID.
1183
+
1184
+ #### `wbs.listExecutions(jobId)`
1185
+ List all executions for a job.
1186
+
1187
+ #### `wbs.killExecution(execId)`
1188
+ Kill a running execution. Returns boolean success.
1189
+
1190
+ #### `wbs.getRunningExecutions()`
1191
+ Get all currently running executions.
1192
+
1193
+ ## Related Documentation
1194
+
1195
+ - [WBS Skill Spec](/docs/cto/designs/wbs-skill-spec.md)
1196
+ - [CrewX CLI Documentation](/packages/cli/AGENTS.md)