claude-autopm 1.26.0 → 1.28.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 (49) hide show
  1. package/README.md +40 -0
  2. package/autopm/.claude/agents/frameworks/e2e-test-engineer.md +1 -18
  3. package/autopm/.claude/agents/frameworks/nats-messaging-expert.md +1 -18
  4. package/autopm/.claude/agents/frameworks/react-frontend-engineer.md +1 -18
  5. package/autopm/.claude/agents/frameworks/react-ui-expert.md +1 -18
  6. package/autopm/.claude/agents/frameworks/tailwindcss-expert.md +1 -18
  7. package/autopm/.claude/agents/frameworks/ux-design-expert.md +1 -18
  8. package/autopm/.claude/agents/languages/bash-scripting-expert.md +1 -18
  9. package/autopm/.claude/agents/languages/javascript-frontend-engineer.md +1 -18
  10. package/autopm/.claude/agents/languages/nodejs-backend-engineer.md +1 -18
  11. package/autopm/.claude/agents/languages/python-backend-engineer.md +1 -18
  12. package/autopm/.claude/agents/languages/python-backend-expert.md +1 -18
  13. package/autopm/.claude/commands/pm/epic-decompose.md +19 -5
  14. package/autopm/.claude/commands/pm/prd-new.md +14 -1
  15. package/autopm/.claude/includes/task-creation-excellence.md +18 -0
  16. package/autopm/.claude/lib/ai-task-generator.js +84 -0
  17. package/autopm/.claude/lib/cli-parser.js +148 -0
  18. package/autopm/.claude/lib/dependency-analyzer.js +157 -0
  19. package/autopm/.claude/lib/frontmatter.js +224 -0
  20. package/autopm/.claude/lib/task-utils.js +64 -0
  21. package/autopm/.claude/scripts/pm/prd-new.js +292 -2
  22. package/autopm/.claude/scripts/pm/template-list.js +119 -0
  23. package/autopm/.claude/scripts/pm/template-new.js +344 -0
  24. package/autopm/.claude/scripts/pm-epic-decompose-local.js +158 -0
  25. package/autopm/.claude/scripts/pm-epic-list-local.js +103 -0
  26. package/autopm/.claude/scripts/pm-epic-show-local.js +70 -0
  27. package/autopm/.claude/scripts/pm-epic-update-local.js +56 -0
  28. package/autopm/.claude/scripts/pm-prd-list-local.js +111 -0
  29. package/autopm/.claude/scripts/pm-prd-new-local.js +196 -0
  30. package/autopm/.claude/scripts/pm-prd-parse-local.js +360 -0
  31. package/autopm/.claude/scripts/pm-prd-show-local.js +101 -0
  32. package/autopm/.claude/scripts/pm-prd-update-local.js +153 -0
  33. package/autopm/.claude/scripts/pm-sync-download-local.js +424 -0
  34. package/autopm/.claude/scripts/pm-sync-upload-local.js +473 -0
  35. package/autopm/.claude/scripts/pm-task-list-local.js +86 -0
  36. package/autopm/.claude/scripts/pm-task-show-local.js +92 -0
  37. package/autopm/.claude/scripts/pm-task-update-local.js +109 -0
  38. package/autopm/.claude/scripts/setup-local-mode.js +127 -0
  39. package/autopm/.claude/templates/prds/README.md +334 -0
  40. package/autopm/.claude/templates/prds/api-feature.md +306 -0
  41. package/autopm/.claude/templates/prds/bug-fix.md +413 -0
  42. package/autopm/.claude/templates/prds/data-migration.md +483 -0
  43. package/autopm/.claude/templates/prds/documentation.md +439 -0
  44. package/autopm/.claude/templates/prds/ui-feature.md +365 -0
  45. package/lib/template-engine.js +347 -0
  46. package/package.json +5 -3
  47. package/scripts/create-task-issues.sh +26 -0
  48. package/scripts/fix-invalid-command-refs.sh +4 -3
  49. package/scripts/fix-invalid-refs-simple.sh +8 -3
package/README.md CHANGED
@@ -44,6 +44,46 @@ PRD → Epic Decomposition → Parallel Development → Testing → Production
44
44
 
45
45
  ## ✨ Key Features
46
46
 
