agileflow 2.42.0 → 2.44.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 (75) hide show
  1. package/package.json +2 -1
  2. package/scripts/generate-all.sh +77 -0
  3. package/scripts/generators/agent-registry.js +167 -0
  4. package/scripts/generators/command-registry.js +135 -0
  5. package/scripts/generators/index.js +87 -0
  6. package/scripts/generators/inject-babysit.js +167 -0
  7. package/scripts/generators/inject-help.js +109 -0
  8. package/scripts/generators/inject-readme.js +156 -0
  9. package/scripts/generators/skill-registry.js +144 -0
  10. package/src/core/agents/accessibility.md +8 -0
  11. package/src/core/agents/adr-writer.md +8 -0
  12. package/src/core/agents/analytics.md +8 -0
  13. package/src/core/agents/api.md +8 -2
  14. package/src/core/agents/ci.md +8 -0
  15. package/src/core/agents/compliance.md +8 -0
  16. package/src/core/agents/configuration/archival.md +23 -1
  17. package/src/core/agents/configuration/attribution.md +22 -1
  18. package/src/core/agents/configuration/ci.md +23 -1
  19. package/src/core/agents/configuration/git-config.md +23 -1
  20. package/src/core/agents/configuration/hooks.md +22 -1
  21. package/src/core/agents/configuration/precompact.md +8 -0
  22. package/src/core/agents/configuration/status-line.md +93 -13
  23. package/src/core/agents/configuration/verify.md +23 -1
  24. package/src/core/agents/database.md +8 -2
  25. package/src/core/agents/datamigration.md +8 -0
  26. package/src/core/agents/design.md +8 -0
  27. package/src/core/agents/devops.md +8 -2
  28. package/src/core/agents/documentation.md +8 -0
  29. package/src/core/agents/epic-planner.md +8 -0
  30. package/src/core/agents/integrations.md +8 -0
  31. package/src/core/agents/mentor.md +8 -3
  32. package/src/core/agents/mobile.md +8 -0
  33. package/src/core/agents/monitoring.md +8 -0
  34. package/src/core/agents/multi-expert.md +8 -0
  35. package/src/core/agents/performance.md +8 -2
  36. package/src/core/agents/product.md +8 -0
  37. package/src/core/agents/qa.md +8 -0
  38. package/src/core/agents/readme-updater.md +8 -0
  39. package/src/core/agents/refactor.md +8 -2
  40. package/src/core/agents/research.md +8 -0
  41. package/src/core/agents/security.md +8 -2
  42. package/src/core/agents/testing.md +8 -0
  43. package/src/core/agents/ui.md +8 -2
  44. package/src/core/commands/adr.md +2 -13
  45. package/src/core/commands/agent.md +2 -13
  46. package/src/core/commands/assign.md +2 -13
  47. package/src/core/commands/auto.md +2 -13
  48. package/src/core/commands/babysit.md +94 -88
  49. package/src/core/commands/baseline.md +2 -13
  50. package/src/core/commands/blockers.md +4 -13
  51. package/src/core/commands/board.md +4 -13
  52. package/src/core/commands/context.md +141 -5
  53. package/src/core/commands/deps.md +4 -15
  54. package/src/core/commands/docs.md +2 -15
  55. package/src/core/commands/epic.md +4 -15
  56. package/src/core/commands/help.md +3 -14
  57. package/src/core/commands/metrics.md +4 -15
  58. package/src/core/commands/packages.md +3 -14
  59. package/src/core/commands/pr.md +4 -13
  60. package/src/core/commands/readme-sync.md +7 -24
  61. package/src/core/commands/research.md +3 -14
  62. package/src/core/commands/retro.md +4 -15
  63. package/src/core/commands/sprint.md +8 -0
  64. package/src/core/commands/status.md +5 -14
  65. package/src/core/commands/story-validate.md +3 -14
  66. package/src/core/commands/story.md +17 -17
  67. package/src/core/commands/template.md +2 -15
  68. package/src/core/commands/tests.md +2 -15
  69. package/src/core/commands/update.md +2 -15
  70. package/src/core/commands/validate-expertise.md +2 -15
  71. package/src/core/commands/velocity.md +4 -15
  72. package/src/core/commands/verify.md +4 -15
  73. package/src/core/templates/agileflow-configure.js +123 -2
  74. package/src/core/templates/agileflow-metadata.json +12 -0
  75. package/src/core/templates/agileflow-statusline.sh +238 -44
@@ -7,21 +7,10 @@ argument-hint: STORY=<US-ID> NEW_OWNER=<id> [NEW_STATUS=<status>] [NOTE=<text>]
7
7
 
