mycontext-cli 0.1.2 โ†’ 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/README.md +264 -71
  2. package/dist/agents/implementations/CodeGenSubAgent.d.ts +48 -0
  3. package/dist/agents/implementations/CodeGenSubAgent.d.ts.map +1 -0
  4. package/dist/agents/implementations/CodeGenSubAgent.js +1356 -0
  5. package/dist/agents/implementations/CodeGenSubAgent.js.map +1 -0
  6. package/dist/agents/implementations/DocsSubAgent.d.ts +35 -0
  7. package/dist/agents/implementations/DocsSubAgent.d.ts.map +1 -0
  8. package/dist/agents/implementations/DocsSubAgent.js +351 -0
  9. package/dist/agents/implementations/DocsSubAgent.js.map +1 -0
  10. package/dist/agents/implementations/EnhancementAgent.d.ts +119 -0
  11. package/dist/agents/implementations/EnhancementAgent.d.ts.map +1 -0
  12. package/dist/agents/implementations/EnhancementAgent.js +598 -0
  13. package/dist/agents/implementations/EnhancementAgent.js.map +1 -0
  14. package/dist/agents/implementations/QASubAgent.d.ts +31 -0
  15. package/dist/agents/implementations/QASubAgent.d.ts.map +1 -0
  16. package/dist/agents/implementations/QASubAgent.js +190 -0
  17. package/dist/agents/implementations/QASubAgent.js.map +1 -0
  18. package/dist/agents/interfaces/SubAgent.d.ts +287 -0
  19. package/dist/agents/interfaces/SubAgent.d.ts.map +1 -0
  20. package/dist/agents/interfaces/SubAgent.js +7 -0
  21. package/dist/agents/interfaces/SubAgent.js.map +1 -0
  22. package/dist/agents/orchestrator/SubAgentOrchestrator.d.ts +59 -0
  23. package/dist/agents/orchestrator/SubAgentOrchestrator.d.ts.map +1 -0
  24. package/dist/agents/orchestrator/SubAgentOrchestrator.js +305 -0
  25. package/dist/agents/orchestrator/SubAgentOrchestrator.js.map +1 -0
  26. package/dist/agents/personalities/definitions.d.ts +32 -0
  27. package/dist/agents/personalities/definitions.d.ts.map +1 -0
  28. package/dist/agents/personalities/definitions.js +359 -0
  29. package/dist/agents/personalities/definitions.js.map +1 -0
  30. package/dist/cli/src/agents/implementations/CodeGenSubAgent.d.ts +1 -0
  31. package/dist/cli/src/agents/implementations/CodeGenSubAgent.d.ts.map +1 -1
  32. package/dist/cli/src/agents/implementations/CodeGenSubAgent.js +25 -91
  33. package/dist/cli/src/agents/implementations/CodeGenSubAgent.js.map +1 -1
  34. package/dist/cli/src/agents/implementations/EnhancementAgent.d.ts +120 -0
  35. package/dist/cli/src/agents/implementations/EnhancementAgent.d.ts.map +1 -0
  36. package/dist/cli/src/agents/implementations/EnhancementAgent.js +606 -0
  37. package/dist/cli/src/agents/implementations/EnhancementAgent.js.map +1 -0
  38. package/dist/cli/src/agents/interfaces/SubAgent.d.ts +130 -0
  39. package/dist/cli/src/agents/interfaces/SubAgent.d.ts.map +1 -1
  40. package/dist/cli/src/agents/personalities/definitions.d.ts +1 -1
  41. package/dist/cli/src/agents/personalities/definitions.d.ts.map +1 -1
  42. package/dist/cli/src/agents/personalities/definitions.js +31 -2
  43. package/dist/cli/src/agents/personalities/definitions.js.map +1 -1
  44. package/dist/cli/src/cli.js +12 -0
  45. package/dist/cli/src/cli.js.map +1 -1
  46. package/dist/cli/src/commands/enhance.d.ts +28 -0
  47. package/dist/cli/src/commands/enhance.d.ts.map +1 -0
  48. package/dist/cli/src/commands/enhance.js +246 -0
  49. package/dist/cli/src/commands/enhance.js.map +1 -0
  50. package/dist/cli/src/commands/generate-components.d.ts +0 -1
  51. package/dist/cli/src/commands/generate-components.d.ts.map +1 -1
  52. package/dist/cli/src/commands/generate-components.js +2 -2
  53. package/dist/cli/src/commands/generate-components.js.map +1 -1
  54. package/dist/cli/src/commands/generate.d.ts.map +1 -1
  55. package/dist/cli/src/commands/generate.js +8 -22
  56. package/dist/cli/src/commands/generate.js.map +1 -1
  57. package/dist/cli/src/commands/list.d.ts.map +1 -1
  58. package/dist/cli/src/commands/list.js +2 -1
  59. package/dist/cli/src/commands/list.js.map +1 -1
  60. package/dist/cli/src/commands/model.d.ts +25 -0
  61. package/dist/cli/src/commands/model.d.ts.map +1 -0
  62. package/dist/cli/src/commands/model.js +317 -0
  63. package/dist/cli/src/commands/model.js.map +1 -0
  64. package/dist/cli/src/commands/setup.d.ts +35 -0
  65. package/dist/cli/src/commands/setup.d.ts.map +1 -0
  66. package/dist/cli/src/commands/setup.js +412 -0
  67. package/dist/cli/src/commands/setup.js.map +1 -0
  68. package/dist/cli/src/config/dependencies.json +180 -0
  69. package/dist/cli/src/utils/componentValidator.d.ts +60 -0
  70. package/dist/cli/src/utils/componentValidator.d.ts.map +1 -0
  71. package/dist/cli/src/utils/componentValidator.js +191 -0
  72. package/dist/cli/src/utils/componentValidator.js.map +1 -0
  73. package/dist/cli/src/utils/designTokenExtractor.d.ts +94 -0
  74. package/dist/cli/src/utils/designTokenExtractor.d.ts.map +1 -0
  75. package/dist/cli/src/utils/designTokenExtractor.js +231 -0
  76. package/dist/cli/src/utils/designTokenExtractor.js.map +1 -0
  77. package/dist/cli/src/utils/ollamaClient.d.ts +37 -0
  78. package/dist/cli/src/utils/ollamaClient.d.ts.map +1 -0
  79. package/dist/cli/src/utils/ollamaClient.js +213 -0
  80. package/dist/cli/src/utils/ollamaClient.js.map +1 -0
  81. package/dist/cli/src/utils/spinner.d.ts +2 -0
  82. package/dist/cli/src/utils/spinner.d.ts.map +1 -1
  83. package/dist/cli/src/utils/spinner.js +7 -0
  84. package/dist/cli/src/utils/spinner.js.map +1 -1
  85. package/dist/cli.d.ts +3 -0
  86. package/dist/cli.d.ts.map +1 -0
  87. package/dist/cli.js +299 -0
  88. package/dist/cli.js.map +1 -0
  89. package/dist/commands/auth.d.ts +23 -0
  90. package/dist/commands/auth.d.ts.map +1 -0
  91. package/dist/commands/auth.js +212 -0
  92. package/dist/commands/auth.js.map +1 -0
  93. package/dist/commands/enhance.d.ts +25 -0
  94. package/dist/commands/enhance.d.ts.map +1 -0
  95. package/dist/commands/enhance.js +242 -0
  96. package/dist/commands/enhance.js.map +1 -0
  97. package/dist/commands/generate-components.d.ts +27 -0
  98. package/dist/commands/generate-components.d.ts.map +1 -0
  99. package/dist/commands/generate-components.js +680 -0
  100. package/dist/commands/generate-components.js.map +1 -0
  101. package/dist/commands/generate.d.ts +23 -0
  102. package/dist/commands/generate.d.ts.map +1 -0
  103. package/dist/commands/generate.js +222 -0
  104. package/dist/commands/generate.js.map +1 -0
  105. package/dist/commands/init.d.ts +13 -0
  106. package/dist/commands/init.d.ts.map +1 -0
  107. package/dist/commands/init.js +91 -0
  108. package/dist/commands/init.js.map +1 -0
  109. package/dist/commands/list.d.ts +17 -0
  110. package/dist/commands/list.d.ts.map +1 -0
  111. package/dist/commands/list.js +210 -0
  112. package/dist/commands/list.js.map +1 -0
  113. package/dist/commands/model.d.ts +25 -0
  114. package/dist/commands/model.d.ts.map +1 -0
  115. package/dist/commands/model.js +317 -0
  116. package/dist/commands/model.js.map +1 -0
  117. package/dist/commands/preview.d.ts +23 -0
  118. package/dist/commands/preview.d.ts.map +1 -0
  119. package/dist/commands/preview.js +1200 -0
  120. package/dist/commands/preview.js.map +1 -0
  121. package/dist/commands/setup.d.ts +35 -0
  122. package/dist/commands/setup.d.ts.map +1 -0
  123. package/dist/commands/setup.js +412 -0
  124. package/dist/commands/setup.js.map +1 -0
  125. package/dist/commands/status.d.ts +21 -0
  126. package/dist/commands/status.d.ts.map +1 -0
  127. package/dist/commands/status.js +287 -0
  128. package/dist/commands/status.js.map +1 -0
  129. package/dist/commands/validate.d.ts +22 -0
  130. package/dist/commands/validate.d.ts.map +1 -0
  131. package/dist/commands/validate.js +259 -0
  132. package/dist/commands/validate.js.map +1 -0
  133. package/dist/types/index.d.ts +154 -0
  134. package/dist/types/index.d.ts.map +1 -0
  135. package/dist/types/index.js +3 -0
  136. package/dist/types/index.js.map +1 -0
  137. package/dist/utils/apiKeyManager.d.ts +137 -0
  138. package/dist/utils/apiKeyManager.d.ts.map +1 -0
  139. package/dist/utils/apiKeyManager.js +471 -0
  140. package/dist/utils/apiKeyManager.js.map +1 -0
  141. package/dist/utils/componentValidator.d.ts +60 -0
  142. package/dist/utils/componentValidator.d.ts.map +1 -0
  143. package/dist/utils/componentValidator.js +191 -0
  144. package/dist/utils/componentValidator.js.map +1 -0
  145. package/dist/utils/designTokenExtractor.d.ts +94 -0
  146. package/dist/utils/designTokenExtractor.d.ts.map +1 -0
  147. package/dist/utils/designTokenExtractor.js +231 -0
  148. package/dist/utils/designTokenExtractor.js.map +1 -0
  149. package/dist/utils/errorHandler.d.ts +105 -0
  150. package/dist/utils/errorHandler.d.ts.map +1 -0
  151. package/dist/utils/errorHandler.js +332 -0
  152. package/dist/utils/errorHandler.js.map +1 -0
  153. package/dist/utils/fileSystem.d.ts +58 -0
  154. package/dist/utils/fileSystem.d.ts.map +1 -0
  155. package/dist/utils/fileSystem.js +230 -0
  156. package/dist/utils/fileSystem.js.map +1 -0
  157. package/dist/utils/githubModels.d.ts +53 -0
  158. package/dist/utils/githubModels.d.ts.map +1 -0
  159. package/dist/utils/githubModels.js +239 -0
  160. package/dist/utils/githubModels.js.map +1 -0
  161. package/dist/utils/ollamaClient.d.ts +37 -0
  162. package/dist/utils/ollamaClient.d.ts.map +1 -0
  163. package/dist/utils/ollamaClient.js +213 -0
  164. package/dist/utils/ollamaClient.js.map +1 -0
  165. package/dist/utils/spinner.d.ts +30 -0
  166. package/dist/utils/spinner.d.ts.map +1 -0
  167. package/dist/utils/spinner.js +119 -0
  168. package/dist/utils/spinner.js.map +1 -0
  169. package/package.json +11 -9
