myaidev-method 0.2.1 → 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.
Files changed (30) hide show
  1. package/.claude/mcp/mcp-config.json +93 -10
  2. package/.claude/mcp/sparc-orchestrator-server.js +607 -0
  3. package/DEV_WORKFLOW_GUIDE.md +1353 -0
  4. package/MCP_INTEGRATION.md +373 -0
  5. package/README.md +378 -21
  6. package/TECHNICAL_ARCHITECTURE.md +1868 -0
  7. package/bin/cli.js +44 -3
  8. package/dist/mcp/mcp-config.json +93 -10
  9. package/dist/mcp/sparc-orchestrator-server.js +607 -0
  10. package/package.json +24 -4
  11. package/src/lib/dev-workflow/agent-types.js +163 -0
  12. package/src/lib/dev-workflow/sparc-workflow.js +302 -0
  13. package/src/lib/dev-workflow/task-manager.js +313 -0
  14. package/src/scripts/dev-architect.js +99 -0
  15. package/src/scripts/dev-code.js +106 -0
  16. package/src/scripts/dev-docs.js +122 -0
  17. package/src/scripts/dev-review.js +117 -0
  18. package/src/scripts/dev-test.js +115 -0
  19. package/src/scripts/sparc-workflow.js +186 -0
  20. package/src/templates/claude/agents/dev-architect.md +436 -0
  21. package/src/templates/claude/agents/dev-coder.md +749 -0
  22. package/src/templates/claude/agents/dev-documenter.md +939 -0
  23. package/src/templates/claude/agents/dev-reviewer.md +1152 -0
  24. package/src/templates/claude/agents/dev-tester.md +600 -0
  25. package/src/templates/claude/commands/myai-dev-architect.md +80 -0
  26. package/src/templates/claude/commands/myai-dev-code.md +93 -0
  27. package/src/templates/claude/commands/myai-dev-docs.md +94 -0
  28. package/src/templates/claude/commands/myai-dev-review.md +96 -0
  29. package/src/templates/claude/commands/myai-dev-test.md +95 -0
  30. package/src/templates/claude/commands/myai-sparc-workflow.md +196 -0