8
8
  Assign or reassign a story to an owner with status update.
9
9
 
10
- ## STEP 0: Activate Command
10
+ ## STEP 0: Gather Context
11
11
 
12
12
  ```bash
13
- node -e "
14
- const fs = require('fs');
15
- const path = 'docs/09-agents/session-state.json';
16
- if (fs.existsSync(path)) {
17
- const state = JSON.parse(fs.readFileSync(path, 'utf8'));
18
- const cmd = { name: 'assign', activated_at: new Date().toISOString(), state: {} };
19
- state.active_commands = state.active_commands || [];
20
- if (!state.active_commands.some(c => c.name === cmd.name)) state.active_commands.push(cmd);
21
- fs.writeFileSync(path, JSON.stringify(state, null, 2) + '\n');
22
- console.log('✅ assign command activated');
23
- }
24
- "
13
+ node scripts/obtain-context.js assign
25
14
  ```
26
15
 
27
16
  <!-- COMPACT_SUMMARY_START -->
@@ -6,21 +6,10 @@ description: Auto-generate stories from PRDs, mockups, or specs
6
6
 
7
7
  Automatically generate user stories from product artifacts like PRDs, mockups, or API docs.
8
8
 
9
- ## STEP 0: Activate Command
9
+ ## STEP 0: Gather Context
10
10
 
11
11
  ```bash
12
- node -e "
13
- const fs = require('fs');
14
- const path = 'docs/09-agents/session-state.json';
15
- if (fs.existsSync(path)) {
16
- const state = JSON.parse(fs.readFileSync(path, 'utf8'));
17
- const cmd = { name: 'auto', activated_at: new Date().toISOString(), state: {} };
18
- state.active_commands = state.active_commands || [];
19
- if (!state.active_commands.some(c => c.name === cmd.name)) state.active_commands.push(cmd);
20
- fs.writeFileSync(path, JSON.stringify(state, null, 2) + '\n');
21
- console.log('✅ auto command activated');
22
- }
23
- "
12
+ node scripts/obtain-context.js auto
24
13
  ```
25
14
 
26
15
  <!-- COMPACT_SUMMARY_START -->
@@ -22,26 +22,24 @@ End-to-end mentor for implementing features.
22
22
 
23
23
  ---
24
24
 
25
- ## 🚨 STEP 0: ACTIVATE COMMAND (REQUIRED FIRST)
25
+ ## 🚨 STEP 0: GATHER CONTEXT (REQUIRED FIRST)
26
26
 
27
- **Before doing ANYTHING else, run this to register the command for context preservation:**
27
+ **Before doing ANYTHING else, run the context script to gather all project state in one shot:**
28
28
 
29
29
  ```bash
30
- node -e "
31
- const fs = require('fs');
32
- const path = 'docs/09-agents/session-state.json';
33
- if (fs.existsSync(path)) {
34
- const state = JSON.parse(fs.readFileSync(path, 'utf8'));
35
- const cmd = { name: 'babysit', activated_at: new Date().toISOString(), state: {} };
36
- state.active_commands = state.active_commands || [];
37
- if (!state.active_commands.some(c => c.name === cmd.name)) state.active_commands.push(cmd);
38
- fs.writeFileSync(path, JSON.stringify(state, null, 2) + '\n');
39
- console.log('✅ Babysit command activated');
40
- }
41
- "
30
+ node scripts/obtain-context.js babysit
42
31
  ```
43
32
 
44
- **Why?** If the conversation compacts, the PreCompact hook will preserve babysit's behavioral rules (like using AskUserQuestion). Without this, those rules get lost.
33
+ This single command gathers:
34
+ - Git status (branch, uncommitted changes, last commit)
35
+ - Stories & epics from status.json (by status, ready items highlighted)
36
+ - Session state (active session, working story)
37
+ - Documentation structure
38
+ - Research notes
39
+ - Recent agent messages
40
+ - Key file presence
41
+
42
+ **Why one script?** Faster startup, fewer tool calls, less context overhead. All the information babysit needs in ~1 second.
45
43
 
46
44
  ---
47
45
 
@@ -72,13 +70,14 @@ Keep this section under 150 lines - it contains the critical behavioral rules an
72
70
  ### TodoWrite Tracking
73
71
 
74
72
  **CRITICAL**: Track progress with TodoWrite tool. Typical workflow:
75
- 1. Run context loading (CLAUDE.md, README, status.json)
73
+ 1. Run context script (`node scripts/obtain-context.js babysit`)
76
74
  2. Present suggestions using AskUserQuestion