package/README.md CHANGED
@@ -1,7 +1,21 @@
1
1
  # MyContext CLI
2
2
 
3
+ **The Micro-Tool That Does Heavy Lifting** ๐Ÿš€
4
+
3
5
  AI-powered component generation CLI for the MyContext platform. Transform your project ideas into production-ready UI components with a systematic, context-first approach.
4
6
 
7
+ > **Why MyContext CLI?** A lightweight, self-contained tool that generates unlimited React components locally with zero ongoing costs. Perfect for developers who want AI-powered development without subscription fees.
8
+
9
+ ## ๐Ÿ’ฐ Pricing Model
10
+
11
+ **Sustainable, Affordable Plans** - Because we're a micro-tool with zero ongoing costs:
12
+
13
+ - **$1/month** - Basic CLI access
14
+ - **$5/month** - Advanced features + priority support
15
+ - **$10/month** - Enterprise features + team collaboration
16
+
17
+ _No API costs, no usage limits, no hidden fees. You control your own AI infrastructure._
18
+
5
19
  ## ๐Ÿš€ Quick Start
6
20
 
7
21
  ### Installation
@@ -17,12 +31,19 @@ pnpm add -g mycontext-cli
17
31
  yarn global add mycontext-cli
18
32
  ```
19
33
 
20
- ### Basic Usage
34
+ ### First-Time Setup
21
35
 
22
36
  ```bash
