myaidev-method 0.2.2 โ†’ 0.2.4

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,117 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * MyAIDev Method - Code Review CLI
5
+ *
6
+ * Invokes the dev-reviewer agent to analyze code quality, security,
7
+ * performance, and best practices compliance.
8
+ *
9
+ * Usage:
10
+ * npx myaidev-method dev:review "Review authentication module"
11
+ * npx myaidev-method dev:review "Security audit for payments" --security
12
+ */
13
+
14
+ import { SparcWorkflow } from '../lib/dev-workflow/sparc-workflow.js';
15
+ import { getAgentByPhase } from '../lib/dev-workflow/agent-types.js';
16
+
17
+ async function main() {
18
+ const args = process.argv.slice(2);
19
+
20
+ if (args.length === 0 || args.includes('--help') || args.includes('-h')) {
21
+ console.log(`
22
+ ๐Ÿ‘๏ธ MyAIDev Method - Code Review
23
+
24
+ Usage:
25
+ npx myaidev-method dev:review "Review authentication"
26
+ npx myaidev-method dev:review "Audit payment module" --security --performance
27
+
28
+ Options:
29
+ --security Focus on security analysis (OWASP Top 10)
30
+ --performance Focus on performance optimization
31
+ --output-dir <path> Custom output directory (default: .myaidev-method/sparc/)
32
+ --help, -h Show this help message
33
+
34
+ Examples:
35
+ npx myaidev-method dev:review "Review user authentication module"
36
+ npx myaidev-method dev:review "Security audit for payment processing" --security
37
+ npx myaidev-method dev:review "Performance review of database queries" --performance
38
+
39
+ Review Standards:
40
+ - Code Quality: Complexity, readability, maintainability
41
+ - Security: OWASP Top 10, vulnerability patterns
42
+ - Performance: Algorithm complexity, resource management
43
+ - Best Practices: SOLID principles, framework standards
44
+ - Technical Debt: Assessment, prioritization, remediation
45
+
46
+ Output:
47
+ .myaidev-method/sparc/review-report.md
48
+
49
+ Next Phase:
50
+ After review, run:
51
+ npx myaidev-method dev:docs "Document [feature]"
52
+ `);
53
+ process.exit(0);
54
+ }
55
+
56
+ const taskDescription = args[0];
57
+
58
+ // Parse options
59
+ const options = {
60
+ workingDir: process.cwd(),
61
+ };
62
+
63
+ for (let i = 1; i < args.length; i++) {
64
+ if (args[i] === '--security') {
65
+ options.focusSecurity = true;
66
+ } else if (args[i] === '--performance') {
67
+ options.focusPerformance = true;
68
+ } else if (args[i] === '--output-dir' && args[i + 1]) {
69
+ options.outputDir = args[i + 1];
70
+ i++;
71
+ }
72
+ }
73
+
74
+ try {
75
+ console.log('๐Ÿ‘๏ธ MyAIDev Method - Code Review');
76
+ console.log('๐Ÿ“‹ Task:', taskDescription);
77
+ if (options.focusSecurity) {
78
+ console.log('๐Ÿ›ก๏ธ Focus: Security Analysis (OWASP Top 10)');
79
+ }
80
+ if (options.focusPerformance) {
81
+ console.log('โšก Focus: Performance Optimization');
82
+ }
83
+ console.log('');
84
+
85
+ const workflow = new SparcWorkflow(taskDescription, options);
86
+ const agent = getAgentByPhase('review');
87
+
88
+ console.log(`๐Ÿš€ Invoking ${agent.emoji} ${agent.name}...`);
89
+ console.log('');
90
+
91
+ const result = await workflow.runPhase('review');
92
+
93
+ console.log('');
94
+ console.log('โœ… Review complete!');
95
+ console.log('๐Ÿ“„ Report:', result.outputFile);
96
+ console.log('');
97
+ console.log('๐Ÿ“Š Review Summary:');
98
+ if (result.summary) {
99
+ console.log(' - Critical Issues:', result.summary.critical || 0);
100
+ console.log(' - High Priority:', result.summary.high || 0);
101
+ console.log(' - Medium Priority:', result.summary.medium || 0);
102
+ console.log(' - Low Priority:', result.summary.low || 0);
103
+ }
104
+ console.log('');
105
+ console.log('๐Ÿ“Œ Next Steps:');
106
+ console.log(' 1. Review report in .myaidev-method/sparc/review-report.md');
107
+ console.log(' 2. Address critical and high-priority issues');
108
+ console.log(' 3. Run: npx myaidev-method dev:docs "Document [feature]"');
109
+ console.log('');
110
+
111
+ } catch (error) {
112
+ console.error('โŒ Error:', error.message);
113
+ process.exit(1);
114
+ }
115
+ }
116
+
117
+ main();
@@ -0,0 +1,115 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * MyAIDev Method - Testing CLI
5
+ *
6
+ * Invokes the dev-tester agent to create comprehensive test suites,
7
+ * generate coverage reports, and validate quality gates.
8
+ *
9
+ * Usage:
10
+ * npx myaidev-method dev:test "Test authentication system"
11
+ * npx myaidev-method dev:test "Integration tests for checkout" --integration
12
+ */
13
+
14
+ import { SparcWorkflow } from '../lib/dev-workflow/sparc-workflow.js';
15
+ import { getAgentByPhase } from '../lib/dev-workflow/agent-types.js';
16
+
17
+ async function main() {
18
+ const args = process.argv.slice(2);
19
+
20
+ if (args.length === 0 || args.includes('--help') || args.includes('-h')) {
21
+ console.log(`
22
+ ๐Ÿงช MyAIDev Method - Testing
23
+
24
+ Usage:
25
+ npx myaidev-method dev:test "Test authentication"
26
+ npx myaidev-method dev:test "Test checkout flow" --integration --coverage
27
+
28
+ Options:
29
+ --coverage Generate coverage report
30
+ --integration Focus on integration tests
31
+ --framework <name> Testing framework (jest, mocha, pytest, etc.)
32
+ --output-dir <path> Custom output directory (default: .myaidev-method/sparc/test-results/)
33
+ --help, -h Show this help message
34
+
35
+ Examples:
36
+ npx myaidev-method dev:test "Test user authentication"
37
+ npx myaidev-method dev:test "Integration tests for API" --integration --coverage
38
+ npx myaidev-method dev:test "Test payment module" --framework jest
39
+
40
+ Testing Standards:
41
+ - 80%+ coverage for critical paths
42
+ - 60%+ overall coverage
43
+ - AAA pattern (Arrange, Act, Assert)
44
+ - Edge cases and error scenarios
45
+ - Quality gates (pre-commit, pre-merge)
46
+
47
+ Output:
48
+ .myaidev-method/sparc/test-results/
49
+
50
+ Next Phase:
51
+ After testing, run:
52
+ npx myaidev-method dev:review "Review [feature]"
53
+ `);
54
+ process.exit(0);
55
+ }
56
+
57
+ const taskDescription = args[0];
58
+
59
+ // Parse options
60
+ const options = {
61
+ workingDir: process.cwd(),
62
+ };
63
+
64
+ for (let i = 1; i < args.length; i++) {
65
+ if (args[i] === '--coverage') {
66
+ options.coverage = true;
67
+ } else if (args[i] === '--integration') {
68
+ options.integration = true;
69
+ } else if (args[i] === '--framework' && args[i + 1]) {
70
+ options.framework = args[i + 1];
71
+ i++;
72
+ } else if (args[i] === '--output-dir' && args[i + 1]) {
73
+ options.outputDir = args[i + 1];
74
+ i++;
75
+ }
76
+ }
77
+
78
+ try {
79
+ console.log('๐Ÿงช MyAIDev Method - Testing');
80
+ console.log('๐Ÿ“‹ Task:', taskDescription);
81
+ if (options.integration) {
82
+ console.log('๐Ÿ”— Focus: Integration Tests');
83
+ }
84
+ if (options.framework) {
85
+ console.log('๐Ÿ”ง Framework:', options.framework);
86
+ }
87
+ console.log('');
88
+
89
+ const workflow = new SparcWorkflow(taskDescription, options);
90
+ const agent = getAgentByPhase('testing');
91
+
92
+ console.log(`๐Ÿš€ Invoking ${agent.emoji} ${agent.name}...`);
93
+ console.log('');
94
+
95
+ const result = await workflow.runPhase('testing');
96
+
97
+ console.log('');
98
+ console.log('โœ… Testing complete!');
99
+ console.log('๐Ÿ“ Output:', result.outputDir);
100
+ if (options.coverage) {
101
+ console.log('๐Ÿ“Š Coverage Report:', result.coverageReport);
102
+ }
103
+ console.log('');
104
+ console.log('๐Ÿ“Œ Next Steps:');
105
+ console.log(' 1. Review test results in .myaidev-method/sparc/test-results/');
106
+ console.log(' 2. Run: npx myaidev-method dev:review "Review [feature]"');
107
+ console.log('');
108
+
109
+ } catch (error) {
110
+ console.error('โŒ Error:', error.message);
111
+ process.exit(1);
112
+ }
113
+ }
114
+
115
+ main();
@@ -0,0 +1,187 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * MyAIDev Method - Complete SPARC Workflow CLI
5
+ *
6
+ * Orchestrates the complete 5-phase SPARC development workflow:
7
+ * Architecture โ†’ Implementation โ†’ Testing โ†’ Review โ†’ Documentation
8
+ *
9
+ * Usage:
10
+ * npx myaidev-method sparc "Build user authentication system"
11
+ * npx myaidev-method sparc "Create payment module" --tech-stack "node,stripe,postgres"
12
+ * npm run sparc "Build feature" (from package root)
13
+ */
14
+
15
+ import { SparcWorkflow } from '../lib/dev-workflow/sparc-workflow.js';
16
+ import { getWorkflowPhases } from '../lib/dev-workflow/agent-types.js';
17
+
18
+ async function main() {
19
+ const args = process.argv.slice(2);
20
+
21
+ if (args.length === 0 || args.includes('--help') || args.includes('-h')) {
22
+ console.log(`
23
+ ๐ŸŒŸ MyAIDev Method - Complete SPARC Workflow
24
+
25
+ Execute the complete 5-phase systematic development workflow:
26
+ 1. Architecture - Design system and APIs
27
+ 2. Implementation - Write production-ready code
28
+ 3. Testing - Create comprehensive tests
29
+ 4. Review - Analyze quality and security
30
+ 5. Documentation - Generate complete docs
31
+
32
+ Usage:
33
+ npx myaidev-method sparc "Build authentication system"
34
+ npx myaidev-method sparc "Create payment module" --tech-stack "node,stripe,postgres"
35
+
36
+ Options:
37
+ --phases <phases> Run specific phases (comma-separated)
38
+ --tech-stack <stack> Technology preferences
39
+ --test-framework <fw> Testing framework (jest, mocha, pytest)
40
+ --skip-phase <phase> Skip specific phase (use with caution)
41
+ --output-dir <path> Custom output directory
42
+ --help, -h Show this help message
43
+
44
+ Examples:
45
+ npx myaidev-method sparc "Build JWT authentication with refresh tokens"
46
+ npx myaidev-method sparc "Create e-commerce checkout" --tech-stack "react,node,stripe"
47
+ npx myaidev-method sparc "Refactor payment module" --phases "architecture,review,documentation"
48
+
49
+ Workflow Phases:
50
+ 1. ๐Ÿ—๏ธ Architecture - System design, API specs, data modeling
51
+ 2. ๐Ÿ’ป Implementation - SOLID code, security, error handling
52
+ 3. ๐Ÿงช Testing - Unit/integration tests, 80%+ coverage
53
+ 4. ๐Ÿ‘๏ธ Review - Quality, security (OWASP), performance
54
+ 5. ๐Ÿ“š Documentation - API docs, user guides, architecture
55
+
56
+ Output Structure:
57
+ .myaidev-method/
58
+ โ”œโ”€โ”€ sparc/
59
+ โ”‚ โ”œโ”€โ”€ architecture.md
60
+ โ”‚ โ”œโ”€โ”€ code-output/
61
+ โ”‚ โ”œโ”€โ”€ test-results/
62
+ โ”‚ โ”œโ”€โ”€ review-report.md
63
+ โ”‚ โ””โ”€โ”€ documentation/
64
+ โ”œโ”€โ”€ tasks/
65
+ โ””โ”€โ”€ workflows/
66
+
67
+ Quality Standards:
68
+ - Code Quality: SOLID, Clean Code, DRY/KISS/YAGNI
69
+ - Testing: 80%+ coverage, integration tests
70
+ - Security: OWASP Top 10 compliance
71
+ - Documentation: Complete API and user documentation
72
+ - Performance: Optimization analysis included
73
+ `);
74
+ process.exit(0);
75
+ }
76
+
77
+ const taskDescription = args[0];
78
+
79
+ // Parse options
80
+ const options = {
81
+ workingDir: process.cwd(),
82
+ };
83
+
84
+ let skipPhases = [];
85
+
86
+ for (let i = 1; i < args.length; i++) {
87
+ if (args[i] === '--phases' && args[i + 1]) {
88
+ options.phases = args[i + 1].split(',').map(p => p.trim());
89
+ i++;
90
+ } else if (args[i] === '--tech-stack' && args[i + 1]) {
91
+ options.techStack = args[i + 1];
92
+ i++;
93
+ } else if (args[i] === '--test-framework' && args[i + 1]) {
94
+ options.framework = args[i + 1];
95
+ i++;
96
+ } else if (args[i] === '--skip-phase' && args[i + 1]) {
97
+ skipPhases.push(args[i + 1]);
98
+ i++;
99
+ } else if (args[i] === '--output-dir' && args[i + 1]) {
100
+ options.outputDir = args[i + 1];
101
+ i++;
102
+ }
103
+ }
104
+
105
+ // Apply skip-phase logic
106
+ if (skipPhases.length > 0) {
107
+ const allPhases = getWorkflowPhases();
108
+ options.phases = allPhases.filter(p => !skipPhases.includes(p));
109
+ console.log('โš ๏ธ Skipping phases:', skipPhases.join(', '));
110
+ }
111
+
112
+ try {
113
+ console.log('');
114
+ console.log('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•');
115
+ console.log('๐ŸŒŸ MyAIDev Method - SPARC Workflow');
116
+ console.log('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•');
117
+ console.log('');
118
+ console.log('๐Ÿ“‹ Task:', taskDescription);
119
+ if (options.techStack) {
120
+ console.log('๐Ÿ”ง Tech Stack:', options.techStack);
121
+ }
122
+ if (options.framework) {
123
+ console.log('๐Ÿงช Test Framework:', options.framework);
124
+ }
125
+ console.log('');
126
+
127
+ const workflow = new SparcWorkflow(taskDescription, options);
128
+ const phases = options.phases || getWorkflowPhases();
129
+
130
+ console.log('๐Ÿ“Š Workflow Plan:');
131
+ phases.forEach((phase, index) => {
132
+ console.log(` ${index + 1}. ${phase}`);
133
+ });
134
+ console.log('');
135
+ console.log('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•');
136
+ console.log('');
137
+
138
+ // Execute complete workflow
139
+ const results = await workflow.runComplete();
140
+
141
+ console.log('');
142
+ console.log('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•');
143
+ console.log('๐ŸŽ‰ SPARC Workflow Complete!');
144
+ console.log('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•');
145
+ console.log('');
146
+ console.log('โœ… All Phases Completed:');
147
+
148
+ Object.entries(results).forEach(([phase, result]) => {
149
+ console.log(` โœ“ ${phase}: ${result.status}`);
150
+ });
151
+
152
+ console.log('');
153
+ console.log('๐Ÿ“ Output Directory: .myaidev-method/sparc/');
154
+ console.log('');
155
+ console.log('๐Ÿ“Œ Deliverables:');
156
+ console.log(' - Architecture: architecture.md');
157
+ console.log(' - Code: code-output/');
158
+ console.log(' - Tests: test-results/');
159
+ console.log(' - Review: review-report.md');
160
+ console.log(' - Documentation: documentation/');
161
+ console.log('');
162
+ console.log('๐Ÿ“Œ Next Steps:');
163
+ console.log(' 1. Review all artifacts in .myaidev-method/sparc/');
164
+ console.log(' 2. Address any review findings (check review-report.md)');
165
+ console.log(' 3. Run tests to verify implementation');
166
+ console.log(' 4. Integrate code into your project structure');
167
+ console.log(' 5. Deploy with confidence! ๐Ÿš€');
168
+ console.log('');
169
+ console.log('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•');
170
+ console.log('');
171
+
172
+ } catch (error) {
173
+ console.error('');
174
+ console.error('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•');
175
+ console.error('โŒ Workflow Error');
176
+ console.error('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•');
177
+ console.error('');
178
+ console.error('Error:', error.message);
179
+ console.error('');
180
+ console.error('Please check the error above and try again.');
181
+ console.error('For help, run: npm run sparc --help');
182
+ console.error('');
183
+ process.exit(1);
184
+ }
185
+ }
186
+
187
+ main();