ai-workflow-init 6.4.2 → 6.6.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.
Files changed (29) hide show
  1. package/.claude/agents/requirement-ba.md +203 -0
  2. package/.claude/agents/requirement-researcher.md +270 -0
  3. package/.claude/agents/requirement-sa.md +259 -0
  4. package/.claude/agents/requirement-uiux.md +349 -0
  5. package/.claude/commands/beads-breakdown.md +278 -0
  6. package/.claude/commands/beads-create-epic-plan.md +205 -0
  7. package/.claude/commands/beads-done.md +248 -0
  8. package/.claude/commands/beads-next.md +260 -0
  9. package/.claude/commands/beads-status.md +247 -0
  10. package/.claude/commands/clarify-requirements.md +445 -192
  11. package/.claude/commands/create-plan.md +79 -2
  12. package/.claude/commands/execute-plan.md +48 -2
  13. package/.claude/settings.json +3 -3
  14. package/.claude/skills/skill-creator/SKILL.md +355 -0
  15. package/.claude/skills/skill-creator/references/output-patterns.md +82 -0
  16. package/.claude/skills/skill-creator/references/workflows.md +28 -0
  17. package/.claude/skills/skill-creator/scripts/init_skill.py +303 -0
  18. package/.claude/skills/skill-creator/scripts/package_skill.py +110 -0
  19. package/.claude/skills/skill-creator/scripts/quick_validate.py +95 -0
  20. package/README.md +97 -3
  21. package/cli.js +21 -1
  22. package/docs/ai/planning/epic-template.md +155 -0
  23. package/docs/ai/planning/feature-template.md +19 -0
  24. package/docs/ai/requirements/req-template.md +164 -58
  25. package/docs/ai/requirements/templates/ba-template.md +151 -0
  26. package/docs/ai/requirements/templates/research-template.md +190 -0
  27. package/docs/ai/requirements/templates/sa-template.md +184 -0
  28. package/docs/ai/requirements/templates/uiux-template.md +325 -0
  29. package/package.json +1 -1