47
+ ### 🆕 **NEW in v1.28.0: Templates & Scaffolding!**
48
+
49
+ **PRD Templates (Quick Start)**
50
+ - 📋 **5 Built-in Templates** - api-feature, ui-feature, bug-fix, data-migration, documentation
51
+ - 🚀 **70% Faster** - Create PRDs in 9 minutes instead of 30
52
+ - 🎯 **Context7-Verified** - All templates use 2025 best practices
53
+ - ✨ **Smart Variables** - Auto-generate IDs, timestamps, authors
54
+ - 🎨 **Custom Templates** - Create your own team-specific templates
55
+
56
+ **Template Commands**
57
+ ```bash
58
+ # Create PRD from template
59
+ autopm prd:new --template api-feature "Payment API"
60
+
61
+ # Interactive template selection
62
+ autopm prd:new "my-feature"
63
+
64
+ # List available templates
65
+ autopm template:list
66
+
67
+ # Create custom template
68
+ autopm template:new prd my-custom-template
69
+ ```
70
+
71
+ **260+ Tests Passing** - Production-ready with comprehensive test coverage!
72
+
73
+ ---
74
+
75
+ ### 🎉 **v1.27.0: Phase 2 Complete!**
76
+
77
+ **GitHub Sync (Bidirectional)**
78
+ - 📤 **Upload to GitHub Issues** - Sync PRDs/Epics/Tasks with smart conflict detection
79
+ - 📥 **Download from GitHub** - Pull Issues back to local files with reverse mapping
80
+ - 🔄 **Bidirectional Mapping** - Maintain consistency with `sync-map.json`
81
+
82
+ **Task Management**
83
+ - ✅ **Complete Task Lifecycle** - List, show, update tasks within epics
84
+ - 🔗 **Dependency Tracking** - Validate task dependencies automatically
85
+ - 📊 **Progress Auto-update** - Epic progress updates on task completion
86
+
47
87
  ### 🤖 **39 Specialized AI Agents**
48
88
 
49
89
  Organized into dynamic teams that load based on your work context:
@@ -39,24 +39,7 @@ Access E2E testing frameworks and patterns:
39
39
  - `mcp://context7/agile/acceptance-criteria` - Writing effective AC
40
40
  - `mcp://context7/project-management/estimation` - Effort estimation
41
41
 
42
- ## Task Creation Excellence
43
-
44
- When creating implementation tasks (for epic decomposition or project planning):
45
-
46
- 1. **Query Context7 First**: Access latest agile/PM best practices
47
- 2. **Follow INVEST Criteria**: Tasks must be Independent, Negotiable, Valuable, Estimable, Small, Testable
48
- 3. **Include TDD Requirements**: Every task must enforce Test-Driven Development
49
- 4. **Technology-Specific Details**: Leverage your E2E testing expertise in technical details
50
- 5. **Clear Acceptance Criteria**: Specific, measurable, testable criteria
51
-
52
- **Task Structure Template**: Use frontmatter with name, status, created, depends_on, parallel, conflicts_with. Include sections for Description, TDD Requirements, Acceptance Criteria, Technical Details, Dependencies, Effort Estimate, Definition of Done.
53
-
54
- **Quality Standards**:
55
- - Tasks completable in 1-3 days maximum
56
- - Action-oriented titles (verb + noun)
57
- - Specific E2E test framework and scenario guidance
58
- - Dependency and parallelization mapping
59
- - Test automation, visual regression, and accessibility testing considerations
42
+ @include includes/task-creation-excellence.md
60
43
 
61
44
  ## E2E Testing Methodology
62
45
 
@@ -37,24 +37,7 @@ Use this agent for NATS messaging system including pub/sub, request/reply, and q
37
37
  - `mcp://context7/agile/acceptance-criteria` - Writing effective AC
38
38
  - `mcp://context7/project-management/estimation` - Effort estimation
39
39
 
40
- ## Task Creation Excellence
41
-
42
- When creating implementation tasks (for epic decomposition or project planning):
43
-
44
- 1. **Query Context7 First**: Access latest agile/PM best practices
45
- 2. **Follow INVEST Criteria**: Tasks must be Independent, Negotiable, Valuable, Estimable, Small, Testable
46
- 3. **Include TDD Requirements**: Every task must enforce Test-Driven Development
47
- 4. **Technology-Specific Details**: Leverage your NATS messaging expertise in technical details
48
- 5. **Clear Acceptance Criteria**: Specific, measurable, testable criteria
49
-
50
- **Task Structure Template**: Use frontmatter with name, status, created, depends_on, parallel, conflicts_with. Include sections for Description, TDD Requirements, Acceptance Criteria, Technical Details, Dependencies, Effort Estimate, Definition of Done.
51
-
52
- **Quality Standards**:
53
- - Tasks completable in 1-3 days maximum
54
- - Action-oriented titles (verb + noun)
55
- - Specific NATS messaging pattern and JetStream guidance
56
- - Dependency and parallelization mapping
57
- - Pub/sub, clustering, and high availability considerations
40
+ @include includes/task-creation-excellence.md
58
41
 