23
- # Set up API keys for AI providers (production-ready security)
37
+ # Set up local AI environment (recommended - ZERO ongoing costs)
38
+ mycontext setup
39
+
40
+ # Or set up API keys for cloud-based generation (optional)
24
41
  mycontext auth setup
42
+ ```
43
+
44
+ ### Basic Usage
25
45
 
46
+ ```bash
26
47
  # Initialize a new project
27
48
  mycontext init my-app --description "My awesome application"
28
49
 
@@ -38,12 +59,77 @@ mycontext generate types
38
59
  # Generate component list (AI-driven)
39
60
  mycontext generate components-list
40
61
 
62
+ # Generate React components (using your local AI - FREE)
63
+ mycontext generate-components all
64
+
65
+ # Enhance existing components
66
+ mycontext enhance TodoApp.tsx --prompt "Make it more accessible"
67
+
41
68
  # Check project status
42
69
  mycontext status
43
70
  ```
44
71
 
72
+ ## ๐ŸŽฏ Why This Architecture Works
73
+
74
+ ### **Micro-Tool, Massive Value**
75
+
76
+ - **Tiny CLI** (~10MB) - Easy to install and update
77
+ - **Local AI Generation** - Zero API costs, unlimited usage
78
+ - **User-Controlled Setup** - Each developer manages their own Ollama
79
+ - **Sustainable Pricing** - No ongoing infrastructure costs to pass on
80
+
81
+ ### **Smart Dependency Management**
82
+
83
+ - **Ollama Runtime** - Users install locally (platform-native)
84
+ - **Specialized Models** - We provide the MyContext-optimized AI model
85
+ - **Health Checks** - CLI validates everything works
86
+ - **Fallback Options** - Cloud APIs available if needed
87
+
45
88
  ## ๐Ÿ“‹ Commands
46
89
 
90
+ ### `mycontext setup`
91
+
92
+ Set up your local AI environment with Ollama and specialized models.
93
+
94
+ ```bash
95
+ # Interactive setup
96
+ mycontext setup
97
+
98
+ # Force local setup
99
+ mycontext setup --local
100
+
101
+ # Skip prompts
102
+ mycontext setup --skip-prompts
103
+ ```
104
+
105
+ **Features:**
106
+
107
+ - **Automatic Ollama Installation** - Installs Ollama runtime for your platform
108
+ - **Specialized Model Creation** - Creates MyContext-optimized AI model
109
+ - **Health Checks** - Validates installation and model functionality
110
+ - **Fallback Options** - Always provides cloud-based alternatives
111
+
112
+ ### `mycontext model`
113
+
114
+ Manage your local AI models and monitor performance.
115
+
116
+ ```bash
117
+ # Check model status
118
+ mycontext model status
119
+
120
+ # Test model generation
121
+ mycontext model test
122
+
123
+ # Update model
124
+ mycontext model update
125
+
126
+ # Reset model
127
+ mycontext model reset
128
+
129
+ # View statistics
130
+ mycontext model stats
131
+ ```
132
+
47
133
  ### `mycontext init <project-name>`
48
134
 
49
135
  Initialize a new MyContext project with proper directory structure.
@@ -78,6 +164,9 @@ mycontext generate components-list
78
164
 
79
165
  # Generate individual components
80
166
  mycontext generate components
167
+
168
+ # Generate app structure
169
+ mycontext generate app-structure
81
170
  ```
