myaidev-method 0.2.8 → 0.2.9

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 (157) hide show
  1. package/.claude/agents/wordpress-admin.md +271 -0
  2. package/.env.example +0 -1
  3. package/PACKAGE_FIXES_SUMMARY.md +319 -0
  4. package/PAYLOADCMS_AUTH_UPDATE.md +248 -0
  5. package/USER_GUIDE.md +260 -0
  6. package/bin/cli.js +36 -0
  7. package/dist/server/.tsbuildinfo +1 -0
  8. package/dist/server/auth/controllers/AuthController.d.ts +34 -0
  9. package/dist/server/auth/controllers/AuthController.d.ts.map +1 -0
  10. package/dist/server/auth/controllers/AuthController.js +43 -0
  11. package/dist/server/auth/controllers/AuthController.js.map +1 -0
  12. package/dist/server/auth/example-usage.d.ts +53 -0
  13. package/dist/server/auth/example-usage.d.ts.map +1 -0
  14. package/dist/server/auth/example-usage.js +129 -0
  15. package/dist/server/auth/example-usage.js.map +1 -0
  16. package/dist/server/auth/index.d.ts +11 -0
  17. package/dist/server/auth/index.d.ts.map +1 -0
  18. package/dist/server/auth/index.js +15 -0
  19. package/dist/server/auth/index.js.map +1 -0
  20. package/dist/server/auth/layers.d.ts +19 -0
  21. package/dist/server/auth/layers.d.ts.map +1 -0
  22. package/dist/server/auth/layers.js +33 -0
  23. package/dist/server/auth/layers.js.map +1 -0
  24. package/dist/server/auth/middleware/authMiddleware.d.ts +24 -0
  25. package/dist/server/auth/middleware/authMiddleware.d.ts.map +1 -0
  26. package/dist/server/auth/middleware/authMiddleware.js +65 -0
  27. package/dist/server/auth/middleware/authMiddleware.js.map +1 -0
  28. package/dist/server/auth/routes/authRoutes.d.ts +11 -0
  29. package/dist/server/auth/routes/authRoutes.d.ts.map +1 -0
  30. package/dist/server/auth/routes/authRoutes.js +213 -0
  31. package/dist/server/auth/routes/authRoutes.js.map +1 -0
  32. package/dist/server/auth/services/AuditLogService.d.ts +21 -0
  33. package/dist/server/auth/services/AuditLogService.d.ts.map +1 -0
  34. package/dist/server/auth/services/AuditLogService.js +28 -0
  35. package/dist/server/auth/services/AuditLogService.js.map +1 -0
  36. package/dist/server/auth/services/AuthService.d.ts +27 -0
  37. package/dist/server/auth/services/AuthService.d.ts.map +1 -0
  38. package/dist/server/auth/services/AuthService.js +246 -0
  39. package/dist/server/auth/services/AuthService.js.map +1 -0
  40. package/dist/server/auth/services/PasswordService.d.ts +12 -0
  41. package/dist/server/auth/services/PasswordService.d.ts.map +1 -0
  42. package/dist/server/auth/services/PasswordService.js +31 -0
  43. package/dist/server/auth/services/PasswordService.js.map +1 -0
  44. package/dist/server/auth/services/SessionRepository.d.ts +24 -0
  45. package/dist/server/auth/services/SessionRepository.d.ts.map +1 -0
  46. package/dist/server/auth/services/SessionRepository.js +101 -0
  47. package/dist/server/auth/services/SessionRepository.js.map +1 -0
  48. package/dist/server/auth/services/TokenService.d.ts +12 -0
  49. package/dist/server/auth/services/TokenService.d.ts.map +1 -0
  50. package/dist/server/auth/services/TokenService.js +86 -0
  51. package/dist/server/auth/services/TokenService.js.map +1 -0
  52. package/dist/server/auth/services/UserRepository.d.ts +23 -0
  53. package/dist/server/auth/services/UserRepository.d.ts.map +1 -0
  54. package/dist/server/auth/services/UserRepository.js +168 -0
  55. package/dist/server/auth/services/UserRepository.js.map +1 -0
  56. package/dist/server/auth/services/example.d.ts +26 -0
  57. package/dist/server/auth/services/example.d.ts.map +1 -0
  58. package/dist/server/auth/services/example.js +221 -0
  59. package/dist/server/auth/services/example.js.map +1 -0
  60. package/dist/server/auth/services/index.d.ts +6 -0
  61. package/dist/server/auth/services/index.d.ts.map +1 -0
  62. package/dist/server/auth/services/index.js +7 -0
  63. package/dist/server/auth/services/index.js.map +1 -0
  64. package/dist/server/database/db.d.ts +28 -0
  65. package/dist/server/database/db.d.ts.map +1 -0
  66. package/dist/server/database/db.js +91 -0
  67. package/dist/server/database/db.js.map +1 -0
  68. package/dist/server/database/schema.sql +95 -0
  69. package/dist/server/hono/app.d.ts +10 -0
  70. package/dist/server/hono/app.d.ts.map +1 -0
  71. package/dist/server/hono/app.js +26 -0
  72. package/dist/server/hono/app.js.map +1 -0
  73. package/dist/server/hono/routes.d.ts +12 -0
  74. package/dist/server/hono/routes.d.ts.map +1 -0
  75. package/dist/server/hono/routes.js +40 -0
  76. package/dist/server/hono/routes.js.map +1 -0
  77. package/dist/server/main.d.ts +2 -0
  78. package/dist/server/main.d.ts.map +1 -0
  79. package/dist/server/main.js +94 -0
  80. package/dist/server/main.js.map +1 -0
  81. package/dist/server/user-management/DirectoryService.d.ts +62 -0
  82. package/dist/server/user-management/DirectoryService.d.ts.map +1 -0
  83. package/dist/server/user-management/DirectoryService.js +201 -0
  84. package/dist/server/user-management/DirectoryService.js.map +1 -0
  85. package/dist/server/user-management/LinuxUserService.d.ts +71 -0
  86. package/dist/server/user-management/LinuxUserService.d.ts.map +1 -0
  87. package/dist/server/user-management/LinuxUserService.js +192 -0
  88. package/dist/server/user-management/LinuxUserService.js.map +1 -0
  89. package/dist/server/user-management/QuotaService.d.ts +59 -0
  90. package/dist/server/user-management/QuotaService.d.ts.map +1 -0
  91. package/dist/server/user-management/QuotaService.js +148 -0
  92. package/dist/server/user-management/QuotaService.js.map +1 -0
  93. package/dist/server/user-management/UserManagementService.d.ts +74 -0
  94. package/dist/server/user-management/UserManagementService.d.ts.map +1 -0
  95. package/dist/server/user-management/UserManagementService.js +122 -0
  96. package/dist/server/user-management/UserManagementService.js.map +1 -0
  97. package/dist/server/user-management/index.d.ts +26 -0
  98. package/dist/server/user-management/index.d.ts.map +1 -0
  99. package/dist/server/user-management/index.js +26 -0
  100. package/dist/server/user-management/index.js.map +1 -0
  101. package/dist/server/user-management/layers.d.ts +27 -0
  102. package/dist/server/user-management/layers.d.ts.map +1 -0
  103. package/dist/server/user-management/layers.js +37 -0
  104. package/dist/server/user-management/layers.js.map +1 -0
  105. package/dist/shared/types.d.ts +94 -0
  106. package/dist/shared/types.d.ts.map +1 -0
  107. package/dist/shared/types.js +32 -0
  108. package/dist/shared/types.js.map +1 -0
  109. package/package.json +25 -5
  110. package/src/lib/payloadcms-utils.js +5 -12
  111. package/src/server/auth/ARCHITECTURE.md +575 -0
  112. package/src/server/auth/IMPLEMENTATION_SUMMARY.md +287 -0
  113. package/src/server/auth/QUICK_START.md +283 -0
  114. package/src/server/auth/README.md +290 -0
  115. package/src/server/auth/controllers/AuthController.ts +129 -0
  116. package/src/server/auth/example-usage.ts +159 -0
  117. package/src/server/auth/index.ts +19 -0
  118. package/src/server/auth/layers.ts +57 -0
  119. package/src/server/auth/middleware/authMiddleware.ts +118 -0
  120. package/src/server/auth/routes/authRoutes.ts +319 -0
  121. package/src/server/auth/services/AuditLogService.ts +81 -0
  122. package/src/server/auth/services/AuthService.ts +408 -0
  123. package/src/server/auth/services/IMPLEMENTATION_SUMMARY.md +404 -0
  124. package/src/server/auth/services/PasswordService.ts +85 -0
  125. package/src/server/auth/services/README.md +361 -0
  126. package/src/server/auth/services/SessionRepository.ts +227 -0
  127. package/src/server/auth/services/TokenService.ts +174 -0
  128. package/src/server/auth/services/UserRepository.ts +318 -0
  129. package/src/server/auth/services/example.ts +346 -0
  130. package/src/server/auth/services/index.ts +6 -0
  131. package/src/server/database/db.ts +161 -0
  132. package/src/server/database/schema.sql +95 -0
  133. package/src/server/hono/app.ts +41 -0
  134. package/src/server/main.ts +115 -0
  135. package/src/server/user-management/DirectoryService.ts +348 -0
  136. package/src/server/user-management/LinuxUserService.ts +338 -0
  137. package/src/server/user-management/QuotaService.ts +256 -0
  138. package/src/server/user-management/README.md +333 -0
  139. package/src/server/user-management/UserManagementService.ts +335 -0
  140. package/src/server/user-management/index.ts +26 -0
  141. package/src/server/user-management/layers.ts +51 -0
  142. package/src/shared/types.ts +111 -0
  143. package/src/templates/claude/agents/payloadcms-publish.md +34 -14
  144. package/src/templates/codex/commands/myai-astro-publish.md +8 -2
  145. package/src/templates/codex/commands/myai-content-writer.md +8 -2
  146. package/src/templates/codex/commands/myai-coolify-deploy.md +8 -2
  147. package/src/templates/codex/commands/myai-dev-architect.md +8 -2
  148. package/src/templates/codex/commands/myai-dev-code.md +8 -2
  149. package/src/templates/codex/commands/myai-dev-docs.md +8 -2
  150. package/src/templates/codex/commands/myai-dev-review.md +8 -2
  151. package/src/templates/codex/commands/myai-dev-test.md +8 -2
  152. package/src/templates/codex/commands/myai-docusaurus-publish.md +8 -2
  153. package/src/templates/codex/commands/myai-mintlify-publish.md +8 -2
  154. package/src/templates/codex/commands/myai-payloadcms-publish.md +17 -3
  155. package/src/templates/codex/commands/myai-sparc-workflow.md +8 -2
  156. package/src/templates/codex/commands/myai-wordpress-admin.md +8 -2
  157. package/src/templates/codex/commands/myai-wordpress-publish.md +8 -2