59
42
  ## Core Expertise
60
43
 
@@ -45,24 +45,7 @@ Before starting any implementation, you have access to live documentation throug
45
45
  - `mcp://context7/agile/acceptance-criteria` - Writing effective AC
46
46
  - `mcp://context7/project-management/estimation` - Effort estimation
47
47
 
48
- ## Task Creation Excellence
49
-
50
- When creating implementation tasks (for epic decomposition or project planning):
51
-
52
- 1. **Query Context7 First**: Access latest agile/PM best practices
53
- 2. **Follow INVEST Criteria**: Tasks must be Independent, Negotiable, Valuable, Estimable, Small, Testable
54
- 3. **Include TDD Requirements**: Every task must enforce Test-Driven Development
55
- 4. **Technology-Specific Details**: Leverage your React expertise in technical details
56
- 5. **Clear Acceptance Criteria**: Specific, measurable, testable criteria
57
-
58
- **Task Structure Template**: Use frontmatter with name, status, created, depends_on, parallel, conflicts_with. Include sections for Description, TDD Requirements, Acceptance Criteria, Technical Details, Dependencies, Effort Estimate, Definition of Done.
59
-
60
- **Quality Standards**:
61
- - Tasks completable in 1-3 days maximum
62
- - Action-oriented titles (verb + noun)
63
- - Specific React implementation guidance
64
- - Dependency and parallelization mapping
65
- - Component architecture and state management considerations
48
+ @include includes/task-creation-excellence.md
66
49
 
67
50
  **Core Expertise:**
68
51
 
@@ -32,24 +32,7 @@ Before implementing any UI solution, access live documentation through context7:
32
32
  - `mcp://context7/agile/acceptance-criteria` - Writing effective AC
33
33
  - `mcp://context7/project-management/estimation` - Effort estimation
34
34
 
35
- ## Task Creation Excellence
36
-
37
- When creating implementation tasks (for epic decomposition or project planning):
38
-
39
- 1. **Query Context7 First**: Access latest agile/PM best practices
40
- 2. **Follow INVEST Criteria**: Tasks must be Independent, Negotiable, Valuable, Estimable, Small, Testable
41
- 3. **Include TDD Requirements**: Every task must enforce Test-Driven Development
42
- 4. **Technology-Specific Details**: Leverage your React UI expertise in technical details
43
- 5. **Clear Acceptance Criteria**: Specific, measurable, testable criteria
44
-
45
- **Task Structure Template**: Use frontmatter with name, status, created, depends_on, parallel, conflicts_with. Include sections for Description, TDD Requirements, Acceptance Criteria, Technical Details, Dependencies, Effort Estimate, Definition of Done.
46
-
47
- **Quality Standards**:
48
- - Tasks completable in 1-3 days maximum
49
- - Action-oriented titles (verb + noun)
50
- - Specific React UI framework implementation guidance
51
- - Dependency and parallelization mapping
52
- - Component design system and accessibility considerations
35
+ @include includes/task-creation-excellence.md
53
36
 
54
37
  ## Test-Driven Development (TDD) Methodology
55
38
 
@@ -40,24 +40,7 @@ Access Tailwind CSS documentation through context7:
40
40
  - `mcp://context7/agile/acceptance-criteria` - Writing effective AC
41
41
  - `mcp://context7/project-management/estimation` - Effort estimation
42
42
 