82
171
 
83
172
  **Types:**
@@ -89,13 +178,66 @@ mycontext generate components
89
178
  - `components` - Individual component generation
90
179
  - `app-structure` - Application structure and routing
91
180
 
181
+ ### Command Options
182
+
183
+ - `--yes` - Skip all prompts and use defaults
184
+ - `--verbose` - Show detailed output
185
+ - `--debug` - Enable debug logging
186
+ - `--temperature` - Set AI generation temperature (0.1-1.0)
187
+ - `--group` - Specify component group for generation
188
+ - `--prompt` - Custom enhancement prompt
189
+ - `--output` - Output directory for generated files
190
+
191
+ ### `mycontext generate-components <target>`
192
+
193
+ Generate React components using AI.
194
+
195
+ ```bash
196
+ # Generate all components
197
+ mycontext generate-components all
198
+
199
+ # Generate specific component group
200
+ mycontext generate-components group --group "authentication"
201
+
202
+ # Generate single component
203
+ mycontext generate-components component --name "UserProfile" --description "User profile display component"
204
+
205
+ # Generate with custom temperature
206
+ mycontext generate-components all --temperature 0.7
207
+ ```
208
+
92
209
  **Options:**
93
210
 
94
- - `--use-claude-code-sdk` - Use Claude Code SDK for generation
95
- - `--use-gemini` - Use Gemini for generation
211
+ - `--group <name>` - Generate specific component group
212
+ - `--all` - Generate all components
213
+ - `--output <path>` - Output directory
214
+ - `--template <name>` - Use specific template
96
215
  - `--use-xai` - Use XAI (Grok) for generation