77
- 3. Plan implementation steps with file paths
78
- 4. Apply code changes incrementally
79
- 5. Update status.json
80
- 6. Verify tests passing
81
- 7. Generate PR description
75
+ 3. Read task-specific docs based on user's choice
76
+ 4. Plan implementation steps with file paths
77
+ 5. Apply code changes incrementally
78
+ 6. Update status.json
79
+ 7. Verify tests passing
80
+ 8. Generate PR description
82
81
 
83
82
  ### Core Goal
84
83
 
@@ -92,11 +91,17 @@ Guide a plain-English intent end-to-end:
92
91
 
93
92
  ### Key Files to Check
94
93
 
95
- - CLAUDE.md - Project conventions
96
- - README.md - Project overview
97
- - docs/09-agents/status.json - Story statuses
98
- - docs/02-practices/ - Codebase practices
99
- - docs/10-research/ - Research notes
94
+ **Context script gathers automatically:**
95
+ - Git status, branch, uncommitted changes
96
+ - status.json (epics, stories by status)
97
+ - session-state.json (active session)
98
+ - docs/ structure overview
99
+ - Research notes list
100
+
101
+ **Read manually for task-specific work:**
102
+ - docs/04-architecture/*.md - Relevant architecture docs
103
+ - docs/02-practices/*.md - Relevant practice docs
104
+ - docs/10-research/*.md - Full research notes
100
105
 
101
106
  ### Output Format
102
107
 
@@ -133,27 +138,25 @@ ROLE: Babysitter (Mentor + Orchestrator)
133
138
 
134
139
  **Principle**: Be helpful, not annoying. Ask for decisions, not permissions.
135
140
 
136
- 🔴 **Format**: NEVER ask users to "type" anything. Use proper options with XML invoke format. See `docs/02-practices/ask-user-question.md`.
141
+ 🔴 **Format**: NEVER ask users to "type" anything. Use proper options with XML invoke format.
137
142
 
138
143
  ---
139
144
 
140
145
  TODO LIST TRACKING
141
146
  **CRITICAL**: Immediately create a todo list using TodoWrite tool to track mentoring workflow:
142
147
  ```
143
- 1. Run mandatory context loading (CLAUDE.md, README, docs structure, status.json)
144
- 2. Check for session harness and run /resume if active
145
- 3. Present intelligent suggestions using AskUserQuestion
148
+ 1. Run context script (node scripts/obtain-context.js babysit)
149
+ 2. Present intelligent suggestions using AskUserQuestion
150
+ 3. Read task-specific docs (based on what user chooses)
146
151
  4. Validate story readiness and architecture context
147
- 5. Research integration (check docs/10-research, suggest MODE=research if needed)
148
- 6. Plan implementation steps with file paths
149
- 7. Apply code changes incrementally (show diff, confirm with AskUserQuestion)
150
- 8. Populate Dev Agent Record during work
151
- 9. Update status.json
152
- 10. Verify tests passing before marking in-review
153
- 11. Generate PR description and next actions
152
+ 5. Plan implementation steps with file paths
153
+ 6. Apply code changes incrementally
154
+ 7. Update status.json
155
+ 8. Verify tests passing before marking in-review
156
+ 9. Generate PR description and next actions
154
157
  ```
155
158
 
156
- Mark each step complete as you work through the feature implementation. This ensures comprehensive mentoring without missing critical steps.
159
+ Mark each step complete as you work through the feature implementation.
157
160
 
158
161
  GOAL
159
162
  - Guide a plain-English intent end-to-end with comprehensive analysis:
@@ -167,67 +170,72 @@ GOAL
167
170
 
168
171
  🔴 ⚠️ MANDATORY CONTEXT LOADING ON FIRST RUN ⚠️ 🔴
169
172
 
170
- **YOU MUST RUN THESE COMMANDS IMMEDIATELY - DO NOT SKIP - THIS IS NOT OPTIONAL**
171
-
172
- Without this context, you cannot work effectively. Run these NOW before doing anything else:
173
+ **Run the context script IMMEDIATELY - DO NOT SKIP:**
173
174
 
174
- 1. **Read CLAUDE.md** (if exists) - Project system prompt with architecture & practices
175
- 2. **Read root README.md** - Project overview, setup, architecture summary
176
- 3. **Bash: ls -la docs/** - See all documentation folders
177
- 4. **Bash: cat docs/README.md** - Documentation structure and navigation (if exists)
178
- 5. **Bash: ls -la docs/02-practices/** - List codebase practice docs
179
- 6. **Bash: cat docs/02-practices/README.md** - Index of practices (if exists)
180
- 7. **Bash: cat docs/09-agents/status.json** - Current story statuses and assignments (if exists)
181
- 8. **Bash: ls -la docs/05-epics/** - List active/planned epics
182
- 9. **Bash: head -20 docs/08-project/roadmap.md** - Project roadmap/priorities (if exists)
183
- 10. **Bash: tail -20 docs/09-agents/bus/log.jsonl** - Last agent messages (if exists)
175
+ ```bash
176
+ node scripts/obtain-context.js babysit
177
+ ```
184
178
 
185
- **WHY THIS IS MANDATORY:**
186
- - You need to understand the project structure (what's in docs/)
187
- - You need to know current practices (docs/02-practices/)
188
- - You need to see what stories exist (docs/09-agents/status.json)
189
- - You need to understand project priorities (docs/08-project/)
190
- - You need to see recent agent decisions (docs/09-agents/bus/log.jsonl)
179
+ This single command gathers all essential context:
180
+ - **Git**: Branch, uncommitted changes, last commit
181
+ - **Stories**: All epics/stories from status.json, grouped by status
182
+ - **Session**: Active session state, current story being worked on
183
+ - **Docs**: Full documentation structure with file counts
184
+ - **Research**: List of research notes (most recent first)
185
+ - **Bus**: Recent agent messages
186
+ - **Key files**: CLAUDE.md, README.md, settings presence
187
+
188
+ **After context script, read task-specific docs based on user's choice:**
189
+
190
+ | Task Domain | Read These Docs |
191
+ |-------------|-----------------|
192
+ | Database | `docs/04-architecture/database-*.md`, `docs/02-practices/database.md` |
193
+ | API | `docs/04-architecture/api-*.md`, `docs/02-practices/api-design.md` |
194
+ | UI/Frontend | `docs/04-architecture/frontend-*.md`, `docs/02-practices/styling.md` |
195
+ | Testing | `docs/02-practices/testing.md` |
196
+ | CI/CD | `docs/02-practices/ci.md` |
197
+
198
+ **WHY ONE SCRIPT:**
199
+ - **Faster**: 1 tool call instead of 8-10
200
+ - **Less overhead**: Reduced context from tool call syntax
201
+ - **Consistent**: Same structured output every time
202
+ - **Complete**: All essential info in one shot
191
203
 
192
204
  **CONSEQUENCE OF SKIPPING:**
193
- - You will make decisions that contradict existing practices
205
+ - You will make decisions that contradict existing patterns
194
206
  - You will miss existing stories/epics and duplicate work
195
- - You will not understand codebase conventions
196
- - You will fail to follow team patterns
197
207
  - THE USER WILL COMPLAIN THAT YOU'RE LAZY
198
208
 
199
209
  **DO THIS FIRST, EVERY TIME, NO EXCEPTIONS**
200
210
 
201
211
  ---
202
212
 
203
- KNOWLEDGE INDEX (load from above commands + read files)
204
-
205
- **1. README.md Files (READ THESE FIRST)**:
206
- - **README.md** (root) - Project overview, setup instructions, getting started, architecture summary
207
- - **docs/README.md** - Documentation structure and navigation
208
- - **docs/02-practices/README.md** - Index of codebase practices (CRITICAL for implementation)
209
- - **ALL docs/**/README.md** - Folder-specific docs; map "Next steps/TODO/Open Questions/Planned/Risks"
210
- - **src/README.md** or module READMEs (if exist) - Code organization, module-specific docs
211
- - Extract critical info: TODOs, open questions, planned features, known risks, setup requirements
212
-
213
- **2. Codebase Practices (READ BEFORE IMPLEMENTING)**:
214
- After reading docs/02-practices/README.md, crawl to relevant practice docs based on task:
215
- - **For UI work** → Read docs/02-practices/{styling.md,typography.md,component-patterns.md,accessibility.md}
216
- - **For API work** Read docs/02-practices/{api-design.md,validation.md,error-handling.md,security.md}
217
- - **For testing** → Read docs/02-practices/testing.md
218
- - **For git workflow** → Read docs/02-practices/git-branching.md
219
- - **For CI/CD** → Read docs/02-practices/ci.md
220
- - **For deployment** → Read docs/02-practices/releasing.md
221
- - **Important**: These are the project's actual conventions - ALWAYS follow them during implementation
222
-
223
- **3. Core Context Files**:
224
- - **CLAUDE.md** (if exists) - AI assistant's system prompt with codebase practices and architecture
225
- - **docs/context.md** (if exists) - One-page project brief for research context
226
-
227
- **4. AgileFlow Command Files**:
213
+ KNOWLEDGE INDEX
214
+
215
+ **Context script provides (automatically):**
216
+ - Git status, branch, uncommitted changes
217
+ - Epics/stories from status.json with status grouping
218
+ - Session state (active session, current story)
219
+ - Documentation structure overview
220
+ - Research notes (filenames, sorted by date)
221
+ - Recent agent bus messages
222
+ - Key file presence checks
223
+
224
+ **Read manually for deep dives (based on task):**
225
+
226
+ | Task Domain | Docs to Read |
227
+ |-------------|--------------|
228
+ | Database | `docs/04-architecture/database-*.md`, `docs/02-practices/database.md` |
229
+ | API | `docs/04-architecture/api-*.md`, `docs/02-practices/api-design.md` |
230
+ | UI/Frontend | `docs/02-practices/styling.md`, `component-patterns.md` |
231
+ | Testing | `docs/02-practices/testing.md` |
232
+ | CI/CD | `docs/02-practices/ci.md` |
233
+ | Full research note | `docs/10-research/<filename>.md` |
234
+
235
+ **AgileFlow Command Files**:
228
236
  <!-- {{COMMAND_LIST}} -->