@@ -0,0 +1,1353 @@
1
+ # Development Workflow Guide - SPARC Methodology
2
+
3
+ > **Systematic Software Development with the MyAIDev Method**
4
+
5
+ This guide provides comprehensive documentation for using the MyAIDev Method's **SPARC development framework** - a 5-phase systematic approach to AI-assisted software development inspired by [GitHub Spec-Kit](https://github.com/github/spec-kit).
6
+
7
+ ## Table of Contents
8
+
9
+ - [Overview](#overview)
10
+ - [SPARC Methodology](#sparc-methodology)
11
+ - [Phase 1: Architecture](#phase-1-architecture)
12
+ - [Phase 2: Implementation](#phase-2-implementation)
13
+ - [Phase 3: Testing](#phase-3-testing)
14
+ - [Phase 4: Review](#phase-4-review)
15
+ - [Phase 5: Documentation](#phase-5-documentation)
16
+ - [Complete Workflow](#complete-workflow)
17
+ - [CLI Commands](#cli-commands)
18
+ - [Quality Standards](#quality-standards)
19
+ - [Best Practices](#best-practices)
20
+ - [Examples](#examples)
21
+ - [Troubleshooting](#troubleshooting)
22
+
23
+ ## Overview
24
+
25
+ The **MyAIDev Method** provides a comprehensive development framework featuring specialized AI agents for every phase of software development. The **SPARC methodology** ensures systematic, high-quality software delivery through:
26
+
27
+ - **Structured Phases**: Clear progression from design to documentation
28
+ - **Quality Gates**: Validation at each phase transition
29
+ - **Specialized Agents**: Dedicated expertise for each development aspect
30
+ - **File-Based Coordination**: Well-defined outputs guide the next phase
31
+ - **Reproducible Workflows**: Consistent results across projects
32
+
33
+ ### Why SPARC?
34
+
35
+ **SPARC** (Specification, Pseudocode, Architecture, Refinement, Completion) provides:
36
+
37
+ ✅ **Quality Assurance**: Built-in testing, review, and security standards
38
+ ✅ **Complete Coverage**: From design to deployment documentation
39
+ ✅ **Best Practices**: SOLID principles, Clean Code, OWASP security
40
+ ✅ **Traceability**: Full workflow history and decision tracking
41
+ ✅ **Efficiency**: Systematic approach reduces rework and errors
42
+
43
+ ## SPARC Methodology
44
+
45
+ ### The 5 Phases
46
+
47
+ ```
48
+ ┌────────────────────────────────────────────────────────┐
49
+ │ SPARC: Systematic Software Development │
50
+ └────────────────────────────────────────────────────────┘
51
+
52
+ 1. 🏗️ ARCHITECTURE (Specification + Architecture)
53
+ └─ Design system structure, APIs, data models
54
+
55
+ 2. 💻 IMPLEMENTATION (Pseudocode → Code)
56
+ └─ Write production-ready code with SOLID principles
57
+
58
+ 3. 🧪 TESTING (Architecture Validation)
59
+ └─ Create comprehensive test suites with 80%+ coverage
60
+
61
+ 4. 👁️ REVIEW (Refinement)
62
+ └─ Analyze code quality, security, performance
63
+
64
+ 5. 📚 DOCUMENTATION (Completion)
65
+ └─ Generate API docs, user guides, architecture specs
66
+ ```
67
+
68
+ ### Phase Dependencies
69
+
70
+ Each phase builds upon the previous:
71
+
72
+ ```
73
+ Architecture.md → Implementation → Tests → Review Report → Documentation
74
+ ↓ ↓ ↓ ↓ ↓
75
+ [Phase 1] [Phase 2] [Phase 3] [Phase 4] [Phase 5]
76
+ ```
77
+
78
+ ## Phase 1: Architecture
79
+
80
+ ### Purpose
81
+ Design scalable system architecture, define API contracts, model data flows, and select appropriate technologies.
82
+
83
+ ### Agent
84
+ **dev-architect** - System architecture and design specialist
85
+
86
+ ### Command
87
+ ```bash
88
+ # Slash command (Claude Code)
89
+ /myai-dev-architect "Design authentication system with JWT"
90
+
91
+ # CLI command (npm)
92
+ npm run dev:architect "Design real-time chat application"
93
+
94
+ # With technology preferences
95
+ npm run dev:architect "Design microservices" --tech-stack "node,kubernetes,postgres,redis"
96
+ ```
97
+
98
+ ### Deliverables
99
+
100
+ **Output File**: `.myaidev-method/sparc/architecture.md`
101
+
102
+ **Contains**:
103
+ - System overview and requirements
104
+ - High-level architecture with Mermaid diagrams
105
+ - Component specifications and responsibilities
106
+ - API contracts and endpoints (REST/GraphQL/gRPC)
107
+ - Data models and schemas (SQL/NoSQL)
108
+ - Technology stack recommendations
109
+ - Security architecture and patterns
110
+ - Scalability and performance planning
111
+ - Deployment architecture
112
+
113
+ ### Example Output
114
+
115
+ ```markdown
116
+ # System Architecture: Authentication System
117
+
118
+ ## 1. Overview
119
+ Purpose: Secure user authentication with JWT tokens and refresh capabilities
120
+ Target Scale: 10,000 concurrent users
121
+
122
+ ## 2. Architecture Design
123
+
124
+ ```mermaid
125
+ graph TB
126
+ Client[Client Apps]
127
+ LB[Load Balancer]
128
+ API[API Servers]
129
+ Auth[Auth Service]
130
+ DB[(PostgreSQL)]
131
+ Cache[(Redis Cache)]
132
+
133
+ Client-->LB
134
+ LB-->API
135
+ API-->Auth
136
+ API-->DB
137
+ API-->Cache
138
+ ```
139
+
140
+ ## 3. API Specifications
141
+
142
+ ### POST /api/auth/login
143
+ Request:
144
+ ```json
145
+ {
146
+ "email": "user@example.com",
147
+ "password": "secure_password"
148
+ }
149
+ ```
150
+
151
+ Response (200 OK):
152
+ ```json
153
+ {
154
+ "user": { "id": "uuid", "email": "user@example.com" },
155
+ "token": "eyJhbGc...",
156
+ "refreshToken": "eyJhbGc..."
157
+ }
158
+ ```
159
+
160
+ ## 4. Data Models
161
+
162
+ ```sql
163
+ CREATE TABLE users (
164
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
165
+ email VARCHAR(255) UNIQUE NOT NULL,
166
+ password_hash VARCHAR(255) NOT NULL,
167
+ created_at TIMESTAMP DEFAULT NOW()
168
+ );
169
+ ```
170
+
171
+ ## 5. Security Considerations
172
+ - JWT tokens with 15-minute expiration
173
+ - bcrypt password hashing (10+ rounds)
174
+ - HTTPS/TLS 1.3 for all communications
175
+ - Rate limiting (100 requests/minute per IP)
176
+ ```
177
+
178
+ ### Options
179
+
180
+ - `--tech-stack <stack>` - Preferred technology stack (comma-separated)
181
+ - `--existing-code` - Analyze existing codebase before designing
182
+ - `--output-dir <path>` - Custom output directory
183
+
184
+ ### Best Practices
185
+
186
+ ✅ Start with clear requirements and constraints
187
+ ✅ Use Mermaid diagrams for visual clarity
188
+ ✅ Document all architectural decisions with rationale
189
+ ✅ Consider security, performance, scalability from the start
190
+ ✅ Keep designs modular and extensible
191
+
192
+ ## Phase 2: Implementation
193
+
194
+ ### Purpose
195
+ Implement features based on architecture specifications using SOLID principles, Clean Code practices, and security best practices.
196
+
197
+ ### Agent
198
+ **dev-coder** - Production code implementation specialist
199
+
200
+ ### Command
201
+ ```bash
202
+ # Slash command
203
+ /myai-dev-code "Implement JWT authentication with refresh tokens"
204
+
205
+ # CLI command
206
+ npm run dev:code "Implement user registration"
207
+
208
+ # Test-Driven Development mode
209
+ npm run dev:code "Implement payment processing" --test-driven
210
+
211
+ # Custom architecture file
212
+ npm run dev:code "Implement auth" --architecture custom-arch.md
213
+ ```
214
+
215
+ ### Deliverables
216
+
217
+ **Output Directory**: `.myaidev-method/sparc/code-output/`
218
+
219
+ **Contains**:
220
+ - Feature implementation code
221
+ - Utility functions and helpers
222
+ - Configuration files
223
+ - Basic unit tests
224
+ - Implementation notes
225
+
226
+ ### Quality Standards
227
+
228
+ **Code Quality**:
229
+ - SOLID principles (Single Responsibility, Open/Closed, etc.)
230
+ - Clean Code: DRY, KISS, YAGNI ( "You Aren't Gonna Need It," is a software development principle that advises against building features or adding complexity until they are actually needed. By focusing on current requirements, teams can deliver value faster, reduce unnecessary work, avoid over-engineering, and create simpler, more maintainable code. The principle encourages developers to postpone implementing features or technical solutions until there is a clear and present need for them)
231
+ - Modular and maintainable structure
232
+ - Clear naming and organization
233
+
234
+ **Security**:
235
+ - Input validation on all user inputs
236
+ - Error handling without exposing internals
237
+ - No secrets in code (use environment variables)
238
+ - OWASP Top 10 compliance
239
+
240
+ **Documentation**:
241
+ - Inline comments for complex logic
242
+ - JSDoc/Sphinx documentation for public APIs
243
+ - Clear function and variable names
244
+
245
+ **Testing**:
246
+ - 80%+ test coverage target
247
+ - Testable code architecture
248
+ - Dependency injection for flexibility
249
+
250
+ ### Example Output Structure
251
+
252
+ ```
253
+ .myaidev-method/sparc/code-output/
254
+ ├── src/
255
+ │ ├── auth/
256
+ │ │ ├── authService.js # Core authentication logic
257
+ │ │ ├── tokenManager.js # JWT token generation/validation
258
+ │ │ └── passwordHash.js # Password hashing utilities
259
+ │ ├── middleware/
260
+ │ │ └── authMiddleware.js # Express authentication middleware
261
+ │ └── models/
262
+ │ └── User.js # User data model
263
+ ├── tests/
264
+ │ └── auth.test.js # Basic unit tests
265
+ └── README.md # Implementation notes
266
+ ```
267
+
268
+ ### Options
269
+
270
+ - `--architecture <file>` - Path to architecture spec (default: `.myaidev-method/sparc/architecture.md`)
271
+ - `--test-driven` - Use TDD approach (write tests first)
272
+ - `--output-dir <path>` - Custom output directory
273
+
274
+ ### Best Practices
275
+
276
+ ✅ Follow architecture specifications closely
277
+ ✅ Write modular, testable code
278
+ ✅ Include comprehensive error handling
279
+ ✅ Add inline documentation for complex logic
280
+ ✅ Avoid hardcoding values, use configuration
281
+ ✅ Keep functions small and focused (Single Responsibility)
282
+
283
+ ## Phase 3: Testing
284
+
285
+ ### Purpose
286
+ Create comprehensive test suites with unit tests, integration tests, and coverage analysis to ensure code quality and functionality.
287
+
288
+ ### Agent
289
+ **dev-tester** - Testing and quality assurance specialist
290
+
291
+ ### Command
292
+ ```bash
293
+ # Slash command
294
+ /myai-dev-test "Test authentication module"
295
+
296
+ # CLI command
297
+ npm run dev:test "Test user registration"
298
+
299
+ # With coverage report
300
+ npm run dev:test "Test auth" --coverage
301
+
302
+ # Integration tests focus
303
+ npm run dev:test "Test checkout flow" --integration
304
+
305
+ # Specify test framework
306
+ npm run dev:test "Test API endpoints" --framework jest
307
+ ```
308
+
309
+ ### Deliverables
310
+
311
+ **Output Directory**: `.myaidev-method/sparc/test-results/`
312
+
313
+ **Contains**:
314
+ - Unit test files
315
+ - Integration test files
316
+ - Test report with metrics
317
+ - Coverage report
318
+ - Quality gates validation
319
+ - Recommendations for improvement
320
+
321
+ ### Coverage Standards
322
+
323
+ **Critical Paths**: 80%+ coverage
324
+ **Overall Project**: 60%+ coverage
325
+ **Quality Gates**:
326
+ - Pre-commit: Unit tests must pass
327
+ - Pre-merge: Integration tests + 60% coverage
328
+ - Pre-deployment: All tests + 80% critical path coverage
329
+
330
+ ### Test Patterns
331
+
332
+ **AAA Pattern** (Arrange, Act, Assert):
333
+ ```javascript
334
+ describe('Authentication Service', () => {
335
+ test('should generate valid JWT token', () => {
336
+ // Arrange
337
+ const user = { id: '123', email: 'test@example.com' };
338
+
339
+ // Act
340
+ const token = authService.generateToken(user);
341
+
342
+ // Assert
343
+ expect(token).toBeDefined();
344
+ expect(authService.verifyToken(token)).toEqual(user);
345
+ });
346
+ });
347
+ ```
348
+
349
+ ### Options
350
+
351
+ - `--coverage` - Generate coverage report
352
+ - `--integration` - Focus on integration tests
353
+ - `--framework <name>` - Testing framework (jest, mocha, pytest, etc.)
354
+ - `--output-dir <path>` - Custom output directory
355
+
356
+ ### Best Practices
357
+
358
+ ✅ Write tests for all public APIs
359
+ ✅ Test edge cases and error scenarios
360
+ ✅ Keep tests independent and isolated
361
+ ✅ Use descriptive test names
362
+ ✅ Fast execution (<5s for unit tests)
363
+ ✅ Mock external dependencies
364
+
365
+ ## Phase 4: Review
366
+
367
+ ### Purpose
368
+ Analyze code quality, security vulnerabilities, performance issues, and best practices compliance with actionable recommendations.
369
+
370
+ ### Agent
371
+ **dev-reviewer** - Code quality and security analysis specialist
372
+
373
+ ### Command
374
+ ```bash
375
+ # Slash command
376
+ /myai-dev-review "Review authentication implementation"
377
+
378
+ # CLI command
379
+ npm run dev:review "Review user service"
380
+
381
+ # Security-focused review
382
+ npm run dev:review "Security audit for payment module" --security
383
+
384
+ # Performance-focused review
385
+ npm run dev:review "Review database queries" --performance
386
+ ```
387
+
388
+ ### Deliverables
389
+
390
+ **Output File**: `.myaidev-method/sparc/review-report.md`
391
+
392
+ **Contains**:
393
+ - Executive summary with quality scores
394
+ - Critical/High/Medium/Low priority issues
395
+ - Security analysis (OWASP Top 10 compliance)
396
+ - Performance metrics and bottlenecks
397
+ - Code quality assessment
398
+ - Technical debt evaluation
399
+ - Testing recommendations
400
+ - Actionable improvement plan
401
+
402
+ ### Review Standards
403
+
404
+ **Code Quality**:
405
+ - Complexity metrics (cyclomatic complexity, cognitive load)
406
+ - Readability and maintainability scores
407
+ - Code smells and anti-patterns
408
+ - Naming conventions and organization
409
+
410
+ **Security**:
411
+ - OWASP Top 10 vulnerability scanning
412
+ - Input validation coverage
413
+ - Authentication/authorization checks
414
+ - Secrets management
415
+ - Error handling security
416
+
417
+ **Performance**:
418
+ - Algorithm complexity analysis (Big O notation)
419
+ - Resource management (memory, connections)
420
+ - N+1 query detection
421
+ - Caching opportunities
422
+ - Database optimization
423
+
424
+ **Best Practices**:
425
+ - SOLID principles adherence
426
+ - Framework-specific standards
427
+ - Design pattern usage
428
+ - Documentation quality
429
+
430
+ ### Example Report Structure
431
+
432
+ ```markdown
433
+ # Code Review Report: Authentication Module
434
+
435
+ ## Executive Summary
436
+ **Overall Quality**: 8.5/10
437
+ **Security Score**: 9/10
438
+ **Performance**: 7.5/10
439
+
440
+ ## Critical Issues (Address Immediately)
441
+ None
442
+
443
+ ## High Priority Issues
444
+ 1. **Performance**: N+1 query in user lookup (auth.js:45)
445
+ - **Impact**: Database performance degradation under load
446
+ - **Recommendation**: Use JOIN or batch query
447
+ - **Effort**: 1 hour
448
+
449
+ ## Medium Priority Issues
450
+ 2. **Code Quality**: High cyclomatic complexity in validateUser() (auth.js:78)
451
+ - **Impact**: Reduced maintainability
452
+ - **Recommendation**: Extract validation logic to separate functions
453
+ - **Effort**: 2 hours
454
+
455
+ ## Security Analysis (OWASP Top 10)
456
+ ✅ A01: Broken Access Control - Properly implemented
457
+ ✅ A02: Cryptographic Failures - bcrypt with 10 rounds
458
+ ⚠️ A03: Injection - Input validation present but could be strengthened
459
+ ```
460
+
461
+ ### Options
462
+
463
+ - `--security` - Focus on security analysis (OWASP Top 10)
464
+ - `--performance` - Focus on performance optimization
465
+ - `--output-dir <path>` - Custom output directory
466
+
467
+ ### Best Practices
468
+
469
+ ✅ Review all code, not just changes
470
+ ✅ Prioritize issues by severity and impact
471
+ ✅ Provide actionable recommendations
472
+ ✅ Include code examples for fixes
473
+ ✅ Consider long-term maintainability
474
+
475
+ ## Phase 5: Documentation
476
+
477
+ ### Purpose
478
+ Generate comprehensive API documentation, user guides, architecture docs, and code examples for maintainability and knowledge transfer.
479
+
480
+ ### Agent
481
+ **dev-documenter** - Technical documentation specialist
482
+
483
+ ### Command
484
+ ```bash
485
+ # Slash command
486
+ /myai-dev-docs "Document authentication API"
487
+
488
+ # CLI command
489
+ npm run dev:docs "Document user service API"
490
+
491
+ # User guide documentation
492
+ npm run dev:docs "Create user guide for checkout" --type user-guide
493
+
494
+ # Architecture documentation
495
+ npm run dev:docs "Document system architecture" --type architecture
496
+
497
+ # OpenAPI specification
498
+ npm run dev:docs "Generate OpenAPI spec for API" --format openapi
499
+ ```
500
+
501
+ ### Deliverables
502
+
503
+ **Output Directory**: `.myaidev-method/sparc/documentation/`
504
+
505
+ **Contains**:
506
+ - API reference documentation
507
+ - User guides and tutorials
508
+ - Architecture documentation
509
+ - Code examples and snippets
510
+ - Mermaid diagrams
511
+ - OpenAPI/Swagger specs (if applicable)
512
+
513
+ ### Documentation Standards
514
+
515
+ **Clarity**:
516
+ - Simple language, clear examples
517
+ - Visual aids (diagrams, screenshots)
518
+ - Progressive difficulty (beginner to advanced)
519
+
520
+ **Completeness**:
521
+ - All public APIs documented
522
+ - Edge cases and error scenarios covered
523
+ - Authentication and authorization requirements
524
+ - Rate limiting and quotas
525
+
526
+ **Accuracy**:
527
+ - Code examples tested and verified
528
+ - Documentation synchronized with code
529
+ - Version-specific information
530
+
531
+ **Accessibility**:
532
+ - Multiple formats (Markdown, HTML, PDF)
533
+ - Searchable content
534
+ - Well-organized structure
535
+ - Table of contents and navigation
536
+
537
+ ### Example Documentation Structure
538
+
539
+ ```
540
+ .myaidev-method/sparc/documentation/
541
+ ├── api/
542
+ │ ├── authentication.md
543
+ │ ├── users.md
544
+ │ └── openapi.yaml
545
+ ├── user-guide/
546
+ │ ├── getting-started.md
547
+ │ ├── authentication-guide.md
548
+ │ └── troubleshooting.md
549
+ └── architecture/
550
+ ├── system-overview.md
551
+ ├── data-models.md
552
+ └── deployment.md
553
+ ```
554
+
555
+ ### Options
556
+
557
+ - `--type <type>` - Documentation type: api, user-guide, architecture, technical
558
+ - `--format <format>` - Output format: markdown, html, openapi, swagger
559
+ - `--output-dir <path>` - Custom output directory
560
+
561
+ ### Best Practices
562
+
563
+ ✅ Write for your target audience
564
+ ✅ Include practical code examples
565
+ ✅ Keep documentation synchronized with code
566
+ ✅ Use diagrams for complex concepts
567
+ ✅ Provide troubleshooting sections
568
+ ✅ Version your documentation
569
+
570
+ ## Complete Workflow
571
+
572
+ ### Running All 5 Phases
573
+
574
+ Execute the complete SPARC workflow with a single command:
575
+
576
+ ```bash
577
+ # CLI command
578
+ npm run sparc "Build user authentication system with JWT and refresh tokens"
579
+
580
+ # Slash command
581
+ /myai-sparc-workflow "Create payment processing module"
582
+
583
+ # With technology preferences
584
+ npm run sparc "Build e-commerce checkout" --tech-stack "react,node,stripe,postgres"
585
+
586
+ # Run specific phases only
587
+ npm run sparc "Refactor auth module" --phases "architecture,review,documentation"
588
+ ```
589
+
590
+ ### Workflow Execution
591
+
592
+ ```
593
+ ┌────────────────────────────────────────────────────────┐
594
+ │ SPARC Workflow Execution │
595
+ └────────────────────────────────────────────────────────┘
596
+
597
+ 🏗️ Phase 1: Architecture
598
+ ├─ Reading requirements...
599
+ ├─ Designing system architecture...
600
+ ├─ Creating Mermaid diagrams...
601
+ └─ ✅ Output: .myaidev-method/sparc/architecture.md
602
+
603
+ 💻 Phase 2: Implementation
604
+ ├─ Reading architecture spec...
605
+ ├─ Implementing features...
606
+ ├─ Writing tests...
607
+ └─ ✅ Output: .myaidev-method/sparc/code-output/
608
+
609
+ 🧪 Phase 3: Testing
610
+ ├─ Analyzing code...
611
+ ├─ Creating test suites...
612
+ ├─ Generating coverage report...
613
+ └─ ✅ Output: .myaidev-method/sparc/test-results/
614
+
615
+ 👁️ Phase 4: Review
616
+ ├─ Code quality analysis...
617
+ ├─ Security audit (OWASP Top 10)...
618
+ ├─ Performance review...
619
+ └─ ✅ Output: .myaidev-method/sparc/review-report.md
620
+
621
+ 📚 Phase 5: Documentation
622
+ ├─ Generating API docs...
623
+ ├─ Creating user guides...
624
+ ├─ Documenting architecture...
625
+ └─ ✅ Output: .myaidev-method/sparc/documentation/
626
+
627
+ 🎉 SPARC Workflow Complete!
628
+ ```
629
+
630
+ ### Output Structure
631
+
632
+ ```
633
+ .myaidev-method/
634
+ ├── sparc/
635
+ │ ├── architecture.md # Phase 1: Architecture
636
+ │ ├── code-output/ # Phase 2: Implementation
637
+ │ ├── test-results/ # Phase 3: Testing
638
+ │ ├── review-report.md # Phase 4: Review
639
+ │ └── documentation/ # Phase 5: Documentation
640
+ ├── tasks/
641
+ │ └── workflow_20250120_123456.json
642
+ └── workflows/
643
+ └── sparc_20250120_123456.json
644
+ ```
645
+
646
+ ## CLI Commands
647
+
648
+ ### Individual Phase Commands
649
+
650
+ ```bash
651
+ # Phase 1: Architecture
652
+ npm run dev:architect "Design real-time chat app"
653
+ npm run dev:architect "Design microservices" --tech-stack "node,kubernetes,mongodb"
654
+
655
+ # Phase 2: Implementation
656
+ npm run dev:code "Implement chat service"
657
+ npm run dev:code "Implement auth" --test-driven
658
+
659
+ # Phase 3: Testing
660
+ npm run dev:test "Test chat functionality" --integration --coverage
661
+ npm run dev:test "Test API endpoints" --framework jest
662
+
663
+ # Phase 4: Review
664
+ npm run dev:review "Review chat implementation" --security
665
+ npm run dev:review "Review database layer" --performance
666
+
667
+ # Phase 5: Documentation
668
+ npm run dev:docs "Document chat API"
669
+ npm run dev:docs "Create deployment guide" --type architecture
670
+ ```
671
+
672
+ ### Complete Workflow Command
673
+
674
+ ```bash
675
+ # Run all 5 phases
676
+ npm run sparc "Build feature X"
677
+
678
+ # Run specific phases
679
+ npm run sparc "Improve feature Y" --phases "architecture,review,documentation"
680
+
681
+ # Skip specific phase (use with caution)
682
+ npm run sparc "Build feature Z" --skip-phase testing
683
+ ```
684
+
685
+ ## Quality Standards
686
+
687
+ ### Code Quality
688
+
689
+ **SOLID Principles**:
690
+ - **S**ingle Responsibility: Each class/function has one reason to change
691
+ - **O**pen/Closed: Open for extension, closed for modification
692
+ - **L**iskov Substitution: Derived classes substitutable for base classes
693
+ - **I**nterface Segregation: Don't depend on unused interfaces
694
+ - **D**ependency Inversion: Depend on abstractions, not concretions
695
+
696
+ **Clean Code**:
697
+ - **DRY** (Don't Repeat Yourself): Abstract common functionality
698
+ - **KISS** (Keep It Simple, Stupid): Prefer simplicity over complexity
699
+ - **YAGNI** (You Aren't Gonna Need It): Implement current requirements only
700
+
701
+ ### Security Standards
702
+
703
+ **OWASP Top 10 Compliance**:
704
+ 1. Broken Access Control
705
+ 2. Cryptographic Failures
706
+ 3. Injection
707
+ 4. Insecure Design
708
+ 5. Security Misconfiguration
709
+ 6. Vulnerable Components
710
+ 7. Authentication Failures
711
+ 8. Software and Data Integrity Failures
712
+ 9. Security Logging Failures
713
+ 10. Server-Side Request Forgery
714
+
715
+ ### Testing Standards
716
+
717
+ **Coverage Requirements**:
718
+ - Critical paths: 80%+ coverage
719
+ - Overall project: 60%+ coverage
720
+ - Public APIs: 100% coverage
721
+
722
+ **Test Types**:
723
+ - Unit tests: Individual functions/methods
724
+ - Integration tests: Component interactions
725
+ - E2E tests: Complete user workflows
726
+
727
+ ### Performance Standards
728
+
729
+ **Response Times**:
730
+ - API endpoints: <200ms (p95)
731
+ - Database queries: <50ms (p95)
732
+ - Page load: <2s (p95)
733
+
734
+ **Scalability**:
735
+ - Horizontal scaling capability
736
+ - Stateless design
737
+ - Efficient resource usage
738
+
739
+ ## Best Practices
740
+
741
+ ### Architecture Phase
742
+
743
+ ✅ Start with clear requirements
744
+ ✅ Consider scalability from the start
745
+ ✅ Document all design decisions
746
+ ✅ Use visual diagrams (Mermaid)
747
+ ✅ Plan for security and performance
748
+
749
+ ### Implementation Phase
750
+
751
+ ✅ Follow architecture specifications
752
+ ✅ Write testable code
753
+ ✅ Use meaningful names
754
+ ✅ Handle errors gracefully
755
+ ✅ Document complex logic
756
+
757
+ ### Testing Phase
758
+
759
+ ✅ Write tests for all public APIs
760
+ ✅ Test edge cases and errors
761
+ ✅ Keep tests independent
762
+ ✅ Use descriptive test names
763
+ ✅ Aim for >80% critical path coverage
764
+
765
+ ### Review Phase
766
+
767
+ ✅ Review all code systematically
768
+ ✅ Prioritize issues by impact
769
+ ✅ Provide actionable recommendations
770
+ ✅ Check OWASP Top 10
771
+ ✅ Analyze performance bottlenecks
772
+
773
+ ### Documentation Phase
774
+
775
+ ✅ Write for your audience
776
+ ✅ Include code examples
777
+ ✅ Keep docs synchronized
778
+ ✅ Use diagrams for clarity
779
+ ✅ Provide troubleshooting
780
+
781
+ ## Examples
782
+
783
+ ### Example 1: Building a Next.js Blog with PayloadCMS Backend
784
+
785
+ This comprehensive example demonstrates building a complete blog system using Next.js for the frontend and PayloadCMS as the headless CMS backend, then using MyAIDev Method's publishing workflow to create and publish content.
786
+
787
+ #### Project Overview
788
+
789
+ **Goal**: Build a modern blog platform with:
790
+ - Next.js 14 frontend with App Router
791
+ - PayloadCMS 2.x headless CMS backend
792
+ - Content publishing workflow
793
+ - SEO optimization
794
+ - Responsive design
795
+
796
+ #### Complete SPARC Workflow
797
+
798
+ ```bash
799
+ # Execute complete SPARC workflow for the entire blog system
800
+ npm run sparc "Build Next.js blog with PayloadCMS backend, including posts collection, user authentication, and content API" --tech-stack "nextjs,payloadcms,mongodb,typescript"
801
+ ```
802
+
803
+ #### Phase-by-Phase Implementation
804
+
805
+ **Phase 1: Architecture**
806
+ ```bash
807
+ npm run dev:architect "Design Next.js blog with PayloadCMS backend" --tech-stack "nextjs,payloadcms,mongodb,typescript"
808
+ ```
809
+
810
+ **Expected Output** (.myaidev-method/sparc/architecture.md):
811
+
812
+ ```markdown
813
+ # System Architecture: Next.js Blog with PayloadCMS
814
+
815
+ ## 1. Overview
816
+ - Frontend: Next.js 14 with App Router, React Server Components
817
+ - Backend: PayloadCMS 2.x (headless CMS)
818
+ - Database: MongoDB
819
+ - Deployment: Vercel (frontend), self-hosted (PayloadCMS)
820
+
821
+ ## 2. Architecture Design
822
+
823
+ ```mermaid
824
+ graph TB
825
+ Browser[Browser Client]
826
+ NextJS[Next.js Frontend]
827
+ PayloadAPI[PayloadCMS API]
828
+ MongoDB[(MongoDB)]
829
+ CDN[Vercel CDN]
830
+
831
+ Browser-->NextJS
832
+ NextJS-->PayloadAPI
833
+ PayloadAPI-->MongoDB
834
+ NextJS-->CDN
835
+ ```
836
+
837
+ ## 3. Collections (PayloadCMS)
838
+
839
+ ### Posts Collection
840
+ ```typescript
841
+ {
842
+ slug: 'posts',
843
+ fields: [
844
+ { name: 'title', type: 'text', required: true },
845
+ { name: 'content', type: 'richText', required: true },
846
+ { name: 'excerpt', type: 'textarea' },
847
+ { name: 'coverImage', type: 'upload', relationTo: 'media' },
848
+ { name: 'author', type: 'relationship', relationTo: 'users' },
849
+ { name: 'publishedDate', type: 'date' },
850
+ { name: 'status', type: 'select', options: ['draft', 'published'] }
851
+ ]
852
+ }
853
+ ```
854
+
855
+ ### Authors Collection
856
+ ```typescript
857
+ {
858
+ slug: 'authors',
859
+ fields: [
860
+ { name: 'name', type: 'text', required: true },
861
+ { name: 'bio', type: 'textarea' },
862
+ { name: 'avatar', type: 'upload', relationTo: 'media' }
863
+ ]
864
+ }
865
+ ```
866
+
867
+ ## 4. API Endpoints
868
+
869
+ ### PayloadCMS REST API
870
+ - GET /api/posts - List all posts
871
+ - GET /api/posts/:id - Get single post
872
+ - POST /api/posts - Create post (authenticated)
873
+ - PATCH /api/posts/:id - Update post (authenticated)
874
+
875
+ ### Next.js Routes
876
+ - / - Homepage (list of posts)
877
+ - /posts/[slug] - Individual post page
878
+ - /author/[slug] - Author page
879
+ ```
880
+
881
+ **Phase 2: Implementation**
882
+ ```bash
883
+ npm run dev:code "Implement Next.js frontend and PayloadCMS backend"
884
+ ```
885
+
886
+ **Expected Output** (.myaidev-method/sparc/code-output/):
887
+
888
+ ```
889
+ code-output/
890
+ ├── payloadcms/
891
+ │ ├── src/
892
+ │ │ ├── collections/
893
+ │ │ │ ├── Posts.ts
894
+ │ │ │ ├── Authors.ts
895
+ │ │ │ └── Media.ts
896
+ │ │ ├── payload.config.ts
897
+ │ │ └── server.ts
898
+ │ └── package.json
899
+ ├── nextjs-blog/
900
+ │ ├── app/
901
+ │ │ ├── page.tsx # Homepage
902
+ │ │ ├── posts/
903
+ │ │ │ └── [slug]/page.tsx # Post detail page
904
+ │ │ └── layout.tsx
905
+ │ ├── components/
906
+ │ │ ├── PostCard.tsx
907
+ │ │ ├── PostContent.tsx
908
+ │ │ └── AuthorBio.tsx
909
+ │ ├── lib/
910
+ │ │ └── payload.ts # PayloadCMS API client
911
+ │ └── package.json
912
+ └── README.md
913
+ ```
914
+
915
+ **Key Implementation Files**:
916
+
917
+ `payloadcms/src/collections/Posts.ts`:
918
+ ```typescript
919
+ import { CollectionConfig } from 'payload/types';
920
+
921
+ export const Posts: CollectionConfig = {
922
+ slug: 'posts',
923
+ admin: {
924
+ useAsTitle: 'title',
925
+ defaultColumns: ['title', 'author', 'publishedDate', 'status'],
926
+ },
927
+ access: {
928
+ read: () => true,
929
+ create: ({ req: { user } }) => !!user,
930
+ update: ({ req: { user } }) => !!user,
931
+ },
932
+ fields: [
933
+ {
934
+ name: 'title',
935
+ type: 'text',
936
+ required: true,
937
+ },
938
+ {
939
+ name: 'content',
940
+ type: 'richText',
941
+ required: true,
942
+ },
943
+ {
944
+ name: 'excerpt',
945
+ type: 'textarea',
946
+ maxLength: 200,
947
+ },
948
+ {
949
+ name: 'slug',
950
+ type: 'text',
951
+ required: true,
952
+ unique: true,
953
+ admin: {
954
+ position: 'sidebar',
955
+ },
956
+ },
957
+ {
958
+ name: 'coverImage',
959
+ type: 'upload',
960
+ relationTo: 'media',
961
+ },
962
+ {
963
+ name: 'author',
964
+ type: 'relationship',
965
+ relationTo: 'authors',
966
+ required: true,
967
+ },
968
+ {
969
+ name: 'publishedDate',
970
+ type: 'date',
971
+ admin: {
972
+ position: 'sidebar',
973
+ },
974
+ },
975
+ {
976
+ name: 'status',
977
+ type: 'select',
978
+ options: ['draft', 'published'],
979
+ defaultValue: 'draft',
980
+ admin: {
981
+ position: 'sidebar',
982
+ },
983
+ },
984
+ ],
985
+ };
986
+ ```
987
+
988
+ `nextjs-blog/lib/payload.ts`:
989
+ ```typescript
990
+ // PayloadCMS API client
991
+ const PAYLOAD_API_URL = process.env.NEXT_PUBLIC_PAYLOAD_URL || 'http://localhost:3001';
992
+
993
+ export async function getPosts() {
994
+ const res = await fetch(`${PAYLOAD_API_URL}/api/posts?where[status][equals]=published`, {
995
+ next: { revalidate: 60 } // ISR: revalidate every 60 seconds
996
+ });
997
+ return res.json();
998
+ }
999
+
1000
+ export async function getPostBySlug(slug: string) {
1001
+ const res = await fetch(`${PAYLOAD_API_URL}/api/posts?where[slug][equals]=${slug}`);
1002
+ const data = await res.json();
1003
+ return data.docs[0];
1004
+ }
1005
+ ```
1006
+
1007
+ `nextjs-blog/app/posts/[slug]/page.tsx`:
1008
+ ```typescript
1009
+ import { getPostBySlug } from '@/lib/payload';
1010
+ import PostContent from '@/components/PostContent';
1011
+
1012
+ export default async function PostPage({ params }: { params: { slug: string } }) {
1013
+ const post = await getPostBySlug(params.slug);
1014
+
1015
+ return (
1016
+ <article className="max-w-4xl mx-auto px-4 py-12">
1017
+ <h1 className="text-4xl font-bold mb-4">{post.title}</h1>
1018
+ <PostContent content={post.content} />
1019
+ </article>
1020
+ );
1021
+ }
1022
+ ```
1023
+
1024
+ **Phase 3: Testing**
1025
+ ```bash
1026
+ npm run dev:test "Test Next.js blog and PayloadCMS integration" --integration --coverage
1027
+ ```
1028
+
1029
+ **Expected Output** (.myaidev-method/sparc/test-results/):
1030
+ - Unit tests for React components (25 tests)
1031
+ - Integration tests for PayloadCMS API (15 tests)
1032
+ - E2E tests for blog workflows (10 tests)
1033
+ - 82% overall coverage
1034
+
1035
+ **Phase 4: Review**
1036
+ ```bash
1037
+ npm run dev:review "Review Next.js blog implementation" --security --performance
1038
+ ```
1039
+
1040
+ **Expected Output** (.myaidev-method/sparc/review-report.md):
1041
+ - Security: 9/10 (API authentication secure, no XSS vulnerabilities)
1042
+ - Performance: 8.5/10 (ISR configured, image optimization needed)
1043
+ - Code Quality: 8/10
1044
+ - Recommendations: Add caching layer for API requests, optimize images
1045
+
1046
+ **Phase 5: Documentation**
1047
+ ```bash
1048
+ npm run dev:docs "Document Next.js blog and PayloadCMS setup"
1049
+ ```
1050
+
1051
+ **Expected Output** (.myaidev-method/sparc/documentation/):
1052
+ - Setup guide for PayloadCMS
1053
+ - Next.js deployment guide
1054
+ - API reference
1055
+ - Content publishing workflow guide
1056
+
1057
+ #### Content Publishing Workflow
1058
+
1059
+ After building the blog system, use MyAIDev Method's content creation and publishing workflow:
1060
+
1061
+ **Step 1: Create Content with AI**
1062
+ ```bash
1063
+ # In Claude Code, use the content writer agent
1064
+ /myai-content-writer "10 Best Practices for Next.js Performance Optimization" --word_count 1500 --tone technical --audience "web developers"
1065
+ ```
1066
+
1067
+ **Output**: Creates `10-best-practices-for-nextjs-performance.md` with:
1068
+ - SEO-optimized content
1069
+ - Proper frontmatter (title, excerpt, keywords)
1070
+ - Markdown formatting
1071
+ - Code examples
1072
+
1073
+ **Step 2: Publish to PayloadCMS**
1074
+ ```bash
1075
+ # Configure PayloadCMS credentials (one-time setup)
1076
+ /myai-configure payloadcms
1077
+
1078
+ # Publish the article to PayloadCMS
1079
+ /myai-payloadcms-publish "10-best-practices-for-nextjs-performance.md" --collection posts --status draft
1080
+ ```
1081
+
1082
+ **What happens**:
1083
+ 1. Converts markdown to Lexical rich text format
1084
+ 2. Extracts frontmatter for metadata
1085
+ 3. Creates post in PayloadCMS via API
1086
+ 4. Sets author (from environment)
1087
+ 5. Uploads any referenced images
1088
+ 6. Returns post ID and admin URL
1089
+
1090
+ **Step 3: Review in PayloadCMS Admin**
1091
+ - Navigate to PayloadCMS admin (http://localhost:3001/admin)
1092
+ - Review the draft post
1093
+ - Add cover image, adjust formatting
1094
+ - Set publish date
1095
+ - Change status to "published"
1096
+
1097
+ **Step 4: View on Frontend**
1098
+ - Post automatically appears on Next.js frontend
1099
+ - ISR revalidates cache (60s interval)
1100
+ - SEO metadata automatically populated
1101
+ - Social sharing ready
1102
+
1103
+ #### Alternative: WordPress Backend
1104
+
1105
+ If using WordPress instead of PayloadCMS:
1106
+
1107
+ ```bash
1108
+ # Architecture with WordPress
1109
+ npm run dev:architect "Design Next.js blog with WordPress headless CMS" --tech-stack "nextjs,wordpress,mysql"
1110
+
1111
+ # Implementation
1112
+ npm run dev:code "Implement Next.js frontend with WordPress REST API"
1113
+
1114
+ # Content creation
1115
+ /myai-content-writer "Getting Started with Headless WordPress" --word_count 1200
1116
+
1117
+ # Publish to WordPress
1118
+ /myai-wordpress-publish "getting-started-with-headless-wordpress.md" --status draft
1119
+
1120
+ # WordPress automatically handles:
1121
+ # - Gutenberg block conversion
1122
+ # - Media library uploads
1123
+ # - SEO metadata (Yoast/RankMath)
1124
+ # - Categories and tags
1125
+ ```
1126
+
1127
+ #### Complete Project Timeline
1128
+
1129
+ **Week 1: Architecture & Setup**
1130
+ - Day 1-2: Architecture design (SPARC Phase 1)
1131
+ - Day 3-4: PayloadCMS setup and collections
1132
+ - Day 5: Next.js project scaffolding
1133
+
1134
+ **Week 2: Implementation**
1135
+ - Day 1-3: Frontend components (SPARC Phase 2)
1136
+ - Day 4-5: API integration and data fetching
1137
+
1138
+ **Week 3: Testing & Review**
1139
+ - Day 1-2: Test suite creation (SPARC Phase 3)
1140
+ - Day 3-4: Code review and improvements (SPARC Phase 4)
1141
+ - Day 5: Bug fixes and optimization
1142
+
1143
+ **Week 4: Documentation & Launch**
1144
+ - Day 1-2: Documentation (SPARC Phase 5)
1145
+ - Day 3: Content creation with AI agents
1146
+ - Day 4: Content publishing workflow
1147
+ - Day 5: Production deployment
1148
+
1149
+ #### Publishing Workflow Diagram
1150
+
1151
+ ```
1152
+ ┌─────────────────────────────────────────────────────────────┐
1153
+ │ Content Creation & Publishing Workflow │
1154
+ └─────────────────────────────────────────────────────────────┘
1155
+
1156
+ 1. Create Content
1157
+ /myai-content-writer "Article Topic" --word_count 1500
1158
+
1159
+ Output: article-topic.md (SEO-optimized markdown)
1160
+
1161
+ 2. Review & Edit
1162
+ - Review generated content
1163
+ - Make manual adjustments
1164
+ - Add custom images/media
1165
+
1166
+
1167
+ 3. Publish to CMS
1168
+ /myai-payloadcms-publish "article-topic.md" --status draft
1169
+ OR
1170
+ /myai-wordpress-publish "article-topic.md" --status draft
1171
+
1172
+ Output: Post created in CMS (draft status)
1173
+
1174
+ 4. CMS Review
1175
+ - Login to PayloadCMS/WordPress admin
1176
+ - Review formatted content
1177
+ - Add cover image, categories, tags
1178
+ - Set publish date
1179
+ - Change status to "published"
1180
+
1181
+
1182
+ 5. Frontend Display
1183
+ - Next.js ISR revalidates
1184
+ - Post appears on blog
1185
+ - SEO metadata active
1186
+ - Social sharing ready
1187
+
1188
+
1189
+ 6. Analytics & Optimization
1190
+ - Monitor post performance
1191
+ - Use AI to create follow-up content
1192
+ - Iterate and improve
1193
+ ```
1194
+
1195
+ #### Benefits of This Workflow
1196
+
1197
+ ✅ **Systematic Development**: SPARC ensures complete coverage from design to docs
1198
+ ✅ **AI-Assisted Content**: Generate SEO-optimized content in minutes
1199
+ ✅ **Headless CMS**: Decouple content from presentation
1200
+ ✅ **Modern Stack**: Next.js + PayloadCMS = fast, scalable, developer-friendly
1201
+ ✅ **Quality Assurance**: Built-in testing, review, and documentation
1202
+ ✅ **Flexible Publishing**: Draft workflow with CMS review before publish
1203
+ ✅ **SEO Ready**: Automatic metadata, image optimization, performance
1204
+
1205
+ ### Example 2: Building Authentication System
1206
+
1207
+ ```bash
1208
+ # Complete workflow
1209
+ npm run sparc "Build JWT authentication with refresh tokens and role-based access control"
1210
+ ```
1211
+
1212
+ **Expected Outputs**:
1213
+ 1. **Architecture** (.myaidev-method/sparc/architecture.md):
1214
+ - System design with auth flow diagrams
1215
+ - JWT token management strategy
1216
+ - User and role data models
1217
+ - Security patterns (token rotation, RBAC)
1218
+
1219
+ 2. **Implementation** (.myaidev-method/sparc/code-output/):
1220
+ - authService.js, tokenManager.js
1221
+ - User and Role models
1222
+ - Express middleware
1223
+ - Unit tests
1224
+
1225
+ 3. **Testing** (.myaidev-method/sparc/test-results/):
1226
+ - 25 unit tests
1227
+ - 10 integration tests
1228
+ - 85% coverage report
1229
+
1230
+ 4. **Review** (.myaidev-method/sparc/review-report.md):
1231
+ - Security: 9/10 (OWASP compliant)
1232
+ - Quality: 8.5/10
1233
+ - 2 medium-priority improvements
1234
+
1235
+ 5. **Documentation** (.myaidev-method/sparc/documentation/):
1236
+ - API reference for /auth endpoints
1237
+ - User guide for authentication
1238
+ - Security best practices
1239
+
1240
+ ### Example 3: Individual Phase Workflow for Real-Time Chat
1241
+
1242
+ ```bash
1243
+ # Step 1: Design architecture
1244
+ npm run dev:architect "Design real-time chat application for 10k users"
1245
+
1246
+ # Review architecture.md, make adjustments if needed
1247
+
1248
+ # Step 2: Implement based on architecture
1249
+ npm run dev:code "Implement WebSocket chat server"
1250
+
1251
+ # Step 3: Create comprehensive tests
1252
+ npm run dev:test "Test chat functionality" --integration --coverage
1253
+
1254
+ # Step 4: Review implementation
1255
+ npm run dev:review "Review chat implementation" --security
1256
+
1257
+ # Address review findings...
1258
+
1259
+ # Step 5: Generate documentation
1260
+ npm run dev:docs "Document chat API and deployment"
1261
+ ```
1262
+
1263
+ ### Example 4: E-Commerce with Content Management
1264
+
1265
+ Building an e-commerce site with WordPress backend for content:
1266
+
1267
+ ```bash
1268
+ # Phase 1: Architecture
1269
+ npm run dev:architect "Design Next.js e-commerce with WordPress for blog and content" --tech-stack "nextjs,wordpress,stripe,mysql"
1270
+
1271
+ # Phase 2: Implementation
1272
+ npm run dev:code "Implement e-commerce frontend with WordPress blog integration"
1273
+
1274
+ # Create product descriptions with AI
1275
+ /myai-content-writer "Product Description: Premium Leather Wallet" --word_count 300 --tone persuasive
1276
+
1277
+ # Create blog content for SEO
1278
+ /myai-content-writer "Complete Guide to Leather Care" --word_count 2000 --seo_keywords "leather care,wallet maintenance"
1279
+
1280
+ # Publish to WordPress
1281
+ /myai-wordpress-publish "complete-guide-to-leather-care.md" --status published
1282
+
1283
+ # WordPress integration provides:
1284
+ # - SEO-optimized blog posts
1285
+ # - Product descriptions
1286
+ # - Landing pages
1287
+ # - Category pages
1288
+ # - All managed via WordPress admin
1289
+ ```
1290
+
1291
+ ## Troubleshooting
1292
+
1293
+ ### Common Issues
1294
+
1295
+ #### "Architecture file not found"
1296
+ **Problem**: Implementation phase can't find architecture.md
1297
+
1298
+ **Solution**:
1299
+ ```bash
1300
+ # Specify custom architecture file
1301
+ npm run dev:code "Implement feature" --architecture path/to/arch.md
1302
+
1303
+ # Or ensure architecture phase completed successfully
1304
+ npm run dev:architect "Design system first"
1305
+ ```
1306
+
1307
+ #### "Coverage below threshold"
1308
+ **Problem**: Tests don't meet 60% minimum coverage
1309
+
1310
+ **Solution**:
1311
+ ```bash
1312
+ # Generate coverage report to see gaps
1313
+ npm run dev:test "Test module" --coverage
1314
+
1315
+ # Review coverage report in .myaidev-method/sparc/test-results/
1316
+ # Add tests for uncovered code paths
1317
+ ```
1318
+
1319
+ #### "Review finds critical security issues"
1320
+ **Problem**: OWASP compliance failures
1321
+
1322
+ **Solution**:
1323
+ 1. Review specific issues in review-report.md
1324
+ 2. Address critical and high-priority issues
1325
+ 3. Re-run review phase
1326
+ ```bash
1327
+ npm run dev:review "Review fixed implementation" --security
1328
+ ```
1329
+
1330
+ ### Getting Help
1331
+
1332
+ 1. **Review Documentation**: Check phase-specific documentation
1333
+ 2. **Check Outputs**: Examine .myaidev-method/sparc/ for detailed reports
1334
+ 3. **Run Individual Phases**: Isolate issues by running phases separately
1335
+ 4. **GitHub Issues**: Report bugs at https://github.com/myaione/myaidev-method/issues
1336
+
1337
+ ## Conclusion
1338
+
1339
+ The MyAIDev Method's SPARC workflow provides a comprehensive, systematic approach to software development. By following the 5 phases and adhering to quality standards, you can:
1340
+
1341
+ ✅ Deliver high-quality, production-ready software
1342
+ ✅ Maintain comprehensive documentation
1343
+ ✅ Ensure security and performance
1344
+ ✅ Build maintainable, testable code
1345
+ ✅ Follow industry best practices
1346
+
1347
+ **Next Steps**:
1348
+ 1. Initialize MyAIDev Method: `npx myaidev-method init --claude`
1349
+ 2. Run your first SPARC workflow: `npm run sparc "Build your feature"`
1350
+ 3. Review outputs in `.myaidev-method/sparc/`
1351
+ 4. Iterate and improve based on review findings
1352
+
1353
+ For more information, visit: https://github.com/myaione/myaidev-method