97
- - `--temperature <number>` - Generation temperature (0-1)
98
- - `--max-tokens <number>` - Maximum tokens for generation
216
+ - `--yes` - Skip prompts
217
+
218
+ ### `mycontext enhance <target>`
219
+
220
+ Enhance existing React components with AI-powered improvements.
221
+
222
+ ```bash
223
+ # Enhance specific component
224
+ mycontext enhance Button.tsx --prompt "Add loading states"
225
+
226
+ # Enhance all components
227
+ mycontext enhance components --prompt "Improve accessibility"
228
+
229
+ # Enhance with custom temperature
230
+ mycontext enhance components --prompt "Add error handling" --temperature 0.8
231
+ ```
232
+
233
+ **Options:**
234
+
235
+ - `--prompt <text>` - Enhancement instructions
236
+ - `--use-xai` - Use XAI (Grok) for enhancement
237
+ - `--temperature <number>` - Generation temperature
238
+ - `--max-tokens <number>` - Maximum tokens
239
+ - `--credits <number>` - Credit limit
240
+ - `--yes` - Skip prompts
99
241
 
100
242
  ### `mycontext validate <target>`
101
243
 
@@ -159,56 +301,77 @@ mycontext auth --yes # Non-interactive mode
159
301
 
160
302
  ## ๐Ÿ” Authentication & Security
161
303
 
162
- ### Enterprise-Grade API Key Management
304
+ ### Local AI Model Management
163
305
 
164
- MyContext CLI includes production-ready security features for managing AI provider API keys:
306
+ MyContext CLI includes production-ready security features for managing your local AI environment:
165
307
 
166
308
  ```bash
167
- # Interactive setup for all providers
168
- mycontext auth setup
309
+ # Set up local AI environment
310
+ mycontext setup
311
+
312
+ # Check model status
313
+ mycontext model status
314
+
315
+ # Test model generation
316
+ mycontext model test
317
+
318
+ # Update specialized model
319
+ mycontext model update
320
+
321
+ # View model statistics
322
+ mycontext model stats
323
+ ```
169
324
 
170
- # Set up specific providers
171
- mycontext auth setup --provider xai
172
- mycontext auth setup --provider openai
173
- mycontext auth setup --provider anthropic
174
- mycontext auth setup --provider google
325
+ **Security Features:**
326
+
327
+ - **Local AI Only** - Your code never leaves your machine
328
+ - **Specialized Models** - MyContext-optimized AI models for React/Shadcn
329
+ - **No API Keys Required** - Zero external dependencies
330
+ - **Complete Privacy** - All processing happens locally
331
+ - **Model Validation** - CLI validates model functionality and health
332
+
333
+ ### Specialized MyContext Models
175
334
 
176
- # List configured API keys
177
- mycontext auth list
335
+ - **mycontext-react** - Specialized for React component generation
336
+ - **mycontext-architect** - Specialized for project architecture and context
337
+ - **Custom Models** - Create your own specialized models for specific use cases
178
338
 
179
- # Export keys for backup (password-protected)
180
- mycontext auth export --password "secure-password"
339
+ ## ๐Ÿค– Local AI Models
181
340
 
182
- # Import keys from backup
183
- mycontext auth import --file backup.json --password "secure-password"
341
+ ### Ollama Integration
184
342
 
185
- # Remove all API keys
186
- mycontext auth clear
343
+ MyContext CLI includes seamless integration with Ollama for local AI generation:
187
344
 
188
- # Check authentication status
189
- mycontext auth:status
345
+ ```bash
346
+ # Check if Ollama is available
347
+ mycontext model status
348
+
349
+ # Test local model generation
350
+ mycontext model test
190
351
 
191
- # Remove authentication
192
- mycontext auth:logout
352
+ # Monitor model performance
353
+ mycontext model stats
193
354
  ```
194
355
 
195
- **Security Features:**
356
+ **Benefits:**
196
357
 
197
- - **AES-256-CBC Encryption** with PBKDF2 key derivation
198
- - **Local Storage** in `~/.mycontext/api-keys.json`
199
- - **Environment Variable Integration** - Automatically detects `XAI_API_KEY`, `OPENAI_API_KEY`, etc.
200
- - **Password-Protected Backup/Restore**
201
- - **Key Validation** - Tests API keys with provider endpoints
202
- - **Rate Limiting Information** - Tracks usage and limits per provider
358
+ - **Zero API Costs** - Generate unlimited components locally
359
+ - **Instant Generation** - No network latency
360
+ - **Complete Privacy** - Your code never leaves your machine
361
+ - **Specialized Models** - Models trained specifically for MyContext patterns
203
362
 
204
- ### Supported AI Providers
363
+ ### Model Management
205
364
 