229
237
 
230
- **5. AgileFlow State & Planning**:
238
+ **AgileFlow State & Planning**:
231
239
  - docs/09-agents/status.json - Story statuses, assignees, dependencies
232
240
  - docs/09-agents/bus/log.jsonl (last 10 messages) - Agent coordination messages
233
241
  - docs/08-project/{roadmap.md,backlog.md,milestones.md} - Project planning
@@ -652,8 +660,6 @@ This ensures the expert loads their mental model before working.
652
660
 
653
661
  PLAN MODE FOR COMPLEX IMPLEMENTATIONS
654
662
 
655
- **Reference**: `@docs/02-practices/plan-mode.md`
656
-
657
663
  Before implementing features, evaluate complexity to decide whether to plan first or implement directly.
658
664
 
659
665
  **Decision Tree**:
@@ -7,21 +7,10 @@ argument-hint: [message] (optional)
7
7
 
8
8
  Create a verified checkpoint representing a known-good state of the project.
9
9
 
10
- ## STEP 0: Activate Command
10
+ ## STEP 0: Gather Context
11
11
 
12
12
  ```bash
13
- node -e "
14
- const fs = require('fs');
15
- const path = 'docs/09-agents/session-state.json';
16
- if (fs.existsSync(path)) {
17
- const state = JSON.parse(fs.readFileSync(path, 'utf8'));
18
- const cmd = { name: 'baseline', activated_at: new Date().toISOString(), state: {} };
19
- state.active_commands = state.active_commands || [];
20
- if (!state.active_commands.some(c => c.name === cmd.name)) state.active_commands.push(cmd);
21
- fs.writeFileSync(path, JSON.stringify(state, null, 2) + '\n');
22
- console.log('✅ baseline command activated');
23
- }
24
- "
13
+ node scripts/obtain-context.js baseline
25
14
  ```
