claude-autopm 1.11.1 → 1.11.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.
@@ -0,0 +1,97 @@
1
+ # Epic Split
2
+
3
+ Automatically split a PRD into multiple logical epics based on content analysis.
4
+
5
+ ## Usage
6
+ ```bash
7
+ /pm:epic-split <feature_name>
8
+ ```
9
+
10
+ ## Description
11
+ This command analyzes a PRD and automatically splits it into multiple epics based on:
12
+ - Technical components (frontend, backend, infrastructure)
13
+ - Feature areas (auth, dashboard, API, etc.)
14
+ - Complexity and dependencies
15
+ - Priority levels (P0, P1, P2)
16
+
17
+ ## How It Works
18
+
19
+ 1. **PRD Analysis**: Scans the PRD for keywords and patterns
20
+ 2. **Epic Identification**: Matches content against epic templates
21
+ 3. **Dependency Mapping**: Determines logical dependencies between epics
22
+ 4. **Structure Creation**: Creates organized epic folders with metadata
23
+
24
+ ## Epic Types Detected
25
+
26
+ - **Infrastructure Foundation** - Docker, DB, monitoring
27
+ - **Authentication Backend** - JWT, users, RBAC
28
+ - **Authentication UI** - Login/register forms
29
+ - **API Core Services** - REST endpoints
30
+ - **Frontend Foundation** - React/Vue/Angular setup
31
+ - **Dashboard & UX** - Main application UI
32
+ - **Data Layer** - Database models, migrations
33
+ - **Testing & Quality** - Test suites, TDD
34
+ - **Deployment & DevOps** - CI/CD, production
35
+ - **Security & Compliance** - OWASP, hardening
36
+
37
+ ## Output Structure
38
+
39
+ ```
40
+ .claude/epics/<feature_name>/
41
+ ├── meta.yaml # Multi-epic metadata
42
+ ├── 01-infrastructure/ # Epic 1
43
+ │ └── epic.md
44
+ ├── 02-auth_backend/ # Epic 2
45
+ │ └── epic.md
46
+ ├── 03-frontend_foundation/ # Epic 3
47
+ │ └── epic.md
48
+ └── ...
49
+ ```
50
+
51
+ ## Example
52
+
53
+ ```bash
54
+ # Split a complex PRD into epics
55
+ /pm:epic-split frontend-backend-db-base
56
+
57
+ # Output:
58
+ ✓ Identified 6 epics
59
+ ✓ Epic 1: Infrastructure Foundation (P0, 1w)
60
+ ✓ Epic 2: Authentication Backend (P0, 2w)
61
+ ✓ Epic 3: Frontend Foundation (P0, 1w)
62
+ ✓ Epic 4: Authentication UI (P0, 2w)
63
+ ✓ Epic 5: Dashboard & UX (P1, 2w)
64
+ ✓ Epic 6: Testing & Quality (P1, 1w)
65
+
66
+ Total Estimated Effort: 9 weeks
67
+ ```
68
+
69
+ ## Benefits
70
+
71
+ - **Automatic Analysis**: No manual epic creation needed
72
+ - **Dependency Detection**: Understands epic relationships
73
+ - **Priority Sorting**: P0 epics come first
74
+ - **Parallel Work**: Identifies what can be done simultaneously
75
+ - **Time Estimates**: Provides week-level estimates
76
+
77
+ ## Next Steps After Split
78
+
79
+ 1. Review the epic breakdown
80
+ 2. Decompose each epic into tasks: `pm epic-decompose <feature>/<epic_number>`
81
+ 3. Sync to GitHub: `pm epic-sync <feature>`
82
+ 4. Start implementation on parallel epics
83
+
84
+ ## When to Use
85
+
86
+ - PRDs with multiple components (frontend + backend + infra)
87
+ - Complex features requiring phased delivery
88
+ - Large teams needing parallel work streams
89
+ - Projects requiring clear milestone tracking
90
+
91
+ ## Manual Override
92
+
93
+ If the automatic split isn't perfect, you can:
94
+ 1. Edit the generated epic files
95
+ 2. Adjust dependencies in meta.yaml
96
+ 3. Merge or split epics further
97
+ 4. Update time estimates
@@ -0,0 +1,300 @@
1
+ # Multi-Epic Breakdown Example: Frontend-Backend-DB-Base
2
+
3
+ ## Original PRD: MUI + FastAPI + PostgreSQL + TDD
4
+
5
+ Ta sama PRD może być podzielona na **6 logicznych epiców** zamiast jednego:
6
+
7
+ ---
8
+
9
+ ## Epic 1: Infrastructure Foundation
10
+ **Priorytet:** P0 (Blokujący)
11
+ **Czas:** 1 tydzień
12
+ **Zależności:** Brak
13
+
14
+ ### Zakres:
15
+ - Docker setup (multi-stage builds)
16
+ - Docker Compose dla dev/prod
17
+ - Monorepo struktura (pnpm + uv/poetry)
18
+ - PostgreSQL setup z pgBouncer
19
+ - Redis setup (opcjonalnie)
20
+ - Health checks i monitoring podstawowy
21
+ - Environment configuration (.env)
22
+
23
+ ### Zadania (7):
24
+ 1. Setup monorepo structure
25
+ 2. Create Docker configurations
26
+ 3. Setup PostgreSQL with migrations
27
+ 4. Configure Redis (optional)
28
+ 5. Setup development environment
29
+ 6. Create health check endpoints
30
+ 7. Configure logging infrastructure
31
+
32
+ ---
33
+
34
+ ## Epic 2: Authentication Core (Backend)
35
+ **Priorytet:** P0
36
+ **Czas:** 2 tygodnie
37
+ **Zależności:** Epic 1
38
+
39
+ ### Zakres:
40
+ - User model i migracje (Alembic)
41
+ - JWT + refresh token implementation
42
+ - Registration endpoint
43
+ - Login/logout endpoints
44
+ - Token refresh mechanism
45
+ - Password hashing (Argon2)
46
+ - RBAC (roles: user, admin)
47
+
48
+ ### Zadania (10):
49
+ 1. Create user database models
50
+ 2. Setup Alembic migrations
51
+ 3. Implement JWT token service
52
+ 4. Create registration endpoint
53
+ 5. Create login endpoint
54
+ 6. Implement refresh token rotation
55
+ 7. Setup RBAC system
56
+ 8. Add token revocation
57
+ 9. Create logout endpoint
58
+ 10. Write auth middleware
59
+
60
+ ---
61
+
62
+ ## Epic 3: Password Management
63
+ **Priorytet:** P0
64
+ **Czas:** 1 tydzień
65
+ **Zależności:** Epic 2
66
+
67
+ ### Zakres:
68
+ - Forgot password flow
69
+ - Reset password via token
70
+ - Change password (logged in)
71
+ - Password complexity rules
72
+ - Password history
73
+ - Rate limiting for password operations
74
+
75
+ ### Zadania (6):
76
+ 1. Create password reset token model
77
+ 2. Implement forgot password endpoint
78
+ 3. Create reset password endpoint
79
+ 4. Implement change password endpoint
80
+ 5. Add password validation rules
81
+ 6. Setup rate limiting
82
+
83
+ ---
84
+
85
+ ## Epic 4: Frontend Foundation
86
+ **Priorytet:** P0
87
+ **Czas:** 1.5 tygodnia
88
+ **Zależności:** Epic 1
89
+
90
+ ### Zakres:
91
+ - React 18 + TypeScript setup
92
+ - Vite configuration
93
+ - MUI theme setup
94
+ - React Router configuration
95
+ - Zustand state management
96
+ - i18n setup (en/pl)
97
+ - API client setup
98
+
99
+ ### Zadania (8):
100
+ 1. Setup React with Vite
101
+ 2. Configure TypeScript
102
+ 3. Setup MUI theme (light/dark)
103
+ 4. Configure React Router
104
+ 5. Setup Zustand store
105
+ 6. Create API client service
106
+ 7. Setup i18n
107
+ 8. Configure form validation (react-hook-form + zod)
108
+
109
+ ---
110
+
111
+ ## Epic 5: Authentication UI
112
+ **Priorytet:** P0
113
+ **Czas:** 2 tygodnie
114
+ **Zależności:** Epic 2, Epic 3, Epic 4
115
+
116
+ ### Zakres:
117
+ - Sign in screen
118
+ - Sign up screen
119
+ - Forgot password screen
120
+ - Reset password screen
121
+ - Change password component
122
+ - Auth state management
123
+ - Protected routes
124
+ - Session management
125
+
126
+ ### Zadania (10):
127
+ 1. Create sign in component
128
+ 2. Create sign up component
129
+ 3. Implement forgot password UI
130
+ 4. Create reset password screen
131
+ 5. Build change password form
132
+ 6. Setup auth context/store
133
+ 7. Implement protected routes
134
+ 8. Add session persistence
135
+ 9. Create auth interceptors
136
+ 10. Handle auth errors UI
137
+
138
+ ---
139
+
140
+ ## Epic 6: Dashboard & User Experience
141
+ **Priorytet:** P1
142
+ **Czas:** 2 tygodnie
143
+ **Zależności:** Epic 5
144
+
145
+ ### Zakres:
146
+ - Post-login layout (AppBar, Drawer)
147
+ - Dashboard with metrics cards
148
+ - User profile page
149
+ - Avatar management
150
+ - Navigation system
151
+ - Breadcrumbs
152
+ - User preferences
153
+ - Sign out functionality
154
+
155
+ ### Zadania (9):
156
+ 1. Create app layout shell
157
+ 2. Build navigation drawer
158
+ 3. Implement app bar with user menu
159
+ 4. Create dashboard page
160
+ 5. Build metrics cards
161
+ 6. Create user profile page
162
+ 7. Add avatar upload
163
+ 8. Setup breadcrumbs
164
+ 9. Implement sign out
165
+
166
+ ---
167
+
168
+ ## Relacje między epicami:
169
+
170
+ ```mermaid
171
+ graph TD
172
+ E1[Epic 1: Infrastructure] --> E2[Epic 2: Auth Core]
173
+ E1 --> E4[Epic 4: Frontend Foundation]
174
+ E2 --> E3[Epic 3: Password Mgmt]
175
+ E2 --> E5[Epic 5: Auth UI]
176
+ E3 --> E5
177
+ E4 --> E5
178
+ E5 --> E6[Epic 6: Dashboard & UX]
179
+ ```
180
+
181
+ ## Zalety podziału na wiele epiców:
182
+
183
+ ### 1. **Równoległość pracy**
184
+ - Epic 2 (Backend Auth) i Epic 4 (Frontend Foundation) mogą być robione równolegle
185
+ - Różne zespoły mogą pracować nad różnymi epicami
186
+
187
+ ### 2. **Lepsza widoczność postępów**
188
+ - Każdy epic ma jasny cel i deliverables
189
+ - Łatwiej śledzić, co jest gotowe
190
+
191
+ ### 3. **Elastyczność priorytetów**
192
+ - Można dostarczyć MVP z epicami 1-3 (tylko backend API)
193
+ - Frontend (epicy 4-6) może być dodany później
194
+
195
+ ### 4. **Zarządzanie ryzykiem**
196
+ - Problemy w jednym epicu nie blokują całości
197
+ - Można re-priorytetyzować epicy w razie potrzeby
198
+
199
+ ### 5. **Lepsze estymaty**
200
+ - Mniejsze, bardziej precyzyjne epicy = dokładniejsze estymaty
201
+ - Łatwiej planować sprinty
202
+
203
+ ---
204
+
205
+ ## Jak to zaimplementować w systemie PM:
206
+
207
+ ### Opcja 1: Rozszerzyć `prd-parse.js`
208
+ ```javascript
209
+ // Analiza złożoności PRD
210
+ const analyzeComplexity = (prdContent) => {
211
+ const components = countComponents(prdContent);
212
+ const features = countFeatures(prdContent);
213
+
214
+ if (components > 5 || features > 10) {
215
+ return 'multi-epic';
216
+ }
217
+ return 'single-epic';
218
+ };
219
+
220
+ // Podział na epicy
221
+ const splitIntoEpics = (prdContent) => {
222
+ const epics = [];
223
+
224
+ // Identyfikuj główne obszary
225
+ if (hasInfrastructure(prdContent)) {
226
+ epics.push(createInfraEpic());
227
+ }
228
+ if (hasAuthentication(prdContent)) {
229
+ epics.push(createAuthEpic());
230
+ }
231
+ if (hasFrontend(prdContent)) {
232
+ epics.push(createFrontendEpic());
233
+ }
234
+
235
+ return epics;
236
+ };
237
+ ```
238
+
239
+ ### Opcja 2: Manual split command
240
+ ```bash
241
+ # Nowa komenda do ręcznego podziału
242
+ pm epic-split frontend-backend-db-base
243
+
244
+ # Interaktywnie pyta:
245
+ # - Ile epiców chcesz utworzyć?
246
+ # - Nazwy epiców
247
+ # - Zależności między nimi
248
+ ```
249
+
250
+ ### Opcja 3: YAML config w PRD
251
+ ```yaml
252
+ # W frontmatter PRD
253
+ ---
254
+ epics:
255
+ - name: infrastructure
256
+ priority: P0
257
+ weeks: 1
258
+ - name: auth-backend
259
+ priority: P0
260
+ weeks: 2
261
+ depends_on: [infrastructure]
262
+ - name: auth-frontend
263
+ priority: P0
264
+ weeks: 2
265
+ depends_on: [infrastructure]
266
+ ---
267
+ ```
268
+
269
+ ---
270
+
271
+ ## Struktura folderów dla multi-epic:
272
+
273
+ ```
274
+ .claude/epics/
275
+ ├── frontend-backend-db-base/ # Główny folder dla PRD
276
+ │ ├── meta.yaml # Metadane o wszystkich epicach
277
+ │ ├── infrastructure/ # Epic 1
278
+ │ │ ├── epic.md
279
+ │ │ ├── 001.md
280
+ │ │ ├── 002.md
281
+ │ │ └── ...
282
+ │ ├── auth-backend/ # Epic 2
283
+ │ │ ├── epic.md
284
+ │ │ └── tasks/
285
+ │ ├── password-management/ # Epic 3
286
+ │ │ ├── epic.md
287
+ │ │ └── tasks/
288
+ │ └── ...
289
+ ```
290
+
291
+ ## Podsumowanie
292
+
293
+ Podział PRD na wiele epiców daje:
294
+ - ✅ Lepszą organizację pracy
295
+ - ✅ Możliwość pracy równoległej
296
+ - ✅ Dokładniejsze śledzenie postępów
297
+ - ✅ Elastyczność w dostarczaniu wartości
298
+ - ✅ Łatwiejsze zarządzanie złożonością
299
+
300
+ Czy chcesz, żebym zaimplementował automatyczny podział PRD na wiele epiców?
@@ -0,0 +1,522 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs').promises;
4
+ const path = require('path');
5
+ const yaml = require('js-yaml');
6
+
7
+ /**
8
+ * Epic Split - Automatically split a PRD into multiple epics
9
+ * Usage: node epic-split.js <feature_name>
10
+ */
11
+
12
+ // ANSI colors
13
+ const colors = {
14
+ reset: '\x1b[0m',
15
+ bright: '\x1b[1m',
16
+ red: '\x1b[31m',
17
+ green: '\x1b[32m',
18
+ yellow: '\x1b[33m',
19
+ blue: '\x1b[34m',
20
+ cyan: '\x1b[36m',
21
+ gray: '\x1b[90m'
22
+ };
23
+
24
+ // Epic templates for different components
25
+ const EPIC_TEMPLATES = {
26
+ infrastructure: {
27
+ name: 'Infrastructure Foundation',
28
+ priority: 'P0',
29
+ type: 'infrastructure',
30
+ weeks: 1,
31
+ description: 'Core infrastructure setup including Docker, database, and development environment',
32
+ components: ['docker', 'database', 'redis', 'monitoring', 'logging'],
33
+ keywords: ['docker', 'postgres', 'redis', 'infrastructure', 'compose', 'health', 'monitoring']
34
+ },
35
+ auth_backend: {
36
+ name: 'Authentication Backend',
37
+ priority: 'P0',
38
+ type: 'backend',
39
+ weeks: 2,
40
+ description: 'Backend authentication system with JWT, user management, and RBAC',
41
+ components: ['jwt', 'users', 'roles', 'permissions', 'tokens'],
42
+ keywords: ['auth', 'jwt', 'login', 'register', 'token', 'rbac', 'user model']
43
+ },
44
+ auth_frontend: {
45
+ name: 'Authentication UI',
46
+ priority: 'P0',
47
+ type: 'frontend',
48
+ weeks: 2,
49
+ description: 'Frontend authentication flows including login, registration, and password management',
50
+ components: ['login_ui', 'register_ui', 'password_reset_ui', 'auth_state'],
51
+ keywords: ['sign in', 'sign up', 'login form', 'register form', 'auth ui']
52
+ },
53
+ api_core: {
54
+ name: 'API Core Services',
55
+ priority: 'P0',
56
+ type: 'backend',
57
+ weeks: 2,
58
+ description: 'Core REST API endpoints and business logic',
59
+ components: ['endpoints', 'services', 'middleware', 'validation'],
60
+ keywords: ['api', 'endpoint', 'rest', 'fastapi', 'route', 'service']
61
+ },
62
+ frontend_foundation: {
63
+ name: 'Frontend Foundation',
64
+ priority: 'P0',
65
+ type: 'frontend',
66
+ weeks: 1,
67
+ description: 'Frontend setup with React, TypeScript, and core libraries',
68
+ components: ['react', 'typescript', 'routing', 'state', 'styling'],
69
+ keywords: ['react', 'typescript', 'vite', 'mui', 'material', 'router', 'zustand']
70
+ },
71
+ dashboard: {
72
+ name: 'Dashboard & User Experience',
73
+ priority: 'P1',
74
+ type: 'frontend',
75
+ weeks: 2,
76
+ description: 'Main application dashboard and user interface',
77
+ components: ['dashboard', 'navigation', 'profile', 'layouts'],
78
+ keywords: ['dashboard', 'profile', 'navigation', 'layout', 'appbar', 'drawer']
79
+ },
80
+ testing: {
81
+ name: 'Testing & Quality',
82
+ priority: 'P1',
83
+ type: 'testing',
84
+ weeks: 1,
85
+ description: 'Comprehensive testing suite including unit, integration, and E2E tests',
86
+ components: ['unit_tests', 'integration_tests', 'e2e_tests', 'coverage'],
87
+ keywords: ['test', 'pytest', 'vitest', 'playwright', 'tdd', 'coverage']
88
+ },
89
+ deployment: {
90
+ name: 'Deployment & DevOps',
91
+ priority: 'P1',
92
+ type: 'devops',
93
+ weeks: 1,
94
+ description: 'CI/CD pipelines, deployment configurations, and production setup',
95
+ components: ['ci_cd', 'deployment', 'monitoring', 'security'],
96
+ keywords: ['deploy', 'ci/cd', 'github actions', 'production', 'release']
97
+ },
98
+ data_layer: {
99
+ name: 'Data Layer & Persistence',
100
+ priority: 'P0',
101
+ type: 'backend',
102
+ weeks: 1,
103
+ description: 'Database models, migrations, and data access layer',
104
+ components: ['models', 'migrations', 'orm', 'queries'],
105
+ keywords: ['database', 'model', 'migration', 'alembic', 'sqlalchemy', 'schema']
106
+ },
107
+ security: {
108
+ name: 'Security & Compliance',
109
+ priority: 'P0',
110
+ type: 'security',
111
+ weeks: 1,
112
+ description: 'Security hardening, OWASP compliance, and vulnerability management',
113
+ components: ['security_headers', 'rate_limiting', 'csrf', 'validation'],
114
+ keywords: ['security', 'owasp', 'csrf', 'cors', 'rate limit', 'vulnerability']
115
+ }
116
+ };
117
+
118
+ // Analyze PRD content to identify needed epics
119
+ function analyzePRD(content) {
120
+ const contentLower = content.toLowerCase();
121
+ const identifiedEpics = [];
122
+
123
+ // Check for each epic template
124
+ for (const [key, template] of Object.entries(EPIC_TEMPLATES)) {
125
+ let score = 0;
126
+ let matchedKeywords = [];
127
+
128
+ // Check keywords
129
+ for (const keyword of template.keywords) {
130
+ if (contentLower.includes(keyword.toLowerCase())) {
131
+ score += 1;
132
+ matchedKeywords.push(keyword);
133
+ }
134
+ }
135
+
136
+ // If enough keywords match, include this epic
137
+ if (score >= 2) {
138
+ identifiedEpics.push({
139
+ key,
140
+ template,
141
+ score,
142
+ matchedKeywords
143
+ });
144
+ }
145
+ }
146
+
147
+ // Sort by score and priority
148
+ identifiedEpics.sort((a, b) => {
149
+ if (a.template.priority !== b.template.priority) {
150
+ return a.template.priority === 'P0' ? -1 : 1;
151
+ }
152
+ return b.score - a.score;
153
+ });
154
+
155
+ return identifiedEpics;
156
+ }
157
+
158
+ // Determine epic dependencies
159
+ function determineDependencies(epics) {
160
+ const dependencies = {};
161
+
162
+ for (const epic of epics) {
163
+ dependencies[epic.key] = [];
164
+
165
+ // Infrastructure is always first
166
+ if (epic.key !== 'infrastructure' && epics.some(e => e.key === 'infrastructure')) {
167
+ if (['auth_backend', 'api_core', 'frontend_foundation', 'data_layer'].includes(epic.key)) {
168
+ dependencies[epic.key].push('infrastructure');
169
+ }
170
+ }
171
+
172
+ // Frontend auth depends on backend auth
173
+ if (epic.key === 'auth_frontend') {
174
+ if (epics.some(e => e.key === 'auth_backend')) {
175
+ dependencies[epic.key].push('auth_backend');
176
+ }
177
+ if (epics.some(e => e.key === 'frontend_foundation')) {
178
+ dependencies[epic.key].push('frontend_foundation');
179
+ }
180
+ }
181
+
182
+ // Dashboard depends on auth UI
183
+ if (epic.key === 'dashboard') {
184
+ if (epics.some(e => e.key === 'auth_frontend')) {
185
+ dependencies[epic.key].push('auth_frontend');
186
+ }
187
+ }
188
+
189
+ // API depends on data layer
190
+ if (epic.key === 'api_core' && epics.some(e => e.key === 'data_layer')) {
191
+ dependencies[epic.key].push('data_layer');
192
+ }
193
+
194
+ // Testing depends on implementation epics
195
+ if (epic.key === 'testing') {
196
+ const implEpics = ['api_core', 'auth_backend', 'auth_frontend', 'dashboard'];
197
+ for (const impl of implEpics) {
198
+ if (epics.some(e => e.key === impl)) {
199
+ dependencies[epic.key].push(impl);
200
+ }
201
+ }
202
+ }
203
+
204
+ // Deployment depends on testing
205
+ if (epic.key === 'deployment' && epics.some(e => e.key === 'testing')) {
206
+ dependencies[epic.key].push('testing');
207
+ }
208
+ }
209
+
210
+ return dependencies;
211
+ }
212
+
213
+ // Generate epic content
214
+ function generateEpicContent(epic, dependencies, prdPath, index) {
215
+ const now = new Date().toISOString();
216
+ const template = epic.template;
217
+
218
+ const frontmatter = {
219
+ name: template.name.toLowerCase().replace(/\s+/g, '-'),
220
+ status: 'backlog',
221
+ created: now,
222
+ progress: 0,
223
+ prd: prdPath,
224
+ github: '[Will be updated when synced to GitHub]',
225
+ priority: template.priority,
226
+ type: template.type,
227
+ dependencies: dependencies[epic.key] || [],
228
+ epic_number: index + 1
229
+ };
230
+
231
+ const content = `---
232
+ ${yaml.dump(frontmatter).trim()}
233
+ ---
234
+
235
+ # Epic ${index + 1}: ${template.name}
236
+
237
+ ## Overview
238
+ ${template.description}
239
+
240
+ ## Scope
241
+ This epic covers the following components:
242
+ ${template.components.map(c => `- ${c.replace(/_/g, ' ').charAt(0).toUpperCase() + c.replace(/_/g, ' ').slice(1)}`).join('\n')}
243
+
244
+ ## Dependencies
245
+ ${dependencies[epic.key]?.length > 0 ? dependencies[epic.key].map(d => {
246
+ const depEpic = EPIC_TEMPLATES[d];
247
+ return `- ${depEpic ? depEpic.name : d}`;
248
+ }).join('\n') : '- None (can start immediately)'}
249
+
250
+ ## Success Criteria
251
+ - All ${template.components.length} components implemented and tested
252
+ - Integration with dependent epics verified
253
+ - Documentation complete
254
+ - Code review passed
255
+ - ${template.type === 'frontend' ? 'UI/UX review approved' : ''}
256
+ - ${template.type === 'backend' ? 'API documentation generated' : ''}
257
+ - ${template.type === 'testing' ? 'Coverage targets met (>80%)' : ''}
258
+
259
+ ## Estimated Effort
260
+ **${template.weeks} week${template.weeks > 1 ? 's' : ''}**
261
+
262
+ ## Technical Approach
263
+ ${template.type === 'infrastructure' ? `
264
+ - Set up containerized development environment
265
+ - Configure database and caching layers
266
+ - Implement logging and monitoring
267
+ - Create development scripts and tooling` : ''}
268
+ ${template.type === 'backend' ? `
269
+ - Design data models and API contracts
270
+ - Implement service layer with business logic
271
+ - Create RESTful endpoints
272
+ - Add validation and error handling` : ''}
273
+ ${template.type === 'frontend' ? `
274
+ - Set up component architecture
275
+ - Implement UI components with accessibility
276
+ - Create responsive layouts
277
+ - Integrate with backend APIs` : ''}
278
+ ${template.type === 'testing' ? `
279
+ - Write comprehensive unit tests
280
+ - Create integration test suites
281
+ - Implement E2E test scenarios
282
+ - Set up continuous testing pipeline` : ''}
283
+ ${template.type === 'devops' ? `
284
+ - Configure CI/CD pipelines
285
+ - Set up deployment automation
286
+ - Implement monitoring and alerting
287
+ - Create rollback procedures` : ''}
288
+
289
+ ## Risk Factors
290
+ - Dependency on ${dependencies[epic.key]?.length || 0} other epic${dependencies[epic.key]?.length !== 1 ? 's' : ''}
291
+ - Estimated complexity: ${template.weeks > 1 ? 'High' : 'Medium'}
292
+ - Technical challenges in ${template.components[0].replace(/_/g, ' ')}
293
+
294
+ ## Notes
295
+ - Epic identified based on PRD analysis
296
+ - Matched keywords: ${epic.matchedKeywords.join(', ')}
297
+ - Can be further decomposed into ${3 + template.components.length} to ${5 + template.components.length * 2} tasks
298
+
299
+ ---
300
+ *Generated on ${now} by Epic Split System*`;
301
+
302
+ return content;
303
+ }
304
+
305
+ // Create meta file for multi-epic structure
306
+ function generateMetaFile(epics, featureName) {
307
+ const now = new Date().toISOString();
308
+
309
+ const meta = {
310
+ feature: featureName,
311
+ created: now,
312
+ total_epics: epics.length,
313
+ epics: epics.map((e, i) => ({
314
+ number: i + 1,
315
+ key: e.key,
316
+ name: e.template.name,
317
+ priority: e.template.priority,
318
+ weeks: e.template.weeks,
319
+ type: e.template.type
320
+ })),
321
+ total_weeks: epics.reduce((sum, e) => sum + e.template.weeks, 0),
322
+ execution_strategy: 'parallel_where_possible'
323
+ };
324
+
325
+ return `---
326
+ ${yaml.dump(meta).trim()}
327
+ ---
328
+
329
+ # Multi-Epic Structure: ${featureName}
330
+
331
+ ## Overview
332
+ This feature has been automatically split into ${epics.length} epics based on PRD analysis.
333
+
334
+ ## Epic Breakdown
335
+
336
+ ${epics.map((e, i) => `### Epic ${i + 1}: ${e.template.name}
337
+ - **Priority:** ${e.template.priority}
338
+ - **Duration:** ${e.template.weeks} week${e.template.weeks > 1 ? 's' : ''}
339
+ - **Type:** ${e.template.type}
340
+ - **Confidence:** ${Math.round((e.score / e.template.keywords.length) * 100)}%
341
+ `).join('\n')}
342
+
343
+ ## Execution Timeline
344
+
345
+ \`\`\`
346
+ Week 1-${epics[0]?.template.weeks || 1}: ${epics[0]?.template.name || 'TBD'}
347
+ ${epics.slice(1).map((e, i) => {
348
+ const startWeek = epics.slice(0, i + 1).reduce((sum, ep) => sum + ep.template.weeks, 1);
349
+ const endWeek = startWeek + e.template.weeks - 1;
350
+ return `Week ${startWeek}-${endWeek}: ${e.template.name}`;
351
+ }).join('\n')}
352
+ \`\`\`
353
+
354
+ ## Total Estimated Effort
355
+ **${epics.reduce((sum, e) => sum + e.template.weeks, 0)} weeks**
356
+
357
+ ## Next Steps
358
+ 1. Review and adjust epic breakdown
359
+ 2. Decompose each epic into tasks: \`pm epic-decompose <feature>/<epic_number>\`
360
+ 3. Sync to GitHub: \`pm epic-sync <feature>\`
361
+
362
+ ---
363
+ *Generated on ${now} by Epic Split System*`;
364
+ }
365
+
366
+ async function main() {
367
+ const args = process.argv.slice(2);
368
+
369
+ if (args.length === 0) {
370
+ console.error(`${colors.red}❌ Missing feature name${colors.reset}`);
371
+ console.log('Usage: node epic-split.js <feature_name>');
372
+ process.exit(1);
373
+ }
374
+
375
+ const featureName = args[0];
376
+ const prdPath = path.join('.claude', 'prds', `${featureName}.md`);
377
+ const epicDir = path.join('.claude', 'epics', featureName);
378
+
379
+ console.log(`${colors.cyan}🔄 Analyzing PRD: ${featureName}${colors.reset}`);
380
+ console.log('══════════════════════════════════════════════════\n');
381
+
382
+ try {
383
+ // Check if PRD exists
384
+ try {
385
+ await fs.access(prdPath);
386
+ } catch {
387
+ console.error(`${colors.red}❌ PRD not found: ${prdPath}${colors.reset}`);
388
+ console.log(`First create a PRD with: pm prd-create ${featureName}`);
389
+ process.exit(1);
390
+ }
391
+
392
+ // Check if epics already exist
393
+ try {
394
+ await fs.access(epicDir);
395
+ const files = await fs.readdir(epicDir);
396
+ const epicFolders = files.filter(f => !f.includes('.'));
397
+
398
+ if (epicFolders.length > 0) {
399
+ console.log(`${colors.yellow}⚠️ Found existing epic structure:${colors.reset}`);
400
+ console.log(` ${epicFolders.join(', ')}`);
401
+ console.log('\nThis will replace the existing structure.');
402
+ console.log('Continue? (Press Ctrl+C to cancel)\n');
403
+
404
+ // In real implementation, would wait for user input
405
+ // For now, we'll proceed
406
+ }
407
+ } catch {
408
+ // Directory doesn't exist, that's fine
409
+ }
410
+
411
+ // Read PRD content
412
+ console.log(`${colors.blue}📖 Reading PRD...${colors.reset}`);
413
+ const prdContent = await fs.readFile(prdPath, 'utf8');
414
+
415
+ // Analyze PRD to identify epics
416
+ console.log(`${colors.blue}🔍 Analyzing requirements...${colors.reset}`);
417
+ const identifiedEpics = analyzePRD(prdContent);
418
+
419
+ if (identifiedEpics.length === 0) {
420
+ console.error(`${colors.red}❌ Could not identify any epics from PRD${colors.reset}`);
421
+ console.log('The PRD may be too simple or lack typical keywords.');
422
+ process.exit(1);
423
+ }
424
+
425
+ console.log(`${colors.green}✓ Identified ${identifiedEpics.length} epics${colors.reset}\n`);
426
+
427
+ // Determine dependencies
428
+ console.log(`${colors.blue}🔗 Determining dependencies...${colors.reset}`);
429
+ const dependencies = determineDependencies(identifiedEpics);
430
+
431
+ // Create epic directory structure
432
+ console.log(`${colors.blue}📁 Creating epic structure...${colors.reset}\n`);
433
+ await fs.mkdir(epicDir, { recursive: true });
434
+
435
+ // Create meta file
436
+ const metaContent = generateMetaFile(identifiedEpics, featureName);
437
+ await fs.writeFile(path.join(epicDir, 'meta.yaml'), metaContent);
438
+
439
+ // Create each epic
440
+ for (let i = 0; i < identifiedEpics.length; i++) {
441
+ const epic = identifiedEpics[i];
442
+ const epicNumber = String(i + 1).padStart(2, '0');
443
+ const epicFolder = `${epicNumber}-${epic.key}`;
444
+ const epicPath = path.join(epicDir, epicFolder);
445
+
446
+ // Create epic folder
447
+ await fs.mkdir(epicPath, { recursive: true });
448
+
449
+ // Generate epic content
450
+ const epicContent = generateEpicContent(
451
+ epic,
452
+ dependencies,
453
+ prdPath,
454
+ i
455
+ );
456
+
457
+ // Write epic file
458
+ await fs.writeFile(path.join(epicPath, 'epic.md'), epicContent);
459
+
460
+ console.log(`${colors.green}✓${colors.reset} Epic ${i + 1}: ${epic.template.name}`);
461
+ console.log(` ${colors.gray}Priority: ${epic.template.priority}, Duration: ${epic.template.weeks}w${colors.reset}`);
462
+ console.log(` ${colors.gray}Location: ${epicPath}${colors.reset}`);
463
+ }
464
+
465
+ // Success summary
466
+ console.log(`\n${colors.green}✅ Successfully split PRD into ${identifiedEpics.length} epics!${colors.reset}\n`);
467
+
468
+ console.log(`${colors.bright}📋 Epic Summary:${colors.reset}`);
469
+ console.log('──────────────────────────────────────────────────');
470
+
471
+ const p0Epics = identifiedEpics.filter(e => e.template.priority === 'P0');
472
+ const p1Epics = identifiedEpics.filter(e => e.template.priority === 'P1');
473
+
474
+ console.log(`${colors.cyan}P0 (Must Have):${colors.reset} ${p0Epics.length} epics`);
475
+ p0Epics.forEach((e, i) => {
476
+ console.log(` • ${e.template.name} (${e.template.weeks}w)`);
477
+ });
478
+
479
+ if (p1Epics.length > 0) {
480
+ console.log(`\n${colors.yellow}P1 (Should Have):${colors.reset} ${p1Epics.length} epics`);
481
+ p1Epics.forEach((e, i) => {
482
+ console.log(` • ${e.template.name} (${e.template.weeks}w)`);
483
+ });
484
+ }
485
+
486
+ const totalWeeks = identifiedEpics.reduce((sum, e) => sum + e.template.weeks, 0);
487
+ console.log(`\n${colors.bright}⏱️ Total Estimated Effort: ${totalWeeks} weeks${colors.reset}`);
488
+
489
+ // Show dependency graph
490
+ console.log(`\n${colors.bright}🔗 Dependency Graph:${colors.reset}`);
491
+ console.log('──────────────────────────────────────────────────');
492
+
493
+ for (const epic of identifiedEpics) {
494
+ const deps = dependencies[epic.key];
495
+ if (deps && deps.length > 0) {
496
+ console.log(`${epic.template.name} ${colors.gray}depends on${colors.reset} → ${deps.map(d => {
497
+ const depEpic = identifiedEpics.find(e => e.key === d);
498
+ return depEpic ? depEpic.template.name : d;
499
+ }).join(', ')}`);
500
+ } else {
501
+ console.log(`${epic.template.name} ${colors.green}(can start immediately)${colors.reset}`);
502
+ }
503
+ }
504
+
505
+ console.log(`\n${colors.bright}💡 Next Steps:${colors.reset}`);
506
+ console.log(` 1. Review epics: ${colors.cyan}pm epic-show ${featureName}${colors.reset}`);
507
+ console.log(` 2. Decompose first epic: ${colors.cyan}pm epic-decompose ${featureName}/01-${identifiedEpics[0].key}${colors.reset}`);
508
+ console.log(` 3. Sync all to GitHub: ${colors.cyan}pm epic-sync ${featureName}${colors.reset}`);
509
+
510
+ } catch (error) {
511
+ console.error(`${colors.red}❌ Error: ${error.message}${colors.reset}`);
512
+ if (error.stack && process.env.DEBUG) {
513
+ console.error(colors.gray + error.stack + colors.reset);
514
+ }
515
+ process.exit(1);
516
+ }
517
+ }
518
+
519
+ main().catch(error => {
520
+ console.error(`${colors.red}Fatal error: ${error.message}${colors.reset}`);
521
+ process.exit(1);
522
+ });
package/bin/autopm.js CHANGED
@@ -229,13 +229,14 @@ function main() {
229
229
 
230
230
  6. /pm:prd-new user-auth # Create Product Requirements Document
231
231
  7. /pm:prd-parse user-auth # Parse PRD into structured format
232
- 8. /pm:epic-decompose user-auth # Break PRD into Epic with Issues
233
- 9. /pm:epic-sync user-auth # Create GitHub Epic + Issues
234
- 10. /pm:next # Get next priority issue
235
- 11. /pm:issue-start ISSUE-123 # Start working on specific issue
236
- 12. # ... development work ...
237
- 13. /pm:issue-close ISSUE-123 # Close completed issue
238
- 14. /pm:standup # Generate progress summary
232
+ 8. /pm:epic-split user-auth # [OPTIONAL] Split complex PRD into multiple epics
233
+ 9. /pm:epic-decompose user-auth # Break PRD/Epic into Issues
234
+ 10. /pm:epic-sync user-auth # Create GitHub Epic + Issues
235
+ 11. /pm:next # Get next priority issue
236
+ 12. /pm:issue-start ISSUE-123 # Start working on specific issue
237
+ 13. # ... development work ...
238
+ 14. /pm:issue-close ISSUE-123 # Close completed issue
239
+ 15. /pm:standup # Generate progress summary
239
240
 
240
241
  === AZURE DEVOPS WORKFLOW (PRD → User Stories → Tasks) ===
241
242
  1. autopm install # Setup project framework
@@ -249,13 +250,32 @@ function main() {
249
250
 
250
251
  6. /pm:prd-new user-auth # Create Product Requirements Document
251
252
  7. /pm:prd-parse user-auth # Parse PRD into structured format
252
- 8. /pm:epic-decompose user-auth # Break PRD into User Stories + Tasks
253
- 9. /pm:epic-sync user-auth # Create Azure Epic + User Stories + Tasks
254
- 10. /pm:next # Get next priority task
255
- 11. /pm:issue-start TASK-123 # Start working on specific task
256
- 12. # ... development work ...
257
- 13. /pm:issue-close TASK-123 # Close completed task
258
- 14. /pm:standup # Generate sprint summary
253
+ 8. /pm:epic-split user-auth # [OPTIONAL] Split complex PRD into multiple epics
254
+ 9. /pm:epic-decompose user-auth # Break PRD/Epic into User Stories + Tasks
255
+ 10. /pm:epic-sync user-auth # Create Azure Epic + User Stories + Tasks
256
+ 11. /pm:next # Get next priority task
257
+ 12. /pm:issue-start TASK-123 # Start working on specific task
258
+ 13. # ... development work ...
259
+ 14. /pm:issue-close TASK-123 # Close completed task
260
+ 15. /pm:standup # Generate sprint summary
261
+
262
+ === COMPLEX PROJECT WORKFLOW (Multi-Epic Split) ===
263
+ Example: Full-stack e-commerce platform
264
+
265
+ 6. /pm:prd-new ecommerce-platform
266
+ 7. /pm:prd-parse ecommerce-platform
267
+ 8. /pm:epic-split ecommerce-platform # → Creates 6 epics automatically
268
+ → Epic 1: Infrastructure Foundation (Docker, DB, monitoring)
269
+ → Epic 2: Authentication Backend (JWT, users, RBAC)
270
+ → Epic 3: Product API Services (catalog, inventory, orders)
271
+ → Epic 4: Frontend Foundation (React setup, state management)
272
+ → Epic 5: E-commerce UI (product pages, cart, checkout)
273
+ → Epic 6: Testing & Deployment (CI/CD, quality gates)
274
+ 9. /pm:epic-decompose ecommerce-platform/01-infrastructure # Decompose each epic
275
+ 10. /pm:epic-decompose ecommerce-platform/02-auth-backend
276
+ 11. ... (repeat for each epic)
277
+ 12. /pm:epic-sync ecommerce-platform # Sync all epics to provider
278
+ 13. /pm:next # Start with P0 infrastructure epic
259
279
 
260
280
  📋 Detailed Step-by-Step Examples:
261
281
 
@@ -269,25 +289,33 @@ function main() {
269
289
  → Analyzes PRD content and structure
270
290
  → Prepares for epic decomposition
271
291
 
272
- STEP 8 - Epic Decomposition:
292
+ STEP 8 - Epic Split (Optional for Complex Projects):
293
+ /pm:epic-split user-authentication
294
+ → Analyzes PRD complexity and identifies logical divisions
295
+ → Splits into multiple epics: Infrastructure, Backend, Frontend, UI, etc.
296
+ → Creates structured epic hierarchy with dependencies
297
+ → Example: 6 epics identified (Infrastructure, Auth Backend, Frontend, etc.)
298
+ → Use when: Multi-component projects, large teams, parallel work needed
299
+
300
+ STEP 9 - Epic Decomposition:
273
301
  /pm:epic-decompose user-authentication
274
302
  → GitHub: Creates Epic with linked Issues
275
303
  → Azure: Creates Epic with User Stories and child Tasks
276
- → File: .claude/epics/user-authentication.md
304
+ → File: .claude/epics/user-authentication.md (or multiple epic folders if split)
277
305
 
278
- STEP 9 - Sync with Provider:
306
+ STEP 10 - Sync with Provider:
279
307
  /pm:epic-sync user-authentication
280
308
  → GitHub: Creates Epic + Issues in repository
281
309
  → Azure: Creates Epic + User Stories + Tasks in project
282
310
  → Links local files with remote work items
283
311
 
284
- STEP 10 - Get Next Work:
312
+ STEP 11 - Get Next Work:
285
313
  /pm:next
286
314
  → Returns highest priority unassigned item
287
315
  → GitHub: Next issue to work on
288
316
  → Azure: Next task to work on
289
317
 
290
- STEP 11 - Start Development:
318
+ STEP 12 - Start Development:
291
319
  /pm:issue-start USER-AUTH-001
292
320
  → Assigns work item to you
293
321
  → Updates status to "In Progress"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-autopm",
3
- "version": "1.11.1",
3
+ "version": "1.11.2",
4
4
  "description": "Autonomous Project Management Framework for Claude Code - Advanced AI-powered development automation",
5
5
  "main": "bin/autopm.js",
6
6
  "bin": {