206
- | Provider | Key Format | Environment Variable |
207
- | -------------- | ---------- | -------------------- |
208
- | **XAI (Grok)** | `xai-*` | `XAI_API_KEY` |
209
- | **OpenAI** | `sk-*` | `OPENAI_API_KEY` |
210
- | **Anthropic** | `sk-ant-*` | `ANTHROPIC_API_KEY` |
211
- | **Google AI** | Various | `GOOGLE_AI_API_KEY` |
365
+ ```bash
366
+ # Update base model
367
+ mycontext model update
368
+
369
+ # Reset to clean state
370
+ mycontext model reset
371
+
372
+ # View detailed statistics
373
+ mycontext model stats --detailed
374
+ ```
212
375
 
213
376
  ## ๐Ÿ—๏ธ Project Structure
214
377
 
@@ -218,15 +381,20 @@ When you initialize a project, MyContext creates this structure:
218
381
  my-app/
219
382
  โ”œโ”€โ”€ .mycontext/
220
383
  โ”‚ โ””โ”€โ”€ config.json # Project configuration
221
- โ””โ”€โ”€ context/
222
- โ”œโ”€โ”€ prd.md # Product Requirements Document
223
- โ”œโ”€โ”€ 01_PRD.md # Generated PRD (v2)
224
- โ”œโ”€โ”€ 02_user_stories.md # User stories and workflows
225
- โ”œโ”€โ”€ 03_technical_specs.md # Technical specifications
226
- โ”œโ”€โ”€ types.ts # TypeScript type definitions
227
- โ”œโ”€โ”€ branding.md # Branding guidelines (generated)
228
- โ”œโ”€โ”€ component-list.json # Component planning (generated)
229
- โ””โ”€โ”€ component-list.md # Component planning (markdown)
384
+ โ”œโ”€โ”€ context/
385
+ โ”‚ โ”œโ”€โ”€ prd.md # Product Requirements Document
386
+ โ”‚ โ”œโ”€โ”€ 01_PRD.md # Generated PRD (v2)
387
+ โ”‚ โ”œโ”€โ”€ 02_user_stories.md # User stories and workflows
388
+ โ”‚ โ”œโ”€โ”€ 03_technical_specs.md # Technical specifications
389
+ โ”‚ โ”œโ”€โ”€ types.ts # TypeScript type definitions
390
+ โ”‚ โ”œโ”€โ”€ branding.md # Branding guidelines (generated)
391
+ โ”‚ โ”œโ”€โ”€ component-list.json # Component planning (generated)
392
+ โ”‚ โ””โ”€โ”€ component-list.md # Component planning (markdown)
393
+ โ””โ”€โ”€ components/
394
+ โ””โ”€โ”€ generated/ # Generated React components
395
+ โ”œโ”€โ”€ core-todo/ # Main app components
396
+ โ”œโ”€โ”€ forms-input/ # Form components
397
+ โ””โ”€โ”€ layout-ui/ # Layout components
230
398
  ```
231
399
 
232
400
  ## ๐Ÿ”„ Development Workflow
@@ -253,7 +421,7 @@ mycontext generate components-list
253
421
  ### Phase 3: Component Generation
254
422
 
255
423
  ```bash
256
- mycontext generate components
424
+ mycontext generate-components all
257
425
  mycontext preview components
258
426
  ```
259
427
 
@@ -262,6 +430,7 @@ mycontext preview components
262
430
  ```bash
263
431
  mycontext list components
264
432
  mycontext status