26
15
 
27
16
  <!-- COMPACT_SUMMARY_START -->
@@ -6,23 +6,14 @@ model: haiku
6
6
 
7
7
  # blockers
8
8
 
9
- ## STEP 0: Activation
9
+ ## STEP 0: Gather Context
10
10
 
11
11
  ```bash
12
- node -e "
13
- const fs = require('fs');
14
- const path = 'docs/09-agents/session-state.json';
15
- if (fs.existsSync(path)) {
16
- const state = JSON.parse(fs.readFileSync(path, 'utf8'));
17
- const cmd = { name: 'blockers', activated_at: new Date().toISOString(), state: {} };
18
- state.active_commands = state.active_commands || [];
19
- if (!state.active_commands.some(c => c.name === cmd.name)) state.active_commands.push(cmd);
20
- fs.writeFileSync(path, JSON.stringify(state, null, 2) + '\n');
21
- console.log('✅ blockers command activated');
22
- }
23
- "
12
+ node scripts/obtain-context.js blockers
24
13
  ```
25
14
 
15
+ This gathers git status, stories/epics, session state, and registers for PreCompact.
16
+
26
17
  ---
27
18
 
28
19
  <!-- COMPACT_SUMMARY_START -->
@@ -7,23 +7,14 @@ model: haiku
7
7
 
8
8
  Generate a visual kanban board from current story statuses.
9
9
 
10
- ## STEP 0: Activate Command
10
+ ## STEP 0: Gather Context
11
11
 
12
12
  ```bash
13
- node -e "
14
- const fs = require('fs');
15
- const path = 'docs/09-agents/session-state.json';
16
- if (fs.existsSync(path)) {
17
- const state = JSON.parse(fs.readFileSync(path, 'utf8'));
18
- const cmd = { name: 'board', activated_at: new Date().toISOString(), state: {} };
19
- state.active_commands = state.active_commands || [];
20
- if (!state.active_commands.some(c => c.name === cmd.name)) state.active_commands.push(cmd);
21
- fs.writeFileSync(path, JSON.stringify(state, null, 2) + '\n');
22
- console.log('✅ board command activated');
23
- }
24
- "
13
+ node scripts/obtain-context.js board
25
14
  ```
