ai-workflow-init 6.6.1 → 7.1.0

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.
@@ -3,153 +3,44 @@
3
3
  Note: All content in this document must be written in English.
4
4
 
5
5
  ---
6
- beads_epic: {bd-xxx or null}
7
6
  requirement: {docs/ai/requirements/req-xxx.md or null}
8
7
  ---
9
8
 
10
9
  ## 1. Overview
11
10
 
12
- ### Problem Statement
13
- [Brief description of the problem this epic solves]
14
-
15
- ### Goals
16
- - [Primary goal]
17
- - [Secondary goal]
18
-
19
- ### Success Metrics
20
- - [How we measure success]
11
+ [1-3 sentences: what this epic delivers and why it needs to be broken into multiple feature plans]
21
12
 
22
13
  ---
23
14
 
24
- ## 2. Architecture
25
-
26
- > **Note**: High-level architecture overview. Detailed implementation goes in task-level plans.
27
-
28
- ### System Diagram
29
- ```
30
- ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
31
- │ Component │────▶│ Component │────▶│ Component │
32
- └─────────────┘ └─────────────┘ └─────────────┘
33
- ```
15
+ ## 2. Feature Plans
34
16
 
35
- ### Key Components
36
- | Component | Responsibility | Location |
37
- |-----------|----------------|----------|
38
- | {Name} | {What it does} | {path/to/} |
17
+ | # | Feature Plan | Priority | Status | Description |
18
+ |---|-------------|----------|--------|-------------|
19
+ | 1 | [feature-{name}-part1.md](feature-{name}-part1.md) | P{0-4} | open | {Brief description} |
20
+ | 2 | [feature-{name}-part2.md](feature-{name}-part2.md) | P{0-4} | open | {Brief description} |
39
21
 
40
- ### Technology Decisions
41
- | Decision | Choice | Rationale |
42
- |----------|--------|-----------|
43
- | {Area} | {Technology} | {Why this choice} |
22
+ **Status values:** `open` | `in_progress` | `completed`
44
23
 
45
24
  ---
46
25
 
47
- ## 3. Task Breakdown
26
+ ## 3. Dependency Graph
48
27
 
49
- > **Note**: If using Beads, this table syncs with Beads via `bd` commands. If not using Beads, manage tasks manually.
50
-
51
- | # | Task | Priority | Status | Blocked By | Plan Doc |
52
- |---|------|----------|--------|------------|----------|
53
- | 1 | {Task title} | P{0-4} | {open/in_progress/closed} | {dependencies or -} | {feature-xxx.md or -} |
54
- | 2 | {Task title} | P{0-4} | {status} | Task 1 | {-} |
55
-
56
- <!-- If using Beads, replace # with Task ID (e.g., bd-xxx.1) -->
57
-
58
- ### Dependency Graph
59
28
  ```
60
- Task 1 ──────────────────────┐
61
-
62
- Task 3 ───▶ Task 2 ───▶ Task 4
29
+ Feature 1 ──────────────────┐
30
+
31
+ Feature 3 ───▶ Feature 2 ───▶ Feature 4
63
32
  ```
64
33
 