433
+ mycontext enhance components
265
434
  ```
266
435
 
267
436
  ## ๐ŸŽฏ Features
@@ -269,11 +438,26 @@ mycontext status
269
438
  ### Enterprise-Grade Security & Authentication
270
439
 
271
440
  - **Production-Ready API Key Management** - AES-256-CBC encryption with PBKDF2
272
- - **Multi-Provider Support** - XAI, OpenAI, Anthropic, Google AI
273
441
  - **Secure Local Storage** - Encrypted storage in `~/.mycontext/api-keys.json`
274
442
  - **Password-Protected Backup/Restore** - Secure key export/import
275
443
  - **Environment Variable Integration** - Seamless CI/CD integration
276
444
 
445
+ ### Local AI Generation
446
+
447
+ - **Ollama Integration** - Seamless local AI model management
448
+ - **Specialized Models** - MyContext-optimized AI models
449
+ - **Zero API Costs** - Generate unlimited components locally
450
+ - **Complete Privacy** - Your code never leaves your machine
451
+ - **Performance Monitoring** - Track model performance and usage
452
+
453
+ ### Business Model Benefits
454
+
455
+ - **Sustainable Pricing** - $1/$5/$10 plans because we have zero ongoing costs
456
+ - **Unlimited Usage** - No API rate limits or usage quotas
457
+ - **User Control** - Each developer manages their own AI infrastructure
458
+ - **Scalable Growth** - More users = more revenue, not more costs
459
+ - **Enterprise Ready** - Teams can run their own Ollama instances
460
+
277
461
  ### Context-First Development
278
462
 
279
463
  - Start with deep understanding before generating code
@@ -283,11 +467,13 @@ mycontext status
283
467
  ### AI-Powered Generation
284
468
 
285
469
  - **Production-Ready CLI** - Fully functional command-line interface
286
- - **Multi-Provider AI Support** - Choose between XAI, OpenAI, Anthropic, or Google
470
+ - **Specialized Local AI Models** - MyContext-optimized models for specific tasks
471
+ - **Local AI Generation** - Ollama integration for cost-free generation
287
472
  - **Dynamic app analysis** - Automatically detects app type and generates appropriate components
288
473
  - **Brand-compliant component generation** - Components follow your design system
289
474
  - **Type-safe TypeScript interfaces** - Full type safety throughout
290
475
  - **Robust Error Handling** - Comprehensive error management and recovery
476
+ - **Component Enhancement** - AI-powered refinement of existing components
291
477
 
292
478
  ### Dynamic Component Generation
293
479
 
@@ -323,12 +509,14 @@ mycontext generate components-list
323
509
  - **Enhanced Error Handling** - Structured error types with recovery suggestions
324
510
  - **Interactive CLI Experience** - Modern prompts with progress feedback
325
511
  - **Non-Interactive Mode** - Full automation support for CI/CD
512
+ - **Local AI Models** - Ollama integration for cost-free generation
326
513
 
327
514
  ### Project Management
328
515
 
329
516
  - Status tracking through development phases
330
517
  - File validation and health checks
331
518
  - Resource discovery and listing
519
+ - Component enhancement and iteration
332
520
 
333
521
  ## ๐Ÿ”ง Configuration
334
522
 
@@ -341,22 +529,20 @@ mycontext generate components-list
341
529
  ### Environment Variables
342
530
 
343
531
  ```bash
344
- # AI Provider API Keys (automatically detected)
345
- export XAI_API_KEY="your-xai-key"
346
- export OPENAI_API_KEY="your-openai-key"
347
- export ANTHROPIC_API_KEY="your-anthropic-key"
348
- export GOOGLE_AI_API_KEY="your-google-key"
532
+ # Ollama configuration
533
+ export OLLAMA_BASE_URL="http://localhost:11434"
349
534
 
350
- # Optional: Custom API endpoint
535
+ # Optional: Custom MyContext API endpoint (for enterprise features)
351
536
  export MYCONTEXT_API_ENDPOINT="https://custom-endpoint.com"
352
537
  ```
353
538
 
354
539
  ## ๐Ÿงช Testing
355
540
 
356
541
  ```bash
357
- # Test API key setup
358
- mycontext auth setup --provider xai --key "test-key"
359
- mycontext auth list
542
+ # Test local setup
543
+ mycontext setup --yes
544
+ mycontext model status
545
+ mycontext model test
360
546
 
361
547
  # Test project initialization
362
548
  mycontext init test-app --description "Test application" --yes
@@ -371,13 +557,15 @@ mycontext validate prd --yes
371
557
  # Test component list generation
372
558
  mycontext generate components-list --yes
373
559
 
560
+ # Test component generation (requires Ollama)
561
+ mycontext generate-components all --yes
562
+
563
+ # Test component enhancement
564
+ mycontext enhance components --prompt "Add loading states" --yes
565
+
374
566
  # Test status checking
375
567
  mycontext status --detailed --yes
376
568
 
377
- # Test authentication commands
378
- mycontext auth:status
379
- mycontext auth clear
380
-
381
569
  # Clean up
382
570
  cd ..
383
571
  rm -rf test-app
@@ -386,8 +574,8 @@ rm -rf test-app
386
574
  ### Production Testing
387
575
 
388
576
  ```bash
389
- # Test with real API keys
390
- mycontext auth setup
577
+ # Test with Ollama installed
578
+ mycontext setup
391
579
  mycontext init production-test --description "Production testing app"
392
580
  cd production-test
393
581
 
@@ -396,10 +584,11 @@ mycontext generate context
396
584
  mycontext validate prd
397
585
  mycontext generate types
398
586
  mycontext generate components-list
587
+ mycontext generate-components all
399
588
  mycontext status --detailed
400
589
 
401
- # Test component generation with AI
402
- mycontext generate components --use-xai
590
+ # Test component enhancement
591
+ mycontext enhance components --prompt "Improve accessibility"
403
592
  ```