26
15
 
16
+ This gathers git status, stories/epics, session state, and registers for PreCompact.
17
+
27
18
  <!-- COMPACT_SUMMARY_START -->
28
19
  ## Compact Summary
29
20
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Generate context export for web AI tools
3
- argument-hint: [MODE=full|export|note|research] [NOTE=<text>] [TOPIC=<text>] [DETAILS=<text>]
3
+ argument-hint: [MODE=full|export|note|research|import] [NOTE=<text>] [TOPIC=<text>] [DETAILS=<text>] [CONTENT=<text>] [SOURCE=<url>]
4
4
  ---
5
5
 
6
6
  <!-- COMPACT_SUMMARY_START
@@ -12,11 +12,12 @@ This section is extracted by the PreCompact hook to preserve essential context a
12
12
  Web AI Context Manager - Generates/exports/manages project context briefs for web AI tools (ChatGPT, Perplexity, Gemini, Claude web).
13
13
 
14
14
  ### Critical Behavioral Rules
15
- - **ALWAYS create TodoWrite list** for MODE=full and MODE=research to track multi-step workflows
15
+ - **ALWAYS create TodoWrite list** for MODE=full, MODE=research, and MODE=import to track multi-step workflows
16
16
  - **Diff-first approach**: Show changes and wait for YES/NO confirmation before ANY file writes
17
17
  - **Preserve user-written content**: Only update managed sections in docs/context.md
18
18
  - **No writes in export mode**: MODE=export outputs text only, never writes files
19
19
  - **Research is two-step**: STEP 1 generates prompt, STEP 2 stores results when user returns
20
+ - **Import is one-step**: Process CONTENT immediately and create research file
20
21
  - **Link research files**: Always reference research from ADRs/Epics/Stories that use it
21
22
 
22
23
  ### Core Workflow
@@ -50,6 +51,16 @@ Web AI Context Manager - Generates/exports/manages project context briefs for we
50
51
  7. Ask if user wants ADR/Epic/Story created from research
51
52
  8. Add research reference to created ADR/Epic/Story
52
53
 
54
+ **MODE=import**
55
+ 1. Create todo list tracking: validate inputs, process content, extract key points, extract code, generate actions, suggest stories, format research file, save, update index
56
+ 2. Validate TOPIC and CONTENT are provided
57
+ 3. Process raw content (transcript, article, etc.) by: summarizing key points, extracting code snippets, generating action items, suggesting user stories
58
+ 4. Format into structured research file with all extracted sections
59
+ 5. Save to docs/10-research/YYYYMMDD-topic-slug.md
60
+ 6. Update docs/10-research/README.md index
61
+ 7. Ask if user wants ADR/Epic/Story created from imported content
62
+ 8. Add research reference to created ADR/Epic/Story
63
+
53
64
  ### Key Files
54
65
  - docs/context.md - Main context brief (managed sections + user content)
55
66
  - docs/10-research/YYYYMMDD-topic-slug.md - Research results storage
@@ -68,9 +79,11 @@ Generate, export, or manage the web AI context brief.
68
79
  ROLE: Web AI Context Manager
69
80
 
70
81
  INPUTS (optional)
71
- - MODE=full|export|note|research (default: full)
82
+ - MODE=full|export|note|research|import (default: full)
72
83
  - NOTE=<text> (required if MODE=note)
73
- - TOPIC=<text> (required if MODE=research)
84
+ - TOPIC=<text> (required if MODE=research or MODE=import)
85
+ - CONTENT=<text> (required if MODE=import - raw content to process)
86
+ - SOURCE=<url> (optional for MODE=import - original source URL)
74
87
 
75
88
  ---
76
89
 
@@ -249,6 +262,124 @@ When user pastes research results back:
249
262
 
250
263
  ---
251
264
 