@@ -0,0 +1,248 @@
1
+ # PayloadCMS Authentication Simplification
2
+
3
+ **Date**: 2025-11-06
4
+ **Status**: ✅ Complete
5
+
6
+ ## Summary
7
+
8
+ Simplified PayloadCMS authentication to use only email/password JWT authentication. Removed unnecessary API key fallback that was never needed.
9
+
10
+ ## Changes Made
11
+
12
+ ### 1. Environment Variables (`.env.example`)
13
+
14
+ **Before**:
15
+ ```bash
16
+ PAYLOADCMS_URL=https://your-payloadcms-site.com
17
+ PAYLOADCMS_EMAIL=your-email@example.com
18
+ PAYLOADCMS_PASSWORD=your-password
19
+ PAYLOADCMS_API_KEY=your-api-key-if-using-api-key-auth # ❌ Removed
20
+ ```
21
+
22
+ **After**:
23
+ ```bash
24
+ PAYLOADCMS_URL=https://your-payloadcms-site.com
25
+ PAYLOADCMS_EMAIL=your-email@example.com
26
+ PAYLOADCMS_PASSWORD=your-password
27
+ ```
28
+
29
+ ### 2. Code Changes (`src/lib/payloadcms-utils.js`)
30
+
31
+ **Removed**:
32
+ - API key fallback authentication
33
+ - `this.apiKey` property
34
+ - `PAYLOADCMS_API_KEY` loading from environment
35
+
36
+ **Simplified**:
37
+ - Constructor now only checks for `email` (removed `apiKey` check)
38
+ - `loadEnvConfig()` no longer loads `PAYLOADCMS_API_KEY`
39
+ - `authenticate()` method simplified to only use email/password JWT flow
40
+ - Better error messages specifying required env vars
41
+
42
+ ### 3. Documentation Updates
43
+
44
+ **Updated Files**:
45
+
46
+ 1. **`src/templates/claude/agents/payloadcms-publish.md`**
47
+ - Changed `PAYLOAD_*` to `PAYLOADCMS_*` for consistency
48
+ - Added clear authentication flow documentation
49
+ - Documented JWT token usage
50
+ - Added "No API Keys Required" section
51
+
52
+ 2. **`src/templates/codex/commands/myai-payloadcms-publish.md`**
53
+ - Updated Prerequisites section with .env configuration
54
+ - Added authentication flow explanation
55
+ - Removed reference to `/myai-configure` (not needed)
56
+
57
+ **Already Correct**:
58
+ - `PUBLISHING_GUIDE.md` - Already had correct 3 env vars
59
+ - `TECHNICAL_ARCHITECTURE.md` - Uses correct variables
60
+
61
+ ## Authentication Flow
62
+
63
+ ### How It Works
64
+
65
+ 1. **User Configuration**: User adds credentials to `.env` file
66
+ ```bash
67
+ PAYLOADCMS_URL=https://cms.example.com
68
+ PAYLOADCMS_EMAIL=user@example.com
69
+ PAYLOADCMS_PASSWORD=secure-password
70
+ ```
71
+
72
+ 2. **Agent Authentication**: When publishing content:
73
+ ```javascript
74
+ // POST to /api/users/login
75
+ {
76
+ "email": "user@example.com",
77
+ "password": "secure-password"
78
+ }
79
+
80
+ // Response contains JWT token
81
+ {
82
+ "token": "eyJhbGc...",
83
+ "user": { ... }
84
+ }
85
+ ```
86
+
87
+ 3. **API Requests**: All subsequent requests use JWT token
88
+ ```javascript
89
+ headers: {
90
+ 'Authorization': 'JWT eyJhbGc...',
91
+ 'Content-Type': 'application/json'
92
+ }
93
+ ```
94
+
95
+ 4. **Automatic Re-authentication**: If token expires, automatically re-authenticates
96
+
97
+ ## Benefits
98
+
99
+ 1. **Simpler Configuration**: Only 3 environment variables needed
100
+ 2. **Standard Authentication**: Uses PayloadCMS's built-in user authentication
101
+ 3. **No Extra Setup**: No API key generation or management required
102
+ 4. **Better Security**: User credentials can be easily rotated
103
+ 5. **Clearer Documentation**: Removed confusion about API keys
104
+
105
+ ## Migration for Existing Users
106
+
107
+ ### If You Were Using API Key (Unlikely)
108
+
109
+ API key authentication was never documented or recommended. If you somehow were using it:
110
+
111
+ 1. Remove `PAYLOADCMS_API_KEY` from your `.env` file
112
+ 2. Ensure `PAYLOADCMS_EMAIL` and `PAYLOADCMS_PASSWORD` are set
113
+ 3. Agent will now use standard email/password authentication
114
+
115
+ ### If You Were Using Email/Password (Most Users)
116
+
117
+ No changes needed! Continue using your existing configuration:
118
+ ```bash
119
+ PAYLOADCMS_URL=https://your-site.com
120
+ PAYLOADCMS_EMAIL=your-email@example.com
121
+ PAYLOADCMS_PASSWORD=your-password
122
+ ```
123
+
124
+ ## Testing
125
+
126
+ ### Manual Test
127
+
128
+ 1. Configure `.env` with PayloadCMS credentials
129
+ 2. Create a test markdown file:
130
+ ```markdown
131
+ ---
132
+ title: Test Article
133
+ ---
134
+
135
+ This is a test article.
136
+ ```
137
+ 3. Run publish command:
138
+ ```bash
139
+ /myai-payloadcms-publish "test-article.md" --status draft
140
+ ```
141
+ 4. Verify:
142
+ - ✅ Authentication succeeds
143
+ - ✅ JWT token obtained
144
+ - ✅ Content published to PayloadCMS
145
+ - ✅ Article visible in admin UI
146
+
147
+ ### Expected Behavior
148
+
149
+ **Authentication Success**:
150
+ ```
151
+ ✅ Authenticated with PayloadCMS
152
+ Method: JWT
153
+ User: user@example.com
154
+ Token: eyJhbGc... (first 10 chars)
155
+ ```
156
+
157
+ **Publishing Success**:
158
+ ```
159
+ ✅ Published to PayloadCMS!
160
+ Collection: posts
161
+ Document ID: 67890abcdef
162
+ Status: draft
163
+ Admin URL: https://cms.example.com/admin/collections/posts/67890abcdef
164
+ ```
165
+
166
+ **Authentication Failure** (helpful error):
167
+ ```
168
+ ❌ PayloadCMS authentication failed: Authentication failed (401): Invalid credentials
169
+
170
+ Please verify your .env configuration:
171
+ PAYLOADCMS_EMAIL and PAYLOADCMS_PASSWORD required for authentication
172
+ ```
173
+
174
+ ## Code Quality
175
+
176
+ ### Before
177
+ ```javascript
178
+ async authenticate() {
179
+ // If API key is provided, use that instead
180
+ if (this.apiKey) {
181
+ this.token = this.apiKey;
182
+ return { success: true, method: 'api-key' };
183
+ }
184
+
185
+ if (!this.email || !this.password) {
186
+ throw new Error('Email and password required for authentication');
187
+ }
188
+ // ... rest of JWT auth
189
+ }
190
+ ```
191
+
192
+ ### After
193
+ ```javascript
194
+ async authenticate() {
195
+ if (!this.email || !this.password) {
196
+ throw new Error('PAYLOADCMS_EMAIL and PAYLOADCMS_PASSWORD required for authentication');
197
+ }
198
+
199
+ // Direct JWT authentication - simpler, clearer
200
+ const response = await fetch(`${this.url}/api/users/login`, {
201
+ method: 'POST',
202
+ headers: { 'Content-Type': 'application/json' },
203
+ body: JSON.stringify({ email: this.email, password: this.password })
204
+ });
205
+ // ... handle response
206
+ }
207
+ ```
208
+
209
+ **Improvements**:
210
+ - Removed unnecessary branching
211
+ - Clearer error messages
212
+ - More maintainable code
213
+ - Follows single responsibility principle
214
+
215
+ ## Files Modified
216
+
217
+ 1. ✅ `.env.example` - Removed PAYLOADCMS_API_KEY
218
+ 2. ✅ `src/lib/payloadcms-utils.js` - Simplified authentication
219
+ 3. ✅ `src/templates/claude/agents/payloadcms-publish.md` - Updated documentation
220
+ 4. ✅ `src/templates/codex/commands/myai-payloadcms-publish.md` - Updated prerequisites
221
+
222
+ ## No Breaking Changes
223
+
224
+ This is a **non-breaking change** for 99% of users:
225
+ - Email/password authentication was always the recommended method
226
+ - API key authentication was never documented
227
+ - Existing configurations continue to work
228
+ - Only removes unused/undocumented functionality
229
+
230
+ ## Conclusion
231
+
232
+ PayloadCMS integration now has cleaner, simpler authentication using only email/password JWT flow. Documentation is consistent and clear about the required environment variables.
233
+
234
+ **Required Configuration** (Final):
235
+ ```bash
236
+ # .env
237
+ PAYLOADCMS_URL=https://your-payloadcms-site.com
238
+ PAYLOADCMS_EMAIL=your-email@example.com
239
+ PAYLOADCMS_PASSWORD=your-password
240
+ ```
241
+
242
+ That's it! No API keys, no extra setup, just standard user authentication. ✅
243
+
244
+ ---
245
+
246
+ **Implementation Date**: 2025-11-06
247
+ **Implemented By**: Claude Code
248
+ **Status**: ✅ Ready for package release
package/USER_GUIDE.md CHANGED
@@ -8,12 +8,16 @@ This guide covers everything you need to know about using, customizing, and exte
8
8
 