404
593
 
405
594
  ## ๐Ÿค Contributing
@@ -416,4 +605,8 @@ MIT License - see [LICENSE](LICENSE) for details.
416
605
 
417
606
  ---
418
607
 
419
- **MyContext CLI**: Where AI-generated code becomes a valuable, reusable asset rather than technical debt.
608
+ **MyContext CLI**: The micro-tool that does heavy lifting. Where AI-generated code becomes a valuable, reusable asset rather than technical debt.
609
+
610
+ **Sustainable Pricing Model**: $1/$5/$10 plans because we have zero ongoing costs. You control your own AI infrastructure.
611
+
612
+ **Local AI Generation**: Generate unlimited components with zero API costs and complete privacy.
@@ -0,0 +1,48 @@
1
+ /**
2
+ * CodeGenSubAgent Implementation
3
+ *
4
+ * Specialized sub-agent for generating production-ready React components and TypeScript code.
5
+ * Uses Claude Code for optimal code generation capabilities.
6
+ * Enhanced with shadcn/ui primitives and modern React patterns for Next.js 14+.
7
+ */
8
+ import { SubAgent, ComponentGenerationInput, ComponentGenerationOutput } from "../interfaces/SubAgent";
9
+ export declare class CodeGenSubAgent implements SubAgent<ComponentGenerationInput, ComponentGenerationOutput> {
10
+ name: string;
11
+ description: string;
12
+ personality: string;
13
+ traits: string[];
14
+ llmProvider: string;
15
+ expertise: string[];
16
+ modelName: string;
17
+ temperature: number;
18
+ maxTokens: number;
19
+ systemPrompt: string;
20
+ constructor();
21
+ run(input: ComponentGenerationInput): Promise<ComponentGenerationOutput>;
22
+ validate(input: ComponentGenerationInput): Promise<boolean>;
23
+ getStatus(): Promise<{
24
+ name: string;
25
+ status: "idle" | "running" | "completed" | "error";
26
+ lastRun?: Date;
27
+ executionTime?: number;
28
+ errorCount: number;
29
+ successCount: number;
30
+ }>;
31
+ private generateProductionReadyComponent;
32
+ private getReactImportsForType;
33
+ private getShadcnImportsForType;
34
+ private getCustomImportsForType;
35
+ private generateTypeDefinitions;
36
+ private generateDetailedPropsForType;
37
+ private generateExampleProps;
38
+ private generateEnhancedPropsDestructuring;
39
+ private generateProductionComponentLogic;
40
+ private generateAccessibleComponentJSX;
41
+ private generateProductionActionFunctions;
42
+ private extractDependencies;
43
+ private extractShadcnComponents;
44
+ private calculateQualityScore;
45
+ private generateComponentName;
46
+ private generateWithOllama;
47
+ }
48
+ //# sourceMappingURL=CodeGenSubAgent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeGenSubAgent.d.ts","sourceRoot":"","sources":["../../../src/agents/implementations/CodeGenSubAgent.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,QAAQ,EACR,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAuChC,qBAAa,eACX,YAAW,QAAQ,CAAC,wBAAwB,EAAE,yBAAyB,CAAC;IAExE,IAAI,SAAqB;IACzB,WAAW,SACkG;IAC7G,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;;IAkBf,GAAG,CACP,KAAK,EAAE,wBAAwB,GAC9B,OAAO,CAAC,yBAAyB,CAAC;IAuC/B,QAAQ,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,OAAO,CAAC;IAwB3D,SAAS,IAAI,OAAO,CAAC;QACzB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;QACnD,OAAO,CAAC,EAAE,IAAI,CAAC;QACf,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;YASY,gCAAgC;IAS9C,OAAO,CAAC,sBAAsB;IA0B9B,OAAO,CAAC,uBAAuB;IAoI/B,OAAO,CAAC,uBAAuB;IAqB/B,OAAO,CAAC,uBAAuB;IA2E/B,OAAO,CAAC,4BAA4B;IAmIpC,OAAO,CAAC,oBAAoB;IAqB5B,OAAO,CAAC,kCAAkC;IA4E1C,OAAO,CAAC,gCAAgC;IAwIxC,OAAO,CAAC,8BAA8B;IAyetC,OAAO,CAAC,iCAAiC;IA0HzC,OAAO,CAAC,mBAAmB;IA4B3B,OAAO,CAAC,uBAAuB;IAe/B,OAAO,CAAC,qBAAqB;IAoC7B,OAAO,CAAC,qBAAqB;YASf,kBAAkB;CA0CjC"}