265
+ ## MODE=import
266
+ Import raw content (transcripts, articles, notes) and convert to structured research file.
267
+
268
+ ### Input
269
+ - TOPIC=<text> (required - name for the research file)
270
+ - CONTENT=<text> (required - raw content to process: transcript, article, notes, etc.)
271
+ - SOURCE=<url> (optional - original source URL for reference)
272
+
273
+ ### Use Cases
274
+ - YouTube video transcripts
275
+ - Conference talk notes
276
+ - Podcast transcripts
277
+ - Blog posts / articles
278
+ - Documentation pages
279
+ - Forum discussions / Stack Overflow threads
280
+ - Meeting notes
281
+
282
+ ### TODO LIST TRACKING
283
+ **CRITICAL**: Immediately create a todo list using TodoWrite tool to track import workflow:
284
+ ```
285
+ 1. Validate TOPIC and CONTENT are provided
286
+ 2. Analyze and summarize key points from content
287
+ 3. Extract any code snippets
288
+ 4. Generate action items based on content
289
+ 5. Create user story suggestions (if applicable)
290
+ 6. Format into structured research markdown
291
+ 7. Show diff for review
292
+ 8. Save to docs/10-research/YYYYMMDD-topic-slug.md
293
+ 9. Update docs/10-research/README.md index
294
+ 10. Ask about creating ADR/Epic/Story from research
295
+ ```
296
+
297
+ Mark each step complete as you finish it.
298
+
299
+ ### Processing Steps
300
+
301
+ 1. **Validate Inputs**
302
+ - Verify TOPIC is provided (error if missing)
303
+ - Verify CONTENT is provided (error if missing)
304
+ - SOURCE is optional but recommended for attribution
305
+
306
+ 2. **Analyze Content**
307
+ Extract from the raw content:
308
+ - **Summary**: 2-3 paragraph TL;DR of the main points
309
+ - **Key Findings**: Bullet list of important takeaways
310
+ - **Code Snippets**: Any code blocks, commands, or configuration (preserve exactly)
311
+ - **Action Items**: Concrete next steps mentioned or implied
312
+ - **Story Suggestions**: Potential user stories/epics based on content
313
+
314
+ 3. **Format Research File**
315
+ ```markdown
316
+ # [Topic Title]
317
+
318
+ **Import Date**: YYYY-MM-DD
319
+ **Topic**: [original topic]
320
+ **Source**: [URL if provided, or "Direct import"]
321
+ **Content Type**: [transcript/article/notes/etc.]
322
+
323
+ ## Summary
324
+ [2-3 paragraph executive summary of the content]
325
+
326
+ ## Key Findings
327
+ - [Main point 1 with details]
328
+ - [Main point 2 with details]
329
+ - [Main point 3 with details]
330
+ - ...
331
+
332
+ ## Code Snippets
333
+ [Preserve all code snippets exactly as they appeared]
334
+ ```language
335
+ [code here]
336
+ ```
337
+
338
+ ## Action Items
339
+ - [ ] [Action 1 - concrete next step]
340
+ - [ ] [Action 2 - concrete next step]
341
+ - [ ] [Action 3 - concrete next step]
342
+
343
+ ## Story Suggestions
344
+ [If content suggests feature work, list potential stories]
345
+
346
+ ### Potential Epic: [Epic Title]
347
+ - **US-XXXX**: [Story 1 title]
348
+ - AC: [acceptance criteria bullet]
349
+ - **US-XXXX**: [Story 2 title]
350
+ - AC: [acceptance criteria bullet]
351
+
352
+ ## Raw Content Reference
353
+ <details>
354
+ <summary>Original content (click to expand)</summary>
355
+
356
+ [First 500 chars of original content for reference...]
357
+ </details>
358
+
359
+ ## References
360
+ - Source: [URL or "Direct import"]
361
+ - Import date: [YYYY-MM-DD]
362
+ ```
363
+
364
+ 4. **Save and Index**
365
+ - Save to `docs/10-research/YYYYMMDD-<topic-slug>.md`
366
+ - Update `docs/10-research/README.md` with new entry
367
+
368
+ 5. **Offer Next Steps**
369
+ Ask user via AskUserQuestion:
370
+ - Create an ADR referencing this research?
371
+ - Create an Epic/Stories based on the story suggestions?
372
+ - Link this research to an existing Epic/Story?
373
+
374
+ ### Rules
375
+ - Diff-first; YES/NO before writing research file
376
+ - Preserve ALL code snippets exactly as provided
377
+ - Generate actionable items (not vague suggestions)
378
+ - Keep raw content reference collapsed to save space
379
+ - Always update the research index
380
+
381
+ ---
382
+
252
383
  ## Usage Examples
253
384
 
254
385
  ```bash
@@ -262,9 +393,13 @@ When user pastes research results back:
262
393
  # Add a quick note
263
394
  /agileflow:context MODE=note NOTE="User reported auth bug in production"
264
395
 
265
- # Build research prompt
396
+ # Build research prompt for web AI
266
397
  /agileflow:context MODE=research TOPIC="Implement OAuth 2.0 with Google"
267
398
  /agileflow:context MODE=research TOPIC="Add Stripe payments" DETAILS="Launch by end of sprint"
399
+
400
+ # Import external content (transcripts, articles, notes)
401
+ /agileflow:context MODE=import TOPIC="React Server Components" CONTENT="[paste transcript here]"
402
+ /agileflow:context MODE=import TOPIC="Stripe Webhooks Tutorial" SOURCE="https://youtube.com/..." CONTENT="[paste transcript here]"
268
403
  ```