9
9
  - [Quick Start](#quick-start)
10
10
  - [Understanding the Structure](#understanding-the-structure)
11
+ - [👤 User Pathways](#-user-pathways)
12
+ - [Content Creator Pathway](#content-creator-pathway)
13
+ - [Developer Pathway](#developer-pathway)
11
14
  - [SPARC Development Workflow](#sparc-development-workflow)
12
15
  - [Git & CI/CD Workflows](#git--cicd-workflows)
13
16
  - [Multi-Platform Support](#multi-platform-support)
14
17
  - [Customizing Agents](#customizing-agents)
15
18
  - [Managing Commands](#managing-commands)
16
19
  - [WordPress Integration](#wordpress-integration)
20
+ - [PayloadCMS Integration](#payloadcms-integration)
17
21
  - [SSH Configuration](#ssh-configuration)
18
22
  - [Agent Management](#agent-management)
19
23
  - [Troubleshooting](#troubleshooting)
@@ -159,6 +163,262 @@ tools: Read, Write, Edit, WebSearch, WebFetch, Task
159
163
  # Agent prompt content goes here...
160
164
  ```
161
165
 
166
+ ## 👤 User Pathways
167
+
168
+ The MyAIDev Method serves two primary user personas, each with distinct workflows and goals:
169
+
170
+ ### Content Creator Pathway
171
+
172
+ **Who**: Writers, marketers, content strategists, and non-technical users creating and publishing content at scale.
173
+
174
+ **Goal**: Streamline content creation, optimization, and multi-platform publishing without needing development expertise.
175
+
176
+ #### Content Creation Pipeline
177
+
178
+ The MyAIDev Method provides a complete pipeline from idea to publication:
179
+
180
+ **1. Research & Planning**
181
+ ```bash
182
+ # Generate content ideas and outlines
183
+ /myai-content-writer "Create SEO-optimized blog post about React hooks best practices"
184
+ ```
185
+
186
+ The content writer agent:
187
+ - Researches topics using web search
188
+ - Generates SEO-optimized outlines
189
+ - Creates comprehensive, well-structured content
190
+ - Includes meta descriptions, keywords, and formatting
191
+
192
+ **2. Content Creation**
193
+
194
+ The agent produces:
195
+ - SEO-optimized articles with proper headings (H1, H2, H3)
196
+ - Meta descriptions and keyword optimization
197
+ - Markdown-formatted content ready for publishing
198
+ - Proper internal/external linking structure
199
+
200
+ **3. Multi-Platform Publishing**
201
+
202
+ Publish to various platforms with a single command:
203
+
204
+ ```bash
205
+ # WordPress publishing
206
+ /myai-wordpress-publish "react-hooks-guide.md" --status published
207
+
208
+ # PayloadCMS headless CMS
209
+ /myai-payloadcms-publish "react-hooks-guide.md" --status published --collection blog-posts
210
+
211
+ # Docusaurus documentation sites
212
+ /myai-docusaurus-publish "react-hooks-guide.md" --category tutorials
213
+
214
+ # Mintlify documentation
215
+ /myai-mintlify-publish "react-hooks-guide.md" --section guides
216
+
217
+ # Astro static sites
218
+ /myai-astro-publish "react-hooks-guide.md" --collection blog
219
+ ```
220
+
221
+ **4. Batch Operations**
222
+
223
+ Create and publish content at scale:
224
+ ```bash
225
+ # Create multiple articles on related topics
226
+ /myai-content-writer "5 articles about React performance optimization techniques"
227
+
228
+ # Publish entire content series
229
+ for file in content/*.md; do
230
+ /myai-wordpress-publish "$file" --status draft
231
+ done
232
+ ```
233
+
234
+ #### Publishing Configuration
235
+
236
+ Set up your publishing credentials once:
237
+
238
+ **WordPress**:
239
+ ```bash
240
+ # .env configuration
241
+ WORDPRESS_URL=https://yoursite.com
242
+ WORDPRESS_USERNAME=your-username
243
+ WORDPRESS_APP_PASSWORD=xxxx-xxxx-xxxx-xxxx
244
+ ```
245
+
246
+ **PayloadCMS**:
247
+ ```bash
248
+ # .env configuration
249
+ PAYLOADCMS_URL=https://cms.yoursite.com
250
+ PAYLOADCMS_EMAIL=your-email@example.com
251
+ PAYLOADCMS_PASSWORD=your-password
252
+ ```
253
+
254
+ #### Content Creator Workflow Example
255
+
256
+ Complete workflow from research to publication:
257
+
258
+ ```bash
259
+ # 1. Research and create content
260
+ /myai-content-writer "Ultimate guide to TypeScript generics with practical examples"
261
+
262
+ # 2. Review generated markdown file (typescript-generics-guide.md)
263
+
264
+ # 3. Publish to WordPress as draft for review
265
+ /myai-wordpress-publish "typescript-generics-guide.md" --status draft
266
+
267
+ # 4. Review on WordPress, make edits if needed
268
+
269
+ # 5. Publish to additional platforms
270
+ /myai-payloadcms-publish "typescript-generics-guide.md" --status published
271
+ /myai-docusaurus-publish "typescript-generics-guide.md" --category advanced-topics
272
+ ```
273
+
274
+ ---
275
+
276
+ ### Developer Pathway
277
+
278
+ **Who**: Software engineers, technical leads, and developers who value structured, specification-driven development.
279
+
280
+ **Goal**: Systematic software development using proven methodologies (SPARC, Spec-Driven Development, BMAD).
281
+
282
+ #### Why Developers Choose MyAIDev Method
283
+
284
+ - **SPARC Methodology**: Structured 5-phase development (Specification → Pseudocode → Architecture → Refinement → Completion)
285
+ - **Spec-Driven Development**: Requirements-first approach ensuring clear deliverables
286
+ - **BMAD Workflows**: Build, Measure, Analyze, Deploy cycles for iterative improvement
287
+ - **Git Integration**: Seamless version control with automated commits and PR creation
288
+ - **Quality Assurance**: Built-in testing, code review, and documentation agents
289
+
290
+ #### SPARC Development Workflow
291
+
292
+ The SPARC methodology provides systematic development with five phases:
293
+
294
+ **Full Workflow Execution**:
295
+ ```bash
296
+ # Execute complete 5-phase SPARC workflow
297
+ /myai-sparc-workflow "Build user authentication with JWT and OAuth"
298
+ ```
299
+
300
+ This runs:
301
+ 1. **Specification**: Requirements analysis, user stories, system boundaries
302
+ 2. **Pseudocode**: Algorithm design, logic planning, data flow
303
+ 3. **Architecture**: System structure, APIs, database schema, component design
304
+ 4. **Refinement**: Implementation with SOLID principles, error handling, testing
305
+ 5. **Completion**: Documentation, deployment prep, production readiness
306
+
307
+ **Individual Phase Control**:
308
+ ```bash
309
+ # Architecture phase
310
+ /myai-dev-architect "Design microservices architecture for e-commerce platform"
311
+
312
+ # Implementation phase
313
+ /myai-dev-code "Implement user authentication service"
314
+
315
+ # Testing phase
316
+ /myai-dev-test "Create comprehensive test suite with 80%+ coverage"
317
+
318
+ # Code review phase
319
+ /myai-dev-review "Review authentication implementation for security best practices"
320
+
321
+ # Documentation phase
322
+ /myai-dev-docs "Generate API documentation and integration guides"
323
+ ```
324
+
325
+ #### Spec-Driven Development
326
+
327
+ Start with requirements, not code:
328
+
329
+ ```bash
330
+ # 1. Create detailed specification
331
+ /myai-dev-architect "Design RESTful API for social media platform with posts, comments, likes"
332
+
333
+ # 2. Generate pseudocode and algorithms
334
+ /myai-sparc-workflow "Implement the social media API based on specification"
335
+
336
+ # 3. Implementation follows the spec
337
+ # Agents reference the specification throughout development
338
+ ```
339
+
340
+ #### BMAD Workflow Integration
341
+
342
+ **Build → Measure → Analyze → Deploy** cycles:
343
+
344
+ ```bash
345
+ # Build: Implement feature
346
+ /myai-dev-code "Add real-time notifications using WebSockets"
347
+
348
+ # Measure: Test and validate
349
+ /myai-dev-test "Create integration tests for WebSocket notifications"
350
+
351
+ # Analyze: Code review and quality checks
352
+ /myai-dev-review "Analyze WebSocket implementation for performance and security"
353
+
354
+ # Deploy: Prepare for production
355
+ /myai-coolify-deploy "Deploy notification service to production"
356
+ ```
357
+
358
+ #### Git & CI/CD Integration
359
+
360
+ MyAIDev Method integrates with your git workflow:
361
+
362
+ ```bash
363
+ # Commit changes with AI-generated messages
364
+ /myai-git-commit "Implement WebSocket notifications"
365
+
366
+ # Create pull request
367
+ /myai-git-pr "Add real-time notification feature"
368
+
369
+ # Deploy to production
370
+ /myai-coolify-deploy "notification-service"
371
+ ```
372
+
373
+ #### Developer Workflow Example
374
+
375
+ Complete feature development:
376
+
377
+ ```bash
378
+ # 1. Design phase - Architecture and specification
379
+ /myai-dev-architect "Design comment system with threading, reactions, and moderation"
380
+
381
+ # 2. Implementation phase
382
+ /myai-dev-code "Implement comment API endpoints with validation"
383
+
384
+ # 3. Testing phase
385
+ /myai-dev-test "Create unit and integration tests for comment system"
386
+
387
+ # 4. Review phase
388
+ /myai-dev-review "Review comment system code for security and performance"
389
+
390
+ # 5. Documentation phase
391
+ /myai-dev-docs "Generate API documentation for comment endpoints"
392
+
393
+ # 6. Git workflow
394
+ /myai-git-commit "Add threaded comment system with reactions"
395
+ /myai-git-pr "Feature: Threaded comments with moderation"
396
+
397
+ # 7. Deployment
398
+ /myai-coolify-deploy "comment-service"
399
+ ```
400
+
401
+ #### Advanced Developer Workflows
402
+
403
+ **Multi-Agent Collaboration**:
404
+ ```bash
405
+ # Architecture agent designs system
406
+ /myai-dev-architect "Design event-driven microservices architecture"
407
+
408
+ # Multiple agents work in parallel
409
+ /myai-dev-code "Implement user service"
410
+ /myai-dev-code "Implement order service"
411
+ /myai-dev-code "Implement notification service"
412
+
413
+ # Testing agent validates integration
414
+ /myai-dev-test "Create end-to-end tests for order flow"
415
+
416
+ # Documentation agent generates guides
417
+ /myai-dev-docs "Generate microservices integration documentation"
418
+ ```
419
+
420
+ ---
421
+
162
422
  ## 🏗️ SPARC Development Workflow
163
423
 
164
424
  The SPARC methodology provides a systematic approach to software development with 5 phases:
package/bin/cli.js CHANGED
@@ -471,4 +471,40 @@ For full documentation, see the USER_GUIDE.md in your project root.
471
471
  await fs.writeFile(path.join(codexDir, 'README.md'), opencodeReadme);
472
472
  }
473
473
 
474
+ program
475
+ .command('claudeweb')
476
+ .description('Start MyAIDev Method Web UI with Claude Code Viewer')
477
+ .option('-p, --port <port>', 'Port to run server on', '3400')
478
+ .option('--single-user', 'Run in single-user mode')
479
+ .option('--multi-user', 'Run in multi-user mode')
480
+ .option('--db-path <path>', 'SQLite database path')
481
+ .action(async (options) => {
482
+ console.log(getASCIIBanner());
483
+ console.log(chalk.blue('\n🌐 Starting MyAIDev Method Web UI...\n'));
484
+
485
+ process.env.PORT = options.port;
486
+ if (options.dbPath) {
487
+ process.env.SQLITE_DB_PATH = options.dbPath;
488
+ }
489
+ if (options.singleUser) {
490
+ process.env.SINGLE_USER_MODE = 'true';
491
+ console.log(chalk.cyan('📌 Running in single-user mode'));
492
+ }
493
+ if (options.multiUser) {
494
+ process.env.MULTI_USER_MODE = 'true';
495
+ console.log(chalk.cyan('📌 Running in multi-user mode'));
496
+ }
497
+
498
+ try {
499
+ const serverModule = await import('../dist/server/main.js');
500
+ console.log(chalk.green('\n✅ Server module loaded successfully'));
501
+ } catch (error) {
502
+ console.error(chalk.red('\n❌ Failed to start server:'));
503
+ console.error(error);
504
+ console.log(chalk.yellow('\n💡 Make sure you have built the server first:'));
505
+ console.log(chalk.gray(' npm run build:server'));
506
+ process.exit(1);
507
+ }
508
+ });
509
+
474
510
  program.parse(process.argv);