ai-sdlc 0.1.0-alpha.1

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.
Files changed (96) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +847 -0
  3. package/dist/agents/implementation.d.ts +11 -0
  4. package/dist/agents/implementation.d.ts.map +1 -0
  5. package/dist/agents/implementation.js +123 -0
  6. package/dist/agents/implementation.js.map +1 -0
  7. package/dist/agents/index.d.ts +7 -0
  8. package/dist/agents/index.d.ts.map +1 -0
  9. package/dist/agents/index.js +8 -0
  10. package/dist/agents/index.js.map +1 -0
  11. package/dist/agents/planning.d.ts +9 -0
  12. package/dist/agents/planning.d.ts.map +1 -0
  13. package/dist/agents/planning.js +84 -0
  14. package/dist/agents/planning.js.map +1 -0
  15. package/dist/agents/refinement.d.ts +10 -0
  16. package/dist/agents/refinement.d.ts.map +1 -0
  17. package/dist/agents/refinement.js +98 -0
  18. package/dist/agents/refinement.js.map +1 -0
  19. package/dist/agents/research.d.ts +16 -0
  20. package/dist/agents/research.d.ts.map +1 -0
  21. package/dist/agents/research.js +141 -0
  22. package/dist/agents/research.js.map +1 -0
  23. package/dist/agents/review.d.ts +24 -0
  24. package/dist/agents/review.d.ts.map +1 -0
  25. package/dist/agents/review.js +740 -0
  26. package/dist/agents/review.js.map +1 -0
  27. package/dist/agents/rework.d.ts +17 -0
  28. package/dist/agents/rework.d.ts.map +1 -0
  29. package/dist/agents/rework.js +139 -0
  30. package/dist/agents/rework.js.map +1 -0
  31. package/dist/agents/state-assessor.d.ts +21 -0
  32. package/dist/agents/state-assessor.d.ts.map +1 -0
  33. package/dist/agents/state-assessor.js +29 -0
  34. package/dist/agents/state-assessor.js.map +1 -0
  35. package/dist/cli/commands.d.ts +87 -0
  36. package/dist/cli/commands.d.ts.map +1 -0
  37. package/dist/cli/commands.js +1183 -0
  38. package/dist/cli/commands.js.map +1 -0
  39. package/dist/cli/formatting.d.ts +68 -0
  40. package/dist/cli/formatting.d.ts.map +1 -0
  41. package/dist/cli/formatting.js +194 -0
  42. package/dist/cli/formatting.js.map +1 -0
  43. package/dist/cli/runner.d.ts +57 -0
  44. package/dist/cli/runner.d.ts.map +1 -0
  45. package/dist/cli/runner.js +272 -0
  46. package/dist/cli/runner.js.map +1 -0
  47. package/dist/cli/story-utils.d.ts +19 -0
  48. package/dist/cli/story-utils.d.ts.map +1 -0
  49. package/dist/cli/story-utils.js +44 -0
  50. package/dist/cli/story-utils.js.map +1 -0
  51. package/dist/cli/table-renderer.d.ts +22 -0
  52. package/dist/cli/table-renderer.d.ts.map +1 -0
  53. package/dist/cli/table-renderer.js +159 -0
  54. package/dist/cli/table-renderer.js.map +1 -0
  55. package/dist/core/auth.d.ts +39 -0
  56. package/dist/core/auth.d.ts.map +1 -0
  57. package/dist/core/auth.js +128 -0
  58. package/dist/core/auth.js.map +1 -0
  59. package/dist/core/client.d.ts +73 -0
  60. package/dist/core/client.d.ts.map +1 -0
  61. package/dist/core/client.js +140 -0
  62. package/dist/core/client.js.map +1 -0
  63. package/dist/core/config.d.ts +48 -0
  64. package/dist/core/config.d.ts.map +1 -0
  65. package/dist/core/config.js +330 -0
  66. package/dist/core/config.js.map +1 -0
  67. package/dist/core/kanban.d.ts +34 -0
  68. package/dist/core/kanban.d.ts.map +1 -0
  69. package/dist/core/kanban.js +253 -0
  70. package/dist/core/kanban.js.map +1 -0
  71. package/dist/core/story.d.ts +91 -0
  72. package/dist/core/story.d.ts.map +1 -0
  73. package/dist/core/story.js +349 -0
  74. package/dist/core/story.js.map +1 -0
  75. package/dist/core/theme.d.ts +17 -0
  76. package/dist/core/theme.d.ts.map +1 -0
  77. package/dist/core/theme.js +136 -0
  78. package/dist/core/theme.js.map +1 -0
  79. package/dist/core/workflow-state.d.ts +56 -0
  80. package/dist/core/workflow-state.d.ts.map +1 -0
  81. package/dist/core/workflow-state.js +162 -0
  82. package/dist/core/workflow-state.js.map +1 -0
  83. package/dist/index.d.ts +3 -0
  84. package/dist/index.d.ts.map +1 -0
  85. package/dist/index.js +103 -0
  86. package/dist/index.js.map +1 -0
  87. package/dist/types/index.d.ts +228 -0
  88. package/dist/types/index.d.ts.map +1 -0
  89. package/dist/types/index.js +38 -0
  90. package/dist/types/index.js.map +1 -0
  91. package/dist/types/workflow-state.d.ts +54 -0
  92. package/dist/types/workflow-state.d.ts.map +1 -0
  93. package/dist/types/workflow-state.js +5 -0
  94. package/dist/types/workflow-state.js.map +1 -0
  95. package/package.json +71 -0
  96. package/templates/story.md +35 -0
