myaidev-method 0.2.2 โ†’ 0.2.3

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
+ * npm run dev:review "Review authentication module"
11
+ * npm run 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
+ npm run dev:review "Review authentication"
26
+ npm run 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
+ npm run dev:review "Review user authentication module"
36
+ npm run dev:review "Security audit for payment processing" --security
37
+ npm run 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
+ npm run 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: npm run 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
+ * npm run dev:test "Test authentication system"
11
+ * npm run 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
+ npm run dev:test "Test authentication"
26
+ npm run 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
+ npm run dev:test "Test user authentication"
37
+ npm run dev:test "Integration tests for API" --integration --coverage
38
+ npm run 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
+ npm run 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: npm run 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,186 @@
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
+ * npm run sparc "Build user authentication system"
11
+ * npm run sparc "Create payment module" --tech-stack "node,stripe,postgres"
12
+ */
13
+
14
+ import { SparcWorkflow } from '../lib/dev-workflow/sparc-workflow.js';
15
+ import { getWorkflowPhases } 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 - Complete SPARC Workflow
23
+
24
+ Execute the complete 5-phase systematic development workflow:
25
+ 1. Architecture - Design system and APIs
26
+ 2. Implementation - Write production-ready code
27
+ 3. Testing - Create comprehensive tests
28
+ 4. Review - Analyze quality and security
29
+ 5. Documentation - Generate complete docs
30
+
31
+ Usage:
32
+ npm run sparc "Build authentication system"
33
+ npm run sparc "Create payment module" --tech-stack "node,stripe,postgres"
34
+
35
+ Options:
36
+ --phases <phases> Run specific phases (comma-separated)
37
+ --tech-stack <stack> Technology preferences
38
+ --test-framework <fw> Testing framework (jest, mocha, pytest)
39
+ --skip-phase <phase> Skip specific phase (use with caution)
40
+ --output-dir <path> Custom output directory
41
+ --help, -h Show this help message
42
+
43
+ Examples:
44
+ npm run sparc "Build JWT authentication with refresh tokens"
45
+ npm run sparc "Create e-commerce checkout" --tech-stack "react,node,stripe"
46
+ npm run sparc "Refactor payment module" --phases "architecture,review,documentation"
47
+
48
+ Workflow Phases:
49
+ 1. ๐Ÿ—๏ธ Architecture - System design, API specs, data modeling
50
+ 2. ๐Ÿ’ป Implementation - SOLID code, security, error handling
51
+ 3. ๐Ÿงช Testing - Unit/integration tests, 80%+ coverage
52
+ 4. ๐Ÿ‘๏ธ Review - Quality, security (OWASP), performance
53
+ 5. ๐Ÿ“š Documentation - API docs, user guides, architecture
54
+
55
+ Output Structure:
56
+ .myaidev-method/
57
+ โ”œโ”€โ”€ sparc/
58
+ โ”‚ โ”œโ”€โ”€ architecture.md
59
+ โ”‚ โ”œโ”€โ”€ code-output/
60
+ โ”‚ โ”œโ”€โ”€ test-results/
61
+ โ”‚ โ”œโ”€โ”€ review-report.md
62
+ โ”‚ โ””โ”€โ”€ documentation/
63
+ โ”œโ”€โ”€ tasks/
64
+ โ””โ”€โ”€ workflows/
65
+
66
+ Quality Standards:
67
+ - Code Quality: SOLID, Clean Code, DRY/KISS/YAGNI
68
+ - Testing: 80%+ coverage, integration tests
69
+ - Security: OWASP Top 10 compliance
70
+ - Documentation: Complete API and user documentation
71
+ - Performance: Optimization analysis included
72
+ `);
73
+ process.exit(0);
74
+ }
75
+
76
+ const taskDescription = args[0];
77
+
78
+ // Parse options
79
+ const options = {
80
+ workingDir: process.cwd(),
81
+ };
82
+
83
+ let skipPhases = [];
84
+
85
+ for (let i = 1; i < args.length; i++) {
86
+ if (args[i] === '--phases' && args[i + 1]) {
87
+ options.phases = args[i + 1].split(',').map(p => p.trim());
88
+ i++;
89
+ } else if (args[i] === '--tech-stack' && args[i + 1]) {
90
+ options.techStack = args[i + 1];
91
+ i++;
92
+ } else if (args[i] === '--test-framework' && args[i + 1]) {
93
+ options.framework = args[i + 1];
94
+ i++;
95
+ } else if (args[i] === '--skip-phase' && args[i + 1]) {
96
+ skipPhases.push(args[i + 1]);
97
+ i++;
98
+ } else if (args[i] === '--output-dir' && args[i + 1]) {
99
+ options.outputDir = args[i + 1];
100
+ i++;
101
+ }
102
+ }
103
+
104
+ // Apply skip-phase logic
105
+ if (skipPhases.length > 0) {
106
+ const allPhases = getWorkflowPhases();
107
+ options.phases = allPhases.filter(p => !skipPhases.includes(p));
108
+ console.log('โš ๏ธ Skipping phases:', skipPhases.join(', '));
109
+ }
110
+
111
+ try {
112
+ console.log('');
113
+ console.log('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•');
114
+ console.log('๐ŸŒŸ MyAIDev Method - SPARC Workflow');
115
+ console.log('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•');
116
+ console.log('');
117
+ console.log('๐Ÿ“‹ Task:', taskDescription);
118
+ if (options.techStack) {
119
+ console.log('๐Ÿ”ง Tech Stack:', options.techStack);
120
+ }
121
+ if (options.framework) {
122
+ console.log('๐Ÿงช Test Framework:', options.framework);
123
+ }
124
+ console.log('');
125
+
126
+ const workflow = new SparcWorkflow(taskDescription, options);
127
+ const phases = options.phases || getWorkflowPhases();
128
+
129
+ console.log('๐Ÿ“Š Workflow Plan:');
130
+ phases.forEach((phase, index) => {
131
+ console.log(` ${index + 1}. ${phase}`);
132
+ });
133
+ console.log('');
134
+ console.log('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•');
135
+ console.log('');
136
+
137
+ // Execute complete workflow
138
+ const results = await workflow.runComplete();
139
+
140
+ console.log('');
141
+ console.log('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•');
142
+ console.log('๐ŸŽ‰ SPARC Workflow Complete!');
143
+ console.log('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•');
144
+ console.log('');
145
+ console.log('โœ… All Phases Completed:');
146
+
147
+ Object.entries(results).forEach(([phase, result]) => {
148
+ console.log(` โœ“ ${phase}: ${result.status}`);
149
+ });
150
+
151
+ console.log('');
152
+ console.log('๐Ÿ“ Output Directory: .myaidev-method/sparc/');
153
+ console.log('');
154
+ console.log('๐Ÿ“Œ Deliverables:');
155
+ console.log(' - Architecture: architecture.md');
156
+ console.log(' - Code: code-output/');
157
+ console.log(' - Tests: test-results/');
158
+ console.log(' - Review: review-report.md');
159
+ console.log(' - Documentation: documentation/');
160
+ console.log('');
161
+ console.log('๐Ÿ“Œ Next Steps:');
162
+ console.log(' 1. Review all artifacts in .myaidev-method/sparc/');
163
+ console.log(' 2. Address any review findings (check review-report.md)');
164
+ console.log(' 3. Run tests to verify implementation');
165
+ console.log(' 4. Integrate code into your project structure');
166
+ console.log(' 5. Deploy with confidence! ๐Ÿš€');
167
+ console.log('');
168
+ console.log('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•');
169
+ console.log('');
170
+
171
+ } catch (error) {
172
+ console.error('');
173
+ console.error('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•');
174
+ console.error('โŒ Workflow Error');
175
+ console.error('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•');
176
+ console.error('');
177
+ console.error('Error:', error.message);
178
+ console.error('');
179
+ console.error('Please check the error above and try again.');
180
+ console.error('For help, run: npm run sparc --help');
181
+ console.error('');
182
+ process.exit(1);
183
+ }
184
+ }
185
+
186
+ main();