43
- ## Task Creation Excellence
44
-
45
- When creating implementation tasks (for epic decomposition or project planning):
46
-
47
- 1. **Query Context7 First**: Access latest agile/PM best practices
48
- 2. **Follow INVEST Criteria**: Tasks must be Independent, Negotiable, Valuable, Estimable, Small, Testable
49
- 3. **Include TDD Requirements**: Every task must enforce Test-Driven Development
50
- 4. **Technology-Specific Details**: Leverage your TailwindCSS expertise in technical details
51
- 5. **Clear Acceptance Criteria**: Specific, measurable, testable criteria
52
-
53
- **Task Structure Template**: Use frontmatter with name, status, created, depends_on, parallel, conflicts_with. Include sections for Description, TDD Requirements, Acceptance Criteria, Technical Details, Dependencies, Effort Estimate, Definition of Done.
54
-
55
- **Quality Standards**:
56
- - Tasks completable in 1-3 days maximum
57
- - Action-oriented titles (verb + noun)
58
- - Specific TailwindCSS utility and design system guidance
59
- - Dependency and parallelization mapping
60
- - Responsive design and theme customization considerations
43
+ @include includes/task-creation-excellence.md
61
44
 
62
45
  ## When to Use This Agent
63
46
 
@@ -41,24 +41,7 @@ Access UX design and accessibility documentation:
41
41
  - `mcp://context7/agile/acceptance-criteria` - Writing effective AC
42
42
  - `mcp://context7/project-management/estimation` - Effort estimation
43
43
 
44
- ## Task Creation Excellence
45
-
46
- When creating implementation tasks (for epic decomposition or project planning):
47
-
48
- 1. **Query Context7 First**: Access latest agile/PM best practices
49
- 2. **Follow INVEST Criteria**: Tasks must be Independent, Negotiable, Valuable, Estimable, Small, Testable
50
- 3. **Include TDD Requirements**: Every task must enforce Test-Driven Development
51
- 4. **Technology-Specific Details**: Leverage your UX design expertise in technical details
52
- 5. **Clear Acceptance Criteria**: Specific, measurable, testable criteria
53
-
54
- **Task Structure Template**: Use frontmatter with name, status, created, depends_on, parallel, conflicts_with. Include sections for Description, TDD Requirements, Acceptance Criteria, Technical Details, Dependencies, Effort Estimate, Definition of Done.
55
-
56
- **Quality Standards**:
57
- - Tasks completable in 1-3 days maximum
58
- - Action-oriented titles (verb + noun)
59
- - Specific UX/UI design and accessibility guidance
60
- - Dependency and parallelization mapping
61
- - User research, interaction design, and accessibility compliance considerations
44
+ @include includes/task-creation-excellence.md
62
45
 
63
46
  ## Core Expertise
64
47
 
@@ -50,24 +50,7 @@ Before starting any implementation, you have access to live documentation throug
50
50
  - `mcp://context7/agile/acceptance-criteria` - Writing effective AC
51
51
  - `mcp://context7/project-management/estimation` - Effort estimation
52
52
 
53
- ## Task Creation Excellence
54
-
55
- When creating implementation tasks (for epic decomposition or project planning):
56
-
57
- 1. **Query Context7 First**: Access latest agile/PM best practices
58
- 2. **Follow INVEST Criteria**: Tasks must be Independent, Negotiable, Valuable, Estimable, Small, Testable
59
- 3. **Include TDD Requirements**: Every task must enforce Test-Driven Development (with bats for Bash)
60
- 4. **Technology-Specific Details**: Leverage your Bash/scripting expertise in technical details
61
- 5. **Clear Acceptance Criteria**: Specific, measurable, testable criteria
62
-
63
- **Task Structure Template**: Use frontmatter with name, status, created, depends_on, parallel, conflicts_with. Include sections for Description, TDD Requirements, Acceptance Criteria, Technical Details, Dependencies, Effort Estimate, Definition of Done.
64
-
65
- **Quality Standards**:
66
- - Tasks completable in 1-3 days maximum
67
- - Action-oriented titles (verb + noun)
68
- - Specific shell scripting implementation guidance
69
- - Dependency and parallelization mapping
70
- - Security and portability considerations included
53
+ @include includes/task-creation-excellence.md
71
54
 
72
55
  ## Core Expertise
73
56
 
@@ -48,24 +48,7 @@ Before starting any implementation, you have access to live documentation throug
48
48
  - `mcp://context7/agile/acceptance-criteria` - Writing effective AC
49
49
  - `mcp://context7/project-management/estimation` - Effort estimation
50
50
 
