ai-sdlc 0.1.0-alpha.1 → 0.1.0-alpha.10
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/README.md +367 -70
- package/dist/agents/implementation.d.ts +80 -2
- package/dist/agents/implementation.d.ts.map +1 -1
- package/dist/agents/implementation.js +467 -2
- package/dist/agents/implementation.js.map +1 -1
- package/dist/agents/planning.d.ts +20 -1
- package/dist/agents/planning.d.ts.map +1 -1
- package/dist/agents/planning.js +73 -12
- package/dist/agents/planning.js.map +1 -1
- package/dist/agents/review.d.ts +21 -1
- package/dist/agents/review.d.ts.map +1 -1
- package/dist/agents/review.js +64 -2
- package/dist/agents/review.js.map +1 -1
- package/dist/agents/rework.d.ts.map +1 -1
- package/dist/agents/rework.js +6 -4
- package/dist/agents/rework.js.map +1 -1
- package/dist/cli/commands.d.ts +2 -1
- package/dist/cli/commands.d.ts.map +1 -1
- package/dist/cli/commands.js +23 -16
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/daemon.d.ts +87 -0
- package/dist/cli/daemon.d.ts.map +1 -0
- package/dist/cli/daemon.js +432 -0
- package/dist/cli/daemon.js.map +1 -0
- package/dist/cli/runner.d.ts +1 -0
- package/dist/cli/runner.d.ts.map +1 -1
- package/dist/cli/runner.js +1 -1
- package/dist/cli/runner.js.map +1 -1
- package/dist/cli/story-utils.d.ts.map +1 -1
- package/dist/cli/story-utils.js +2 -0
- package/dist/cli/story-utils.js.map +1 -1
- package/dist/cli/table-renderer.js +1 -1
- package/dist/cli/table-renderer.js.map +1 -1
- package/dist/core/client.js +1 -1
- package/dist/core/client.js.map +1 -1
- package/dist/core/config.d.ts +10 -2
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +84 -14
- package/dist/core/config.js.map +1 -1
- package/dist/core/kanban.d.ts.map +1 -1
- package/dist/core/kanban.js +22 -10
- package/dist/core/kanban.js.map +1 -1
- package/dist/core/story.d.ts +7 -0
- package/dist/core/story.d.ts.map +1 -1
- package/dist/core/story.js +51 -1
- package/dist/core/story.js.map +1 -1
- package/dist/core/theme.d.ts.map +1 -1
- package/dist/core/theme.js +3 -0
- package/dist/core/theme.js.map +1 -1
- package/dist/core/workflow-state.d.ts +4 -4
- package/dist/core/workflow-state.js +4 -4
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +61 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +3 -1
- package/dist/types/index.js.map +1 -1
- package/package.json +8 -6
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AI SDLC
|
|
2
2
|
|
|
3
3
|
> **Alpha Release**: This is an early alpha. Expect breaking changes.
|
|
4
4
|
> Report issues at [GitHub Issues](https://github.com/patrob/agentic-workflow/issues)
|
|
@@ -7,14 +7,15 @@ Agent-first SDLC workflow manager using Claude Agent SDK. A Kanban-style board w
|
|
|
7
7
|
|
|
8
8
|
## Features
|
|
9
9
|
|
|
10
|
-
- 📋 Kanban-style story management (Backlog → Ready → In Progress → Done)
|
|
11
|
-
- 🤖 AI-powered agents for each workflow stage
|
|
12
|
-
- 🚀 **Full SDLC automation**
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
10
|
+
- 📋 **Kanban-style story management** (Backlog → Ready → In Progress → Done)
|
|
11
|
+
- 🤖 **AI-powered agents** for each workflow stage (refine, research, plan, implement, review)
|
|
12
|
+
- 🚀 **Full SDLC automation** with `--auto --story` - takes a story from idea to reviewed code
|
|
13
|
+
- 🔴🟢🔵 **TDD Mode** - Optional Test-Driven Development enforcement with Red-Green-Refactor cycles
|
|
14
|
+
- 🔄 **Resume workflows** after interruption with `--continue` flag
|
|
15
|
+
- 👀 **Daemon mode** - Continuously watch for and process new stories with `--watch`
|
|
16
|
+
- 🎨 **Customizable themes** (auto, light, dark, none)
|
|
17
|
+
- 📊 **Visual progress tracking** with status flags [R][P][I][V]
|
|
18
|
+
- ♻️ **Smart phase skipping** - automatically skips completed phases
|
|
18
19
|
|
|
19
20
|
## Installation
|
|
20
21
|
|
|
@@ -26,36 +27,47 @@ npm run build
|
|
|
26
27
|
## Quick Start
|
|
27
28
|
|
|
28
29
|
```bash
|
|
29
|
-
# Initialize the
|
|
30
|
-
|
|
30
|
+
# 1. Initialize the project
|
|
31
|
+
ai-sdlc init
|
|
31
32
|
|
|
32
|
-
# Add a
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
# Run the workflow (process next action)
|
|
36
|
-
agentic-sdlc run
|
|
33
|
+
# 2. Add a story to the backlog
|
|
34
|
+
ai-sdlc add "Implement user authentication"
|
|
37
35
|
|
|
38
|
-
#
|
|
39
|
-
|
|
36
|
+
# 3. View your board
|
|
37
|
+
ai-sdlc status
|
|
40
38
|
|
|
41
|
-
#
|
|
42
|
-
|
|
39
|
+
# 4. Run the full SDLC for a story (refine → research → plan → implement → review)
|
|
40
|
+
ai-sdlc run --auto --story implement-user-authentication
|
|
43
41
|
```
|
|
44
42
|
|
|
43
|
+
### Common Commands
|
|
44
|
+
|
|
45
|
+
| Command | Description |
|
|
46
|
+
|---------|-------------|
|
|
47
|
+
| `ai-sdlc status` | View all stories in Kanban board |
|
|
48
|
+
| `ai-sdlc add "title"` | Add a new story to backlog |
|
|
49
|
+
| `ai-sdlc run` | Process next recommended action |
|
|
50
|
+
| `ai-sdlc run --auto` | Process all pending actions |
|
|
51
|
+
| `ai-sdlc run --auto --story <id>` | Full SDLC for one story |
|
|
52
|
+
| `ai-sdlc run --continue` | Resume after interruption |
|
|
53
|
+
| `ai-sdlc run --watch` | Daemon mode - watch for new stories |
|
|
54
|
+
| `ai-sdlc details <id>` | Show story details |
|
|
55
|
+
| `ai-sdlc config` | View/set configuration |
|
|
56
|
+
|
|
45
57
|
## CLI Commands
|
|
46
58
|
|
|
47
59
|
### `init`
|
|
48
|
-
Initialize the `.
|
|
60
|
+
Initialize the `.ai-sdlc` folder structure with Kanban columns.
|
|
49
61
|
|
|
50
62
|
```bash
|
|
51
|
-
|
|
63
|
+
ai-sdlc init
|
|
52
64
|
```
|
|
53
65
|
|
|
54
66
|
### `status`
|
|
55
67
|
View all stories in a formatted table view with story IDs, truncated text, and uniform alignment.
|
|
56
68
|
|
|
57
69
|
```bash
|
|
58
|
-
|
|
70
|
+
ai-sdlc status
|
|
59
71
|
```
|
|
60
72
|
|
|
61
73
|
**Table View** (terminal width ≥ 100 columns):
|
|
@@ -91,13 +103,13 @@ Labels: enhancement, ui, cli | Flags: [R]
|
|
|
91
103
|
|
|
92
104
|
**Minimum Terminal Width**: 100 columns recommended for table view
|
|
93
105
|
|
|
94
|
-
**Disable Hints**: Set `
|
|
106
|
+
**Disable Hints**: Set `AI_SDLC_NO_HINTS=1` to hide the compact view notification
|
|
95
107
|
|
|
96
108
|
### `add <title>`
|
|
97
109
|
Add a new story to the backlog.
|
|
98
110
|
|
|
99
111
|
```bash
|
|
100
|
-
|
|
112
|
+
ai-sdlc add "Add dark mode toggle"
|
|
101
113
|
```
|
|
102
114
|
|
|
103
115
|
### `details <id>` (alias: `d`)
|
|
@@ -107,13 +119,13 @@ Show detailed information about a specific story by ID or slug.
|
|
|
107
119
|
|
|
108
120
|
```bash
|
|
109
121
|
# View by story ID
|
|
110
|
-
|
|
122
|
+
ai-sdlc details story-mk68fjh7-fvbt
|
|
111
123
|
|
|
112
124
|
# View by slug
|
|
113
|
-
|
|
125
|
+
ai-sdlc details add-dark-mode-toggle
|
|
114
126
|
|
|
115
127
|
# Use short alias
|
|
116
|
-
|
|
128
|
+
ai-sdlc d story-mk68fjh7-fvbt
|
|
117
129
|
```
|
|
118
130
|
|
|
119
131
|
**Displays:**
|
|
@@ -139,27 +151,31 @@ Run the workflow and process actions.
|
|
|
139
151
|
- `--continue` - Resume workflow from last checkpoint
|
|
140
152
|
- `--story <id-or-slug>` - Target a specific story by ID or slug
|
|
141
153
|
- `--step <phase>` - Run a specific phase (refine, research, plan, implement, review) - cannot be combined with `--auto --story`
|
|
154
|
+
- `--watch` - Run in daemon mode, continuously processing backlog (NEW!)
|
|
142
155
|
|
|
143
156
|
**Examples:**
|
|
144
157
|
|
|
145
158
|
```bash
|
|
146
159
|
# Process the next recommended action
|
|
147
|
-
|
|
160
|
+
ai-sdlc run
|
|
148
161
|
|
|
149
162
|
# Process all pending actions
|
|
150
|
-
|
|
163
|
+
ai-sdlc run --auto
|
|
151
164
|
|
|
152
165
|
# Resume after interruption (Ctrl+C, error, etc.)
|
|
153
|
-
|
|
166
|
+
ai-sdlc run --continue
|
|
154
167
|
|
|
155
168
|
# Preview what would be executed
|
|
156
|
-
|
|
169
|
+
ai-sdlc run --dry-run
|
|
157
170
|
|
|
158
171
|
# Run full SDLC for a specific story (NEW!)
|
|
159
|
-
|
|
172
|
+
ai-sdlc run --auto --story my-feature
|
|
160
173
|
|
|
161
174
|
# Run specific phase for a story
|
|
162
|
-
|
|
175
|
+
ai-sdlc run --story my-feature --step research
|
|
176
|
+
|
|
177
|
+
# Run in daemon/watch mode (NEW!)
|
|
178
|
+
ai-sdlc run --watch
|
|
163
179
|
```
|
|
164
180
|
|
|
165
181
|
### `config [key] [value]`
|
|
@@ -167,13 +183,13 @@ Manage configuration settings.
|
|
|
167
183
|
|
|
168
184
|
```bash
|
|
169
185
|
# View all configuration
|
|
170
|
-
|
|
186
|
+
ai-sdlc config
|
|
171
187
|
|
|
172
188
|
# View theme setting
|
|
173
|
-
|
|
189
|
+
ai-sdlc config theme
|
|
174
190
|
|
|
175
191
|
# Set theme
|
|
176
|
-
|
|
192
|
+
ai-sdlc config theme dark
|
|
177
193
|
```
|
|
178
194
|
|
|
179
195
|
## Full SDLC Automation (--auto --story)
|
|
@@ -184,7 +200,7 @@ The `--auto --story` combination provides complete end-to-end automation for ind
|
|
|
184
200
|
|
|
185
201
|
```bash
|
|
186
202
|
# Take a story from idea to reviewed implementation in one command
|
|
187
|
-
|
|
203
|
+
ai-sdlc run --auto --story my-feature
|
|
188
204
|
```
|
|
189
205
|
|
|
190
206
|
### How It Works
|
|
@@ -225,7 +241,7 @@ Already completed phases are automatically skipped:
|
|
|
225
241
|
|
|
226
242
|
```bash
|
|
227
243
|
# Story has research and plan complete
|
|
228
|
-
|
|
244
|
+
ai-sdlc run --auto --story my-feature
|
|
229
245
|
|
|
230
246
|
# Output:
|
|
231
247
|
# 🚀 Starting full SDLC for story: My Feature
|
|
@@ -292,7 +308,7 @@ Fix the error above and use --continue to resume.
|
|
|
292
308
|
|
|
293
309
|
**Recovery:**
|
|
294
310
|
1. Fix the underlying issue
|
|
295
|
-
2. Resume with: `
|
|
311
|
+
2. Resume with: `ai-sdlc run --continue`
|
|
296
312
|
3. Workflow continues from failed phase
|
|
297
313
|
|
|
298
314
|
### Resuming Full SDLC Workflows
|
|
@@ -301,12 +317,12 @@ Full SDLC mode integrates seamlessly with checkpoint/resume:
|
|
|
301
317
|
|
|
302
318
|
```bash
|
|
303
319
|
# Start full SDLC workflow
|
|
304
|
-
|
|
320
|
+
ai-sdlc run --auto --story my-feature
|
|
305
321
|
|
|
306
322
|
# (Interrupted during implementation phase)
|
|
307
323
|
|
|
308
324
|
# Resume automatically - full SDLC mode is restored
|
|
309
|
-
|
|
325
|
+
ai-sdlc run --continue
|
|
310
326
|
|
|
311
327
|
# Output:
|
|
312
328
|
# ⟳ Resuming workflow from checkpoint
|
|
@@ -328,13 +344,13 @@ Full SDLC mode respects configured stage gates:
|
|
|
328
344
|
|
|
329
345
|
```bash
|
|
330
346
|
# With requireApprovalBeforeImplementation enabled
|
|
331
|
-
|
|
347
|
+
ai-sdlc run --auto --story my-feature
|
|
332
348
|
|
|
333
349
|
# Output:
|
|
334
350
|
# ✓ Research complete
|
|
335
351
|
# ✓ Plan complete
|
|
336
352
|
# ⚠️ Stage gate: Implementation requires approval
|
|
337
|
-
# Run '
|
|
353
|
+
# Run 'ai-sdlc run --continue' to proceed after approval
|
|
338
354
|
```
|
|
339
355
|
|
|
340
356
|
### Review Retry Logic
|
|
@@ -359,10 +375,10 @@ The system tracks retry attempts and stops if max retries are exceeded.
|
|
|
359
375
|
|
|
360
376
|
```bash
|
|
361
377
|
# Add a new story
|
|
362
|
-
|
|
378
|
+
ai-sdlc add "Add user authentication"
|
|
363
379
|
|
|
364
380
|
# Run complete SDLC automation
|
|
365
|
-
|
|
381
|
+
ai-sdlc run --auto --story add-user-authentication
|
|
366
382
|
|
|
367
383
|
# Story progresses through all phases automatically:
|
|
368
384
|
# 1. Refine (backlog → ready)
|
|
@@ -386,12 +402,12 @@ agentic-sdlc run --auto --story add-user-authentication
|
|
|
386
402
|
**Cannot combine with --step:**
|
|
387
403
|
```bash
|
|
388
404
|
# This will error:
|
|
389
|
-
|
|
405
|
+
ai-sdlc run --auto --story my-feature --step research
|
|
390
406
|
|
|
391
407
|
# Error: Cannot combine --auto --story with --step flag.
|
|
392
408
|
# Use either:
|
|
393
|
-
# -
|
|
394
|
-
# -
|
|
409
|
+
# - ai-sdlc run --auto --story my-feature (full SDLC)
|
|
410
|
+
# - ai-sdlc run --story my-feature --step research (single phase)
|
|
395
411
|
```
|
|
396
412
|
|
|
397
413
|
**All phases are executed in sequence:**
|
|
@@ -411,6 +427,267 @@ agentic-sdlc run --auto --story my-feature --step research
|
|
|
411
427
|
- ❌ Running just one specific phase (use `--story --step` instead)
|
|
412
428
|
- ❌ Interactive workflows requiring manual review between phases
|
|
413
429
|
|
|
430
|
+
## TDD Mode (Test-Driven Development)
|
|
431
|
+
|
|
432
|
+
TDD mode enforces strict Test-Driven Development practices during implementation, ensuring code is developed using the Red-Green-Refactor cycle. This helps eliminate review failures caused by missing or improperly sequenced tests.
|
|
433
|
+
|
|
434
|
+
### Enabling TDD Mode
|
|
435
|
+
|
|
436
|
+
**Per-story** (recommended for gradual adoption):
|
|
437
|
+
|
|
438
|
+
Add `tdd_enabled: true` to your story's frontmatter:
|
|
439
|
+
|
|
440
|
+
```yaml
|
|
441
|
+
---
|
|
442
|
+
id: story-abc123
|
|
443
|
+
title: Add user authentication
|
|
444
|
+
status: ready
|
|
445
|
+
tdd_enabled: true
|
|
446
|
+
---
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
**Globally** (for all stories):
|
|
450
|
+
|
|
451
|
+
Add to your `.ai-sdlc.json` config:
|
|
452
|
+
|
|
453
|
+
```json
|
|
454
|
+
{
|
|
455
|
+
"tdd": {
|
|
456
|
+
"enabled": true
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
### How TDD Mode Works
|
|
462
|
+
|
|
463
|
+
When TDD is enabled, the implementation agent follows a strict Red-Green-Refactor cycle for each acceptance criterion:
|
|
464
|
+
|
|
465
|
+
```
|
|
466
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
467
|
+
│ TDD Cycle (per AC) │
|
|
468
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
469
|
+
│ 🔴 RED → Write failing test → Verify test FAILS │
|
|
470
|
+
│ 🟢 GREEN → Write minimum code → Verify test PASSES │
|
|
471
|
+
│ → → Verify NO regressions │
|
|
472
|
+
│ 🔵 REFACTOR → Improve code quality → Verify ALL tests pass │
|
|
473
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
**Cycle enforcement:**
|
|
477
|
+
1. **RED**: Agent writes a test for the next acceptance criterion, verifies it fails
|
|
478
|
+
2. **GREEN**: Agent writes minimum code to pass, verifies test passes and no regressions
|
|
479
|
+
3. **REFACTOR**: Agent improves code quality, verifies all tests still pass
|
|
480
|
+
4. **Record**: Cycle is recorded to story frontmatter and persisted
|
|
481
|
+
5. **Repeat**: Process continues until all acceptance criteria are covered
|
|
482
|
+
|
|
483
|
+
### TDD Validation in Review
|
|
484
|
+
|
|
485
|
+
When TDD is enabled, the review agent validates that:
|
|
486
|
+
- All TDD cycles have complete RED → GREEN → REFACTOR phases
|
|
487
|
+
- All tests remained green after each phase
|
|
488
|
+
- No cycles were skipped or incomplete
|
|
489
|
+
|
|
490
|
+
Violations generate critical review issues that must be addressed.
|
|
491
|
+
|
|
492
|
+
### TDD Configuration Options
|
|
493
|
+
|
|
494
|
+
```json
|
|
495
|
+
{
|
|
496
|
+
"tdd": {
|
|
497
|
+
"enabled": false,
|
|
498
|
+
"strictMode": true,
|
|
499
|
+
"maxCycles": 50,
|
|
500
|
+
"requireApprovalPerCycle": false
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
| Option | Default | Description |
|
|
506
|
+
|--------|---------|-------------|
|
|
507
|
+
| `enabled` | `false` | Enable TDD mode globally (can be overridden per-story) |
|
|
508
|
+
| `strictMode` | `true` | Reserved for future strict enforcement rules |
|
|
509
|
+
| `maxCycles` | `50` | Maximum TDD cycles before stopping (prevents infinite loops) |
|
|
510
|
+
| `requireApprovalPerCycle` | `false` | Reserved for future approval workflow |
|
|
511
|
+
|
|
512
|
+
### TDD Cycle History
|
|
513
|
+
|
|
514
|
+
TDD cycles are recorded in the story frontmatter for audit and debugging:
|
|
515
|
+
|
|
516
|
+
```yaml
|
|
517
|
+
tdd_test_history:
|
|
518
|
+
- test_name: "should authenticate valid user"
|
|
519
|
+
test_file: "src/auth/login.test.ts"
|
|
520
|
+
red_timestamp: "2024-01-15T10:00:00.000Z"
|
|
521
|
+
green_timestamp: "2024-01-15T10:05:00.000Z"
|
|
522
|
+
refactor_timestamp: "2024-01-15T10:08:00.000Z"
|
|
523
|
+
all_tests_green: true
|
|
524
|
+
cycle_number: 1
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
History is trimmed to the last 100 cycles to prevent unbounded growth.
|
|
528
|
+
|
|
529
|
+
### When to Use TDD Mode
|
|
530
|
+
|
|
531
|
+
**Ideal for:**
|
|
532
|
+
- ✅ New feature development where test coverage is critical
|
|
533
|
+
- ✅ Teams adopting TDD practices
|
|
534
|
+
- ✅ Stories with clear, testable acceptance criteria
|
|
535
|
+
- ✅ Reducing review failures from missing tests
|
|
536
|
+
|
|
537
|
+
**Consider standard mode for:**
|
|
538
|
+
- ❌ Quick fixes or hotfixes where speed is critical
|
|
539
|
+
- ❌ Refactoring tasks without new functionality
|
|
540
|
+
- ❌ Stories without clear testable criteria
|
|
541
|
+
|
|
542
|
+
## Daemon/Watch Mode (--watch)
|
|
543
|
+
|
|
544
|
+
The `--watch` flag runs AI-SDLC in daemon mode, continuously monitoring the backlog folder for new stories and automatically processing them through the full workflow pipeline.
|
|
545
|
+
|
|
546
|
+
### Quick Example
|
|
547
|
+
|
|
548
|
+
```bash
|
|
549
|
+
# Start daemon mode - runs indefinitely
|
|
550
|
+
ai-sdlc run --watch
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
### How It Works
|
|
554
|
+
|
|
555
|
+
When you run with `--watch`, the system:
|
|
556
|
+
|
|
557
|
+
1. **Starts a file system watcher** monitoring `.ai-sdlc/backlog/*.md`
|
|
558
|
+
2. **Detects new story files** in real-time using chokidar
|
|
559
|
+
3. **Automatically processes each story** through the workflow (refine → research → plan → implement → review)
|
|
560
|
+
4. **Queues multiple stories** for sequential processing (no parallel execution)
|
|
561
|
+
5. **Continues running** even if individual stories fail
|
|
562
|
+
6. **Logs all activity** to console for monitoring
|
|
563
|
+
|
|
564
|
+
### Usage
|
|
565
|
+
|
|
566
|
+
```bash
|
|
567
|
+
# Start daemon mode
|
|
568
|
+
ai-sdlc run --watch
|
|
569
|
+
|
|
570
|
+
# Output:
|
|
571
|
+
# 🤖 AI-SDLC Daemon Mode Started
|
|
572
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
573
|
+
# SDLC Root: /path/to/.ai-sdlc
|
|
574
|
+
# Watching: .ai-sdlc/backlog/*.md
|
|
575
|
+
# Polling Interval: 5000ms
|
|
576
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
577
|
+
#
|
|
578
|
+
# 👀 Watching for new stories...
|
|
579
|
+
# Press Ctrl+C to shutdown gracefully
|
|
580
|
+
#
|
|
581
|
+
# 📄 New story detected: my-feature.md
|
|
582
|
+
# ▶️ Starting workflow for: my-feature
|
|
583
|
+
# ✅ Workflow completed: my-feature
|
|
584
|
+
#
|
|
585
|
+
# 👀 Queue empty, waiting for new stories...
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
### Graceful Shutdown
|
|
589
|
+
|
|
590
|
+
The daemon supports graceful shutdown to ensure stories complete processing:
|
|
591
|
+
|
|
592
|
+
```bash
|
|
593
|
+
# Single Ctrl+C - graceful shutdown
|
|
594
|
+
Press Ctrl+C
|
|
595
|
+
|
|
596
|
+
# Output:
|
|
597
|
+
# 🛑 Shutting down gracefully...
|
|
598
|
+
# Waiting for current story to complete...
|
|
599
|
+
# Current story completed
|
|
600
|
+
# File watcher stopped
|
|
601
|
+
# ✨ Daemon shutdown complete
|
|
602
|
+
|
|
603
|
+
# Double Ctrl+C (within 2 seconds) - force quit
|
|
604
|
+
Press Ctrl+C (twice quickly)
|
|
605
|
+
|
|
606
|
+
# Output:
|
|
607
|
+
# ⚠️ Force quitting...
|
|
608
|
+
```
|
|
609
|
+
|
|
610
|
+
**Shutdown Behavior:**
|
|
611
|
+
- **First Ctrl+C**: Initiates graceful shutdown, waits for current story to complete (max 30 seconds)
|
|
612
|
+
- **Second Ctrl+C**: Forces immediate exit if pressed within 2 seconds
|
|
613
|
+
- **SIGTERM**: Also triggers graceful shutdown (useful for systemd/docker)
|
|
614
|
+
|
|
615
|
+
### Configuration
|
|
616
|
+
|
|
617
|
+
Daemon behavior can be customized in `.ai-sdlc.json`:
|
|
618
|
+
|
|
619
|
+
```json
|
|
620
|
+
{
|
|
621
|
+
"daemon": {
|
|
622
|
+
"enabled": false,
|
|
623
|
+
"pollingInterval": 5000,
|
|
624
|
+
"watchPatterns": [".ai-sdlc/backlog/*.md"],
|
|
625
|
+
"processDelay": 500,
|
|
626
|
+
"shutdownTimeout": 30000,
|
|
627
|
+
"enableEscShutdown": false,
|
|
628
|
+
"escTimeout": 500
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
```
|
|
632
|
+
|
|
633
|
+
**Configuration Options:**
|
|
634
|
+
- `enabled` - Enable daemon mode by default (default: `false`)
|
|
635
|
+
- `pollingInterval` - Fallback polling interval in milliseconds (default: `5000`)
|
|
636
|
+
- `watchPatterns` - Glob patterns to watch for new stories (default: `[".ai-sdlc/backlog/*.md"]`)
|
|
637
|
+
- `processDelay` - Debounce delay for file changes in milliseconds (default: `500`)
|
|
638
|
+
- `shutdownTimeout` - Maximum time to wait for graceful shutdown in milliseconds (default: `30000`)
|
|
639
|
+
- `enableEscShutdown` - Enable Esc+Esc shutdown (Phase 2 feature, default: `false`)
|
|
640
|
+
- `escTimeout` - Maximum time between Esc presses in milliseconds (default: `500`)
|
|
641
|
+
|
|
642
|
+
### Error Handling
|
|
643
|
+
|
|
644
|
+
The daemon is designed to be resilient:
|
|
645
|
+
|
|
646
|
+
- **Story processing failures** are logged but don't stop the daemon
|
|
647
|
+
- **Malformed story files** are skipped with error logging
|
|
648
|
+
- **API failures** are logged and the story is marked with an error
|
|
649
|
+
- **File system errors** are logged but the watcher continues
|
|
650
|
+
- **Duplicate processing** is prevented via story ID tracking
|
|
651
|
+
|
|
652
|
+
```bash
|
|
653
|
+
# Example error handling
|
|
654
|
+
📄 New story detected: malformed-story.md
|
|
655
|
+
▶️ Starting workflow for: malformed-story
|
|
656
|
+
❌ Workflow failed: malformed-story
|
|
657
|
+
|
|
658
|
+
⚠️ Error processing malformed-story.md
|
|
659
|
+
Invalid YAML frontmatter
|
|
660
|
+
Daemon continues running...
|
|
661
|
+
|
|
662
|
+
👀 Queue empty, waiting for new stories...
|
|
663
|
+
```
|
|
664
|
+
|
|
665
|
+
### Use Cases
|
|
666
|
+
|
|
667
|
+
**Ideal for:**
|
|
668
|
+
- ✅ Continuous integration environments
|
|
669
|
+
- ✅ Monitoring backlog folders for new work
|
|
670
|
+
- ✅ Unattended story processing
|
|
671
|
+
- ✅ Development workflows with frequent story additions
|
|
672
|
+
- ✅ Demo and testing scenarios
|
|
673
|
+
|
|
674
|
+
**Not ideal for:**
|
|
675
|
+
- ❌ Interactive development requiring manual approvals
|
|
676
|
+
- ❌ Stories requiring mid-workflow intervention
|
|
677
|
+
- ❌ Environments where resource usage must be minimal
|
|
678
|
+
|
|
679
|
+
### Limitations (MVP)
|
|
680
|
+
|
|
681
|
+
The current MVP implementation has these limitations:
|
|
682
|
+
|
|
683
|
+
- **No Esc+Esc shutdown** - Only Ctrl+C is supported for shutdown
|
|
684
|
+
- **No web dashboard** - All monitoring is via console output
|
|
685
|
+
- **No multi-daemon support** - Only one daemon instance per SDLC folder
|
|
686
|
+
- **No auto-restart** - Daemon must be restarted manually if it crashes
|
|
687
|
+
- **Sequential processing only** - Stories are processed one at a time
|
|
688
|
+
|
|
689
|
+
These features are planned for future releases.
|
|
690
|
+
|
|
414
691
|
## Resuming Workflows
|
|
415
692
|
|
|
416
693
|
The `--continue` flag enables resuming workflows after interruption. This is useful when:
|
|
@@ -422,7 +699,7 @@ The `--continue` flag enables resuming workflows after interruption. This is use
|
|
|
422
699
|
|
|
423
700
|
### How It Works
|
|
424
701
|
|
|
425
|
-
1. **Automatic Checkpointing**: After each successful action, the workflow state is saved to `.
|
|
702
|
+
1. **Automatic Checkpointing**: After each successful action, the workflow state is saved to `.ai-sdlc/.workflow-state.json`
|
|
426
703
|
2. **Smart Resume**: When you use `--continue`, the system:
|
|
427
704
|
- Loads the saved checkpoint
|
|
428
705
|
- Shows which actions were already completed
|
|
@@ -436,12 +713,12 @@ The `--continue` flag enables resuming workflows after interruption. This is use
|
|
|
436
713
|
|
|
437
714
|
```bash
|
|
438
715
|
# Start workflow
|
|
439
|
-
|
|
716
|
+
ai-sdlc run --auto
|
|
440
717
|
|
|
441
718
|
# (Interrupted by Ctrl+C after research completes)
|
|
442
719
|
|
|
443
720
|
# Resume from checkpoint
|
|
444
|
-
|
|
721
|
+
ai-sdlc run --continue
|
|
445
722
|
# Output:
|
|
446
723
|
# ⟳ Resuming workflow from checkpoint
|
|
447
724
|
# Workflow ID: workflow-1234567890-abc123
|
|
@@ -459,14 +736,14 @@ agentic-sdlc run --continue
|
|
|
459
736
|
|
|
460
737
|
```bash
|
|
461
738
|
# Resume and complete all remaining actions
|
|
462
|
-
|
|
739
|
+
ai-sdlc run --auto --continue
|
|
463
740
|
```
|
|
464
741
|
|
|
465
742
|
**Check for existing checkpoint:**
|
|
466
743
|
|
|
467
744
|
```bash
|
|
468
745
|
# Start a new workflow when checkpoint exists
|
|
469
|
-
|
|
746
|
+
ai-sdlc run
|
|
470
747
|
# Output:
|
|
471
748
|
# Note: Found previous checkpoint. Use --continue to resume.
|
|
472
749
|
```
|
|
@@ -505,7 +782,7 @@ Checkpoint cleared.
|
|
|
505
782
|
|
|
506
783
|
Checkpoint files are stored at:
|
|
507
784
|
```
|
|
508
|
-
.
|
|
785
|
+
.ai-sdlc/.workflow-state.json
|
|
509
786
|
```
|
|
510
787
|
|
|
511
788
|
**State file format:**
|
|
@@ -519,12 +796,12 @@ Checkpoint files are stored at:
|
|
|
519
796
|
{
|
|
520
797
|
"type": "research",
|
|
521
798
|
"storyId": "story-123",
|
|
522
|
-
"storyPath": ".
|
|
799
|
+
"storyPath": ".ai-sdlc/in-progress/add-dark-mode.md",
|
|
523
800
|
"completedAt": "2024-01-08T15:45:12.000Z"
|
|
524
801
|
}
|
|
525
802
|
],
|
|
526
803
|
"context": {
|
|
527
|
-
"sdlcRoot": ".
|
|
804
|
+
"sdlcRoot": ".ai-sdlc",
|
|
528
805
|
"options": {
|
|
529
806
|
"auto": true
|
|
530
807
|
},
|
|
@@ -549,7 +826,7 @@ Each story progresses through these stages:
|
|
|
549
826
|
|
|
550
827
|
## Story Status Flags
|
|
551
828
|
|
|
552
|
-
When viewing stories with `
|
|
829
|
+
When viewing stories with `ai-sdlc status`, you'll see progress flags:
|
|
553
830
|
|
|
554
831
|
- `R` - Research complete
|
|
555
832
|
- `P` - Plan complete
|
|
@@ -565,30 +842,50 @@ IN-PROGRESS (1)
|
|
|
565
842
|
|
|
566
843
|
## Configuration
|
|
567
844
|
|
|
568
|
-
Configuration is stored in `.
|
|
845
|
+
Configuration is stored in `.ai-sdlc.json` at the project root.
|
|
569
846
|
|
|
570
847
|
**Default configuration:**
|
|
571
848
|
```json
|
|
572
849
|
{
|
|
573
|
-
"sdlcFolder": ".
|
|
850
|
+
"sdlcFolder": ".ai-sdlc",
|
|
574
851
|
"stageGates": {
|
|
575
852
|
"requireApprovalBeforeImplementation": false,
|
|
576
853
|
"requireApprovalBeforePR": false,
|
|
577
854
|
"autoMergeOnApproval": false
|
|
578
855
|
},
|
|
856
|
+
"tdd": {
|
|
857
|
+
"enabled": false,
|
|
858
|
+
"strictMode": true,
|
|
859
|
+
"maxCycles": 50,
|
|
860
|
+
"requireApprovalPerCycle": false
|
|
861
|
+
},
|
|
579
862
|
"defaultLabels": [],
|
|
580
863
|
"theme": "auto",
|
|
581
864
|
"settingSources": []
|
|
582
865
|
}
|
|
583
866
|
```
|
|
584
867
|
|
|
868
|
+
**Configuration options:**
|
|
869
|
+
|
|
870
|
+
| Section | Option | Default | Description |
|
|
871
|
+
|---------|--------|---------|-------------|
|
|
872
|
+
| `sdlcFolder` | - | `.ai-sdlc` | Folder for story files |
|
|
873
|
+
| `stageGates` | `requireApprovalBeforeImplementation` | `false` | Pause before implementation |
|
|
874
|
+
| `stageGates` | `requireApprovalBeforePR` | `false` | Pause before PR creation |
|
|
875
|
+
| `stageGates` | `autoMergeOnApproval` | `false` | Auto-merge approved PRs |
|
|
876
|
+
| `tdd` | `enabled` | `false` | Enable TDD mode globally |
|
|
877
|
+
| `tdd` | `strictMode` | `true` | Reserved for future use |
|
|
878
|
+
| `tdd` | `maxCycles` | `50` | Max TDD cycles per story |
|
|
879
|
+
| `tdd` | `requireApprovalPerCycle` | `false` | Reserved for future use |
|
|
880
|
+
| `theme` | - | `auto` | Color theme (auto/light/dark/none) |
|
|
881
|
+
|
|
585
882
|
### Project Settings with CLAUDE.md
|
|
586
883
|
|
|
587
884
|
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
885
|
|
|
589
886
|
#### How to Enable
|
|
590
887
|
|
|
591
|
-
Add `"project"` to the `settingSources` array in your `.
|
|
888
|
+
Add `"project"` to the `settingSources` array in your `.ai-sdlc.json`:
|
|
592
889
|
|
|
593
890
|
```json
|
|
594
891
|
{
|
|
@@ -613,7 +910,7 @@ your-project/
|
|
|
613
910
|
│ ├── CLAUDE.md # Custom instructions (you create this)
|
|
614
911
|
│ ├── settings.json # Project settings (SDK managed)
|
|
615
912
|
│ └── settings.local.json # Local overrides (SDK managed, gitignored)
|
|
616
|
-
├── .
|
|
913
|
+
├── .ai-sdlc.json
|
|
617
914
|
└── ...
|
|
618
915
|
```
|
|
619
916
|
|
|
@@ -753,7 +1050,7 @@ Available themes:
|
|
|
753
1050
|
|
|
754
1051
|
```bash
|
|
755
1052
|
# Set theme
|
|
756
|
-
|
|
1053
|
+
ai-sdlc config theme dark
|
|
757
1054
|
```
|
|
758
1055
|
|
|
759
1056
|
## Authentication
|
|
@@ -773,7 +1070,7 @@ export ANTHROPIC_API_KEY=your-key-here
|
|
|
773
1070
|
## Folder Structure
|
|
774
1071
|
|
|
775
1072
|
```
|
|
776
|
-
.
|
|
1073
|
+
.ai-sdlc/
|
|
777
1074
|
├── backlog/ # New stories
|
|
778
1075
|
├── ready/ # Stories ready to start
|
|
779
1076
|
├── in-progress/ # Active stories
|
|
@@ -822,14 +1119,14 @@ npm test -- --watch
|
|
|
822
1119
|
If you encounter a corrupted checkpoint error:
|
|
823
1120
|
|
|
824
1121
|
```bash
|
|
825
|
-
Error: Corrupted workflow state file at .
|
|
826
|
-
Delete the file to start fresh: rm ".
|
|
1122
|
+
Error: Corrupted workflow state file at .ai-sdlc/.workflow-state.json.
|
|
1123
|
+
Delete the file to start fresh: rm ".ai-sdlc/.workflow-state.json"
|
|
827
1124
|
```
|
|
828
1125
|
|
|
829
1126
|
Solution:
|
|
830
1127
|
```bash
|
|
831
|
-
rm .
|
|
832
|
-
|
|
1128
|
+
rm .ai-sdlc/.workflow-state.json
|
|
1129
|
+
ai-sdlc run # Start fresh
|
|
833
1130
|
```
|
|
834
1131
|
|
|
835
1132
|
### Multiple Workflows
|
|
@@ -838,8 +1135,8 @@ Currently, only one workflow can run at a time. If you try to start a new workfl
|
|
|
838
1135
|
|
|
839
1136
|
To start fresh (ignoring the checkpoint):
|
|
840
1137
|
```bash
|
|
841
|
-
rm .
|
|
842
|
-
|
|
1138
|
+
rm .ai-sdlc/.workflow-state.json
|
|
1139
|
+
ai-sdlc run
|
|
843
1140
|
```
|
|
844
1141
|
|
|
845
1142
|
## License
|