ai-sdlc 0.2.0-alpha.6 → 0.2.0-beta.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.
- package/README.md +53 -1058
- package/dist/agents/implementation.d.ts +6 -0
- package/dist/agents/implementation.d.ts.map +1 -1
- package/dist/agents/implementation.js +87 -13
- package/dist/agents/implementation.js.map +1 -1
- package/dist/agents/planning.d.ts.map +1 -1
- package/dist/agents/planning.js +22 -3
- package/dist/agents/planning.js.map +1 -1
- package/dist/agents/refinement.d.ts.map +1 -1
- package/dist/agents/refinement.js +22 -3
- package/dist/agents/refinement.js.map +1 -1
- package/dist/agents/research.d.ts +85 -1
- package/dist/agents/research.d.ts.map +1 -1
- package/dist/agents/research.js +506 -16
- package/dist/agents/research.js.map +1 -1
- package/dist/agents/review.d.ts +67 -2
- package/dist/agents/review.d.ts.map +1 -1
- package/dist/agents/review.js +477 -68
- package/dist/agents/review.js.map +1 -1
- package/dist/agents/rework.d.ts.map +1 -1
- package/dist/agents/rework.js +22 -3
- package/dist/agents/rework.js.map +1 -1
- package/dist/agents/state-assessor.d.ts +3 -3
- package/dist/agents/state-assessor.d.ts.map +1 -1
- package/dist/agents/state-assessor.js +6 -6
- package/dist/agents/state-assessor.js.map +1 -1
- package/dist/agents/test-pattern-detector.d.ts +49 -0
- package/dist/agents/test-pattern-detector.d.ts.map +1 -0
- package/dist/agents/test-pattern-detector.js +273 -0
- package/dist/agents/test-pattern-detector.js.map +1 -0
- package/dist/agents/verification.d.ts +11 -0
- package/dist/agents/verification.d.ts.map +1 -1
- package/dist/agents/verification.js +74 -1
- package/dist/agents/verification.js.map +1 -1
- package/dist/cli/commands/migrate.js +1 -1
- package/dist/cli/commands/migrate.js.map +1 -1
- package/dist/cli/commands.d.ts +59 -3
- package/dist/cli/commands.d.ts.map +1 -1
- package/dist/cli/commands.js +1042 -204
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/daemon.d.ts.map +1 -1
- package/dist/cli/daemon.js +20 -3
- package/dist/cli/daemon.js.map +1 -1
- package/dist/cli/runner.d.ts.map +1 -1
- package/dist/cli/runner.js +18 -6
- package/dist/cli/runner.js.map +1 -1
- package/dist/core/auth.d.ts +43 -0
- package/dist/core/auth.d.ts.map +1 -1
- package/dist/core/auth.js +105 -1
- package/dist/core/auth.js.map +1 -1
- package/dist/core/client.d.ts +6 -0
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/client.js +57 -3
- package/dist/core/client.js.map +1 -1
- package/dist/core/config.d.ts +24 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +95 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/conflict-detector.d.ts +108 -0
- package/dist/core/conflict-detector.d.ts.map +1 -0
- package/dist/core/conflict-detector.js +413 -0
- package/dist/core/conflict-detector.js.map +1 -0
- package/dist/core/git-utils.d.ts +28 -0
- package/dist/core/git-utils.d.ts.map +1 -0
- package/dist/core/git-utils.js +146 -0
- package/dist/core/git-utils.js.map +1 -0
- package/dist/core/index.d.ts +17 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +17 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/kanban.d.ts +1 -1
- package/dist/core/kanban.d.ts.map +1 -1
- package/dist/core/kanban.js +3 -3
- package/dist/core/kanban.js.map +1 -1
- package/dist/core/logger.d.ts +92 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +221 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/story-logger.d.ts +102 -0
- package/dist/core/story-logger.d.ts.map +1 -0
- package/dist/core/story-logger.js +265 -0
- package/dist/core/story-logger.js.map +1 -0
- package/dist/core/story.d.ts +79 -20
- package/dist/core/story.d.ts.map +1 -1
- package/dist/core/story.js +221 -39
- package/dist/core/story.js.map +1 -1
- package/dist/core/workflow-state.d.ts +45 -6
- package/dist/core/workflow-state.d.ts.map +1 -1
- package/dist/core/workflow-state.js +201 -12
- package/dist/core/workflow-state.js.map +1 -1
- package/dist/core/worktree.d.ts +77 -0
- package/dist/core/worktree.d.ts.map +1 -0
- package/dist/core/worktree.js +246 -0
- package/dist/core/worktree.js.map +1 -0
- package/dist/index.js +135 -5
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +151 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -1,1144 +1,139 @@
|
|
|
1
1
|
# AI SDLC
|
|
2
2
|
|
|
3
|
-
> **Alpha Release**:
|
|
4
|
-
> Report issues at [GitHub Issues](https://github.com/patrob/agentic-workflow/issues)
|
|
3
|
+
> **Alpha Release**: Expect breaking changes. Report issues at [GitHub Issues](https://github.com/patrob/ai-sdlc/issues)
|
|
5
4
|
|
|
6
5
|
Agent-first SDLC workflow manager using Claude Agent SDK. A Kanban-style board with AI-powered workflow automation for software development stories.
|
|
7
6
|
|
|
8
7
|
## Features
|
|
9
8
|
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
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
|
|
9
|
+
- **Kanban-style story management** (Backlog → Ready → In Progress → Done)
|
|
10
|
+
- **AI-powered agents** for each workflow stage (refine, research, plan, implement, review)
|
|
11
|
+
- **Full SDLC automation** with `--auto --story` - takes a story from idea to reviewed code
|
|
12
|
+
- **TDD Mode** - Optional Test-Driven Development with Red-Green-Refactor cycles
|
|
13
|
+
- **Resume workflows** after interruption with `--continue`
|
|
14
|
+
- **Daemon mode** - Watch for and process new stories with `--watch`
|
|
19
15
|
|
|
20
16
|
## Installation
|
|
21
17
|
|
|
22
18
|
```bash
|
|
23
|
-
npm install
|
|
24
|
-
npm run build
|
|
19
|
+
npm install -g ai-sdlc
|
|
25
20
|
```
|
|
26
21
|
|
|
27
22
|
## Quick Start
|
|
28
23
|
|
|
29
24
|
```bash
|
|
30
|
-
#
|
|
25
|
+
# Initialize the project
|
|
31
26
|
ai-sdlc init
|
|
32
27
|
|
|
33
|
-
#
|
|
28
|
+
# Add a story to the backlog
|
|
34
29
|
ai-sdlc add "Implement user authentication"
|
|
35
30
|
|
|
36
|
-
#
|
|
31
|
+
# View your board
|
|
37
32
|
ai-sdlc status
|
|
38
33
|
|
|
39
|
-
#
|
|
34
|
+
# Run the full SDLC for a story
|
|
40
35
|
ai-sdlc run --auto --story implement-user-authentication
|
|
41
36
|
```
|
|
42
37
|
|
|
43
|
-
|
|
38
|
+
## Commands
|
|
44
39
|
|
|
45
40
|
| Command | Description |
|
|
46
41
|
|---------|-------------|
|
|
47
|
-
| `ai-sdlc
|
|
42
|
+
| `ai-sdlc init` | Initialize `.ai-sdlc` folder structure |
|
|
43
|
+
| `ai-sdlc status` | View stories in Kanban board |
|
|
48
44
|
| `ai-sdlc add "title"` | Add a new story to backlog |
|
|
49
45
|
| `ai-sdlc run` | Process next recommended action |
|
|
50
46
|
| `ai-sdlc run --auto` | Process all pending actions |
|
|
51
47
|
| `ai-sdlc run --auto --story <id>` | Full SDLC for one story |
|
|
48
|
+
| `ai-sdlc run --story <id> --step <phase>` | Run specific phase (refine/research/plan/implement/review) |
|
|
52
49
|
| `ai-sdlc run --continue` | Resume after interruption |
|
|
53
50
|
| `ai-sdlc run --watch` | Daemon mode - watch for new stories |
|
|
54
51
|
| `ai-sdlc details <id>` | Show story details |
|
|
55
|
-
| `ai-sdlc config` | View/set configuration |
|
|
56
|
-
|
|
57
|
-
## CLI Commands
|
|
58
|
-
|
|
59
|
-
### `init`
|
|
60
|
-
Initialize the `.ai-sdlc` folder structure with Kanban columns.
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
ai-sdlc init
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### `status`
|
|
67
|
-
View all stories in a formatted table view with story IDs, truncated text, and uniform alignment.
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
ai-sdlc status
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
**Table View** (terminal width ≥ 100 columns):
|
|
74
|
-
```
|
|
75
|
-
┌──────────────────────┬────────────────────────────────────────────┬──────────────┬────────────────────┬────────┐
|
|
76
|
-
│ Story ID │ Title │ Status │ Labels │ Flags │
|
|
77
|
-
├──────────────────────┼────────────────────────────────────────────┼──────────────┼────────────────────┼────────┤
|
|
78
|
-
│ story-mk68fjh7-fvbt │ Improve status output: add story ID... │ backlog │ enhancement, ui │ [R] │
|
|
79
|
-
│ story-mk6a2jk9-xyzf │ Add user authentication │ in-progress │ feature, security │ [RPI] │
|
|
80
|
-
│ story-mk6b3lm1-abcd │ Fix payment processing bug │ ready │ bug, critical │ [RP] │
|
|
81
|
-
└──────────────────────┴────────────────────────────────────────────┴──────────────┴────────────────────┴────────┘
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
**Compact View** (terminal width < 100 columns):
|
|
85
|
-
```
|
|
86
|
-
ID: story-mk68fjh7-fvbt | Status: backlog
|
|
87
|
-
Title: Improve status output: add story ID column...
|
|
88
|
-
Labels: enhancement, ui, cli | Flags: [R]
|
|
89
|
-
────────────────────────────────────────────────
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
**Features:**
|
|
93
|
-
- **Story ID Column**: Quickly identify stories by their unique ID
|
|
94
|
-
- **Smart Truncation**: Titles and labels are truncated for readability with "..." indicator
|
|
95
|
-
- **Responsive Design**: Automatically switches between table and compact view based on terminal width
|
|
96
|
-
- **Color Coding**: Status and flags are color-coded for quick visual scanning
|
|
97
|
-
- **Workflow Flags**:
|
|
98
|
-
- `[R]` - Research complete
|
|
99
|
-
- `[P]` - Plan complete
|
|
100
|
-
- `[I]` - Implementation complete
|
|
101
|
-
- `[V]` - Reviews complete
|
|
102
|
-
- `[!]` - Blocked
|
|
103
|
-
|
|
104
|
-
**Minimum Terminal Width**: 100 columns recommended for table view
|
|
105
|
-
|
|
106
|
-
**Disable Hints**: Set `AI_SDLC_NO_HINTS=1` to hide the compact view notification
|
|
107
|
-
|
|
108
|
-
### `add <title>`
|
|
109
|
-
Add a new story to the backlog.
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
ai-sdlc add "Add dark mode toggle"
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
### `details <id>` (alias: `d`)
|
|
116
|
-
Show detailed information about a specific story by ID or slug.
|
|
117
|
-
|
|
118
|
-
**Usage:**
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
# View by story ID
|
|
122
|
-
ai-sdlc details story-mk68fjh7-fvbt
|
|
123
|
-
|
|
124
|
-
# View by slug
|
|
125
|
-
ai-sdlc details add-dark-mode-toggle
|
|
126
|
-
|
|
127
|
-
# Use short alias
|
|
128
|
-
ai-sdlc d story-mk68fjh7-fvbt
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
**Displays:**
|
|
132
|
-
- All metadata (ID, slug, status, priority, type, effort, assignee, labels)
|
|
133
|
-
- Workflow status (research, planning, implementation, reviews)
|
|
134
|
-
- PR information (branch, URL)
|
|
135
|
-
- All content sections (summary, acceptance criteria, research, plan, review notes)
|
|
136
|
-
- Automatically hides empty sections
|
|
137
|
-
|
|
138
|
-
**Features:**
|
|
139
|
-
- Case-insensitive lookup
|
|
140
|
-
- Works with both story ID and slug
|
|
141
|
-
- Helpful error messages with suggestions
|
|
142
|
-
- Color-coded status indicators
|
|
143
|
-
- Formatted dates
|
|
144
|
-
|
|
145
|
-
### `run [options]`
|
|
146
|
-
Run the workflow and process actions.
|
|
147
|
-
|
|
148
|
-
**Options:**
|
|
149
|
-
- `--auto` - Process all pending actions automatically (combine with `--story` for full SDLC: refine → research → plan → implement → review)
|
|
150
|
-
- `--dry-run` - Show what would be executed without running
|
|
151
|
-
- `--continue` - Resume workflow from last checkpoint
|
|
152
|
-
- `--story <id-or-slug>` - Target a specific story by ID or slug
|
|
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!)
|
|
155
|
-
|
|
156
|
-
**Examples:**
|
|
157
|
-
|
|
158
|
-
```bash
|
|
159
|
-
# Process the next recommended action
|
|
160
|
-
ai-sdlc run
|
|
161
|
-
|
|
162
|
-
# Process all pending actions
|
|
163
|
-
ai-sdlc run --auto
|
|
164
|
-
|
|
165
|
-
# Resume after interruption (Ctrl+C, error, etc.)
|
|
166
|
-
ai-sdlc run --continue
|
|
167
|
-
|
|
168
|
-
# Preview what would be executed
|
|
169
|
-
ai-sdlc run --dry-run
|
|
170
|
-
|
|
171
|
-
# Run full SDLC for a specific story (NEW!)
|
|
172
|
-
ai-sdlc run --auto --story my-feature
|
|
173
|
-
|
|
174
|
-
# Run specific phase for a story
|
|
175
|
-
ai-sdlc run --story my-feature --step research
|
|
176
|
-
|
|
177
|
-
# Run in daemon/watch mode (NEW!)
|
|
178
|
-
ai-sdlc run --watch
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
### `config [key] [value]`
|
|
182
|
-
Manage configuration settings.
|
|
183
|
-
|
|
184
|
-
```bash
|
|
185
|
-
# View all configuration
|
|
186
|
-
ai-sdlc config
|
|
187
|
-
|
|
188
|
-
# View theme setting
|
|
189
|
-
ai-sdlc config theme
|
|
190
|
-
|
|
191
|
-
# Set theme
|
|
192
|
-
ai-sdlc config theme dark
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
## Full SDLC Automation (--auto --story)
|
|
196
|
-
|
|
197
|
-
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**.
|
|
198
|
-
|
|
199
|
-
### Quick Example
|
|
200
|
-
|
|
201
|
-
```bash
|
|
202
|
-
# Take a story from idea to reviewed implementation in one command
|
|
203
|
-
ai-sdlc run --auto --story my-feature
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
### How It Works
|
|
207
|
-
|
|
208
|
-
When you combine `--auto` with `--story`, the system:
|
|
209
|
-
|
|
210
|
-
1. **Identifies the target story** by ID or slug
|
|
211
|
-
2. **Assesses current state** to determine which phases are incomplete
|
|
212
|
-
3. **Generates complete phase sequence** (refine → research → plan → implement → review)
|
|
213
|
-
4. **Skips completed phases** automatically (idempotent - safe to re-run)
|
|
214
|
-
5. **Executes remaining phases** sequentially with progress tracking
|
|
215
|
-
6. **Saves checkpoints** after each phase for resume capability
|
|
216
|
-
7. **Stops on failure** with clear error messages
|
|
217
|
-
|
|
218
|
-
### Phase Progression
|
|
219
|
-
|
|
220
|
-
The full SDLC workflow follows this progression:
|
|
221
|
-
|
|
222
|
-
```
|
|
223
|
-
┌─────────┐ ┌──────────┐ ┌──────┐ ┌───────────┐ ┌────────┐
|
|
224
|
-
│ Refine │ -> │ Research │ -> │ Plan │ -> │ Implement │ -> │ Review │
|
|
225
|
-
└─────────┘ └──────────┘ └──────┘ └───────────┘ └────────┘
|
|
226
|
-
backlog ready ready in-progress in-progress
|
|
227
|
-
→ ready (flags) (flags) (flags) (done)
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
**Phase Details:**
|
|
231
|
-
|
|
232
|
-
1. **Refine** - Enhances story clarity and moves from backlog → ready
|
|
233
|
-
2. **Research** - Analyzes codebase and adds research findings
|
|
234
|
-
3. **Plan** - Creates implementation plan
|
|
235
|
-
4. **Implement** - Generates code changes
|
|
236
|
-
5. **Review** - Performs code, security, and product owner reviews
|
|
237
|
-
|
|
238
|
-
### Smart Phase Skipping
|
|
239
|
-
|
|
240
|
-
Already completed phases are automatically skipped:
|
|
241
|
-
|
|
242
|
-
```bash
|
|
243
|
-
# Story has research and plan complete
|
|
244
|
-
ai-sdlc run --auto --story my-feature
|
|
245
|
-
|
|
246
|
-
# Output:
|
|
247
|
-
# 🚀 Starting full SDLC for story: My Feature
|
|
248
|
-
# ID: story-abc123
|
|
249
|
-
# Status: ready
|
|
250
|
-
# Skipping completed phases: refine, research, plan
|
|
251
|
-
# Phases to execute: 2/5
|
|
252
|
-
#
|
|
253
|
-
# ═══ Phase 1/2: IMPLEMENT ═══
|
|
254
|
-
# ...
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
**Skipping Logic:**
|
|
258
|
-
- **Refine**: Skipped if story is not in backlog/
|
|
259
|
-
- **Research**: Skipped if `research_complete: true`
|
|
260
|
-
- **Plan**: Skipped if `plan_complete: true`
|
|
261
|
-
- **Implement**: Skipped if `implementation_complete: true`
|
|
262
|
-
- **Review**: Skipped if `reviews_complete: true`
|
|
263
|
-
|
|
264
|
-
### Progress Tracking
|
|
265
|
-
|
|
266
|
-
Clear progress indicators show current phase:
|
|
267
|
-
|
|
268
|
-
```bash
|
|
269
|
-
🚀 Starting full SDLC for story: Add dark mode toggle
|
|
270
|
-
ID: story-mk68fjh7-fvbt
|
|
271
|
-
Status: backlog
|
|
272
|
-
Phases to execute: 5/5
|
|
273
|
-
|
|
274
|
-
═══ Phase 1/5: REFINE ═══
|
|
275
|
-
✓ Refine "add-dark-mode-toggle"
|
|
276
|
-
→ Story enhanced with acceptance criteria
|
|
277
|
-
→ Moved to ready/
|
|
278
|
-
✓ Progress saved (1 actions completed)
|
|
279
|
-
|
|
280
|
-
═══ Phase 2/5: RESEARCH ═══
|
|
281
|
-
✓ Research "add-dark-mode-toggle"
|
|
282
|
-
→ Research findings added
|
|
283
|
-
✓ Progress saved (2 actions completed)
|
|
284
|
-
|
|
285
|
-
═══ Phase 3/5: PLAN ═══
|
|
286
|
-
...
|
|
287
|
-
|
|
288
|
-
═══════════════════════════════════════════════════
|
|
289
|
-
✓ Full SDLC completed successfully!
|
|
290
|
-
═══════════════════════════════════════════════════
|
|
291
|
-
Completed phases: 5/5
|
|
292
|
-
Story is now ready for PR creation.
|
|
293
|
-
Checkpoint cleared.
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
### Error Handling
|
|
297
|
-
|
|
298
|
-
If any phase fails, the workflow stops immediately:
|
|
299
|
-
|
|
300
|
-
```bash
|
|
301
|
-
═══ Phase 3/5: PLAN ═══
|
|
302
|
-
✗ Phase plan failed
|
|
303
|
-
|
|
304
|
-
✗ Phase plan failed
|
|
305
|
-
Completed 2 of 5 phases
|
|
306
|
-
Fix the error above and use --continue to resume.
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
**Recovery:**
|
|
310
|
-
1. Fix the underlying issue
|
|
311
|
-
2. Resume with: `ai-sdlc run --continue`
|
|
312
|
-
3. Workflow continues from failed phase
|
|
313
|
-
|
|
314
|
-
### Resuming Full SDLC Workflows
|
|
315
|
-
|
|
316
|
-
Full SDLC mode integrates seamlessly with checkpoint/resume:
|
|
317
|
-
|
|
318
|
-
```bash
|
|
319
|
-
# Start full SDLC workflow
|
|
320
|
-
ai-sdlc run --auto --story my-feature
|
|
321
|
-
|
|
322
|
-
# (Interrupted during implementation phase)
|
|
323
|
-
|
|
324
|
-
# Resume automatically - full SDLC mode is restored
|
|
325
|
-
ai-sdlc run --continue
|
|
326
|
-
|
|
327
|
-
# Output:
|
|
328
|
-
# ⟳ Resuming workflow from checkpoint
|
|
329
|
-
# Mode: Full SDLC (story: my-feature)
|
|
330
|
-
# Completed actions: 3
|
|
331
|
-
#
|
|
332
|
-
# ⊘ Skipping completed actions:
|
|
333
|
-
# ✓ Refine "my-feature"
|
|
334
|
-
# ✓ Research "my-feature"
|
|
335
|
-
# ✓ Plan "my-feature"
|
|
336
|
-
#
|
|
337
|
-
# ═══ Phase 4/5: IMPLEMENT ═══
|
|
338
|
-
# ...
|
|
339
|
-
```
|
|
340
|
-
|
|
341
|
-
### Stage Gates
|
|
342
|
-
|
|
343
|
-
Full SDLC mode respects configured stage gates:
|
|
344
|
-
|
|
345
|
-
```bash
|
|
346
|
-
# With requireApprovalBeforeImplementation enabled
|
|
347
|
-
ai-sdlc run --auto --story my-feature
|
|
348
|
-
|
|
349
|
-
# Output:
|
|
350
|
-
# ✓ Research complete
|
|
351
|
-
# ✓ Plan complete
|
|
352
|
-
# ⚠️ Stage gate: Implementation requires approval
|
|
353
|
-
# Run 'ai-sdlc run --continue' to proceed after approval
|
|
354
|
-
```
|
|
355
|
-
|
|
356
|
-
### Review Retry Logic
|
|
357
|
-
|
|
358
|
-
If review fails, the system automatically triggers the retry cycle:
|
|
359
|
-
|
|
360
|
-
```bash
|
|
361
|
-
═══ Phase 5/5: REVIEW ═══
|
|
362
|
-
✓ Review "my-feature"
|
|
363
|
-
→ Review decision: REJECTED
|
|
364
|
-
|
|
365
|
-
🔄 Review rejected. Restarting RPIV cycle (attempt 1/3)
|
|
366
|
-
Reason: Code review identified security concerns...
|
|
367
|
-
|
|
368
|
-
═══ Phase 3/5: PLAN ═══
|
|
369
|
-
# Workflow continues through plan → implement → review again
|
|
370
|
-
```
|
|
371
|
-
|
|
372
|
-
The system tracks retry attempts and stops if max retries are exceeded.
|
|
373
|
-
|
|
374
|
-
### Complete Example
|
|
375
|
-
|
|
376
|
-
```bash
|
|
377
|
-
# Add a new story
|
|
378
|
-
ai-sdlc add "Add user authentication"
|
|
379
|
-
|
|
380
|
-
# Run complete SDLC automation
|
|
381
|
-
ai-sdlc run --auto --story add-user-authentication
|
|
382
|
-
|
|
383
|
-
# Story progresses through all phases automatically:
|
|
384
|
-
# 1. Refine (backlog → ready)
|
|
385
|
-
# 2. Research (analyze codebase)
|
|
386
|
-
# 3. Plan (create implementation plan)
|
|
387
|
-
# 4. Implement (generate code)
|
|
388
|
-
# 5. Review (validate quality)
|
|
389
|
-
|
|
390
|
-
# Result: Story ready for PR creation in one command!
|
|
391
|
-
```
|
|
392
|
-
|
|
393
|
-
### Differences from Standard --auto
|
|
394
|
-
|
|
395
|
-
| Mode | Behavior |
|
|
396
|
-
|------|----------|
|
|
397
|
-
| `--auto` | Processes all recommended actions across all stories based on priority |
|
|
398
|
-
| `--auto --story` | Executes complete SDLC (5 phases) for one specific story only |
|
|
399
|
-
|
|
400
|
-
### Limitations
|
|
401
|
-
|
|
402
|
-
**Cannot combine with --step:**
|
|
403
|
-
```bash
|
|
404
|
-
# This will error:
|
|
405
|
-
ai-sdlc run --auto --story my-feature --step research
|
|
406
|
-
|
|
407
|
-
# Error: Cannot combine --auto --story with --step flag.
|
|
408
|
-
# Use either:
|
|
409
|
-
# - ai-sdlc run --auto --story my-feature (full SDLC)
|
|
410
|
-
# - ai-sdlc run --story my-feature --step research (single phase)
|
|
411
|
-
```
|
|
412
|
-
|
|
413
|
-
**All phases are executed in sequence:**
|
|
414
|
-
- You cannot skip phases in full SDLC mode
|
|
415
|
-
- To run a specific phase only, use `--story --step` instead
|
|
416
|
-
|
|
417
|
-
### Use Cases
|
|
418
|
-
|
|
419
|
-
**Perfect for:**
|
|
420
|
-
- ✅ Taking a single story from idea to implementation
|
|
421
|
-
- ✅ Fully automating individual features
|
|
422
|
-
- ✅ Batch processing during off-hours
|
|
423
|
-
- ✅ Demo workflows and testing
|
|
424
|
-
|
|
425
|
-
**Not ideal for:**
|
|
426
|
-
- ❌ Processing multiple stories at different phases (use `--auto` instead)
|
|
427
|
-
- ❌ Running just one specific phase (use `--story --step` instead)
|
|
428
|
-
- ❌ Interactive workflows requiring manual review between phases
|
|
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
|
|
52
|
+
| `ai-sdlc config [key] [value]` | View/set configuration |
|
|
569
53
|
|
|
570
|
-
|
|
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
|
-
|
|
691
|
-
## Resuming Workflows
|
|
692
|
-
|
|
693
|
-
The `--continue` flag enables resuming workflows after interruption. This is useful when:
|
|
694
|
-
|
|
695
|
-
- A workflow was interrupted by Ctrl+C
|
|
696
|
-
- An action failed and you fixed the issue
|
|
697
|
-
- Your system crashed or lost connection
|
|
698
|
-
- You want to continue from where you left off
|
|
699
|
-
|
|
700
|
-
### How It Works
|
|
701
|
-
|
|
702
|
-
1. **Automatic Checkpointing**: After each successful action, the workflow state is saved to `.ai-sdlc/.workflow-state.json`
|
|
703
|
-
2. **Smart Resume**: When you use `--continue`, the system:
|
|
704
|
-
- Loads the saved checkpoint
|
|
705
|
-
- Shows which actions were already completed
|
|
706
|
-
- Skips completed actions
|
|
707
|
-
- Continues with remaining pending actions
|
|
708
|
-
3. **Automatic Cleanup**: When all actions complete, the checkpoint is automatically cleared
|
|
709
|
-
|
|
710
|
-
### Resume Examples
|
|
711
|
-
|
|
712
|
-
**Basic interruption and resume:**
|
|
713
|
-
|
|
714
|
-
```bash
|
|
715
|
-
# Start workflow
|
|
716
|
-
ai-sdlc run --auto
|
|
717
|
-
|
|
718
|
-
# (Interrupted by Ctrl+C after research completes)
|
|
719
|
-
|
|
720
|
-
# Resume from checkpoint
|
|
721
|
-
ai-sdlc run --continue
|
|
722
|
-
# Output:
|
|
723
|
-
# ⟳ Resuming workflow from checkpoint
|
|
724
|
-
# Workflow ID: workflow-1234567890-abc123
|
|
725
|
-
# Checkpoint: 1/8/2024, 3:45:12 PM
|
|
726
|
-
# Completed actions: 1
|
|
727
|
-
#
|
|
728
|
-
# ⊘ Skipping completed actions:
|
|
729
|
-
# ✓ Research "add-dark-mode"
|
|
730
|
-
#
|
|
731
|
-
# Planning "add-dark-mode"...
|
|
732
|
-
# ✓ Progress saved (2 actions completed)
|
|
733
|
-
```
|
|
734
|
-
|
|
735
|
-
**Resume with --auto flag:**
|
|
54
|
+
## Workflow Phases
|
|
736
55
|
|
|
737
|
-
|
|
738
|
-
# Resume and complete all remaining actions
|
|
739
|
-
ai-sdlc run --auto --continue
|
|
740
|
-
```
|
|
741
|
-
|
|
742
|
-
**Check for existing checkpoint:**
|
|
743
|
-
|
|
744
|
-
```bash
|
|
745
|
-
# Start a new workflow when checkpoint exists
|
|
746
|
-
ai-sdlc run
|
|
747
|
-
# Output:
|
|
748
|
-
# Note: Found previous checkpoint. Use --continue to resume.
|
|
749
|
-
```
|
|
56
|
+
Stories progress through these phases:
|
|
750
57
|
|
|
751
|
-
### Edge Cases & Warnings
|
|
752
|
-
|
|
753
|
-
The resume feature handles several edge cases:
|
|
754
|
-
|
|
755
|
-
**Story content changed:**
|
|
756
|
-
```bash
|
|
757
|
-
⟳ Resuming workflow from checkpoint
|
|
758
|
-
⚠ Warning: Story content changed since interruption
|
|
759
|
-
Proceeding with current state...
|
|
760
|
-
```
|
|
761
|
-
|
|
762
|
-
**Stale checkpoint (>48 hours old):**
|
|
763
|
-
```bash
|
|
764
|
-
⟳ Resuming workflow from checkpoint
|
|
765
|
-
⚠ Warning: Checkpoint is more than 48 hours old
|
|
766
|
-
Context may be stale. Consider starting fresh.
|
|
767
58
|
```
|
|
768
|
-
|
|
769
|
-
**No checkpoint found:**
|
|
770
|
-
```bash
|
|
771
|
-
Error: No checkpoint found.
|
|
772
|
-
Remove --continue flag to start a new workflow.
|
|
773
|
-
```
|
|
774
|
-
|
|
775
|
-
**All actions already completed:**
|
|
776
|
-
```bash
|
|
777
|
-
All actions from checkpoint already completed!
|
|
778
|
-
Checkpoint cleared.
|
|
779
|
-
```
|
|
780
|
-
|
|
781
|
-
### Checkpoint Files
|
|
782
|
-
|
|
783
|
-
Checkpoint files are stored at:
|
|
784
|
-
```
|
|
785
|
-
.ai-sdlc/.workflow-state.json
|
|
786
|
-
```
|
|
787
|
-
|
|
788
|
-
**State file format:**
|
|
789
|
-
```json
|
|
790
|
-
{
|
|
791
|
-
"version": "1.0",
|
|
792
|
-
"workflowId": "workflow-1234567890-abc123",
|
|
793
|
-
"timestamp": "2024-01-08T15:45:12.000Z",
|
|
794
|
-
"currentAction": null,
|
|
795
|
-
"completedActions": [
|
|
796
|
-
{
|
|
797
|
-
"type": "research",
|
|
798
|
-
"storyId": "story-123",
|
|
799
|
-
"storyPath": ".ai-sdlc/in-progress/add-dark-mode.md",
|
|
800
|
-
"completedAt": "2024-01-08T15:45:12.000Z"
|
|
801
|
-
}
|
|
802
|
-
],
|
|
803
|
-
"context": {
|
|
804
|
-
"sdlcRoot": ".ai-sdlc",
|
|
805
|
-
"options": {
|
|
806
|
-
"auto": true
|
|
807
|
-
},
|
|
808
|
-
"storyContentHash": "abc123..."
|
|
809
|
-
}
|
|
810
|
-
}
|
|
59
|
+
Refine → Research → Plan → Implement → Review → Create PR → Done
|
|
811
60
|
```
|
|
812
61
|
|
|
813
|
-
**
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
1. **Refine** - AI agent enhances the story description
|
|
820
|
-
2. **Research** - AI agent researches implementation approach
|
|
821
|
-
3. **Plan** - AI agent creates detailed implementation plan
|
|
822
|
-
4. **Implement** - AI agent implements the feature
|
|
823
|
-
5. **Review** - AI agent reviews the implementation
|
|
824
|
-
6. **Create PR** - Create pull request for review
|
|
825
|
-
7. **Move to Done** - Mark story as complete
|
|
826
|
-
|
|
827
|
-
## Story Status Flags
|
|
828
|
-
|
|
829
|
-
When viewing stories with `ai-sdlc status`, you'll see progress flags:
|
|
830
|
-
|
|
831
|
-
- `R` - Research complete
|
|
832
|
-
- `P` - Plan complete
|
|
833
|
-
- `I` - Implementation complete
|
|
834
|
-
- `V` - Reviews complete
|
|
835
|
-
- `!` - Error occurred
|
|
836
|
-
|
|
837
|
-
Example:
|
|
838
|
-
```
|
|
839
|
-
IN-PROGRESS (1)
|
|
840
|
-
[1] add-dark-mode - Add dark mode toggle [RP]
|
|
841
|
-
```
|
|
62
|
+
**Status flags** shown in `ai-sdlc status`:
|
|
63
|
+
- `[R]` Research complete
|
|
64
|
+
- `[P]` Plan complete
|
|
65
|
+
- `[I]` Implementation complete
|
|
66
|
+
- `[V]` Reviews complete
|
|
67
|
+
- `[!]` Blocked
|
|
842
68
|
|
|
843
69
|
## Configuration
|
|
844
70
|
|
|
845
|
-
|
|
71
|
+
Settings in `.ai-sdlc.json`:
|
|
846
72
|
|
|
847
|
-
**Default configuration:**
|
|
848
73
|
```json
|
|
849
74
|
{
|
|
850
75
|
"sdlcFolder": ".ai-sdlc",
|
|
851
76
|
"stageGates": {
|
|
852
77
|
"requireApprovalBeforeImplementation": false,
|
|
853
|
-
"requireApprovalBeforePR": false
|
|
854
|
-
"autoMergeOnApproval": false
|
|
78
|
+
"requireApprovalBeforePR": false
|
|
855
79
|
},
|
|
856
80
|
"tdd": {
|
|
857
|
-
"enabled": false
|
|
858
|
-
"strictMode": true,
|
|
859
|
-
"maxCycles": 50,
|
|
860
|
-
"requireApprovalPerCycle": false
|
|
81
|
+
"enabled": false
|
|
861
82
|
},
|
|
862
|
-
"
|
|
863
|
-
"theme": "auto",
|
|
864
|
-
"settingSources": []
|
|
865
|
-
}
|
|
866
|
-
```
|
|
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
|
-
|
|
882
|
-
### Project Settings with CLAUDE.md
|
|
883
|
-
|
|
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.
|
|
885
|
-
|
|
886
|
-
#### How to Enable
|
|
887
|
-
|
|
888
|
-
Add `"project"` to the `settingSources` array in your `.ai-sdlc.json`:
|
|
889
|
-
|
|
890
|
-
```json
|
|
891
|
-
{
|
|
892
|
-
"settingSources": ["project"]
|
|
83
|
+
"theme": "auto"
|
|
893
84
|
}
|
|
894
85
|
```
|
|
895
86
|
|
|
896
|
-
**
|
|
897
|
-
- `"user"` - Global user settings from `~/.claude/settings.json`
|
|
898
|
-
- `"project"` - Project settings from `.claude/settings.json` and `CLAUDE.md`
|
|
899
|
-
- `"local"` - Local settings from `.claude/settings.local.json`
|
|
87
|
+
**TDD Mode**: Enable per-story with `tdd_enabled: true` in frontmatter, or globally via config.
|
|
900
88
|
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
#### Directory Structure
|
|
904
|
-
|
|
905
|
-
Create a `.claude/` directory in your project root:
|
|
906
|
-
|
|
907
|
-
```
|
|
908
|
-
your-project/
|
|
909
|
-
├── .claude/
|
|
910
|
-
│ ├── CLAUDE.md # Custom instructions (you create this)
|
|
911
|
-
│ ├── settings.json # Project settings (SDK managed)
|
|
912
|
-
│ └── settings.local.json # Local overrides (SDK managed, gitignored)
|
|
913
|
-
├── .ai-sdlc.json
|
|
914
|
-
└── ...
|
|
915
|
-
```
|
|
916
|
-
|
|
917
|
-
#### Creating CLAUDE.md
|
|
918
|
-
|
|
919
|
-
Create `.claude/CLAUDE.md` with your custom instructions:
|
|
920
|
-
|
|
921
|
-
```markdown
|
|
922
|
-
# Project-Specific Instructions
|
|
923
|
-
|
|
924
|
-
You are working on a React TypeScript project that follows these conventions:
|
|
925
|
-
|
|
926
|
-
## Code Style
|
|
927
|
-
- Use functional components with hooks
|
|
928
|
-
- Prefer named exports over default exports
|
|
929
|
-
- Use absolute imports with `@/` prefix
|
|
930
|
-
|
|
931
|
-
## Testing
|
|
932
|
-
- Write unit tests for all business logic
|
|
933
|
-
- Use React Testing Library for component tests
|
|
934
|
-
- Aim for 80%+ code coverage
|
|
935
|
-
|
|
936
|
-
## Documentation
|
|
937
|
-
- Add JSDoc comments for all exported functions
|
|
938
|
-
- Update README.md when adding new features
|
|
939
|
-
```
|
|
940
|
-
|
|
941
|
-
#### Priority Order
|
|
942
|
-
|
|
943
|
-
When multiple sources are configured, settings are applied in this order:
|
|
944
|
-
|
|
945
|
-
1. **Explicit configuration** (highest priority) - systemPrompt passed directly to the Agent SDK
|
|
946
|
-
2. **Local settings** - `.claude/settings.local.json`
|
|
947
|
-
3. **Project settings** - `.claude/settings.json` and `CLAUDE.md`
|
|
948
|
-
4. **User settings** (lowest priority) - `~/.claude/settings.json`
|
|
949
|
-
|
|
950
|
-
**Note:** Explicit `systemPrompt` configuration in your code always takes precedence over any settings files.
|
|
951
|
-
|
|
952
|
-
#### Debug Logging
|
|
953
|
-
|
|
954
|
-
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:
|
|
955
|
-
|
|
956
|
-
```bash
|
|
957
|
-
Debug: Found CLAUDE.md in project settings
|
|
958
|
-
```
|
|
89
|
+
## Authentication
|
|
959
90
|
|
|
960
|
-
|
|
91
|
+
Set your API key:
|
|
961
92
|
|
|
962
93
|
```bash
|
|
963
|
-
|
|
964
|
-
```
|
|
965
|
-
|
|
966
|
-
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.
|
|
967
|
-
|
|
968
|
-
**Note:** Debug logging is always enabled when `'project'` is in settingSources. To suppress output, redirect stderr or set your terminal's logging level.
|
|
969
|
-
|
|
970
|
-
#### Use Cases
|
|
971
|
-
|
|
972
|
-
**Team Collaboration:**
|
|
973
|
-
```json
|
|
974
|
-
{
|
|
975
|
-
"settingSources": ["project"]
|
|
976
|
-
}
|
|
977
|
-
```
|
|
978
|
-
All team members share the same custom instructions from `.claude/CLAUDE.md`.
|
|
979
|
-
|
|
980
|
-
**Personal + Team Settings:**
|
|
981
|
-
```json
|
|
982
|
-
{
|
|
983
|
-
"settingSources": ["user", "project"]
|
|
984
|
-
}
|
|
985
|
-
```
|
|
986
|
-
Use your personal preferences plus project-specific instructions.
|
|
987
|
-
|
|
988
|
-
**Local Development Overrides:**
|
|
989
|
-
```json
|
|
990
|
-
{
|
|
991
|
-
"settingSources": ["project", "local"]
|
|
992
|
-
}
|
|
94
|
+
export ANTHROPIC_API_KEY=your-key-here
|
|
993
95
|
```
|
|
994
|
-
Project defaults with local overrides (`.claude/settings.local.json` is gitignored).
|
|
995
|
-
|
|
996
|
-
#### Security Considerations
|
|
997
|
-
|
|
998
|
-
The implementation includes several security measures to protect against malicious CLAUDE.md files:
|
|
999
|
-
|
|
1000
|
-
**Path Validation:**
|
|
1001
|
-
- Working directories are validated to prevent path traversal attacks
|
|
1002
|
-
- Paths outside the project boundaries are rejected
|
|
1003
|
-
|
|
1004
|
-
**Symlink Protection:**
|
|
1005
|
-
- Symlinks are resolved and validated to ensure they point within the project directory
|
|
1006
|
-
- Symlinks pointing to system files or outside the project are rejected with a warning
|
|
1007
96
|
|
|
1008
|
-
|
|
1009
|
-
- Files larger than 1MB trigger a warning (recommended maximum for performance)
|
|
1010
|
-
- Files larger than 10MB are rejected completely
|
|
1011
|
-
- Size warnings help prevent denial-of-service through memory exhaustion
|
|
1012
|
-
|
|
1013
|
-
**Content Validation:**
|
|
1014
|
-
- Basic validation checks for unexpected control characters in CLAUDE.md
|
|
1015
|
-
- Warnings are logged for suspicious content patterns
|
|
1016
|
-
|
|
1017
|
-
**Configuration Security:**
|
|
1018
|
-
- Input validation prevents prototype pollution attacks
|
|
1019
|
-
- Invalid `settingSources` values are filtered with warnings
|
|
1020
|
-
- Environment variables are validated with bounds checking
|
|
1021
|
-
|
|
1022
|
-
**Troubleshooting:**
|
|
1023
|
-
|
|
1024
|
-
If you encounter issues:
|
|
1025
|
-
|
|
1026
|
-
```bash
|
|
1027
|
-
# Permission errors
|
|
1028
|
-
chmod 644 .claude/CLAUDE.md
|
|
1029
|
-
|
|
1030
|
-
# Symlink rejected
|
|
1031
|
-
# Ensure symlink target is within your project directory
|
|
1032
|
-
ls -la .claude/CLAUDE.md
|
|
97
|
+
Get an API key at: https://console.anthropic.com/
|
|
1033
98
|
|
|
1034
|
-
|
|
1035
|
-
# Consider reducing CLAUDE.md size or splitting instructions
|
|
1036
|
-
du -h .claude/CLAUDE.md
|
|
1037
|
-
```
|
|
99
|
+
## Releasing
|
|
1038
100
|
|
|
1039
|
-
|
|
101
|
+
Releases are automated via GitHub Actions using [npm trusted publishing](https://docs.npmjs.com/trusted-publishers/) (OIDC - no tokens required).
|
|
1040
102
|
|
|
1041
|
-
|
|
103
|
+
| Release Type | How to Trigger | npm Tag |
|
|
104
|
+
|--------------|----------------|---------|
|
|
105
|
+
| **Alpha** | Automatic on push to `main` | `@alpha` |
|
|
106
|
+
| **Stable** | Push a git tag (`v1.2.3`) | `@latest` |
|
|
1042
107
|
|
|
1043
|
-
|
|
108
|
+
**Alpha releases** happen automatically when you push to `main`. The version is auto-incremented based on the latest alpha on npm.
|
|
1044
109
|
|
|
1045
|
-
|
|
1046
|
-
- `auto` - Automatically detect based on terminal capabilities
|
|
1047
|
-
- `light` - Light theme with colors
|
|
1048
|
-
- `dark` - Dark theme with colors
|
|
1049
|
-
- `none` - No colors (plain text)
|
|
110
|
+
**Stable releases** are triggered by pushing a semver git tag:
|
|
1050
111
|
|
|
1051
112
|
```bash
|
|
1052
|
-
#
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
## Authentication
|
|
113
|
+
# Patch release (bug fixes)
|
|
114
|
+
git tag v0.2.1
|
|
115
|
+
git push origin v0.2.1
|
|
1057
116
|
|
|
1058
|
-
|
|
117
|
+
# Minor release (new features)
|
|
118
|
+
git tag v0.3.0
|
|
119
|
+
git push origin v0.3.0
|
|
1059
120
|
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
Get an API key at: https://console.anthropic.com/
|
|
1064
|
-
|
|
1065
|
-
```bash
|
|
1066
|
-
# Set via environment variable
|
|
1067
|
-
export ANTHROPIC_API_KEY=your-key-here
|
|
121
|
+
# Major release (breaking changes)
|
|
122
|
+
git tag v1.0.0
|
|
123
|
+
git push origin v1.0.0
|
|
1068
124
|
```
|
|
1069
125
|
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
```
|
|
1073
|
-
.ai-sdlc/
|
|
1074
|
-
├── backlog/ # New stories
|
|
1075
|
-
├── ready/ # Stories ready to start
|
|
1076
|
-
├── in-progress/ # Active stories
|
|
1077
|
-
├── done/ # Completed stories
|
|
1078
|
-
└── .workflow-state.json # Checkpoint file (auto-created, gitignored)
|
|
1079
|
-
```
|
|
126
|
+
Stable releases automatically create a GitHub Release with generated notes.
|
|
1080
127
|
|
|
1081
128
|
## Development
|
|
1082
129
|
|
|
1083
130
|
```bash
|
|
1084
|
-
# Install dependencies
|
|
1085
131
|
npm install
|
|
1086
|
-
|
|
1087
|
-
# Run in development mode
|
|
1088
|
-
npm run dev
|
|
1089
|
-
|
|
1090
|
-
# Build
|
|
1091
132
|
npm run build
|
|
1092
|
-
|
|
1093
|
-
# Run tests
|
|
1094
133
|
npm test
|
|
1095
|
-
|
|
1096
|
-
# Type check
|
|
1097
134
|
npm run lint
|
|
1098
135
|
```
|
|
1099
136
|
|
|
1100
|
-
## Testing
|
|
1101
|
-
|
|
1102
|
-
The project includes comprehensive tests for the workflow state persistence layer:
|
|
1103
|
-
|
|
1104
|
-
```bash
|
|
1105
|
-
# Run all tests
|
|
1106
|
-
npm test
|
|
1107
|
-
|
|
1108
|
-
# Run specific test file
|
|
1109
|
-
npm test workflow-state.test.ts
|
|
1110
|
-
|
|
1111
|
-
# Run tests in watch mode
|
|
1112
|
-
npm test -- --watch
|
|
1113
|
-
```
|
|
1114
|
-
|
|
1115
|
-
## Troubleshooting
|
|
1116
|
-
|
|
1117
|
-
### Corrupted Checkpoint
|
|
1118
|
-
|
|
1119
|
-
If you encounter a corrupted checkpoint error:
|
|
1120
|
-
|
|
1121
|
-
```bash
|
|
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"
|
|
1124
|
-
```
|
|
1125
|
-
|
|
1126
|
-
Solution:
|
|
1127
|
-
```bash
|
|
1128
|
-
rm .ai-sdlc/.workflow-state.json
|
|
1129
|
-
ai-sdlc run # Start fresh
|
|
1130
|
-
```
|
|
1131
|
-
|
|
1132
|
-
### Multiple Workflows
|
|
1133
|
-
|
|
1134
|
-
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`.
|
|
1135
|
-
|
|
1136
|
-
To start fresh (ignoring the checkpoint):
|
|
1137
|
-
```bash
|
|
1138
|
-
rm .ai-sdlc/.workflow-state.json
|
|
1139
|
-
ai-sdlc run
|
|
1140
|
-
```
|
|
1141
|
-
|
|
1142
137
|
## License
|
|
1143
138
|
|
|
1144
139
|
MIT
|