51
- ## Task Creation Excellence
52
-
53
- When creating implementation tasks (for epic decomposition or project planning):
54
-
55
- 1. **Query Context7 First**: Access latest agile/PM best practices
56
- 2. **Follow INVEST Criteria**: Tasks must be Independent, Negotiable, Valuable, Estimable, Small, Testable
57
- 3. **Include TDD Requirements**: Every task must enforce Test-Driven Development
58
- 4. **Technology-Specific Details**: Leverage your JavaScript/TypeScript expertise in technical details
59
- 5. **Clear Acceptance Criteria**: Specific, measurable, testable criteria
60
-
61
- **Task Structure Template**: Use frontmatter with name, status, created, depends_on, parallel, conflicts_with. Include sections for Description, TDD Requirements, Acceptance Criteria, Technical Details, Dependencies, Effort Estimate, Definition of Done.
62
-
63
- **Quality Standards**:
64
- - Tasks completable in 1-3 days maximum
65
- - Action-oriented titles (verb + noun)
66
- - Specific technical implementation guidance
67
- - Dependency and parallelization mapping
68
- - No vague descriptions or missing acceptance criteria
51
+ @include includes/task-creation-excellence.md
69
52
 
70
53
  ## Core Expertise
71
54
 
@@ -52,24 +52,7 @@ Before starting any implementation, you have access to live documentation throug
52
52
  3. **Security Standards**: Access current security recommendations
53
53
  4. **Performance Patterns**: Get latest Node.js optimization techniques
54
54
 
55
- ## Task Creation Excellence
56
-
57
- When creating implementation tasks (for epic decomposition or project planning):
58
-
59
- 1. **Query Context7 First**: Access latest agile/PM best practices
60
- 2. **Follow INVEST Criteria**: Tasks must be Independent, Negotiable, Valuable, Estimable, Small, Testable
61
- 3. **Include TDD Requirements**: Every task must enforce Test-Driven Development
62
- 4. **Technology-Specific Details**: Leverage your Node.js/backend expertise in technical details
63
- 5. **Clear Acceptance Criteria**: Specific, measurable, testable criteria
64
-
65
- **Task Structure Template**: Use frontmatter with name, status, created, depends_on, parallel, conflicts_with. Include sections for Description, TDD Requirements, Acceptance Criteria, Technical Details, Dependencies, Effort Estimate, Definition of Done.
66
-
67
- **Quality Standards**:
68
- - Tasks completable in 1-3 days maximum
69
- - Action-oriented titles (verb + noun)
70
- - Specific technical implementation guidance for backend/APIs
71
- - Dependency and parallelization mapping
72
- - Security and performance considerations included
55
+ @include includes/task-creation-excellence.md
73
56
 
74
57
  ## Core Expertise
75
58
 
@@ -45,24 +45,7 @@ Before starting any implementation, you have access to live documentation throug
45
45
  - `mcp://context7/agile/acceptance-criteria` - Writing effective AC
46
46
  - `mcp://context7/project-management/estimation` - Effort estimation
47
47
 
48
- ## Task Creation Excellence
49
-
50
- When creating implementation tasks (for epic decomposition or project planning):
51
-
52
- 1. **Query Context7 First**: Access latest agile/PM best practices
53
- 2. **Follow INVEST Criteria**: Tasks must be Independent, Negotiable, Valuable, Estimable, Small, Testable
54
- 3. **Include TDD Requirements**: Every task must enforce Test-Driven Development
55
- 4. **Technology-Specific Details**: Leverage your Python backend expertise in technical details
56
- 5. **Clear Acceptance Criteria**: Specific, measurable, testable criteria
57
-
58
- **Task Structure Template**: Use frontmatter with name, status, created, depends_on, parallel, conflicts_with. Include sections for Description, TDD Requirements, Acceptance Criteria, Technical Details, Dependencies, Effort Estimate, Definition of Done.
59
-
60
- **Quality Standards**:
61
- - Tasks completable in 1-3 days maximum
62
- - Action-oriented titles (verb + noun)
63
- - Specific Python/FastAPI implementation guidance
64
- - Dependency and parallelization mapping
65
- - API design, database integration, and async pattern considerations
48
+ @include includes/task-creation-excellence.md
66
49
 
67
50
  **Core Expertise:**
68
51
 
@@ -32,24 +32,7 @@ Before implementing any Python backend solution, access live documentation throu
32
32
  - `mcp://context7/agile/acceptance-criteria` - Writing effective AC
33
33
  - `mcp://context7/project-management/estimation` - Effort estimation
34
34
 