65
- <!-- If using Beads, replace Task # with bd-xxx.# -->
66
-
67
- ---
68
-
69
- ## 4. Data Flow
70
-
71
- ### Primary Flow: {Flow Name}
72
- 1. [Step 1]: {description}
73
- 2. [Step 2]: {description}
74
- 3. [Step 3]: {description}
75
-
76
- ### Alternative Flow: {Flow Name} (Optional)
77
- 1. [Step 1]: {description}
78
-
79
- ### Error Handling
80
- - {Error case}: {How it's handled}
81
-
82
- ---
83
-
84
- ## 5. API Contracts (Optional)
85
-
86
- > **Note**: Include if epic involves API changes. Keep high-level; details in task plans.
87
-
88
- ### Endpoints Overview
89
- | Method | Endpoint | Description |
90
- |--------|----------|-------------|
91
- | POST | /api/v1/{resource} | {What it does} |
92
- | GET | /api/v1/{resource}/:id | {What it does} |
93
-
94
- ### Key Data Models
95
- ```
96
- {ModelName}:
97
- - field1: type
98
- - field2: type
99
- ```
100
-
101
- ---
102
-
103
- ## 6. Key Decisions & Trade-offs
104
-
105
- | Decision | Options Considered | Choice | Trade-off |
106
- |----------|-------------------|--------|-----------|
107
- | {Decision area} | {Option A, Option B} | {Chosen} | {What we gain/lose} |
108
-
109
- ---
110
-
111
- ## 7. Risks & Mitigations
112
-
113
- | Risk | Impact | Probability | Mitigation |
114
- |------|--------|-------------|------------|
115
- | {Risk description} | High/Medium/Low | High/Medium/Low | {How to mitigate} |
116
-
117
- ---
118
-
119
- ## 8. Dependencies
120
-
121
- ### External
122
- - {External service/API}: {What we need from it}
123
-
124
- ### Internal
125
- - {Internal service/team}: {What we need from it}
126
-
127
- ### Blockers
128
- - [ ] {Blocker that must be resolved before starting}
129
-
130
- ---
131
-
132
- ## 9. Milestones (Optional)
133
-
134
- > **Note**: Focus on task groupings and sequence, not time estimates.
135
-
136
- | Milestone | Tasks | Description |
137
- |-----------|-------|-------------|
138
- | {Milestone 1} | Task 1, Task 2 | {What this milestone delivers} |
139
- | {Milestone 2} | Task 3, Task 4 | {What this milestone delivers} |
140
-
141
34
  ---
142
35
 
143
- ## 10. References
36
+ ## 4. Related Documents
144
37
 
145
- - **Requirement Doc**: [req-{name}.md](../requirements/req-{name}.md)
146
- - **Related Epics**: {links to related epic plans}
147
- - **External Docs**: {links to external resources}
38
+ - **Requirement**: [req-{name}.md](../requirements/req-{name}.md)
148
39
 
149
40
  ---
150
41
 
151
42
  ## Changelog
152
43
 
153
- | Date | Author | Change |
154
- |------|--------|--------|
155
- | {YYYY-MM-DD} | {name} | Initial epic plan created |
44
+ | Date | Change |
45
+ |------|--------|
46
+ | {YYYY-MM-DD} | Epic created |
@@ -3,27 +3,18 @@
3
3
  Note: All content in this document must be written in English.
4
4
 
5
5
  ---
6
- beads_task: {bd-xxx.n or null}
7
- beads_epic: {bd-xxx or null}
8
- epic_plan: {docs/ai/planning/epic-xxx.md or null}
6
+ epic_plan: null
7
+ requirement: null
9
8
  ---
10
9
 
11
- ## 0. Beads Context (Optional)
10
+ ## 0. Related Documents (Optional — remove if no linked docs)
12
11
 
13
- > **Note**: This section is auto-generated when plan is created via `/beads-next` → `/create-plan` workflow. Delete if not using Beads.
12
+ | Type | Document |
13
+ |------|----------|
14
+ | Requirement | [req-{name}.md](../requirements/req-{name}.md) |
15
+ | Epic | [epic-{name}.md](epic-{name}.md) |
14
16
 
15
- - **Epic**: {epic-id} "{Epic Title}"
16
- - **Task**: {task-id} "{Task Title}"
17
- - **Epic Plan**: [epic-{name}.md](epic-{name}.md)
18
- - **Status**: in_progress
19
- - **Blocked by**: {list or "none"}
20
- - **Blocks**: {list of dependent tasks or "none"}
21
-
22
- ---
23
-
24
- ## 0. Requirements Reference (Optional)
25
-
26
- - **Requirement Doc**: [req-{feature-name}.md](../requirements/req-{feature-name}.md)
17
+ > **Note**: Remove this entire section if no requirement or epic is linked. This section is added by `/manage-epic` or `/create-plan` when context is provided.
27
18
 
28
19
  ---
29
20
 
@@ -277,30 +268,75 @@ epic_plan: {docs/ai/planning/epic-xxx.md or null}
277
268
 
278
269
  - [ ] [ACTION] path/to/file — Summary of change
279
270
  ```
280
- Pseudo-code:
281
- - Step 1: describe what will be done
282
- - Step 2: validation or key logic
283
- - Step 3: output or return value
271
+ Function: functionName(param1: type, param2: type) OR Endpoint: METHOD /path
272
+
273
+ Input validation:
274
+ - param1: [validation rules, constraints, format]
275
+ - param2: [validation rules, constraints, format]
276
+
277
+ Logic flow:
278
+ 1. [Step with specific values/thresholds]
279
+ 2. [Branching: if X then Y, else Z]
280
+ 3. [External calls: DB queries, API calls with params]
281
+ 4. [Data transformations with format]
282
+
283
+ Return: { field1: type, field2: type } | Error(code, message)
284
+
285
+ Edge cases:
286
+ - [Scenario] → [Handler/Response]
287
+ - [Error case] → [HTTP status + message OR error handling]
288
+
289
+ Dependencies: [Other functions/modules/APIs called]
284
290
  ```
285
291
 
286
292
  - [ ] [ACTION] path/to/file — Summary of change
287
293
  ```
288
- Pseudo-code:
289
- - ...
294
+ Function: ...
295
+
296
+ Input validation:
297
+ - ...
298
+
299
+ Logic flow:
300
+ 1. ...
301
+
302
+ Return: ...
303
+
304
+ Edge cases:
305
+ - ...
306
+
307
+ Dependencies: ...
290
308
  ```
291
309
 
292
310
  ### Phase 2: [Phase Name]
293
311
 
294
312
  - [ ] [ACTION] path/to/file — Summary of change
295
313
  ```
296
- Pseudo-code:
297
- - ...
314
+ Function: ...
315
+
316
+ Input validation:
317
+ - ...
318
+
319
+ Logic flow:
320
+ 1. ...
321
+
322
+ Return: ...
323
+
324
+ Edge cases:
325
+ - ...
326
+
327
+ Dependencies: ...
298
328
  ```
299
329
 
300
330
  Notes:
301
331
  - ACTION must be one of: ADDED | MODIFIED | DELETED | RENAMED
302
332
  - For MODIFIED files, use sub-bullets for each distinct logic change and include line ranges
303
- - Pseudo-code shows logic structure and key steps, not actual implementation code
333
+ - Pseudo-code format uses structured sections for clarity:
334
+ - **Function/Endpoint**: Signature or route definition
335
+ - **Input validation**: All validation rules, data types, constraints
336
+ - **Logic flow**: Step-by-step with specific values, branches, external calls
337
+ - **Return**: Success response structure + error formats
338
+ - **Edge cases**: Error scenarios with handlers (HTTP status, messages, fallbacks)
339
+ - **Dependencies**: External modules, APIs, database tables
304
340
  - Each phase groups related tasks; phases execute sequentially
305
341
  - Use only one phase for small features (≤ 5 tasks); use multiple phases for larger features
306
342
 
@@ -240,4 +240,5 @@ See: [UI/UX Design Document](agents/uiux-{name}.md)
240
240
 
241
241
  1. [ ] Review this requirement document
242
242
  2. [ ] Address open questions
243
- 3. [ ] Run `/create-plan` to generate implementation plan
243
+ 3. [ ] Run `/create-plan` to generate implementation plan (small feature)
244
+ 4. [ ] Run `/manage-epic` to break into feature plans (large feature)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-workflow-init",
3
- "version": "6.6.1",
3
+ "version": "7.1.0",
4
4
  "description": "Initialize AI workflow docs & commands into any repo with one command",
5
5
  "bin": {
6
6
  "ai-workflow-init": "./cli.js"
@@ -1,278 +0,0 @@
1
- ---
2
- name: beads-breakdown
3
- description: Analyzes feature/requirement and breaks down into Beads epic with tasks and dependencies.
4
- ---
5
-
6
- ## Goal
7
-
8
- Analyze a feature description (user prompt, requirement file, or planning file) and break it down into a Beads epic with tasks and dependencies. Confirm with user before executing any `bd` commands.
9
-
10
- ## Workflow Alignment
11
-
12
- - Provide brief status updates (1–3 sentences) before/after important actions.
13
- - ALWAYS confirm breakdown with user before executing `bd` commands.
14
- - Show exact commands that will be executed for transparency.
15
-
16
- ---
17
-
18
- ## Step 1: Detect Input Source
19
-
20
- **Parse user input to identify source type:**
21
-
22
- 1. **File reference detected** (starts with `@` or file path):
23
- - Requirement file: `@docs/ai/requirements/req-{name}.md`
24
- - Planning file: `@docs/ai/planning/feature-{name}.md`
25
- - Read file and extract content
26
-
27
- 2. **User prompt only**:
28
- - Use prompt directly for analysis
29
-
30
- 3. **Both file + prompt**:
31
- - File provides base requirements
32
- - Prompt provides additional context/focus
33
-
34
- **Tool:** Read(file_path=...) if file reference detected
35
-
36
- **Extract from file (if requirement doc):**
37
- - Problem Statement → Epic description
38
- - Functional Requirements (FR-xx) → Tasks
39
- - Non-Functional Requirements → Constraints/notes
40
- - Dependencies/Constraints → Task dependencies
41
- - Acceptance Criteria → Task acceptance criteria
42
-
43
- **Extract from file (if planning doc):**
44
- - Goal → Epic description
45
- - Implementation phases → Tasks
46
- - Phase dependencies → Task dependencies
47
-
48
- ---
49
-
50
- ## Step 2: Analyze and Generate Breakdown
51
-
52
- **Generate epic structure:**
53
-
54
- 1. **Epic title**: Concise name for the feature (e.g., "User Authentication System")
55
-
56
- 2. **Tasks**: Break down into 3-10 tasks
57
- - Each task should be independently plannable (1-3 phases when detailed)
58
- - Task title: Action-oriented (e.g., "Setup JWT infrastructure")
59
- - Priority: P0 (critical) to P4 (backlog)
60
-
61
- 3. **Dependencies**: Identify blocking relationships
62
- - Which tasks must complete before others can start?
63
- - Which tasks can run in parallel?
64
-
65
- **Analysis guidelines:**
66
- - **Too granular**: If task takes < 1 hour → merge with related task
67
- - **Too large**: If task needs > 5 implementation phases → split further
68
- - **Parallel-friendly**: Maximize tasks that can run simultaneously
69
-
70
- ---
71
-
72
- ## Step 3: Present Breakdown for Confirmation
73
-
74
- **Display proposed breakdown:**
75
-
76
- ```
77
- ## Proposed Epic Breakdown
78
-
79
- **Epic**: {Epic Title}
80
- **Source**: {file path or "user prompt"}
81
- **Description**: {1-2 sentence summary}
82
-
83
- ### Tasks
84
-
85
- | # | Title | Priority | Blocked By | Notes |
86
- |---|-------|----------|------------|-------|
87
- | 1 | {Task title} | P{0-4} | - | {brief note} |
88
- | 2 | {Task title} | P{0-4} | Task 1 | {brief note} |
89
- | 3 | {Task title} | P{0-4} | - | {can parallel with 1} |
90
- | 4 | {Task title} | P{0-4} | Task 2 | {brief note} |
91
-
92
- ### Dependency Graph
93
-
94
- ```
95
- Task 1 ──────────────────────┐
96
-
97
- Task 3 ───▶ Task 2 ───▶ Task 4
98
- ```
99
-
100
- ### Ready to Start (can run in parallel)
101
- - Task 1: {title}
102
- - Task 3: {title}
103
-
104
- ---
105
-
106
- ### Commands to Execute
107
-
108
- ```bash
109
- # Create Epic
110
- bd create "{Epic Title}" -p 0 --type epic
111
-
112
- # Create Tasks (after epic created, will use actual epic ID)
113
- bd create "{Task 1 title}" -p {priority} --parent {epic-id}
114
- bd create "{Task 2 title}" -p {priority} --parent {epic-id}
115
- bd create "{Task 3 title}" -p {priority} --parent {epic-id}
116
- bd create "{Task 4 title}" -p {priority} --parent {epic-id}
117
-
118
- # Set Dependencies
119
- bd dep add {task-2-id} {task-1-id} # Task 2 blocked by Task 1
120
- bd dep add {task-4-id} {task-2-id} # Task 4 blocked by Task 2
121
-
122
- # Sync to git
123
- bd sync
124
- ```
125
- ```
126
-
127
- **Ask for confirmation:**
128
-
129
- ```
130
- AskUserQuestion(questions=[{
131
- question: "Review the breakdown above. How would you like to proceed?",
132
- header: "Confirm",
133
- options: [
134
- { label: "Execute breakdown", description: "Create epic and tasks in Beads with the structure shown above" },
135
- { label: "Modify tasks", description: "I want to add, remove, or change tasks before creating" },
136
- { label: "Cancel", description: "Don't create anything, I'll provide more context" }
137
- ],
138
- multiSelect: false
139
- }])
140
- ```
141
-
142
- ---
143
-
144
- ## Step 4: Handle User Response
145
-
146
- ### If "Execute breakdown":
147
-
148
- Execute `bd` commands sequentially:
149
-
150
- ```bash
151
- # 1. Create Epic
152
- bd create "{Epic Title}" -p 0 --type epic
153
- # Capture epic ID from output (e.g., bd-auth)
154
-
155
- # 2. Create Tasks (use actual epic ID)
156
- bd create "{Task 1}" -p {priority} --parent {epic-id}
157
- # Capture task ID (e.g., bd-auth.1)
158
-
159
- bd create "{Task 2}" -p {priority} --parent {epic-id}
160
- # Capture task ID (e.g., bd-auth.2)
161
-
162
- # ... repeat for all tasks
163
-
164
- # 3. Set Dependencies (use actual task IDs)
165
- bd dep add {task-2-id} {task-1-id}
166
- # ... repeat for all dependencies
167
-
168
- # 4. Sync
169
- bd sync
170
- ```
171
-
172
- **Output summary:**
173
-
174
- ```
175
- ✓ Created Epic: {epic-id} "{Epic Title}"
176
-
177
- Tasks created:
178
- ├── {task-1-id} "{Task 1}" [ready]
179
- ├── {task-2-id} "{Task 2}" [blocked by {task-1-id}]
180
- ├── {task-3-id} "{Task 3}" [ready]
181
- └── {task-4-id} "{Task 4}" [blocked by {task-2-id}]
182
-
183
- Ready to start (parallel): {task-1-id}, {task-3-id}
184
-
185
- Next steps:
186
- 1. Run `/beads-create-epic-plan` to create high-level epic plan
187
- 2. Run `/beads-next` to claim a task and start working
188
- ```
189
-
190
- ### If "Modify tasks":
191
-
192
- Ask follow-up:
193
-
194
- ```
195
- AskUserQuestion(questions=[{
196
- question: "What would you like to modify?",
197
- header: "Modify",
198
- options: [
199
- { label: "Add tasks", description: "Add more tasks to the breakdown" },
200
- { label: "Remove tasks", description: "Remove some tasks" },
201
- { label: "Change dependencies", description: "Modify blocking relationships" },
202
- { label: "Change priorities", description: "Adjust task priorities" }
203
- ],
204
- multiSelect: true
205
- }])
206
- ```
207
-
208
- Collect modifications and return to Step 3 with updated breakdown.
209
-
210
- ### If "Cancel":
211
-
212
- ```
213
- Breakdown cancelled.
214
-
215
- To try again with more context:
216
- /beads-breakdown "more detailed description"
217
- /beads-breakdown @docs/ai/requirements/req-{name}.md
218
- ```
219
-
220
- ---
221
-
222
- ## Step 5: Store Context for Next Commands
223
-
224
- After successful creation, store context for `/beads-create-epic-plan`:
225
-
226
- **File:** `.beads/current-epic.json`
227
-
228
- ```json
229
- {
230
- "epic_id": "{epic-id}",
231
- "epic_title": "{Epic Title}",
232
- "source_file": "{file path or null}",
233
- "tasks": [
234
- {
235
- "id": "{task-1-id}",
236
- "title": "{Task 1}",
237
- "priority": 1,
238
- "blocked_by": [],
239
- "status": "open"
240
- },
241
- {
242
- "id": "{task-2-id}",
243
- "title": "{Task 2}",
244
- "priority": 1,
245
- "blocked_by": ["{task-1-id}"],
246
- "status": "open"
247
- }
248
- ],
249
- "created_at": "{ISO timestamp}"
250
- }
251
- ```
252
-
253
- ---
254
-
255
- ## Notes
256
-
257
- - **Confirmation required**: Never execute `bd` commands without user confirmation
258
- - **Idempotent**: Safe to re-run; will show current state if epic exists
259
- - **Source tracking**: Links back to requirement/planning doc if provided
260
- - **Parallel-friendly**: Breakdown should maximize parallel execution opportunities
261
-
262
- ### Task Sizing Guidelines
263
-
264
- | Size | Description | When to use |
265
- |------|-------------|-------------|
266
- | Too small | < 1 hour, single function | Merge with related task |
267
- | Good | 2-8 hours, 1-3 phases | Ideal task size |
268
- | Too large | > 2 days, > 5 phases | Split into subtasks |
269
-
270
- ### Priority Guidelines
271
-
272
- | Priority | Meaning | Use for |
273
- |----------|---------|---------|
274
- | P0 | Critical | Blockers, urgent fixes |
275
- | P1 | High | Core functionality |
276
- | P2 | Medium | Important but not blocking |
277
- | P3 | Low | Nice to have |
278
- | P4 | Backlog | Future consideration |