package/README.md ADDED
@@ -0,0 +1,847 @@
1
+ # Agentic SDLC
2
+
3
+ > **Alpha Release**: This is an early alpha. Expect breaking changes.
4
+ > Report issues at [GitHub Issues](https://github.com/patrob/agentic-workflow/issues)
5
+
6
+ Agent-first SDLC workflow manager using Claude Agent SDK. A Kanban-style board with AI-powered workflow automation for software development stories.
7
+
8
+ ## Features
9
+
10
+ - 📋 Kanban-style story management (Backlog → Ready → In Progress → Done)
11
+ - 🤖 AI-powered agents for each workflow stage
12
+ - 🚀 **Full SDLC automation** for individual stories with `--auto --story` (refine → research → plan → implement → review)
13
+ - 🔄 **Resume workflows after interruption** with `--continue` flag
14
+ - 🎨 Customizable themes (auto, light, dark, none)
15
+ - 📊 Visual progress tracking with status flags
16
+ - ⚡ Automatic state assessment and action recommendations
17
+ - ♻️ Smart phase skipping (automatically skips completed phases)
18
+
19
+ ## Installation
20
+
21
+ ```bash
22
+ npm install
23
+ npm run build
24
+ ```
25
+
26
+ ## Quick Start
27
+
28
+ ```bash
29
+ # Initialize the .agentic-sdlc folder
30
+ agentic-sdlc init
31
+
32
+ # Add a new story
33
+ agentic-sdlc add "Implement user authentication"
34
+
35
+ # Run the workflow (process next action)
36
+ agentic-sdlc run
37
+
38
+ # Process all pending actions automatically
39
+ agentic-sdlc run --auto
40
+
41
+ # Resume workflow after interruption
42
+ agentic-sdlc run --continue
43
+ ```
44
+
45
+ ## CLI Commands
46
+
47
+ ### `init`
48
+ Initialize the `.agentic-sdlc` folder structure with Kanban columns.
49
+
50
+ ```bash
51
+ agentic-sdlc init
52
+ ```
53
+
54
+ ### `status`
55
+ View all stories in a formatted table view with story IDs, truncated text, and uniform alignment.
56
+
57
+ ```bash
58
+ agentic-sdlc status
59
+ ```
60
+
61
+ **Table View** (terminal width ≥ 100 columns):
62
+ ```
63
+ ┌──────────────────────┬────────────────────────────────────────────┬──────────────┬────────────────────┬────────┐
64
+ │ Story ID │ Title │ Status │ Labels │ Flags │
65
+ ├──────────────────────┼────────────────────────────────────────────┼──────────────┼────────────────────┼────────┤
66
+ │ story-mk68fjh7-fvbt │ Improve status output: add story ID... │ backlog │ enhancement, ui │ [R] │
67
+ │ story-mk6a2jk9-xyzf │ Add user authentication │ in-progress │ feature, security │ [RPI] │
68
+ │ story-mk6b3lm1-abcd │ Fix payment processing bug │ ready │ bug, critical │ [RP] │
69
+ └──────────────────────┴────────────────────────────────────────────┴──────────────┴────────────────────┴────────┘
70
+ ```
71
+
72
+ **Compact View** (terminal width < 100 columns):
73
+ ```
74
+ ID: story-mk68fjh7-fvbt | Status: backlog
75
+ Title: Improve status output: add story ID column...
76
+ Labels: enhancement, ui, cli | Flags: [R]
77
+ ────────────────────────────────────────────────
78
+ ```
79
+
80
+ **Features:**
81
+ - **Story ID Column**: Quickly identify stories by their unique ID
82
+ - **Smart Truncation**: Titles and labels are truncated for readability with "..." indicator
83
+ - **Responsive Design**: Automatically switches between table and compact view based on terminal width
84
+ - **Color Coding**: Status and flags are color-coded for quick visual scanning
85
+ - **Workflow Flags**:
86
+ - `[R]` - Research complete
87
+ - `[P]` - Plan complete
88
+ - `[I]` - Implementation complete
89
+ - `[V]` - Reviews complete
90
+ - `[!]` - Blocked
91
+
92
+ **Minimum Terminal Width**: 100 columns recommended for table view
93
+
94
+ **Disable Hints**: Set `AGENTIC_SDLC_NO_HINTS=1` to hide the compact view notification
95
+
96
+ ### `add <title>`
97
+ Add a new story to the backlog.
98
+
99
+ ```bash
100
+ agentic-sdlc add "Add dark mode toggle"
101
+ ```
102
+
103
+ ### `details <id>` (alias: `d`)
104
+ Show detailed information about a specific story by ID or slug.
105
+
106
+ **Usage:**
107
+
108
+ ```bash
109
+ # View by story ID
110
+ agentic-sdlc details story-mk68fjh7-fvbt
111
+
112
+ # View by slug
113
+ agentic-sdlc details add-dark-mode-toggle
114
+
115
+ # Use short alias
116
+ agentic-sdlc d story-mk68fjh7-fvbt
117
+ ```
118
+
119
+ **Displays:**
120
+ - All metadata (ID, slug, status, priority, type, effort, assignee, labels)
121
+ - Workflow status (research, planning, implementation, reviews)
122
+ - PR information (branch, URL)
123
+ - All content sections (summary, acceptance criteria, research, plan, review notes)
124
+ - Automatically hides empty sections
125
+
126
+ **Features:**
127
+ - Case-insensitive lookup
128
+ - Works with both story ID and slug
129
+ - Helpful error messages with suggestions
130
+ - Color-coded status indicators
131
+ - Formatted dates
132
+
133
+ ### `run [options]`
134
+ Run the workflow and process actions.
135
+
136
+ **Options:**
137
+ - `--auto` - Process all pending actions automatically (combine with `--story` for full SDLC: refine → research → plan → implement → review)
138
+ - `--dry-run` - Show what would be executed without running
139
+ - `--continue` - Resume workflow from last checkpoint
140
+ - `--story <id-or-slug>` - Target a specific story by ID or slug
141
+ - `--step <phase>` - Run a specific phase (refine, research, plan, implement, review) - cannot be combined with `--auto --story`
142
+
143
+ **Examples:**
144
+
145
+ ```bash
146
+ # Process the next recommended action
147
+ agentic-sdlc run
148
+
149
+ # Process all pending actions
150
+ agentic-sdlc run --auto
151
+
152
+ # Resume after interruption (Ctrl+C, error, etc.)
153
+ agentic-sdlc run --continue
154
+
155
+ # Preview what would be executed
156
+ agentic-sdlc run --dry-run
157
+
158
+ # Run full SDLC for a specific story (NEW!)
159
+ agentic-sdlc run --auto --story my-feature
160
+
161
+ # Run specific phase for a story
162
+ agentic-sdlc run --story my-feature --step research
163
+ ```
164
+
165
+ ### `config [key] [value]`
166
+ Manage configuration settings.
167
+
168
+ ```bash
169
+ # View all configuration
170
+ agentic-sdlc config
171
+
172
+ # View theme setting
173
+ agentic-sdlc config theme
174
+
175
+ # Set theme
176
+ agentic-sdlc config theme dark
177
+ ```
178
+
179
+ ## Full SDLC Automation (--auto --story)
180
+
181
+ The `--auto --story` combination provides complete end-to-end automation for individual stories, executing all five SDLC phases in sequence: **refine → research → plan → implement → review**.
182
+
183
+ ### Quick Example
184
+
185
+ ```bash
186
+ # Take a story from idea to reviewed implementation in one command
187
+ agentic-sdlc run --auto --story my-feature
188
+ ```
189
+
190
+ ### How It Works
191
+
192
+ When you combine `--auto` with `--story`, the system:
193
+
194
+ 1. **Identifies the target story** by ID or slug
195
+ 2. **Assesses current state** to determine which phases are incomplete
196
+ 3. **Generates complete phase sequence** (refine → research → plan → implement → review)
197
+ 4. **Skips completed phases** automatically (idempotent - safe to re-run)
198
+ 5. **Executes remaining phases** sequentially with progress tracking
199
+ 6. **Saves checkpoints** after each phase for resume capability
200
+ 7. **Stops on failure** with clear error messages
201
+
202
+ ### Phase Progression
203
+
204
+ The full SDLC workflow follows this progression:
205
+
206
+ ```
207
+ ┌─────────┐ ┌──────────┐ ┌──────┐ ┌───────────┐ ┌────────┐
208
+ │ Refine │ -> │ Research │ -> │ Plan │ -> │ Implement │ -> │ Review │
209
+ └─────────┘ └──────────┘ └──────┘ └───────────┘ └────────┘
210
+ backlog ready ready in-progress in-progress
211
+ → ready (flags) (flags) (flags) (done)
212
+ ```
213
+
214
+ **Phase Details:**
215
+
216
+ 1. **Refine** - Enhances story clarity and moves from backlog → ready
217
+ 2. **Research** - Analyzes codebase and adds research findings
218
+ 3. **Plan** - Creates implementation plan
219
+ 4. **Implement** - Generates code changes
220
+ 5. **Review** - Performs code, security, and product owner reviews
221
+
222
+ ### Smart Phase Skipping
223
+
224
+ Already completed phases are automatically skipped:
225
+
226
+ ```bash
227
+ # Story has research and plan complete
228
+ agentic-sdlc run --auto --story my-feature
229
+
230
+ # Output:
231
+ # 🚀 Starting full SDLC for story: My Feature
232
+ # ID: story-abc123
233
+ # Status: ready
234
+ # Skipping completed phases: refine, research, plan
235
+ # Phases to execute: 2/5
236
+ #
237
+ # ═══ Phase 1/2: IMPLEMENT ═══
238
+ # ...
239
+ ```
240
+
241
+ **Skipping Logic:**
242
+ - **Refine**: Skipped if story is not in backlog/
243
+ - **Research**: Skipped if `research_complete: true`
244
+ - **Plan**: Skipped if `plan_complete: true`
245
+ - **Implement**: Skipped if `implementation_complete: true`
246
+ - **Review**: Skipped if `reviews_complete: true`
247
+
248
+ ### Progress Tracking
249
+
250
+ Clear progress indicators show current phase:
251
+
252
+ ```bash
253
+ 🚀 Starting full SDLC for story: Add dark mode toggle
254
+ ID: story-mk68fjh7-fvbt
255
+ Status: backlog
256
+ Phases to execute: 5/5
257
+
258
+ ═══ Phase 1/5: REFINE ═══
259
+ ✓ Refine "add-dark-mode-toggle"
260
+ → Story enhanced with acceptance criteria
261
+ → Moved to ready/
262
+ ✓ Progress saved (1 actions completed)
263
+
264
+ ═══ Phase 2/5: RESEARCH ═══
265
+ ✓ Research "add-dark-mode-toggle"
266
+ → Research findings added
267
+ ✓ Progress saved (2 actions completed)
268
+
269
+ ═══ Phase 3/5: PLAN ═══
270
+ ...
271
+
272
+ ═══════════════════════════════════════════════════
273
+ ✓ Full SDLC completed successfully!
274
+ ═══════════════════════════════════════════════════
275
+ Completed phases: 5/5
276
+ Story is now ready for PR creation.
277
+ Checkpoint cleared.
278
+ ```
279
+
280
+ ### Error Handling
281
+
282
+ If any phase fails, the workflow stops immediately:
283
+
284
+ ```bash
285
+ ═══ Phase 3/5: PLAN ═══
286
+ ✗ Phase plan failed
287
+
288
+ ✗ Phase plan failed
289
+ Completed 2 of 5 phases
290
+ Fix the error above and use --continue to resume.
291
+ ```
292
+
293
+ **Recovery:**
294
+ 1. Fix the underlying issue
295
+ 2. Resume with: `agentic-sdlc run --continue`
296
+ 3. Workflow continues from failed phase
297
+
298
+ ### Resuming Full SDLC Workflows
299
+
300
+ Full SDLC mode integrates seamlessly with checkpoint/resume:
301
+
302
+ ```bash
303
+ # Start full SDLC workflow
304
+ agentic-sdlc run --auto --story my-feature
305
+
306
+ # (Interrupted during implementation phase)
307
+
308
+ # Resume automatically - full SDLC mode is restored
309
+ agentic-sdlc run --continue
310
+
311
+ # Output:
312
+ # ⟳ Resuming workflow from checkpoint
313
+ # Mode: Full SDLC (story: my-feature)
314
+ # Completed actions: 3
315
+ #
316
+ # ⊘ Skipping completed actions:
317
+ # ✓ Refine "my-feature"
318
+ # ✓ Research "my-feature"
319
+ # ✓ Plan "my-feature"
320
+ #
321
+ # ═══ Phase 4/5: IMPLEMENT ═══
322
+ # ...
323
+ ```
324
+
325
+ ### Stage Gates
326
+
327
+ Full SDLC mode respects configured stage gates:
328
+
329
+ ```bash
330
+ # With requireApprovalBeforeImplementation enabled
331
+ agentic-sdlc run --auto --story my-feature
332
+
333
+ # Output:
334
+ # ✓ Research complete
335
+ # ✓ Plan complete
336
+ # ⚠️ Stage gate: Implementation requires approval
337
+ # Run 'agentic-sdlc run --continue' to proceed after approval
338
+ ```
339
+
340
+ ### Review Retry Logic
341
+
342
+ If review fails, the system automatically triggers the retry cycle:
343
+
344
+ ```bash
345
+ ═══ Phase 5/5: REVIEW ═══
346
+ ✓ Review "my-feature"
347
+ → Review decision: REJECTED
348
+
349
+ 🔄 Review rejected. Restarting RPIV cycle (attempt 1/3)
350
+ Reason: Code review identified security concerns...
351
+
352
+ ═══ Phase 3/5: PLAN ═══
353
+ # Workflow continues through plan → implement → review again
354
+ ```
355
+
356
+ The system tracks retry attempts and stops if max retries are exceeded.
357
+
358
+ ### Complete Example
359
+
360
+ ```bash
361
+ # Add a new story
362
+ agentic-sdlc add "Add user authentication"
363
+
364
+ # Run complete SDLC automation
365
+ agentic-sdlc run --auto --story add-user-authentication
366
+
367
+ # Story progresses through all phases automatically:
368
+ # 1. Refine (backlog → ready)
369
+ # 2. Research (analyze codebase)
370
+ # 3. Plan (create implementation plan)
371
+ # 4. Implement (generate code)
372
+ # 5. Review (validate quality)
373
+
374
+ # Result: Story ready for PR creation in one command!
375
+ ```
376
+
377
+ ### Differences from Standard --auto
378
+
379
+ | Mode | Behavior |
380
+ |------|----------|
381
+ | `--auto` | Processes all recommended actions across all stories based on priority |
382
+ | `--auto --story` | Executes complete SDLC (5 phases) for one specific story only |
383
+
384
+ ### Limitations
385
+
386
+ **Cannot combine with --step:**
387
+ ```bash
388
+ # This will error:
389
+ agentic-sdlc run --auto --story my-feature --step research
390
+
391
+ # Error: Cannot combine --auto --story with --step flag.
392
+ # Use either:
393
+ # - agentic-sdlc run --auto --story my-feature (full SDLC)
394
+ # - agentic-sdlc run --story my-feature --step research (single phase)
395
+ ```
396
+
397
+ **All phases are executed in sequence:**
398
+ - You cannot skip phases in full SDLC mode
399
+ - To run a specific phase only, use `--story --step` instead
400
+
401
+ ### Use Cases
402
+
403
+ **Perfect for:**
404
+ - ✅ Taking a single story from idea to implementation
405
+ - ✅ Fully automating individual features
406
+ - ✅ Batch processing during off-hours
407
+ - ✅ Demo workflows and testing
408
+
409
+ **Not ideal for:**
410
+ - ❌ Processing multiple stories at different phases (use `--auto` instead)
411
+ - ❌ Running just one specific phase (use `--story --step` instead)
412
+ - ❌ Interactive workflows requiring manual review between phases
413
+
414
+ ## Resuming Workflows
415
+
416
+ The `--continue` flag enables resuming workflows after interruption. This is useful when:
417
+
418
+ - A workflow was interrupted by Ctrl+C
419
+ - An action failed and you fixed the issue
420
+ - Your system crashed or lost connection
421
+ - You want to continue from where you left off
422
+
423
+ ### How It Works
424
+
425
+ 1. **Automatic Checkpointing**: After each successful action, the workflow state is saved to `.agentic-sdlc/.workflow-state.json`
426
+ 2. **Smart Resume**: When you use `--continue`, the system:
427
+ - Loads the saved checkpoint
428
+ - Shows which actions were already completed
429
+ - Skips completed actions
430
+ - Continues with remaining pending actions
431
+ 3. **Automatic Cleanup**: When all actions complete, the checkpoint is automatically cleared
432
+
433
+ ### Resume Examples
434
+
435
+ **Basic interruption and resume:**
436
+
437
+ ```bash
438
+ # Start workflow
439
+ agentic-sdlc run --auto
440
+
441
+ # (Interrupted by Ctrl+C after research completes)
442
+
443
+ # Resume from checkpoint
444
+ agentic-sdlc run --continue
445
+ # Output:
446
+ # ⟳ Resuming workflow from checkpoint
447
+ # Workflow ID: workflow-1234567890-abc123
448
+ # Checkpoint: 1/8/2024, 3:45:12 PM
449
+ # Completed actions: 1
450
+ #
451
+ # ⊘ Skipping completed actions:
452
+ # ✓ Research "add-dark-mode"
453
+ #
454
+ # Planning "add-dark-mode"...
455
+ # ✓ Progress saved (2 actions completed)
456
+ ```
457
+
458
+ **Resume with --auto flag:**
459
+
460
+ ```bash
461
+ # Resume and complete all remaining actions
462
+ agentic-sdlc run --auto --continue
463
+ ```
464
+
465
+ **Check for existing checkpoint:**
466
+
467
+ ```bash
468
+ # Start a new workflow when checkpoint exists
469
+ agentic-sdlc run
470
+ # Output:
471
+ # Note: Found previous checkpoint. Use --continue to resume.
472
+ ```
473
+
474
+ ### Edge Cases & Warnings
475
+
476
+ The resume feature handles several edge cases:
477
+
478
+ **Story content changed:**
479
+ ```bash
480
+ ⟳ Resuming workflow from checkpoint
481
+ ⚠ Warning: Story content changed since interruption
482
+ Proceeding with current state...
483
+ ```
484
+
485
+ **Stale checkpoint (>48 hours old):**
486
+ ```bash
487
+ ⟳ Resuming workflow from checkpoint
488
+ ⚠ Warning: Checkpoint is more than 48 hours old
489
+ Context may be stale. Consider starting fresh.
490
+ ```
491
+
492
+ **No checkpoint found:**
493
+ ```bash
494
+ Error: No checkpoint found.
495
+ Remove --continue flag to start a new workflow.
496
+ ```
497
+
498
+ **All actions already completed:**
499
+ ```bash
500
+ All actions from checkpoint already completed!
501
+ Checkpoint cleared.
502
+ ```
503
+
504
+ ### Checkpoint Files
505
+
506
+ Checkpoint files are stored at:
507
+ ```
508
+ .agentic-sdlc/.workflow-state.json
509
+ ```
510
+
511
+ **State file format:**
512
+ ```json
513
+ {
514
+ "version": "1.0",
515
+ "workflowId": "workflow-1234567890-abc123",
516
+ "timestamp": "2024-01-08T15:45:12.000Z",
517
+ "currentAction": null,
518
+ "completedActions": [
519
+ {
520
+ "type": "research",
521
+ "storyId": "story-123",
522
+ "storyPath": ".agentic-sdlc/in-progress/add-dark-mode.md",
523
+ "completedAt": "2024-01-08T15:45:12.000Z"
524
+ }
525
+ ],
526
+ "context": {
527
+ "sdlcRoot": ".agentic-sdlc",
528
+ "options": {
529
+ "auto": true
530
+ },
531
+ "storyContentHash": "abc123..."
532
+ }
533
+ }
534
+ ```
535
+
536
+ **Note:** Checkpoint files are automatically added to `.gitignore` and should not be committed to version control.
537
+
538
+ ## Workflow Stages
539
+
540
+ Each story progresses through these stages:
541
+
542
+ 1. **Refine** - AI agent enhances the story description
543
+ 2. **Research** - AI agent researches implementation approach
544
+ 3. **Plan** - AI agent creates detailed implementation plan
545
+ 4. **Implement** - AI agent implements the feature
546
+ 5. **Review** - AI agent reviews the implementation
547
+ 6. **Create PR** - Create pull request for review
548
+ 7. **Move to Done** - Mark story as complete
549
+
550
+ ## Story Status Flags
551
+
552
+ When viewing stories with `agentic-sdlc status`, you'll see progress flags:
553
+
554
+ - `R` - Research complete
555
+ - `P` - Plan complete
556
+ - `I` - Implementation complete
557
+ - `V` - Reviews complete
558
+ - `!` - Error occurred
559
+
560
+ Example:
561
+ ```
562
+ IN-PROGRESS (1)
563
+ [1] add-dark-mode - Add dark mode toggle [RP]
564
+ ```
565
+
566
+ ## Configuration
567
+
568
+ Configuration is stored in `.agentic-sdlc.json` at the project root.
569
+
570
+ **Default configuration:**
571
+ ```json
572
+ {
573
+ "sdlcFolder": ".agentic-sdlc",
574
+ "stageGates": {
575
+ "requireApprovalBeforeImplementation": false,
576
+ "requireApprovalBeforePR": false,
577
+ "autoMergeOnApproval": false
578
+ },
579
+ "defaultLabels": [],
580
+ "theme": "auto",
581
+ "settingSources": []
582
+ }
583
+ ```
584
+
585
+ ### Project Settings with CLAUDE.md
586
+
587
+ The Agent SDK can automatically load custom instructions from a `CLAUDE.md` file in your project's `.claude/` directory. This feature allows teams to share consistent AI behavior across all team members without manually specifying custom instructions.
588
+
589
+ #### How to Enable
590
+
591
+ Add `"project"` to the `settingSources` array in your `.agentic-sdlc.json`:
592
+
593
+ ```json
594
+ {
595
+ "settingSources": ["project"]
596
+ }
597
+ ```
598
+
599
+ **Available setting sources:**
600
+ - `"user"` - Global user settings from `~/.claude/settings.json`
601
+ - `"project"` - Project settings from `.claude/settings.json` and `CLAUDE.md`
602
+ - `"local"` - Local settings from `.claude/settings.local.json`
603
+
604
+ You can specify multiple sources (e.g., `["user", "project"]`) to load settings from multiple locations.
605
+
606
+ #### Directory Structure
607
+
608
+ Create a `.claude/` directory in your project root:
609
+
610
+ ```
611
+ your-project/
612
+ ├── .claude/
613
+ │ ├── CLAUDE.md # Custom instructions (you create this)
614
+ │ ├── settings.json # Project settings (SDK managed)
615
+ │ └── settings.local.json # Local overrides (SDK managed, gitignored)
616
+ ├── .agentic-sdlc.json
617
+ └── ...
618
+ ```
619
+
620
+ #### Creating CLAUDE.md
621
+
622
+ Create `.claude/CLAUDE.md` with your custom instructions:
623
+
624
+ ```markdown
625
+ # Project-Specific Instructions
626
+
627
+ You are working on a React TypeScript project that follows these conventions:
628
+
629
+ ## Code Style
630
+ - Use functional components with hooks
631
+ - Prefer named exports over default exports
632
+ - Use absolute imports with `@/` prefix
633
+
634
+ ## Testing
635
+ - Write unit tests for all business logic
636
+ - Use React Testing Library for component tests
637
+ - Aim for 80%+ code coverage
638
+
639
+ ## Documentation
640
+ - Add JSDoc comments for all exported functions
641
+ - Update README.md when adding new features
642
+ ```
643
+
644
+ #### Priority Order
645
+
646
+ When multiple sources are configured, settings are applied in this order:
647
+
648
+ 1. **Explicit configuration** (highest priority) - systemPrompt passed directly to the Agent SDK
649
+ 2. **Local settings** - `.claude/settings.local.json`
650
+ 3. **Project settings** - `.claude/settings.json` and `CLAUDE.md`
651
+ 4. **User settings** (lowest priority) - `~/.claude/settings.json`
652
+
653
+ **Note:** Explicit `systemPrompt` configuration in your code always takes precedence over any settings files.
654
+
655
+ #### Debug Logging
656
+
657
+ When `settingSources` includes `"project"`, the application logs debug messages indicating whether CLAUDE.md exists in the project settings directory. These are application-level logs, not SDK logs:
658
+
659
+ ```bash
660
+ Debug: Found CLAUDE.md in project settings
661
+ ```
662
+
663
+ or
664
+
665
+ ```bash
666
+ Debug: CLAUDE.md not found in project settings
667
+ ```
668
+
669
+ These messages use `console.debug()` and help verify that your configuration is correct. The actual loading of CLAUDE.md content is handled internally by the Agent SDK.
670
+
671
+ **Note:** Debug logging is always enabled when `'project'` is in settingSources. To suppress output, redirect stderr or set your terminal's logging level.
672
+
673
+ #### Use Cases
674
+
675
+ **Team Collaboration:**
676
+ ```json
677
+ {
678
+ "settingSources": ["project"]
679
+ }
680
+ ```
681
+ All team members share the same custom instructions from `.claude/CLAUDE.md`.
682
+
683
+ **Personal + Team Settings:**
684
+ ```json
685
+ {
686
+ "settingSources": ["user", "project"]
687
+ }
688
+ ```
689
+ Use your personal preferences plus project-specific instructions.
690
+
691
+ **Local Development Overrides:**
692
+ ```json
693
+ {
694
+ "settingSources": ["project", "local"]
695
+ }
696
+ ```
697
+ Project defaults with local overrides (`.claude/settings.local.json` is gitignored).
698
+
699
+ #### Security Considerations
700
+
701
+ The implementation includes several security measures to protect against malicious CLAUDE.md files:
702
+
703
+ **Path Validation:**
704
+ - Working directories are validated to prevent path traversal attacks
705
+ - Paths outside the project boundaries are rejected
706
+
707
+ **Symlink Protection:**
708
+ - Symlinks are resolved and validated to ensure they point within the project directory
709
+ - Symlinks pointing to system files or outside the project are rejected with a warning
710
+
711
+ **File Size Limits:**
712
+ - Files larger than 1MB trigger a warning (recommended maximum for performance)
713
+ - Files larger than 10MB are rejected completely
714
+ - Size warnings help prevent denial-of-service through memory exhaustion
715
+
716
+ **Content Validation:**
717
+ - Basic validation checks for unexpected control characters in CLAUDE.md
718
+ - Warnings are logged for suspicious content patterns
719
+
720
+ **Configuration Security:**
721
+ - Input validation prevents prototype pollution attacks
722
+ - Invalid `settingSources` values are filtered with warnings
723
+ - Environment variables are validated with bounds checking
724
+
725
+ **Troubleshooting:**
726
+
727
+ If you encounter issues:
728
+
729
+ ```bash
730
+ # Permission errors
731
+ chmod 644 .claude/CLAUDE.md
732
+
733
+ # Symlink rejected
734
+ # Ensure symlink target is within your project directory
735
+ ls -la .claude/CLAUDE.md
736
+
737
+ # File too large warning
738
+ # Consider reducing CLAUDE.md size or splitting instructions
739
+ du -h .claude/CLAUDE.md
740
+ ```
741
+
742
+ #### Backward Compatibility
743
+
744
+ The default configuration (`"settingSources": []`) maintains SDK isolation mode, ensuring existing workflows continue to work without changes. To enable project settings, you must explicitly add `"project"` to `settingSources`.
745
+
746
+ ### Theme Configuration
747
+
748
+ Available themes:
749
+ - `auto` - Automatically detect based on terminal capabilities
750
+ - `light` - Light theme with colors
751
+ - `dark` - Dark theme with colors
752
+ - `none` - No colors (plain text)
753
+
754
+ ```bash
755
+ # Set theme
756
+ agentic-sdlc config theme dark
757
+ ```
758
+
759
+ ## Authentication
760
+
761
+ The system supports two authentication methods:
762
+
763
+ 1. **Claude Code credentials** (stored in Keychain)
764
+ 2. **Environment variable**: `ANTHROPIC_API_KEY`
765
+
766
+ Get an API key at: https://console.anthropic.com/
767
+
768
+ ```bash
769
+ # Set via environment variable
770
+ export ANTHROPIC_API_KEY=your-key-here
771
+ ```
772
+
773
+ ## Folder Structure
774
+
775
+ ```
776
+ .agentic-sdlc/
777
+ ├── backlog/ # New stories
778
+ ├── ready/ # Stories ready to start
779
+ ├── in-progress/ # Active stories
780
+ ├── done/ # Completed stories
781
+ └── .workflow-state.json # Checkpoint file (auto-created, gitignored)
782
+ ```
783
+
784
+ ## Development
785
+
786
+ ```bash
787
+ # Install dependencies
788
+ npm install
789
+
790
+ # Run in development mode
791
+ npm run dev
792
+
793
+ # Build
794
+ npm run build
795
+
796
+ # Run tests
797
+ npm test
798
+
799
+ # Type check
800
+ npm run lint
801
+ ```
802
+
803
+ ## Testing
804
+
805
+ The project includes comprehensive tests for the workflow state persistence layer:
806
+
807
+ ```bash
808
+ # Run all tests
809
+ npm test
810
+
811
+ # Run specific test file
812
+ npm test workflow-state.test.ts
813
+
814
+ # Run tests in watch mode
815
+ npm test -- --watch
816
+ ```
817
+
818
+ ## Troubleshooting
819
+
820
+ ### Corrupted Checkpoint
821
+
822
+ If you encounter a corrupted checkpoint error:
823
+
824
+ ```bash
825
+ Error: Corrupted workflow state file at .agentic-sdlc/.workflow-state.json.
826
+ Delete the file to start fresh: rm ".agentic-sdlc/.workflow-state.json"
827
+ ```
828
+
829
+ Solution:
830
+ ```bash
831
+ rm .agentic-sdlc/.workflow-state.json
832
+ agentic-sdlc run # Start fresh
833
+ ```
834
+
835
+ ### Multiple Workflows
836
+
837
+ Currently, only one workflow can run at a time. If you try to start a new workflow while a checkpoint exists, you'll see a suggestion to use `--continue`.
838
+
839
+ To start fresh (ignoring the checkpoint):
840
+ ```bash
841
+ rm .agentic-sdlc/.workflow-state.json
842
+ agentic-sdlc run
843
+ ```
844
+
845
+ ## License
846
+
847
+ MIT