@@ -0,0 +1,248 @@
1
+ ---
2
+ name: beads-done
3
+ description: Closes current task, syncs to git, clears context, and shows next ready tasks.
4
+ ---
5
+
6
+ ## Goal
7
+
8
+ Mark the current Beads task as complete, sync changes to git, clear the task context, and show what tasks are now ready (including any that were unblocked).
9
+
10
+ ## Workflow Alignment
11
+
12
+ - Provide brief status updates (1–3 sentences) before/after important actions.
13
+ - Confirm before closing if there are uncommitted changes.
14
+ - Always sync to git after closing.
15
+
16
+ ---
17
+
18
+ ## Step 1: Load Current Task Context
19
+
20
+ **Read:** `.beads/current-task.json`
21
+
22
+ If exists:
23
+ - Extract task_id, task_title, epic_id
24
+ - Proceed to Step 2
25
+
26
+ If not exists:
27
+ - Ask user which task to close
28
+
29
+ ```
30
+ AskUserQuestion(questions=[{
31
+ question: "No active task context found. Which task would you like to close?",
32
+ header: "Close Task",
33
+ options: [
34
+ { label: "Enter task ID", description: "e.g., bd-auth.1" },
35
+ { label: "Show in-progress tasks", description: "List tasks I'm working on" },
36
+ { label: "Cancel", description: "Don't close anything" }
37
+ ],
38
+ multiSelect: false
39
+ }])
40
+ ```
41
+
42
+ If "Show in-progress tasks":
43
+ - Run: `bd list --status=in_progress`
44
+ - Display list and ask user to select
45
+
46
+ ---
47
+
48
+ ## Step 2: Pre-Close Checks
49
+
50
+ ### 2a: Check Git Status
51
+
52
+ **Run:** `git status --porcelain`
53
+
54
+ If uncommitted changes exist:
55
+
56
+ ```
57
+ ⚠️ Uncommitted changes detected:
58
+
59
+ {list of modified/added files}
60
+
61
+ These changes should be committed before closing the task.
62
+ ```
63
+
64
+ ```
65
+ AskUserQuestion(questions=[{
66
+ question: "You have uncommitted changes. How would you like to proceed?",
67
+ header: "Git Status",
68
+ options: [
69
+ { label: "Commit changes first", description: "I'll commit, then run /beads-done again" },
70
+ { label: "Close anyway", description: "Close task without committing (changes will remain staged)" },
71
+ { label: "Cancel", description: "Don't close the task yet" }
72
+ ],
73
+ multiSelect: false
74
+ }])
75
+ ```
76
+
77
+ If "Commit changes first": Exit and let user commit.
78
+ If "Cancel": Exit without closing.
79
+ If "Close anyway": Proceed to Step 3.
80
+
81
+ ### 2b: Check Planning Doc Status
82
+
83
+ **Read task details:** `bd show {task-id} --json`
84
+
85
+ Check if plan doc exists (from notes or known path).
86
+
87
+ If plan doc exists:
88
+ - Read planning doc
89
+ - Check if all phases are complete (all `[x]` checkboxes)
90
+ - If incomplete phases exist, warn user:
91
+
92
+ ```
93
+ ⚠️ Planning doc has incomplete tasks:
94
+
95
+ Phase 2: API Implementation
96
+ - [ ] Task 3: Incomplete
97
+ - [ ] Task 4: Incomplete
98
+
99
+ Are you sure you want to close this task?
100
+ ```
101
+
102
+ ```
103
+ AskUserQuestion(questions=[{
104
+ question: "Planning doc has incomplete tasks. Close anyway?",
105
+ header: "Incomplete",
106
+ options: [
107
+ { label: "Close anyway", description: "Mark task as complete despite incomplete plan items" },
108
+ { label: "Cancel", description: "Keep task open and finish the work" }
109
+ ],
110
+ multiSelect: false
111
+ }])
112
+ ```
113
+
114
+ ---
115
+
116
+ ## Step 3: Close Task
117
+
118
+ ### 3a: Ask for Close Reason (optional)
119
+
120
+ ```
121
+ AskUserQuestion(questions=[{
122
+ question: "Add a closing note? (optional)",
123
+ header: "Close Note",
124
+ options: [
125
+ { label: "Completed successfully", description: "Task finished as planned" },
126
+ { label: "Completed with modifications", description: "Finished but deviated from original plan" },
127
+ { label: "Custom note", description: "Enter a custom closing note" },
128
+ { label: "No note", description: "Close without a note" }
129
+ ],
130
+ multiSelect: false
131
+ }])
132
+ ```
133
+
134
+ ### 3b: Execute Close
135
+
136
+ **Run:** `bd close {task-id} --reason "{close reason}"`
137
+
138
+ Capture output for confirmation.
139
+
140
+ ---
141
+
142
+ ## Step 4: Update Epic Plan (if exists)
143
+
144
+ **Read:** `.beads/current-epic.json`
145
+
146
+ If epic_plan exists:
147
+ - Read epic plan file
148
+ - Update Task Breakdown table:
149
+ - Change status from `in_progress` to `closed`
150
+ - Add plan doc path if created
151
+
152
+ **Edit:** `docs/ai/planning/epic-{name}.md`
153
+
154
+ Update the task row:
155
+ ```markdown
156
+ | {task-id} | {title} | P{n} | closed | - | feature-{name}.md |
157
+ ```
158
+
159
+ ---
160
+
161
+ ## Step 5: Sync to Git
162
+
163
+ **Run:** `bd sync`
164
+
165
+ This will:
166
+ - Export Beads changes to JSONL
167
+ - Commit Beads changes
168
+ - Push to remote
169
+
170
+ Display sync result.
171
+
172
+ ---
173
+
174
+ ## Step 6: Clear Context
175
+
176
+ **Delete:** `.beads/current-task.json`
177
+
178
+ Context is cleared so `/create-plan` won't auto-link to this closed task.
179
+
180
+ ---
181
+
182
+ ## Step 7: Show Next Ready Tasks
183
+
184
+ **Run:** `bd ready --json`
185
+
186
+ Check if any tasks were unblocked by closing this task.
187
+
188
+ **Output:**
189
+
190
+ ```
191
+ ✓ Closed: {task-id} "{Task Title}"
192
+ ✓ Synced to git
193
+
194
+ {If tasks were unblocked:}
195
+ 🔓 Unblocked by this completion:
196
+ - {unblocked-task-id} "{title}" [now ready]
197
+ - {unblocked-task-id} "{title}" [now ready]
198
+
199
+ {Show ready tasks:}
200
+ 📋 Ready to work ({count}):
201
+ 1. {task-id} "{title}" (P{n})
202
+ 2. {task-id} "{title}" (P{n})
203
+
204
+ {Show epic progress:}
205
+ 📊 Epic Progress: {epic-id}
206
+ Completed: {closed}/{total} tasks ({percentage}%)
207
+ Remaining: {open + in_progress} tasks
208
+
209
+ Next steps:
210
+ - Run `/beads-next` to claim next task
211
+ - Run `/beads-status` to see full epic progress
212
+ ```
213
+
214
+ **If all tasks in epic are complete:**
215
+
216
+ ```
217
+ 🎉 Epic Complete: {epic-id} "{Epic Title}"
218
+
219
+ All {total} tasks have been completed!
220
+
221
+ Next steps:
222
+ - Review epic plan for any follow-ups
223
+ - Close epic: `bd close {epic-id} --reason "All tasks complete"`
224
+ - Start new work: `/beads-breakdown`
225
+ ```
226
+
227
+ ---
228
+
229
+ ## Notes
230
+
231
+ - **Git sync required**: Always syncs to git after closing to persist state
232
+ - **Context cleanup**: Clears current-task.json to prevent stale context
233
+ - **Epic progress**: Shows progress after each task completion
234
+ - **Unblocked tasks**: Highlights tasks that became ready after this completion
235
+
236
+ ### Close vs Cancel
237
+
238
+ | Action | When to use |
239
+ |--------|-------------|
240
+ | Close (this command) | Task is complete, work is done |
241
+ | Cancel (`bd update --status open`) | Task is abandoned, need to unclaim |
242
+
243
+ ### Error Recovery
244
+
245
+ If close fails:
246
+ - Check `bd doctor` for sync issues
247
+ - Manually run `bd sync` to retry
248
+ - Check git status for conflicts
@@ -0,0 +1,260 @@
1
+ ---
2
+ name: beads-next
3
+ description: Shows ready tasks, allows claiming a task, and sets context for /create-plan.
4
+ ---
5
+
6
+ ## Goal
7
+
8
+ Show available Beads tasks (in_progress and ready), let user claim a task, and set context so `/create-plan` knows which Beads task to link.
9
+
10
+ ## Workflow Alignment
11
+
12
+ - Provide brief status updates (1–3 sentences) before/after important actions.
13
+ - Always show in_progress tasks first (user may have work in progress from previous session).
14
+ - Set context file for seamless integration with `/create-plan`.
15
+
16
+ ---
17
+
18
+ ## Step 1: Check Current State
19
+
20
+ ### 1a: Load Epic Context (if exists)
21
+
22
+ **Read:** `.beads/current-epic.json`
23
+
24
+ If exists:
25
+ - Use epic_id to filter tasks
26
+ - Show only tasks from current epic
27
+
28
+ If not exists:
29
+ - Show all tasks across all epics
30
+
31
+ ### 1b: Get In-Progress Tasks
32
+
33
+ **Run:** `bd list --status=in_progress --json`
34
+
35
+ Parse output to get tasks currently being worked on.
36
+
37
+ ### 1c: Get Ready Tasks
38
+
39
+ **Run:** `bd ready --json`
40
+
41
+ Parse output to get tasks with no blockers.
42
+
43
+ ---
44
+
45
+ ## Step 2: Display Task Overview
46
+
47
+ **Format output:**
48
+
49
+ ```
50
+ ## Beads Task Overview
51
+
52
+ {If epic context exists:}
53
+ **Current Epic**: {epic-id} "{Epic Title}"
54
+ **Epic Plan**: {epic-plan path or "Not created yet"}
55
+
56
+ ---
57
+
58
+ ### 🔄 In Progress ({count})
59
+
60
+ {If in_progress tasks exist:}
61
+ | Task ID | Title | Epic | Plan Doc |
62
+ |---------|-------|------|----------|
63
+ | {task-id} | {title} | {epic-id} | {plan path or "-"} |
64
+
65
+ {If no in_progress:}
66
+ No tasks in progress.
67
+
68
+ ---
69
+
70
+ ### ✅ Ready to Start ({count})
71
+
72
+ {If ready tasks exist:}
73
+ | # | Task ID | Title | Priority | Epic |
74
+ |---|---------|-------|----------|------|
75
+ | 1 | {task-id} | {title} | P{n} | {epic-id} |
76
+ | 2 | {task-id} | {title} | P{n} | {epic-id} |
77
+ | 3 | {task-id} | {title} | P{n} | {epic-id} |
78
+
79
+ {If no ready tasks:}
80
+ No tasks ready. Check blocked tasks with `bd blocked`.
81
+
82
+ ---
83
+
84
+ ### 🚫 Blocked ({count})
85
+
86
+ {task-id}: blocked by {blocker-id} "{blocker-title}"
87
+ ```
88
+
89
+ ---
90
+
91
+ ## Step 3: Ask User Action
92
+
93
+ **If in_progress tasks exist:**
94
+
95
+ ```
96
+ AskUserQuestion(questions=[{
97
+ question: "You have tasks in progress. What would you like to do?",
98
+ header: "Action",
99
+ options: [
100
+ { label: "Continue {task-id}", description: "Resume working on '{task-title}'" },
101
+ { label: "Claim new task", description: "Pick a different task from ready list" },
102
+ { label: "View task details", description: "Show full details of a specific task" }
103
+ ],
104
+ multiSelect: false
105
+ }])
106
+ ```
107
+
108
+ **If no in_progress, but ready tasks exist:**
109
+
110
+ ```
111
+ AskUserQuestion(questions=[{
112
+ question: "Which task would you like to claim?",
113
+ header: "Claim Task",
114
+ options: [
115
+ { label: "{task-1-id}: {title}", description: "Priority: P{n}" },
116
+ { label: "{task-2-id}: {title}", description: "Priority: P{n}" },
117
+ { label: "{task-3-id}: {title}", description: "Priority: P{n}" },
118
+ { label: "View details first", description: "Show full details before claiming" }
119
+ ],
120
+ multiSelect: false
121
+ }])
122
+ ```
123
+
124
+ **If no tasks available:**
125
+
126
+ ```
127
+ No tasks available to work on.
128
+
129
+ Options:
130
+ - Run `bd blocked` to see what's blocking tasks
131
+ - Run `/beads-breakdown` to create new tasks
132
+ - Run `bd list` to see all tasks
133
+ ```
134
+
135
+ ---
136
+
137
+ ## Step 4: Handle User Selection
138
+
139
+ ### If "Continue {task-id}" (resume in_progress):
140
+
141
+ 1. Load task details: `bd show {task-id} --json`
142
+ 2. Check if plan doc exists (from notes or epic plan table)
143
+ 3. Set context file (Step 5)
144
+ 4. Output next steps
145
+
146
+ ### If user selects a ready task to claim:
147
+
148
+ 1. **Claim task:**
149
+ ```bash
150
+ bd update {task-id} --status in_progress
151
+ ```
152
+
153
+ 2. **Load task details:** `bd show {task-id} --json`
154
+
155
+ 3. **Set context file** (Step 5)
156
+
157
+ 4. **Output confirmation:**
158
+ ```
159
+ ✓ Claimed: {task-id} "{Task Title}"
160
+
161
+ Task Details:
162
+ Priority: P{n}
163
+ Epic: {epic-id}
164
+ Blocked by: {none or list}
165
+ Blocks: {list of dependent tasks}
166
+
167
+ Next steps:
168
+ 1. Run `/create-plan` to create detailed implementation plan
169
+ 2. After planning, run `/execute-plan` to implement
170
+ ```
171
+
172
+ ### If "View details first":
173
+
174
+ ```
175
+ AskUserQuestion(questions=[{
176
+ question: "Which task details would you like to see?",
177
+ header: "View Task",
178
+ options: [
179
+ { label: "{task-1-id}", description: "{title}" },
180
+ { label: "{task-2-id}", description: "{title}" },
181
+ { label: "{task-3-id}", description: "{title}" }
182
+ ],
183
+ multiSelect: false
184
+ }])
185
+ ```
186
+
187
+ Then run: `bd show {selected-task-id}`
188
+
189
+ Display full details and return to Step 3 for claiming.
190
+
191
+ ---
192
+
193
+ ## Step 5: Set Context for /create-plan
194
+
195
+ **Create/Update:** `.beads/current-task.json`
196
+
197
+ ```json
198
+ {
199
+ "task_id": "{task-id}",
200
+ "task_title": "{Task Title}",
201
+ "epic_id": "{epic-id}",
202
+ "epic_title": "{Epic Title}",
203
+ "epic_plan": "{docs/ai/planning/epic-xxx.md or null}",
204
+ "priority": {priority number},
205
+ "blocked_by": [],
206
+ "blocks": ["{dependent-task-ids}"],
207
+ "claimed_at": "{ISO timestamp}"
208
+ }
209
+ ```
210
+
211
+ This file is read by `/create-plan` to:
212
+ - Auto-populate beads metadata in frontmatter
213
+ - Reference epic plan for architecture context
214
+ - Link task to plan doc when created
215
+
216
+ ---
217
+
218
+ ## Step 6: Final Output
219
+
220
+ ```
221
+ ✓ Context set for: {task-id} "{Task Title}"
222
+
223
+ Ready for:
224
+ /create-plan → Create detailed implementation plan
225
+ /create-plan "{title}" → Create plan with custom title
226
+
227
+ To view task details anytime:
228
+ bd show {task-id}
229
+
230
+ To unclaim this task:
231
+ bd update {task-id} --status open
232
+ ```
233
+
234
+ ---
235
+
236
+ ## Notes
237
+
238
+ - **Session persistence**: Context file (`.beads/current-task.json`) persists across sessions
239
+ - **One task at a time**: Only one task should be in_progress per developer
240
+ - **Epic filtering**: If working on an epic, only shows tasks from that epic
241
+ - **Parallel work**: Multiple developers can claim different tasks (Beads handles this)
242
+
243
+ ### Task Status Flow
244
+
245
+ ```
246
+ open → in_progress → closed
247
+
248
+ (unclaim)
249
+
250
+ open
251
+ ```
252
+
253
+ ### Context File Lifecycle
254
+
255
+ ```
256
+ /beads-next (claim) → Creates .beads/current-task.json
257
+ /create-plan → Reads context, links plan doc
258
+ /execute-plan → Uses plan doc (context optional)
259
+ /beads-done → Deletes .beads/current-task.json
260
+ ```