35
- ## Task Creation Excellence
36
-
37
- When creating implementation tasks (for epic decomposition or project planning):
38
-
39
- 1. **Query Context7 First**: Access latest agile/PM best practices
40
- 2. **Follow INVEST Criteria**: Tasks must be Independent, Negotiable, Valuable, Estimable, Small, Testable
41
- 3. **Include TDD Requirements**: Every task must enforce Test-Driven Development
42
- 4. **Technology-Specific Details**: Leverage your Python backend expertise in technical details
43
- 5. **Clear Acceptance Criteria**: Specific, measurable, testable criteria
44
-
45
- **Task Structure Template**: Use frontmatter with name, status, created, depends_on, parallel, conflicts_with. Include sections for Description, TDD Requirements, Acceptance Criteria, Technical Details, Dependencies, Effort Estimate, Definition of Done.
46
-
47
- **Quality Standards**:
48
- - Tasks completable in 1-3 days maximum
49
- - Action-oriented titles (verb + noun)
50
- - Specific Python framework implementation guidance
51
- - Dependency and parallelization mapping
52
- - Architecture patterns, ORM integration, and async support considerations
35
+ @include includes/task-creation-excellence.md
53
36
 
54
37
  ## Test-Driven Development (TDD) Methodology
55
38
 
@@ -10,13 +10,13 @@ Break epic into concrete, actionable tasks.
10
10
 
11
11
  **Single Epic:**
12
12
  ```bash
13
- /pm:epic-decompose <feature_name>
13
+ /pm:epic-decompose <feature_name> [--local]
14
14
  ```
15
15
 
16
16
  **Multi-Epic (decomposes ALL epics at once):**
17
17
  ```bash
18
- /pm:epic-decompose <feature_name>
19
- # Example: /pm:epic-decompose ecommerce-platform
18
+ /pm:epic-decompose <feature_name> [--local]
19
+ # Example: /pm:epic-decompose ecommerce-platform --local
20
20
  # This will automatically decompose ALL epics:
21
21
  # - 01-infrastructure
22
22
  # - 02-auth-backend
@@ -26,8 +26,22 @@ Break epic into concrete, actionable tasks.
26
26
 
27
27
  **Single Epic from Multi-Epic structure:**
28
28
  ```bash
29
- /pm:epic-decompose <feature_name>/<epic_folder>
30
- # Example: /pm:epic-decompose ecommerce-platform/01-infrastructure
29
+ /pm:epic-decompose <feature_name>/<epic_folder> [--local]
30
+ # Example: /pm:epic-decompose ecommerce-platform/01-infrastructure --local
31
+ ```
32
+
33
+ ## Flags
34
+
35
+ `--local`, `-l`
36
+ : Use local mode (offline workflow)
37
+ : Creates task files in `.claude/epics/` directory structure
38
+ : No GitHub/Azure synchronization
39
+ : Task files remain local-only until manually synced
40
+ : Ideal for offline work or projects without remote tracking
41
+
42
+ Example:
43
+ ```
44
+ /pm:epic-decompose user-authentication --local
31
45
  ```
32
46
 
33
47
  ## Required Documentation Access
@@ -8,7 +8,20 @@ Launch interactive brainstorming session for new product requirement document.
8
8
 
9
9
  ## Usage
10
10
  ```