269
404
 
270
405
  ---
@@ -276,3 +411,4 @@ Depending on MODE:
276
411
  - **export**: Text output ready to paste into web AI tool
277
412
  - **note**: Appended note to docs/context.md (after YES confirmation)
278
413
  - **research**: Research prompt in code block ready to paste into web AI tool
414
+ - **import**: Processed research file saved to docs/10-research/ (after YES confirmation)
@@ -10,25 +10,14 @@ Visualize and analyze story/epic dependency graphs with critical path analysis a
10
10
 
11
11
  ---
12
12
 
13
- ## 🚨 STEP 0: ACTIVATE COMMAND (REQUIRED FIRST)
14
-
15
- **Before doing ANYTHING else, run this to register the command for context preservation:**
13
+ ## STEP 0: Gather Context
16
14
 
17
15
  ```bash
18
- node -e "
19
- const fs = require('fs');
20
- const path = 'docs/09-agents/session-state.json';
21
- if (fs.existsSync(path)) {
22
- const state = JSON.parse(fs.readFileSync(path, 'utf8'));
23
- const cmd = { name: 'deps', activated_at: new Date().toISOString(), state: {} };
24
- state.active_commands = state.active_commands || [];
25
- if (!state.active_commands.some(c => c.name === cmd.name)) state.active_commands.push(cmd);
26
- fs.writeFileSync(path, JSON.stringify(state, null, 2) + '\n');
27
- console.log('✅ Deps command activated');
28
- }
29
- "
16
+ node scripts/obtain-context.js deps
30
17
  ```
31
18
 
19
+ This gathers git status, stories/epics, session state, and registers for PreCompact.
20
+
32
21
  ---
33
22
 
34
23
  <!-- COMPACT_SUMMARY_START -->
@@ -9,23 +9,10 @@ Synchronize documentation with codebase changes.
9
9
 
10
10
  ---
11
11
 
12
- ## 🚨 STEP 0: ACTIVATE COMMAND (REQUIRED FIRST)
13
-
14
- **Before doing ANYTHING else, run this to register the command for context preservation:**
12
+ ## STEP 0: Gather Context
15
13
 
16
14
  ```bash
17
- node -e "
18
- const fs = require('fs');
19
- const path = 'docs/09-agents/session-state.json';
20
- if (fs.existsSync(path)) {
21
- const state = JSON.parse(fs.readFileSync(path, 'utf8'));
22
- const cmd = { name: 'docs', activated_at: new Date().toISOString(), state: {} };
23
- state.active_commands = state.active_commands || [];
24
- if (!state.active_commands.some(c => c.name === cmd.name)) state.active_commands.push(cmd);
25
- fs.writeFileSync(path, JSON.stringify(state, null, 2) + '\n');
26
- console.log('✅ Docs command activated');
27
- }
28
- "
15
+ node scripts/obtain-context.js docs
29
16
  ```
30
17
 
31
18
  ---
@@ -7,25 +7,14 @@ argument-hint: EPIC=<EP-ID> TITLE=<text> OWNER=<id> GOAL=<text> [STORIES=<list>]
7
7
 
8
8
  ---
9
9
 
10
- ## 🚨 STEP 0: ACTIVATE COMMAND (REQUIRED FIRST)
11
-
12
- **Before doing ANYTHING else, run this to register the command for context preservation:**
10
+ ## STEP 0: Gather Context
13
11
 
14
12
  ```bash
15
- node -e "
16
- const fs = require('fs');
17
- const path = 'docs/09-agents/session-state.json';
18
- if (fs.existsSync(path)) {
19
- const state = JSON.parse(fs.readFileSync(path, 'utf8'));
20
- const cmd = { name: 'epic', activated_at: new Date().toISOString(), state: {} };
21
- state.active_commands = state.active_commands || [];
22
- if (!state.active_commands.some(c => c.name === cmd.name)) state.active_commands.push(cmd);
23
- fs.writeFileSync(path, JSON.stringify(state, null, 2) + '\n');
24
- console.log('✅ Epic command activated');
25
- }
26
- "
13
+ node scripts/obtain-context.js epic
27
14
  ```
28
15
 
16
+ This gathers git status, stories/epics, session state, and registers for PreCompact.
17
+
29
18
  ---
30
19
 
31
20
  Create a new epic with optional child stories.