|
| 1 | +[ |
| 2 | + { |
| 3 | + "id": "feature-profile-editor", |
| 4 | + "name": "Feature: User Profile Editor", |
| 5 | + "description": "4-step pipeline: validate schema -> build API endpoints -> create UI components -> write tests", |
| 6 | + "type": "feature_dev", |
| 7 | + "complexity": "medium", |
| 8 | + "steps": [ |
| 9 | + { "id": "validate", "action": "Validate user profile schema and permissions model" }, |
| 10 | + { "id": "api", "action": "Build CRUD API endpoints for user profiles", "depends_on": ["validate"] }, |
| 11 | + { "id": "ui", "action": "Create React profile editor components", "depends_on": ["api"] }, |
| 12 | + { "id": "tests", "action": "Write integration tests for profile CRUD flow", "depends_on": ["api", "ui"] } |
| 13 | + ], |
| 14 | + "cord_transcript": [ |
| 15 | + { "tool": "cord_spawn", "args": { "goal": "Validate user profile schema", "prompt": "Review existing User model, define profile fields (name, bio, avatar, settings), check RBAC permissions" } }, |
| 16 | + { "tool": "cord_complete", "args": { "task_id": "T1", "result": "Schema: {name: string, bio: string(500), avatar: url, settings: {theme, notifications}}. RBAC: owner can edit all, admin can edit any, viewer read-only." } }, |
| 17 | + { "tool": "cord_spawn", "args": { "goal": "Build profile API endpoints", "prompt": "REST endpoints: GET/PUT /api/profile/:id, PATCH /api/profile/:id/settings", "blocked_by": ["T1"] } }, |
| 18 | + { "tool": "cord_complete", "args": { "task_id": "T2", "result": "Endpoints implemented: GET /api/profile/:id (200/404), PUT /api/profile/:id (200/400/403), PATCH /api/profile/:id/settings (200/400). Validation middleware added." } }, |
| 19 | + { "tool": "cord_spawn", "args": { "goal": "Create profile UI components", "prompt": "React components: ProfileEditor, AvatarUpload, SettingsPanel", "blocked_by": ["T2"] } }, |
| 20 | + { "tool": "cord_complete", "args": { "task_id": "T3", "result": "Components: ProfileEditor (form with validation), AvatarUpload (drag-drop + crop), SettingsPanel (toggle switches). All use profile API hooks." } }, |
| 21 | + { "tool": "cord_spawn", "args": { "goal": "Write integration tests", "prompt": "Test profile CRUD flow end-to-end", "blocked_by": ["T2", "T3"] } }, |
| 22 | + { "tool": "cord_tree", "args": { "include_results": true } } |
| 23 | + ], |
| 24 | + "flat_transcript": [ |
| 25 | + { "tool": "create_task", "args": { "title": "Validate user profile schema", "description": "Review existing User model, define profile fields" } }, |
| 26 | + { "tool": "update_task_status", "args": { "task_id": "T1", "status": "completed", "notes": "Schema: {name, bio, avatar, settings}. RBAC: owner/admin/viewer." } }, |
| 27 | + { "tool": "create_task", "args": { "title": "Build profile API endpoints", "description": "REST endpoints. Schema from T1: {name: string, bio: string(500), avatar: url, settings: {theme, notifications}}. RBAC: owner can edit all, admin can edit any." } }, |
| 28 | + { "tool": "update_task_status", "args": { "task_id": "T2", "status": "completed", "notes": "GET/PUT/PATCH endpoints done" } }, |
| 29 | + { "tool": "create_task", "args": { "title": "Create profile UI components", "description": "ProfileEditor, AvatarUpload, SettingsPanel. API endpoints from T2: GET/PUT /profile/:id, PATCH /profile/:id/settings" } }, |
| 30 | + { "tool": "update_task_status", "args": { "task_id": "T3", "status": "completed", "notes": "Components done" } }, |
| 31 | + { "tool": "create_task", "args": { "title": "Write integration tests", "description": "Test CRUD flow. Must manually reference T2 and T3 results." } }, |
| 32 | + { "tool": "list_tasks", "args": {} } |
| 33 | + ] |
| 34 | + }, |
| 35 | + { |
| 36 | + "id": "debug-memory-leak", |
| 37 | + "name": "Debug: Memory Leak Investigation", |
| 38 | + "description": "Parallel investigation (profiler + log analysis) then fix + verify", |
| 39 | + "type": "complex_debug", |
| 40 | + "complexity": "high", |
| 41 | + "steps": [ |
| 42 | + { "id": "profiler", "action": "Run heap profiler to identify leak source" }, |
| 43 | + { "id": "logs", "action": "Analyze server logs for memory growth pattern" }, |
| 44 | + { "id": "fix", "action": "Implement fix based on profiler + log findings", "depends_on": ["profiler", "logs"] }, |
| 45 | + { "id": "verify", "action": "Verify fix with load test", "depends_on": ["fix"] } |
| 46 | + ], |
| 47 | + "cord_transcript": [ |
| 48 | + { "tool": "cord_spawn", "args": { "goal": "Run heap profiler", "prompt": "Take heap snapshots at 1min intervals, identify objects with growing retention" } }, |
| 49 | + { "tool": "cord_spawn", "args": { "goal": "Analyze server logs", "prompt": "Search for RSS growth, GC pressure, unclosed connections in last 24h logs" } }, |
| 50 | + { "tool": "cord_complete", "args": { "task_id": "T1", "result": "Heap profiler: EventEmitter listeners on WebSocket connections never removed. 150 leaked listeners after 1h. Source: src/ws/handler.ts:47 missing removeListener in disconnect." } }, |
| 51 | + { "tool": "cord_complete", "args": { "task_id": "T2", "result": "Logs: RSS grows 2MB/min under 100 concurrent connections. GC runs every 30s but old-gen keeps growing. Correlates with WS reconnection spikes at :00/:30 marks." } }, |
| 52 | + { "tool": "cord_spawn", "args": { "goal": "Fix memory leak", "prompt": "Fix the WebSocket listener leak", "blocked_by": ["T1", "T2"] } }, |
| 53 | + { "tool": "cord_complete", "args": { "task_id": "T3", "result": "Fixed: Added removeAllListeners() in ws disconnect handler. Also added maxListeners warning at 10. RSS now stable at 180MB under load." } }, |
| 54 | + { "tool": "cord_spawn", "args": { "goal": "Verify fix with load test", "prompt": "Run 1h soak test with 200 connections", "blocked_by": ["T3"] } }, |
| 55 | + { "tool": "cord_tree", "args": { "include_results": true } } |
| 56 | + ], |
| 57 | + "flat_transcript": [ |
| 58 | + { "tool": "create_task", "args": { "title": "Run heap profiler", "description": "Take heap snapshots" } }, |
| 59 | + { "tool": "create_task", "args": { "title": "Analyze server logs", "description": "Search for memory growth patterns" } }, |
| 60 | + { "tool": "update_task_status", "args": { "task_id": "T1", "status": "completed", "notes": "Leaked EventEmitter listeners on WS" } }, |
| 61 | + { "tool": "update_task_status", "args": { "task_id": "T2", "status": "completed", "notes": "RSS grows 2MB/min" } }, |
| 62 | + { "tool": "create_task", "args": { "title": "Fix memory leak", "description": "Based on T1 (listeners leak) and T2 (RSS growth). Must manually copy results here." } }, |
| 63 | + { "tool": "list_tasks", "args": {} }, |
| 64 | + { "tool": "update_task_status", "args": { "task_id": "T3", "status": "completed", "notes": "Fixed removeAllListeners" } }, |
| 65 | + { "tool": "create_task", "args": { "title": "Verify fix", "description": "Run soak test. Depends on T3 fix." } }, |
| 66 | + { "tool": "list_tasks", "args": {} } |
| 67 | + ] |
| 68 | + }, |
| 69 | + { |
| 70 | + "id": "refactor-auth-migration", |
| 71 | + "name": "Refactor: Auth System Migration", |
| 72 | + "description": "Nested decomposition: audit -> design -> parallel impl (JWT + session) -> migrate -> test", |
| 73 | + "type": "refactor", |
| 74 | + "complexity": "very_high", |
| 75 | + "steps": [ |
| 76 | + { "id": "audit", "action": "Audit current auth system usage across codebase" }, |
| 77 | + { "id": "design", "action": "Design new auth architecture", "depends_on": ["audit"] }, |
| 78 | + { "id": "impl-jwt", "action": "Implement JWT token service", "depends_on": ["design"] }, |
| 79 | + { "id": "impl-session", "action": "Implement session migration layer", "depends_on": ["design"] }, |
| 80 | + { "id": "migrate", "action": "Run data migration", "depends_on": ["impl-jwt", "impl-session"] }, |
| 81 | + { "id": "test", "action": "Run full auth regression suite", "depends_on": ["migrate"] } |
| 82 | + ], |
| 83 | + "cord_transcript": [ |
| 84 | + { "tool": "cord_spawn", "args": { "goal": "Audit current auth system", "prompt": "Find all session-based auth usage: middleware, login flows, token refresh, logout" } }, |
| 85 | + { "tool": "cord_complete", "args": { "task_id": "T1", "result": "47 files use session auth. 12 middleware functions. 3 login flows (web, mobile, API). Session stored in Redis with 24h TTL." } }, |
| 86 | + { "tool": "cord_spawn", "args": { "goal": "Design new auth architecture", "prompt": "Design JWT + refresh token system", "blocked_by": ["T1"] } }, |
| 87 | + { "tool": "cord_complete", "args": { "task_id": "T2", "result": "Architecture: JWT access (15min) + refresh (7d) in httpOnly cookie. Middleware: verifyJWT -> extractUser. Migration: dual-mode period (2 weeks) accepting both session and JWT." } }, |
| 88 | + { "tool": "cord_fork", "args": { "goal": "Implement JWT token service", "prompt": "Build JWT sign/verify/refresh", "blocked_by": ["T2"], "parent_id": "T2" } }, |
| 89 | + { "tool": "cord_fork", "args": { "goal": "Implement session migration layer", "prompt": "Build session-to-JWT converter", "blocked_by": ["T2"], "parent_id": "T2" } }, |
| 90 | + { "tool": "cord_complete", "args": { "task_id": "T3", "result": "JWT service: sign(payload, 15min), verify(token), refresh(refreshToken, 7d). RS256 key rotation support." } }, |
| 91 | + { "tool": "cord_complete", "args": { "task_id": "T4", "result": "Migration layer: detectAuthType(req) -> session|jwt. convertSession(sessionId) -> {accessToken, refreshToken}. Dual-mode middleware." } }, |
| 92 | + { "tool": "cord_spawn", "args": { "goal": "Run data migration", "prompt": "Migrate active sessions to JWT", "blocked_by": ["T3", "T4"] } }, |
| 93 | + { "tool": "cord_complete", "args": { "task_id": "T5", "result": "Migration complete: 15,000 active sessions converted. 99.7% success rate. 45 sessions expired during migration (expected)." } }, |
| 94 | + { "tool": "cord_spawn", "args": { "goal": "Run auth regression suite", "prompt": "Full test coverage", "blocked_by": ["T5"] } }, |
| 95 | + { "tool": "cord_tree", "args": { "include_results": true } } |
| 96 | + ], |
| 97 | + "flat_transcript": [ |
| 98 | + { "tool": "create_task", "args": { "title": "Audit current auth", "description": "Find session auth usage" } }, |
| 99 | + { "tool": "update_task_status", "args": { "task_id": "T1", "status": "completed" } }, |
| 100 | + { "tool": "create_task", "args": { "title": "Design new auth", "description": "JWT system. Audit found 47 files, 12 middleware, 3 login flows." } }, |
| 101 | + { "tool": "update_task_status", "args": { "task_id": "T2", "status": "completed" } }, |
| 102 | + { "tool": "create_task", "args": { "title": "Implement JWT service", "description": "Build JWT. Design: access 15min, refresh 7d, RS256." } }, |
| 103 | + { "tool": "create_task", "args": { "title": "Implement session migration", "description": "Build converter. Design: dual-mode 2 weeks." } }, |
| 104 | + { "tool": "update_task_status", "args": { "task_id": "T3", "status": "completed" } }, |
| 105 | + { "tool": "update_task_status", "args": { "task_id": "T4", "status": "completed" } }, |
| 106 | + { "tool": "create_task", "args": { "title": "Run migration", "description": "Depends on T3 and T4. Must check both are done." } }, |
| 107 | + { "tool": "list_tasks", "args": {} }, |
| 108 | + { "tool": "update_task_status", "args": { "task_id": "T5", "status": "completed" } }, |
| 109 | + { "tool": "create_task", "args": { "title": "Run regression tests", "description": "Depends on T5." } }, |
| 110 | + { "tool": "list_tasks", "args": {} } |
| 111 | + ] |
| 112 | + }, |
| 113 | + { |
| 114 | + "id": "hotfix-production-error", |
| 115 | + "name": "Hotfix: Production Error", |
| 116 | + "description": "Decision point (rollback vs fix-forward?) then execute chosen approach", |
| 117 | + "type": "bug_fix", |
| 118 | + "complexity": "high", |
| 119 | + "steps": [ |
| 120 | + { "id": "diagnose", "action": "Diagnose production error from logs and monitoring" }, |
| 121 | + { "id": "decide", "action": "Decision: rollback or fix-forward?", "depends_on": ["diagnose"] }, |
| 122 | + { "id": "execute", "action": "Execute chosen approach", "depends_on": ["decide"] }, |
| 123 | + { "id": "verify", "action": "Verify production is healthy", "depends_on": ["execute"] } |
| 124 | + ], |
| 125 | + "cord_transcript": [ |
| 126 | + { "tool": "cord_spawn", "args": { "goal": "Diagnose production error", "prompt": "Check error logs, Sentry alerts, and metrics dashboards" } }, |
| 127 | + { "tool": "cord_complete", "args": { "task_id": "T1", "result": "Error: NullPointerException in PaymentService.processRefund() since deploy v2.14.0 (2h ago). Affects 12% of refund requests. Root cause: missing null check on optional coupon field added in v2.14.0." } }, |
| 128 | + { "tool": "cord_ask", "args": { "question": "Rollback or fix-forward for PaymentService NPE?", "options": ["rollback to v2.13.9 (safe, 5min downtime)", "fix-forward with null check patch (risky, 0 downtime)"], "blocked_by": ["T1"] } }, |
| 129 | + { "tool": "cord_complete", "args": { "task_id": "T2", "result": "fix-forward: the coupon field is needed for new feature launching tomorrow, rollback would block it" } }, |
| 130 | + { "tool": "cord_spawn", "args": { "goal": "Patch PaymentService with null check", "prompt": "Add null check for coupon field in processRefund()", "blocked_by": ["T2"] } }, |
| 131 | + { "tool": "cord_complete", "args": { "task_id": "T3", "result": "Patched: Added optional chaining on coupon?.discountAmount in processRefund(). Deploy v2.14.1 pushed. Error rate dropped to 0%." } }, |
| 132 | + { "tool": "cord_spawn", "args": { "goal": "Verify production health", "prompt": "Check error rate, refund success rate, monitoring dashboards", "blocked_by": ["T3"] } }, |
| 133 | + { "tool": "cord_tree", "args": { "include_results": true } } |
| 134 | + ], |
| 135 | + "flat_transcript": [ |
| 136 | + { "tool": "create_task", "args": { "title": "Diagnose production error", "description": "Check logs and monitoring" } }, |
| 137 | + { "tool": "update_task_status", "args": { "task_id": "T1", "status": "completed", "notes": "NPE in PaymentService since v2.14.0" } }, |
| 138 | + { "tool": "create_task", "args": { "title": "Decision: rollback or fix-forward?", "description": "Options: 1) rollback v2.13.9 (5min downtime) 2) fix-forward null check (0 downtime). Diagnosis: missing null check on coupon field." } }, |
| 139 | + { "tool": "list_tasks", "args": {} }, |
| 140 | + { "tool": "update_task_status", "args": { "task_id": "T2", "status": "completed", "notes": "fix-forward chosen" } }, |
| 141 | + { "tool": "create_task", "args": { "title": "Patch PaymentService", "description": "Add null check. Decision was fix-forward. Must manually copy diagnosis context." } }, |
| 142 | + { "tool": "update_task_status", "args": { "task_id": "T3", "status": "completed" } }, |
| 143 | + { "tool": "create_task", "args": { "title": "Verify production", "description": "Check health after patch" } }, |
| 144 | + { "tool": "list_tasks", "args": {} } |
| 145 | + ] |
| 146 | + } |
| 147 | +] |
0 commit comments