11
- /pm:prd-new <feature_name>
11
+ /pm:prd-new <feature_name> [--local]
12
+ ```
13
+
14
+ ## Flags
15
+
16
+ `--local`, `-l`
17
+ : Use local mode (offline workflow)
18
+ : Creates PRD files in `.claude/prds/` directory
19
+ : No GitHub/Azure synchronization required
20
+ : Ideal for working offline or without remote provider configured
21
+
22
+ Example:
23
+ ```
24
+ /pm:prd-new user-authentication --local
12
25
  ```
13
26
 
14
27
  ## Required Documentation Access
@@ -0,0 +1,18 @@
1
+ ## Task Creation Excellence
2
+
3
+ When creating implementation tasks (for epic decomposition or project planning):
4
+
5
+ 1. **Query Context7 First**: Access latest agile/PM best practices
6
+ 2. **Follow INVEST Criteria**: Tasks must be Independent, Negotiable, Valuable, Estimable, Small, Testable
7
+ 3. **Include TDD Requirements**: Every task must enforce Test-Driven Development
8
+ 4. **Technology-Specific Details**: Leverage your technology-specific expertise in technical details
9
+ 5. **Clear Acceptance Criteria**: Specific, measurable, testable criteria
10
+
11
+ **Task Structure Template**: Use frontmatter with name, status, created, depends_on, parallel, conflicts_with. Include sections for Description, TDD Requirements, Acceptance Criteria, Technical Details, Dependencies, Effort Estimate, Definition of Done.
12
+
13
+ **Quality Standards**:
14
+ - Tasks completable in 1-3 days maximum
15
+ - Action-oriented titles (verb + noun)
16
+ - Specific technical implementation guidance
17
+ - Dependency and parallelization mapping
18
+ - No vague descriptions or missing acceptance criteria
@@ -0,0 +1,84 @@
1
+ /**
2
+ * AI Task Generator
3
+ *
4
+ * Generates tasks from epic content using AI providers (OpenAI, Claude, etc.)
5
+ * Supports dependency injection for testing with mock providers.
6
+ *
7
+ * Usage:
8
+ * const { TaskGenerator } = require('./ai-task-generator');
9
+ *
10
+ * const generator = new TaskGenerator();
11
+ * const tasks = await generator.generate(epicContent, { maxTasks: 10 });
12
+ */
13
+
14
+ /**
15
+ * Task Generator using AI providers
16
+ */
17
+ class TaskGenerator {
18
+ constructor(provider = null) {
19
+ this.provider = provider; // Allow injection for testing
20
+ }
21
+
22
+ /**
23
+ * Generate tasks from epic content
24
+ *
25
+ * @param {string} epicContent - Epic markdown content
26
+ * @param {Object} options - Generation options
27
+ * @param {number} [options.maxTasks=15] - Maximum number of tasks to generate
28
+ * @param {number} [options.minHours=2] - Minimum estimated hours per task
29
+ * @param {number} [options.maxHours=8] - Maximum estimated hours per task
30
+ * @returns {Promise<Array>} Array of task objects
31
+ */
32
+ async generate(epicContent, options = {}) {
33
+ const {
34
+ maxTasks = 15,
35
+ minHours = 2,
36
+ maxHours = 8
37
+ } = options;
38
+
39
+ if (!this.provider) {
40
+ throw new Error('AI provider not configured. Use TaskGenerator(provider) or set via setProvider');
41
+ }
42
+
43
+ // Generate tasks using AI provider
44
+ const tasks = await this.provider.generateTasks(epicContent, {
45
+ maxTasks,
46
+ minHours,
47
+ maxHours
48
+ });
49
+
50
+ // Validate and normalize tasks
51
+ return tasks.map((task, index) => this.normalizeTask(task, index + 1));
52
+ }
53
+
54
+ /**
55
+ * Normalize task object to standard format
56
+ *
57
+ * @param {Object} task - Raw task from AI
58
+ * @param {number} taskNumber - Task sequence number
59
+ * @returns {Object} Normalized task object
60
+ */
61
+ normalizeTask(task, taskNumber) {
62
+ return {
63
+ number: taskNumber,
64
+ title: task.title || `Task ${taskNumber}`,
65
+ description: task.description || '',
66
+ acceptance_criteria: task.acceptance_criteria || [],
67
+ estimated_hours: task.estimated_hours || 4,
68
+ dependencies: task.dependencies || [],
69
+ priority: task.priority || 'medium',
70
+ tags: task.tags || []
71
+ };
72
+ }
73
+
74
+ /**
75
+ * Set AI provider (for dependency injection)
76
+ *
77
+ * @param {Object} provider - AI provider instance
78
+ */
79
+ setProvider(provider) {
80
+ this.provider = provider;
81
+ }
82
+ }
83
+
84
+ module.exports = { TaskGenerator };
@@ -0,0 +1,148 @@
1
+ /**
2
+ * CLI Parser for PM Commands
3
+ *
4
+ * Provides unified command-line argument parsing with --local flag support
5
+ * across all PM commands using yargs best practices.
6
+ *
7
+ * Following Context7 yargs documentation patterns:
8
+ * - .boolean() for boolean flags
9
+ * - .alias() for short flags
10
+ * - .parse() for argument processing
11
+ */
12
+
13
+ const yargs = require('yargs/yargs');
14
+ const { hideBin } = require('yargs/helpers');
15
+ const fs = require('fs');
16
+ const path = require('path');
17
+
18
+ /**
19
+ * Read project configuration to determine default provider
20
+ * @returns {string} Default provider ('github', 'azure', or 'local')
21
+ */
22
+ function getDefaultProvider() {
23
+ try {
24
+ const configPath = path.join(process.cwd(), '.claude/config.json');
25
+ if (fs.existsSync(configPath)) {
26
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
27
+ return config.provider || 'github';
28
+ }
29
+ } catch (error) {
30
+ // Silently fall back to github if config cannot be read
31
+ }
32
+ return 'github';
33
+ }
34
+
35
+ /**
36
+ * Parse PM command arguments with --local flag support
37
+ *
38
+ * @param {string[]} args - Command arguments (usually process.argv)
39
+ * @returns {object} Parsed arguments with mode determined
40
+ *
41
+ * @example
42
+ * // Local mode
43
+ * parsePMCommand(['prd-new', 'feature', '--local'])
44
+ * // => { _: ['prd-new', 'feature'], local: true, mode: 'local' }
45
+ *
46
+ * @example
47
+ * // Remote mode (from config)
48
+ * parsePMCommand(['prd-list'])
49
+ * // => { _: ['prd-list'], local: false, mode: 'github' }
50
+ */
51
+ function parsePMCommand(args) {
52
+ let failureMessage = null;
53
+
54
+ // Don't use hideBin if args are already clean (for testing)
55
+ const cleanArgs = Array.isArray(args) && !args[0]?.includes('node') ? args : hideBin(args);
56
+
57
+ const argv = yargs(cleanArgs)
58
+ .option('local', {
59
+ alias: 'l',
60
+ type: 'boolean',
61
+ describe: 'Use local mode (offline, no GitHub/Azure)',
62
+ default: false
63
+ })
64
+ .option('github', {
65
+ type: 'boolean',
66
+ describe: 'Use GitHub provider',
67
+ default: false
68
+ })
69
+ .option('azure', {
70
+ type: 'boolean',
71
+ describe: 'Use Azure DevOps provider',
72
+ default: false
73
+ })
74
+ .option('verbose', {
75
+ alias: 'v',
76
+ type: 'boolean',
77
+ describe: 'Enable verbose output',
78
+ default: false
79
+ })
80
+ .option('force', {
81
+ alias: 'f',
82
+ type: 'boolean',
83
+ describe: 'Force operation',
84
+ default: false
85
+ })
86
+ .option('output', {
87
+ alias: 'o',
88
+ type: 'string',
89
+ describe: 'Output format (json, text)',
90
+ choices: ['json', 'text']
91
+ })
92
+ .check((argv) => {
93
+ // Validate: cannot use --local with --github or --azure
94
+ if (argv.local && (argv.github || argv.azure)) {
95
+ throw new Error('Cannot use both --local and remote provider (--github or --azure)');
96
+ }
97
+ return true;
98
+ })
99
+ .fail((msg, err) => {
100
+ // Capture failure for throwing
101
+ failureMessage = msg || (err && err.message) || 'Unknown error';
102
+ })
103
+ .exitProcess(false) // Don't call process.exit on error (for testing)
104
+ .parse();
105
+
106
+ // Throw error if validation failed
107
+ if (failureMessage) {
108
+ throw new Error(failureMessage);
109
+ }
110
+
111
+ // Determine mode based on flags and config
112
+ if (argv.local) {
113
+ argv.mode = 'local';
114
+ } else if (argv.github) {
115
+ argv.mode = 'github';
116
+ } else if (argv.azure) {
117
+ argv.mode = 'azure';
118
+ } else {
119
+ // Read from config
120
+ argv.mode = getDefaultProvider();
121
+ }
122
+
123
+ return argv;
124
+ }
125
+
126
+ /**
127
+ * Get help text for CLI parser
128
+ * Used for testing help text includes --local flag
129
+ *
130
+ * @returns {Promise<string>} Help text
131
+ */
132
+ async function getHelpText() {
133
+ const parser = yargs([])
134
+ .option('local', {
135
+ alias: 'l',
136
+ type: 'boolean',
137
+ describe: 'Use local mode (offline, no GitHub/Azure)',
138
+ default: false
139
+ });
140
+
141
+ return await parser.getHelp();
142
+ }
143
+
144
+ module.exports = {
145
+ parsePMCommand,
146
+ getHelpText,
147
+ getDefaultProvider
148
+ };