claude-autopm 1.23.2 ā 1.24.2
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 +1 -1
- package/autopm/.claude/agents/frameworks/e2e-test-engineer.md +26 -1
- package/autopm/.claude/agents/frameworks/nats-messaging-expert.md +28 -3
- package/autopm/.claude/agents/frameworks/react-frontend-engineer.md +26 -1
- package/autopm/.claude/agents/frameworks/react-ui-expert.md +26 -1
- package/autopm/.claude/agents/frameworks/tailwindcss-expert.md +26 -1
- package/autopm/.claude/agents/frameworks/ux-design-expert.md +25 -1
- package/autopm/.claude/agents/languages/bash-scripting-expert.md +26 -1
- package/autopm/.claude/agents/languages/javascript-frontend-engineer.md +26 -1
- package/autopm/.claude/agents/languages/nodejs-backend-engineer.md +27 -1
- package/autopm/.claude/agents/languages/python-backend-engineer.md +27 -2
- package/autopm/.claude/agents/languages/python-backend-expert.md +26 -1
- package/autopm/.claude/commands/pm/context-create.md +136 -0
- package/autopm/.claude/commands/pm/context-prime.md +170 -0
- package/autopm/.claude/commands/pm/context-update.md +292 -0
- package/autopm/.claude/commands/pm/epic-decompose.md +19 -0
- package/autopm/.claude/commands/pm/epic-merge.md +2 -2
- package/autopm/.claude/lib/commands/pm/epicSyncTasks.js +190 -0
- package/autopm/.claude/scripts/pm/prd-parse.js +19 -1
- package/autopm/.claude/templates/context-templates/progress.md.template +25 -0
- package/autopm/.claude/templates/context-templates/project-brief.md.template +19 -0
- package/autopm/.claude/templates/context-templates/project-structure.md.template +23 -0
- package/autopm/.claude/templates/context-templates/tech-context.md.template +23 -0
- package/package.json +1 -1
- package/scripts/fix-invalid-command-refs.sh +141 -0
- package/scripts/fix-invalid-refs-simple.sh +49 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: Read, Bash
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Context Prime
|
|
6
|
+
|
|
7
|
+
Load project context into current AI session for better understanding and continuity.
|
|
8
|
+
|
|
9
|
+
## Required Documentation Access
|
|
10
|
+
|
|
11
|
+
**MANDATORY:** Before priming context, query Context7 for best practices:
|
|
12
|
+
|
|
13
|
+
**Documentation Queries:**
|
|
14
|
+
- `mcp://context7/knowledge-management/context-loading` - Context loading patterns
|
|
15
|
+
- `mcp://context7/ai/prompt-engineering` - Effective context management for AI
|
|
16
|
+
|
|
17
|
+
**Why This is Required:**
|
|
18
|
+
- Ensures optimal context loading for AI comprehension
|
|
19
|
+
- Provides strategies for maintaining session continuity
|
|
20
|
+
|
|
21
|
+
## Instructions
|
|
22
|
+
|
|
23
|
+
Load comprehensive project context into the current AI session.
|
|
24
|
+
|
|
25
|
+
### 1. Verify context exists
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
if [ ! -d ".claude/context" ]; then
|
|
29
|
+
echo "ā Context not found. Run /pm:context-create first."
|
|
30
|
+
exit 1
|
|
31
|
+
fi
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 2. Read all context files
|
|
35
|
+
|
|
36
|
+
Read in order:
|
|
37
|
+
1. `.claude/context/project-brief.md` - Project overview and objectives
|
|
38
|
+
2. `.claude/context/tech-context.md` - Technical stack and dependencies
|
|
39
|
+
3. `.claude/context/project-structure.md` - Directory layout and organization
|
|
40
|
+
4. `.claude/context/progress.md` - Current status and next steps
|
|
41
|
+
|
|
42
|
+
### 3. Process and internalize context
|
|
43
|
+
|
|
44
|
+
**Parse key information:**
|
|
45
|
+
|
|
46
|
+
From **project-brief.md**:
|
|
47
|
+
- Project name and description
|
|
48
|
+
- Primary objectives and goals
|
|
49
|
+
- Target users and stakeholders
|
|
50
|
+
- Key constraints and limitations
|
|
51
|
+
- Success criteria
|
|
52
|
+
|
|
53
|
+
From **tech-context.md**:
|
|
54
|
+
- Technology stack (frontend, backend, database, infrastructure)
|
|
55
|
+
- Development environment (Node.js version, package manager, testing framework)
|
|
56
|
+
- Key dependencies and their purposes
|
|
57
|
+
- Architecture patterns in use
|
|
58
|
+
- Development practices
|
|
59
|
+
|
|
60
|
+
From **project-structure.md**:
|
|
61
|
+
- Directory layout and organization
|
|
62
|
+
- Key files and their purposes
|
|
63
|
+
- Module structure
|
|
64
|
+
- Configuration files
|
|
65
|
+
|
|
66
|
+
From **progress.md**:
|
|
67
|
+
- Current phase and progress percentage
|
|
68
|
+
- Completed tasks
|
|
69
|
+
- In-progress tasks
|
|
70
|
+
- Next steps
|
|
71
|
+
- Any blockers
|
|
72
|
+
|
|
73
|
+
### 4. Display loaded context summary
|
|
74
|
+
|
|
75
|
+
Present a comprehensive summary:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
š Project Context Loaded
|
|
79
|
+
|
|
80
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
81
|
+
|
|
82
|
+
PROJECT: [Project Name]
|
|
83
|
+
PHASE: [Current Phase] | PROGRESS: [X]%
|
|
84
|
+
LAST UPDATED: [Date from progress.md]
|
|
85
|
+
|
|
86
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
87
|
+
|
|
88
|
+
šÆ OBJECTIVES
|
|
89
|
+
- [Primary goal]
|
|
90
|
+
- [Secondary goal]
|
|
91
|
+
- [Tertiary goal]
|
|
92
|
+
|
|
93
|
+
š§ TECH STACK
|
|
94
|
+
- Frontend: [Technologies]
|
|
95
|
+
- Backend: [Technologies]
|
|
96
|
+
- Database: [Database]
|
|
97
|
+
- Testing: [Framework]
|
|
98
|
+
|
|
99
|
+
š STRUCTURE
|
|
100
|
+
[Brief structure overview]
|
|
101
|
+
|
|
102
|
+
ā
COMPLETED
|
|
103
|
+
- [Recent completed task 1]
|
|
104
|
+
- [Recent completed task 2]
|
|
105
|
+
|
|
106
|
+
š§ IN PROGRESS
|
|
107
|
+
- [Current task 1]
|
|
108
|
+
- [Current task 2]
|
|
109
|
+
|
|
110
|
+
āļø NEXT STEPS
|
|
111
|
+
1. [Next action 1]
|
|
112
|
+
2. [Next action 2]
|
|
113
|
+
|
|
114
|
+
ā ļø BLOCKERS
|
|
115
|
+
- [Blocker 1, if any]
|
|
116
|
+
|
|
117
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
118
|
+
|
|
119
|
+
ā
Context loaded. AI agent now has project memory.
|
|
120
|
+
|
|
121
|
+
š” TIP: Run /pm:context-update after significant changes to keep context current.
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### 5. Internal context retention
|
|
125
|
+
|
|
126
|
+
**CRITICAL:** After displaying the summary, the AI agent should:
|
|
127
|
+
|
|
128
|
+
1. **Retain project identity**: Remember project name, goals, and constraints
|
|
129
|
+
2. **Understand technical environment**: Keep tech stack and dependencies in mind
|
|
130
|
+
3. **Maintain progress awareness**: Know what's done, what's in progress, what's next
|
|
131
|
+
4. **Respect project structure**: Work within established organization patterns
|
|
132
|
+
5. **Align with practices**: Follow development practices outlined in context
|
|
133
|
+
|
|
134
|
+
This context should guide all subsequent interactions in the session:
|
|
135
|
+
- Suggestions should align with project objectives
|
|
136
|
+
- Recommendations should fit the tech stack
|
|
137
|
+
- Changes should consider current progress
|
|
138
|
+
- Code should match project structure
|
|
139
|
+
|
|
140
|
+
### 6. Confirmation
|
|
141
|
+
|
|
142
|
+
Return structured confirmation:
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"status": "loaded",
|
|
147
|
+
"project": "[Project Name]",
|
|
148
|
+
"phase": "[Current Phase]",
|
|
149
|
+
"progress": "[X]%",
|
|
150
|
+
"filesRead": [
|
|
151
|
+
"project-brief.md",
|
|
152
|
+
"tech-context.md",
|
|
153
|
+
"project-structure.md",
|
|
154
|
+
"progress.md"
|
|
155
|
+
],
|
|
156
|
+
"keyTakeaways": [
|
|
157
|
+
"[Important point 1]",
|
|
158
|
+
"[Important point 2]",
|
|
159
|
+
"[Important point 3]"
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Output Format
|
|
165
|
+
|
|
166
|
+
Return:
|
|
167
|
+
- Formatted context summary (as shown above)
|
|
168
|
+
- Key information highlighted
|
|
169
|
+
- Current focus areas
|
|
170
|
+
- Recommendations based on loaded context
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: Read, Write, Edit, Bash, Glob
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Context Update
|
|
6
|
+
|
|
7
|
+
Update project context after significant changes to maintain AI agent memory accuracy.
|
|
8
|
+
|
|
9
|
+
## Required Documentation Access
|
|
10
|
+
|
|
11
|
+
**MANDATORY:** Before updating context, query Context7 for best practices:
|
|
12
|
+
|
|
13
|
+
**Documentation Queries:**
|
|
14
|
+
- `mcp://context7/knowledge-management/documentation-maintenance` - Documentation update strategies
|
|
15
|
+
- `mcp://context7/agile/progress-tracking` - Progress tracking best practices
|
|
16
|
+
- `mcp://context7/project-management/status-reporting` - Status update patterns
|
|
17
|
+
|
|
18
|
+
**Why This is Required:**
|
|
19
|
+
- Ensures context updates follow documentation best practices
|
|
20
|
+
- Maintains consistency with agile progress tracking
|
|
21
|
+
- Provides effective status reporting patterns
|
|
22
|
+
|
|
23
|
+
## Instructions
|
|
24
|
+
|
|
25
|
+
Intelligently update project context files based on detected changes.
|
|
26
|
+
|
|
27
|
+
### 1. Verify context exists
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
if [ ! -d ".claude/context" ]; then
|
|
31
|
+
echo "ā Context not found. Run /pm:context-create first."
|
|
32
|
+
exit 1
|
|
33
|
+
fi
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 2. Detect changes since last update
|
|
37
|
+
|
|
38
|
+
**Check multiple sources for changes:**
|
|
39
|
+
|
|
40
|
+
1. **package.json changes:**
|
|
41
|
+
- Compare current dependencies with tech-context.md
|
|
42
|
+
- Detect new dependencies added
|
|
43
|
+
- Identify version updates
|
|
44
|
+
- Note removed dependencies
|
|
45
|
+
|
|
46
|
+
2. **Directory structure changes:**
|
|
47
|
+
- Scan current directory structure
|
|
48
|
+
- Compare with project-structure.md
|
|
49
|
+
- Detect new directories
|
|
50
|
+
- Note removed directories
|
|
51
|
+
|
|
52
|
+
3. **Git history (if available):**
|
|
53
|
+
- Check recent commits since last context update
|
|
54
|
+
- Extract meaningful changes from commit messages
|
|
55
|
+
- Identify completed features/tasks
|
|
56
|
+
|
|
57
|
+
4. **README.md changes:**
|
|
58
|
+
- Compare current README with project-brief.md
|
|
59
|
+
- Detect updated project description
|
|
60
|
+
- Note new features or objectives
|
|
61
|
+
|
|
62
|
+
### 3. Update relevant files
|
|
63
|
+
|
|
64
|
+
**Update tech-context.md if tech stack changed:**
|
|
65
|
+
|
|
66
|
+
If new dependencies detected:
|
|
67
|
+
```markdown
|
|
68
|
+
## Dependencies
|
|
69
|
+
[Existing dependencies]
|
|
70
|
+
|
|
71
|
+
**Recently Added:**
|
|
72
|
+
- [new-package-name]: [Purpose/description]
|
|
73
|
+
Added: [Date]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
If versions changed:
|
|
77
|
+
```markdown
|
|
78
|
+
## Development Environment
|
|
79
|
+
- Node.js: [new version] (updated from [old version])
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Update progress.md for project progress:**
|
|
83
|
+
|
|
84
|
+
Always update:
|
|
85
|
+
1. **Last Updated timestamp** to current date
|
|
86
|
+
2. Move completed items from "In Progress" to "Completed"
|
|
87
|
+
3. Update progress percentage based on completed tasks
|
|
88
|
+
4. Add new tasks to "In Progress" or "Next Steps"
|
|
89
|
+
5. Update or remove blockers
|
|
90
|
+
|
|
91
|
+
Example update:
|
|
92
|
+
```markdown
|
|
93
|
+
## Current Status
|
|
94
|
+
- Phase: [Current phase]
|
|
95
|
+
- Progress: [Updated]%
|
|
96
|
+
- Last Updated: [Current date]
|
|
97
|
+
|
|
98
|
+
## Completed
|
|
99
|
+
- [x] [Previously in-progress task now completed]
|
|
100
|
+
- [x] [Another completed task]
|
|
101
|
+
|
|
102
|
+
## In Progress
|
|
103
|
+
- [ ] [New current task]
|
|
104
|
+
- [ ] [Another current task]
|
|
105
|
+
|
|
106
|
+
## Next Steps
|
|
107
|
+
1. [Updated next action]
|
|
108
|
+
2. [New next action]
|
|
109
|
+
|
|
110
|
+
## Blockers
|
|
111
|
+
- [Updated or new blocker, or note "None" if resolved]
|
|
112
|
+
|
|
113
|
+
## Recent Updates
|
|
114
|
+
- [Date]: [Description of recent change]
|
|
115
|
+
- [Date]: [Description of recent change]
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Update project-structure.md if structure changed:**
|
|
119
|
+
|
|
120
|
+
If new directories detected:
|
|
121
|
+
```markdown
|
|
122
|
+
## Directory Layout
|
|
123
|
+
```
|
|
124
|
+
project/
|
|
125
|
+
āāā src/ # Source code
|
|
126
|
+
āāā test/ # Tests
|
|
127
|
+
āāā .claude/ # AutoPM configuration
|
|
128
|
+
āāā [new-dir]/ # [Purpose of new directory]
|
|
129
|
+
āāā docs/ # Documentation
|
|
130
|
+
```
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
If new key files added:
|
|
134
|
+
```markdown
|
|
135
|
+
## Key Files
|
|
136
|
+
- **[new-file]**: [Purpose and description]
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Update project-brief.md if scope changed:**
|
|
140
|
+
|
|
141
|
+
Only if README.md or objectives significantly changed:
|
|
142
|
+
- Update project description
|
|
143
|
+
- Add new objectives
|
|
144
|
+
- Update success criteria
|
|
145
|
+
- Note scope expansions or reductions
|
|
146
|
+
|
|
147
|
+
### 4. Generate change summary
|
|
148
|
+
|
|
149
|
+
Track what was updated:
|
|
150
|
+
```json
|
|
151
|
+
{
|
|
152
|
+
"updatedFiles": [],
|
|
153
|
+
"changes": {
|
|
154
|
+
"techContext": {
|
|
155
|
+
"addedDependencies": [],
|
|
156
|
+
"updatedVersions": [],
|
|
157
|
+
"removedDependencies": []
|
|
158
|
+
},
|
|
159
|
+
"progress": {
|
|
160
|
+
"completedTasks": [],
|
|
161
|
+
"newTasks": [],
|
|
162
|
+
"progressIncrease": "X%",
|
|
163
|
+
"resolvedBlockers": []
|
|
164
|
+
},
|
|
165
|
+
"structure": {
|
|
166
|
+
"newDirectories": [],
|
|
167
|
+
"newFiles": []
|
|
168
|
+
},
|
|
169
|
+
"brief": {
|
|
170
|
+
"updated": false,
|
|
171
|
+
"changes": []
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### 5. Smart update logic
|
|
178
|
+
|
|
179
|
+
**Only update files with actual changes:**
|
|
180
|
+
|
|
181
|
+
```javascript
|
|
182
|
+
// Pseudocode for update logic
|
|
183
|
+
if (techStackChanged) {
|
|
184
|
+
updateTechContext();
|
|
185
|
+
updatedFiles.push("tech-context.md");
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (progressChanged || tasksCompleted) {
|
|
189
|
+
updateProgress();
|
|
190
|
+
updatedFiles.push("progress.md");
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (structureChanged) {
|
|
194
|
+
updateProjectStructure();
|
|
195
|
+
updatedFiles.push("project-structure.md");
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (scopeChanged) {
|
|
199
|
+
updateProjectBrief();
|
|
200
|
+
updatedFiles.push("project-brief.md");
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Always update progress.md with "Last Updated" timestamp
|
|
204
|
+
if (!updatedFiles.includes("progress.md")) {
|
|
205
|
+
updateProgressTimestamp();
|
|
206
|
+
updatedFiles.push("progress.md");
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### 6. Confirm updates
|
|
211
|
+
|
|
212
|
+
Display comprehensive update summary:
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
ā
Context updated
|
|
216
|
+
|
|
217
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
218
|
+
|
|
219
|
+
š UPDATED FILES
|
|
220
|
+
- tech-context.md
|
|
221
|
+
- progress.md
|
|
222
|
+
- project-structure.md
|
|
223
|
+
|
|
224
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
225
|
+
|
|
226
|
+
š§ TECH CONTEXT CHANGES
|
|
227
|
+
Added Dependencies:
|
|
228
|
+
- [new-package]: [Purpose]
|
|
229
|
+
|
|
230
|
+
Updated Versions:
|
|
231
|
+
- Node.js: [old] ā [new]
|
|
232
|
+
|
|
233
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
234
|
+
|
|
235
|
+
š PROGRESS UPDATES
|
|
236
|
+
Completed Tasks:
|
|
237
|
+
ā
[Task 1]
|
|
238
|
+
ā
[Task 2]
|
|
239
|
+
|
|
240
|
+
Progress: [Old]% ā [New]%
|
|
241
|
+
Phase: [Phase name]
|
|
242
|
+
|
|
243
|
+
Next Steps:
|
|
244
|
+
1. [Next action]
|
|
245
|
+
2. [Next action]
|
|
246
|
+
|
|
247
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
248
|
+
|
|
249
|
+
š STRUCTURE CHANGES
|
|
250
|
+
New Directories:
|
|
251
|
+
+ [new-dir]/ # [Purpose]
|
|
252
|
+
|
|
253
|
+
New Key Files:
|
|
254
|
+
+ [new-file] # [Purpose]
|
|
255
|
+
|
|
256
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
257
|
+
|
|
258
|
+
š” RECOMMENDATIONS
|
|
259
|
+
- Run /pm:context-prime to reload updated context
|
|
260
|
+
- Consider updating project-brief.md if objectives changed
|
|
261
|
+
- [Other relevant recommendations]
|
|
262
|
+
|
|
263
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### 7. Handle no-change scenario
|
|
267
|
+
|
|
268
|
+
If no changes detected:
|
|
269
|
+
|
|
270
|
+
```
|
|
271
|
+
ā¹ļø No significant changes detected since last update
|
|
272
|
+
|
|
273
|
+
Context is up-to-date:
|
|
274
|
+
- Tech stack: No changes
|
|
275
|
+
- Progress: No new completions
|
|
276
|
+
- Structure: No changes
|
|
277
|
+
- Last updated: [Date from progress.md]
|
|
278
|
+
|
|
279
|
+
š” Context will be updated when changes are detected:
|
|
280
|
+
- New dependencies in package.json
|
|
281
|
+
- New directories or files
|
|
282
|
+
- Changes to README.md
|
|
283
|
+
- Git commits (if available)
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
## Output Format
|
|
287
|
+
|
|
288
|
+
Return:
|
|
289
|
+
- List of updated files
|
|
290
|
+
- Detailed change summary for each file
|
|
291
|
+
- Recommendations based on changes
|
|
292
|
+
- Prompt to reload context if significant updates made
|
|
@@ -7,8 +7,27 @@ allowed-tools: Bash, Read, Write, LS, Task
|
|
|
7
7
|
Break epic into concrete, actionable tasks.
|
|
8
8
|
|
|
9
9
|
## Usage
|
|
10
|
+
|
|
11
|
+
**Single Epic:**
|
|
12
|
+
```bash
|
|
13
|
+
/pm:epic-decompose <feature_name>
|
|
10
14
|
```
|
|
15
|
+
|
|
16
|
+
**Multi-Epic (decomposes ALL epics at once):**
|
|
17
|
+
```bash
|
|
11
18
|
/pm:epic-decompose <feature_name>
|
|
19
|
+
# Example: /pm:epic-decompose ecommerce-platform
|
|
20
|
+
# This will automatically decompose ALL epics:
|
|
21
|
+
# - 01-infrastructure
|
|
22
|
+
# - 02-auth-backend
|
|
23
|
+
# - 03-product-api
|
|
24
|
+
# - etc.
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Single Epic from Multi-Epic structure:**
|
|
28
|
+
```bash
|
|
29
|
+
/pm:epic-decompose <feature_name>/<epic_folder>
|
|
30
|
+
# Example: /pm:epic-decompose ecommerce-platform/01-infrastructure
|
|
12
31
|
```
|
|
13
32
|
|
|
14
33
|
## Required Documentation Access
|
|
@@ -37,7 +37,7 @@ Merge completed epic branch back to main branch.
|
|
|
37
37
|
|
|
38
38
|
2. **Check for active agents:**
|
|
39
39
|
Read `.claude/epics/$ARGUMENTS/execution-status.md`
|
|
40
|
-
If active agents exist: "ā ļø Active agents detected. Stop them first with: /pm:epic-
|
|
40
|
+
If active agents exist: "ā ļø Active agents detected. Stop them first with: /pm:epic-close $ARGUMENTS"
|
|
41
41
|
|
|
42
42
|
## Instructions
|
|
43
43
|
|
|
@@ -123,7 +123,7 @@ Options:
|
|
|
123
123
|
git merge --abort
|
|
124
124
|
|
|
125
125
|
3. Get help:
|
|
126
|
-
/pm:epic-
|
|
126
|
+
/pm:epic-close $ARGUMENTS
|
|
127
127
|
|
|
128
128
|
Branch preserved at: epic/$ARGUMENTS
|
|
129
129
|
"
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Epic Sync Tasks - Create GitHub issues for all tasks in an epic
|
|
4
|
+
*
|
|
5
|
+
* Modern Node.js replacement for bash scripts that had parsing issues.
|
|
6
|
+
* Uses simple, testable code instead of complex shell heredocs.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const { execSync } = require('child_process');
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Parse task file frontmatter and content
|
|
15
|
+
*/
|
|
16
|
+
function parseTaskFile(filePath) {
|
|
17
|
+
const content = fs.readFileSync(filePath, 'utf8');
|
|
18
|
+
const lines = content.split('\n');
|
|
19
|
+
|
|
20
|
+
let inFrontmatter = false;
|
|
21
|
+
let frontmatterLines = [];
|
|
22
|
+
let bodyLines = [];
|
|
23
|
+
let frontmatterCount = 0;
|
|
24
|
+
|
|
25
|
+
for (const line of lines) {
|
|
26
|
+
if (line === '---') {
|
|
27
|
+
frontmatterCount++;
|
|
28
|
+
if (frontmatterCount === 1) {
|
|
29
|
+
inFrontmatter = true;
|
|
30
|
+
continue;
|
|
31
|
+
} else if (frontmatterCount === 2) {
|
|
32
|
+
inFrontmatter = false;
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (inFrontmatter) {
|
|
38
|
+
frontmatterLines.push(line);
|
|
39
|
+
} else if (frontmatterCount === 2) {
|
|
40
|
+
bodyLines.push(line);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Parse frontmatter
|
|
45
|
+
const frontmatter = {};
|
|
46
|
+
for (const line of frontmatterLines) {
|
|
47
|
+
const match = line.match(/^(\w+):\s*(.+)$/);
|
|
48
|
+
if (match) {
|
|
49
|
+
const [, key, value] = match;
|
|
50
|
+
frontmatter[key] = value;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
frontmatter,
|
|
56
|
+
body: bodyLines.join('\n').trim(),
|
|
57
|
+
title: frontmatter.name || 'Untitled Task'
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Create GitHub issue for a task
|
|
63
|
+
*/
|
|
64
|
+
function createTaskIssue(taskData, epicIssueNumber, epicPath, taskNumber) {
|
|
65
|
+
const { title, body } = taskData;
|
|
66
|
+
|
|
67
|
+
// Create issue body with epic reference
|
|
68
|
+
const issueBody = `
|
|
69
|
+
Part of Epic #${epicIssueNumber}
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
${body}
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
**Epic Path:** \`${epicPath}\`
|
|
78
|
+
**Task Number:** ${taskNumber}
|
|
79
|
+
`.trim();
|
|
80
|
+
|
|
81
|
+
// Escape quotes for shell
|
|
82
|
+
const escapedTitle = title.replace(/"/g, '\\"');
|
|
83
|
+
const escapedBody = issueBody.replace(/"/g, '\\"').replace(/`/g, '\\`');
|
|
84
|
+
|
|
85
|
+
// Create GitHub issue
|
|
86
|
+
try {
|
|
87
|
+
const result = execSync(
|
|
88
|
+
`gh issue create --title "${escapedTitle}" --body "${escapedBody}" --label "task"`,
|
|
89
|
+
{ encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] }
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
const issueMatch = result.match(/https:\/\/github\.com\/[^\/]+\/[^\/]+\/issues\/(\d+)/);
|
|
93
|
+
if (issueMatch) {
|
|
94
|
+
return parseInt(issueMatch[1]);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return null;
|
|
98
|
+
} catch (error) {
|
|
99
|
+
console.error(`ā Failed to create issue for task ${taskNumber}:`, error.message);
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Update task file with GitHub issue number
|
|
106
|
+
*/
|
|
107
|
+
function updateTaskFrontmatter(filePath, issueNumber) {
|
|
108
|
+
const content = fs.readFileSync(filePath, 'utf8');
|
|
109
|
+
const updatedContent = content.replace(
|
|
110
|
+
/^github:.*$/m,
|
|
111
|
+
`github: "#${issueNumber}"`
|
|
112
|
+
);
|
|
113
|
+
fs.writeFileSync(filePath, updatedContent, 'utf8');
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Main function
|
|
118
|
+
*/
|
|
119
|
+
function main() {
|
|
120
|
+
const args = process.argv.slice(2);
|
|
121
|
+
|
|
122
|
+
if (args.length < 2) {
|
|
123
|
+
console.error('Usage: epicSyncTasks.js <epic-path> <epic-issue-number>');
|
|
124
|
+
console.error('Example: epicSyncTasks.js fullstack/01-infrastructure 2');
|
|
125
|
+
process.exit(1);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const [epicPath, epicIssueNumber] = args;
|
|
129
|
+
const epicDir = path.join(process.cwd(), '.claude/epics', epicPath);
|
|
130
|
+
|
|
131
|
+
if (!fs.existsSync(epicDir)) {
|
|
132
|
+
console.error(`ā Epic directory not found: ${epicDir}`);
|
|
133
|
+
process.exit(1);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Find all task files (numbered .md files)
|
|
137
|
+
const taskFiles = fs.readdirSync(epicDir)
|
|
138
|
+
.filter(f => /^\d+\.md$/.test(f))
|
|
139
|
+
.sort();
|
|
140
|
+
|
|
141
|
+
if (taskFiles.length === 0) {
|
|
142
|
+
console.error(`ā No task files found in ${epicDir}`);
|
|
143
|
+
process.exit(1);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
console.log(`š Creating ${taskFiles.length} task issues for epic #${epicIssueNumber}`);
|
|
147
|
+
console.log(`š Epic path: ${epicPath}\n`);
|
|
148
|
+
|
|
149
|
+
let successCount = 0;
|
|
150
|
+
let failCount = 0;
|
|
151
|
+
|
|
152
|
+
for (const taskFile of taskFiles) {
|
|
153
|
+
const taskNumber = taskFile.replace('.md', '');
|
|
154
|
+
const taskPath = path.join(epicDir, taskFile);
|
|
155
|
+
|
|
156
|
+
console.log(`[${successCount + failCount + 1}/${taskFiles.length}] Creating issue for task ${taskNumber}...`);
|
|
157
|
+
|
|
158
|
+
try {
|
|
159
|
+
const taskData = parseTaskFile(taskPath);
|
|
160
|
+
const issueNumber = createTaskIssue(taskData, epicIssueNumber, epicPath, taskNumber);
|
|
161
|
+
|
|
162
|
+
if (issueNumber) {
|
|
163
|
+
updateTaskFrontmatter(taskPath, issueNumber);
|
|
164
|
+
console.log(` ā
Created issue #${issueNumber}: ${taskData.title}`);
|
|
165
|
+
successCount++;
|
|
166
|
+
} else {
|
|
167
|
+
console.log(` ā ļø Issue created but number not found`);
|
|
168
|
+
failCount++;
|
|
169
|
+
}
|
|
170
|
+
} catch (error) {
|
|
171
|
+
console.error(` ā Error: ${error.message}`);
|
|
172
|
+
failCount++;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
console.log(`\nš Summary:`);
|
|
177
|
+
console.log(` ā
Success: ${successCount}`);
|
|
178
|
+
console.log(` ā Failed: ${failCount}`);
|
|
179
|
+
console.log(` š Total: ${taskFiles.length}`);
|
|
180
|
+
|
|
181
|
+
if (failCount > 0) {
|
|
182
|
+
process.exit(1);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (require.main === module) {
|
|
187
|
+
main();
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
module.exports = { parseTaskFile, createTaskIssue, updateTaskFrontmatter };
|