mycontext-cli 2.0.26 → 2.0.28

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 (129) hide show
  1. package/README.md +36 -355
  2. package/dist/agents/implementations/CodeGenSubAgent.d.ts.map +1 -1
  3. package/dist/agents/implementations/CodeGenSubAgent.js +67 -14
  4. package/dist/agents/implementations/CodeGenSubAgent.js.map +1 -1
  5. package/dist/agents/implementations/DesignPipelineAgent.d.ts +80 -0
  6. package/dist/agents/implementations/DesignPipelineAgent.d.ts.map +1 -0
  7. package/dist/agents/implementations/DesignPipelineAgent.js +1406 -0
  8. package/dist/agents/implementations/DesignPipelineAgent.js.map +1 -0
  9. package/dist/agents/implementations/FeatureAssemblyAgent.d.ts +67 -0
  10. package/dist/agents/implementations/FeatureAssemblyAgent.d.ts.map +1 -0
  11. package/dist/agents/implementations/FeatureAssemblyAgent.js +564 -0
  12. package/dist/agents/implementations/FeatureAssemblyAgent.js.map +1 -0
  13. package/dist/agents/implementations/PromptConstructorAgent.d.ts +10 -0
  14. package/dist/agents/implementations/PromptConstructorAgent.d.ts.map +1 -1
  15. package/dist/agents/implementations/PromptConstructorAgent.js +172 -12
  16. package/dist/agents/implementations/PromptConstructorAgent.js.map +1 -1
  17. package/dist/agents/implementations/RoleBasedGenerator.d.ts +52 -0
  18. package/dist/agents/implementations/RoleBasedGenerator.d.ts.map +1 -0
  19. package/dist/agents/implementations/RoleBasedGenerator.js +370 -0
  20. package/dist/agents/implementations/RoleBasedGenerator.js.map +1 -0
  21. package/dist/cli.js +65 -0
  22. package/dist/cli.js.map +1 -1
  23. package/dist/clients/ClaudeSDKClient.d.ts +48 -0
  24. package/dist/clients/ClaudeSDKClient.d.ts.map +1 -0
  25. package/dist/clients/ClaudeSDKClient.js +158 -0
  26. package/dist/clients/ClaudeSDKClient.js.map +1 -0
  27. package/dist/clients/MyContextAIClient.d.ts +73 -0
  28. package/dist/clients/MyContextAIClient.d.ts.map +1 -0
  29. package/dist/clients/MyContextAIClient.js +280 -0
  30. package/dist/clients/MyContextAIClient.js.map +1 -0
  31. package/dist/clients/ProviderChain.d.ts +87 -0
  32. package/dist/clients/ProviderChain.d.ts.map +1 -0
  33. package/dist/clients/ProviderChain.js +246 -0
  34. package/dist/clients/ProviderChain.js.map +1 -0
  35. package/dist/clients/XAIClient.d.ts +48 -0
  36. package/dist/clients/XAIClient.d.ts.map +1 -0
  37. package/dist/clients/XAIClient.js +152 -0
  38. package/dist/clients/XAIClient.js.map +1 -0
  39. package/dist/commands/assemble-features.d.ts +40 -0
  40. package/dist/commands/assemble-features.d.ts.map +1 -0
  41. package/dist/commands/assemble-features.js +383 -0
  42. package/dist/commands/assemble-features.js.map +1 -0
  43. package/dist/commands/clone-starter.d.ts +32 -0
  44. package/dist/commands/clone-starter.d.ts.map +1 -0
  45. package/dist/commands/clone-starter.js +218 -0
  46. package/dist/commands/clone-starter.js.map +1 -0
  47. package/dist/commands/design-analyze.d.ts +46 -0
  48. package/dist/commands/design-analyze.d.ts.map +1 -0
  49. package/dist/commands/design-analyze.js +232 -0
  50. package/dist/commands/design-analyze.js.map +1 -0
  51. package/dist/commands/generate-components.d.ts +1 -0
  52. package/dist/commands/generate-components.d.ts.map +1 -1
  53. package/dist/commands/generate-components.js +42 -9
  54. package/dist/commands/generate-components.js.map +1 -1
  55. package/dist/commands/generate.d.ts.map +1 -1
  56. package/dist/commands/generate.js +34 -1
  57. package/dist/commands/generate.js.map +1 -1
  58. package/dist/commands/setup-complete.d.ts.map +1 -1
  59. package/dist/commands/setup-complete.js +38 -2
  60. package/dist/commands/setup-complete.js.map +1 -1
  61. package/dist/commands/workflow.d.ts.map +1 -1
  62. package/dist/commands/workflow.js +86 -7
  63. package/dist/commands/workflow.js.map +1 -1
  64. package/dist/config/intent-dictionary.json +3700 -0
  65. package/dist/package.json +3 -1
  66. package/dist/services/IntentEnricher.d.ts +61 -0
  67. package/dist/services/IntentEnricher.d.ts.map +1 -0
  68. package/dist/services/IntentEnricher.js +318 -0
  69. package/dist/services/IntentEnricher.js.map +1 -0
  70. package/dist/services/IntentValidator.d.ts +114 -0
  71. package/dist/services/IntentValidator.d.ts.map +1 -0
  72. package/dist/services/IntentValidator.js +680 -0
  73. package/dist/services/IntentValidator.js.map +1 -0
  74. package/dist/types/design-pipeline.d.ts +300 -0
  75. package/dist/types/design-pipeline.d.ts.map +1 -0
  76. package/dist/types/design-pipeline.js +9 -0
  77. package/dist/types/design-pipeline.js.map +1 -0
  78. package/dist/types/feature-bundle.d.ts +239 -0
  79. package/dist/types/feature-bundle.d.ts.map +1 -0
  80. package/dist/types/feature-bundle.js +9 -0
  81. package/dist/types/feature-bundle.js.map +1 -0
  82. package/dist/types/index.d.ts +2 -0
  83. package/dist/types/index.d.ts.map +1 -1
  84. package/dist/types/index.js +2 -0
  85. package/dist/types/index.js.map +1 -1
  86. package/dist/types/intent-dictionary.d.ts +525 -0
  87. package/dist/types/intent-dictionary.d.ts.map +1 -0
  88. package/dist/types/intent-dictionary.js +11 -0
  89. package/dist/types/intent-dictionary.js.map +1 -0
  90. package/dist/types/role-permissions.d.ts +167 -0
  91. package/dist/types/role-permissions.d.ts.map +1 -0
  92. package/dist/types/role-permissions.js +9 -0
  93. package/dist/types/role-permissions.js.map +1 -0
  94. package/dist/utils/contextEnricher.d.ts +41 -0
  95. package/dist/utils/contextEnricher.d.ts.map +1 -0
  96. package/dist/utils/contextEnricher.js +327 -0
  97. package/dist/utils/contextEnricher.js.map +1 -0
  98. package/dist/utils/designFallbacks.d.ts +48 -0
  99. package/dist/utils/designFallbacks.d.ts.map +1 -0
  100. package/dist/utils/designFallbacks.js +885 -0
  101. package/dist/utils/designFallbacks.js.map +1 -0
  102. package/dist/utils/designManifestManager.d.ts +89 -0
  103. package/dist/utils/designManifestManager.d.ts.map +1 -0
  104. package/dist/utils/designManifestManager.js +533 -0
  105. package/dist/utils/designManifestManager.js.map +1 -0
  106. package/dist/utils/designPipelineStateManager.d.ts +63 -0
  107. package/dist/utils/designPipelineStateManager.d.ts.map +1 -0
  108. package/dist/utils/designPipelineStateManager.js +174 -0
  109. package/dist/utils/designPipelineStateManager.js.map +1 -0
  110. package/dist/utils/envExampleGenerator.d.ts.map +1 -1
  111. package/dist/utils/envExampleGenerator.js +35 -171
  112. package/dist/utils/envExampleGenerator.js.map +1 -1
  113. package/dist/utils/featureBundleManager.d.ts +90 -0
  114. package/dist/utils/featureBundleManager.d.ts.map +1 -0
  115. package/dist/utils/featureBundleManager.js +340 -0
  116. package/dist/utils/featureBundleManager.js.map +1 -0
  117. package/dist/utils/githubCloner.d.ts +93 -0
  118. package/dist/utils/githubCloner.d.ts.map +1 -0
  119. package/dist/utils/githubCloner.js +305 -0
  120. package/dist/utils/githubCloner.js.map +1 -0
  121. package/dist/utils/rolePermissionMapper.d.ts +89 -0
  122. package/dist/utils/rolePermissionMapper.d.ts.map +1 -0
  123. package/dist/utils/rolePermissionMapper.js +337 -0
  124. package/dist/utils/rolePermissionMapper.js.map +1 -0
  125. package/dist/utils/unifiedDesignContextLoader.d.ts +76 -0
  126. package/dist/utils/unifiedDesignContextLoader.d.ts.map +1 -0
  127. package/dist/utils/unifiedDesignContextLoader.js +344 -0
  128. package/dist/utils/unifiedDesignContextLoader.js.map +1 -0
  129. package/package.json +3 -1
package/README.md CHANGED
@@ -1,394 +1,75 @@
1
- # MyContext CLI + mycontext PM System
1
+ # MyContext CLI + MyContext AI
2
2
 
3
- **🤖 AI-Powered Project Management + Component-First Development**
3
+ **Open Source AI-Powered Component Generation**
4
4
 
5
5
  [![npm version](https://badge.fury.io/js/mycontext-cli.svg)](https://www.npmjs.com/package/mycontext-cli)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
  [![Node Version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen)](https://nodejs.org)
8
8
 
9
- **Two powerful systems in one:**
10
-
11
- 1. **🎯 mycontext PM** - Intelligent project planning, task decomposition, and real-time monitoring using Claude Agent SDK
12
- 2. **🎨 MyContext CLI** - Component-first development with zero-error guarantees and production-ready code generation
13
-
14
- **Result:** From client requirements to production deployment - fully automated with AI oversight.
9
+ Generate production-ready React components from natural language descriptions. Built with 11 specialized AI agents and our proprietary Intent Dictionary System for 95%+ accuracy.
15
10
 
16
11
  ## 🚀 Quick Start
17
12
 
18
- ### **Option 1: Complete Guided Setup (⭐ Recommended for New Projects)**
19
-
20
- ```bash
21
- # Install globally
22
- npm install -g mycontext-cli
23
-
24
- # Single command complete setup with AI guidance
25
- mycontext setup-complete --interactive
26
-
27
- # That's it! Project is ready for development.
28
- ```
29
-
30
- ### **Option 2: Step-by-Step Development**
31
-
32
13
  ```bash
33
14
  # Install globally
34
15
  npm install -g mycontext-cli
35
16
 
36
- # 1. Initialize project
17
+ # Initialize a new project
37
18
  mycontext init my-app
19
+ cd my-app
38
20
 
39
- # 2. Generate context files (PRD, features, etc.)
40
- mycontext generate-context-files --description "Your app idea"
41
-
42
- # 3. Compile PRD (requires approval)
43
- mycontext compile-prd
21
+ # Configure your AI provider
22
+ echo 'ANTHROPIC_API_KEY=your-key' > .mycontext/.env
44
23
 
45
- # 4. Generate individual components
46
- mycontext generate types
47
- mycontext generate brand
48
- mycontext generate components-list
49
- mycontext generate project-structure
50
-
51
- # 5. Generate components with validation
52
- mycontext generate-components all --with-tests
53
-
54
- # 6. Preview components visually
55
- mycontext preview components
56
-
57
- # 7. Build complete app when ready
58
- mycontext build-app --interactive
24
+ # Generate your first component
25
+ mycontext generate:component "Create a login form with email and password"
59
26
  ```
60
27
 
61
- ### **Option 3: AI-Powered Workflow Analysis**
28
+ ## What You Get
62
29
 
63
- ```bash
64
- # Install globally
65
- npm install -g mycontext-cli
66
-
67
- # 1. AI analyzes your project requirements
68
-
69
- # 2. AI generates contextual workflow and executes it
70
- mycontext workflow generate --description "E-commerce platform with payments"
30
+ - **Production-Ready Components** - TypeScript + shadcn/ui + Tailwind CSS
31
+ - **Zero Hallucination** - Intent Dictionary maps natural language to exact components
32
+ - **Type Safety** - Complete TypeScript definitions with proper interfaces
33
+ - **Accessibility First** - Built-in ARIA compliance and semantic HTML
34
+ - **Design System** - Automatic shadcn/ui adherence with design tokens
71
35
 
72
- # 3. Or use interactive workflow planning
73
- mycontext workflow --interactive
36
+ ## 💰 Pricing
74
37
 
75
- # 4. AI creates complete project structure with components
76
- # 5. Continue development with AI-generated architecture
77
- ```
78
-
79
- ## 💡 Philosophy: Component-First Development
38
+ - **MyContext CLI** - Free and open source (MIT License)
39
+ - **MyContext AI API** - Coming soon - Fine-tuned model for 95%+ accuracy
80
40
 
81
- **Start Small, Scale Gradually:**
41
+ Use the CLI with your own AI provider keys (Claude, OpenAI, XAI) for free, or upgrade to our hosted API for best-in-class quality.
82
42
 
83
- 1. **Context Files** → Define your app (PRD, features, technical specs)
84
- 2. **Component List** → AI automatically generates list of needed components
85
- 3. **Build Strategy** → Choose how to approach development
86
- 4. **Component Generation** → Build components one by one with validation
87
- 5. **Visual Preview** → See components in browser before integration
88
- 6. **Scale to App** → Assemble validated components into full application
43
+ ## 📚 Full Documentation
89
44
 
90
- **Result:** Production-ready apps with 0 errors, built incrementally.
45
+ **Complete guides, tutorials, and API reference available on GitHub:**
91
46
 
92
- ## 🏗️ System Architecture
47
+ 👉 **[View Full Documentation](https://github.com/farajabien/mycontext-cli/tree/main/docs)**
93
48
 
94
- ```
95
- ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
96
- │ Client Input │───▶│ mycontext PM │───▶│ MyContext CLI │
97
- │ │ │ (Next.js App) │ │ │
98
- • Requirements │ │ │ │ • Code Generation│
99
- │ • Budget │ │ • Task Planning │ │ • Component │
100
- │ • Timeline │ │ • Progress Mgmt │ │ Creation │
101
- └─────────────────┘ │ • Real-time │ └─────────────────┘
102
- │ Monitoring │
103
- └─────────────────┘
104
-
105
-
106
- ┌─────────────────┐
107
- │ Progress Sync │
108
- │ (Webhooks) │
109
- └─────────────────┘
110
- ```
111
-
112
- ### **Data Flow:**
113
-
114
- 1. **Client Requirements** → mycontext PM analyzes and decomposes into structured JSON
115
- 2. **mycontext PM Plan** → MyContext CLI imports and generates project structure
116
- 3. **Code Generation** → MyContext builds production-ready components
117
- 4. **Progress Updates** → Real-time sync back to mycontext PM dashboard
118
- 5. **AI Oversight** → Continuous monitoring and intelligent suggestions
49
+ - [Getting Started Guide](https://github.com/farajabien/mycontext-cli/blob/main/docs/01-getting-started/quick-start.md)
50
+ - [AI Agents System](https://github.com/farajabien/mycontext-cli/blob/main/docs/02-core-features/ai-agents.md)
51
+ - [Intent Dictionary](https://github.com/farajabien/mycontext-cli/blob/main/docs/02-core-features/intent-dictionary-system.md)
52
+ - [Command Reference](https://github.com/farajabien/mycontext-cli/blob/main/docs/03-reference/commands.md)
53
+ - [Architecture](https://github.com/farajabien/mycontext-cli/blob/main/docs/06-architecture/system-overview.md)
119
54
 
120
55
  ## 🎯 Key Features
121
56
 
122
- ### 🤖 **mycontext PM (NEW)**
123
-
124
- - **Intelligent Project Planning** - AI decomposes requirements into epics, user stories, and tasks
125
- - **Real-time Progress Monitoring** - Hourly checks, blocker detection, timeline adjustments
126
- - **Client Brief Processing** - Parse contracts, budgets, and timelines into structured plans
127
- - **Task Assignment & Tracking** - Automated task management with priority and dependency handling
128
- - **Progress Synchronization** - Webhook integration for live dashboard updates
129
-
130
- ### ✅ **MyContext CLI (Component-First Development)**
131
-
132
- - **Streamlined Workflow** - Single `generate architecture` command replaces 5 separate steps
133
- - **Smart Next Steps** - Context-aware suggestions guide you through the development process
134
- - **Zero-Error Guarantee** - TypeScript/ESLint/build validation on every component
135
- - **UI Specification System** - Plain-English specs with accessibility & responsive guidance
136
- - **Visual Preview** - Figma-like component board for testing
137
- - **BYOK Model** - Use your own Claude/X.AI/OpenAI API keys (~$20/month)
138
-
139
- ### 🤖 **AI Workflow Analysis**
140
-
141
- - **Intelligent Project Analysis** - AI understands your requirements and suggests optimal workflows
142
- - **Contextual Workflow Generation** - Custom workflows tailored to your specific project needs
143
- - **Component Recommendations** - AI suggests appropriate components and features
144
- - **Architecture Guidance** - Recommends best tech stack and project structure
145
-
146
- ## 📋 Commands
147
-
148
- ### Complete Project Setup (⭐ NEW)
149
-
150
- ```bash
151
- mycontext setup-complete --interactive # Complete guided project setup
152
- mycontext setup-complete --name "MyApp" # Direct setup with options
153
- ```
154
-
155
- ### AI Workflow Analysis (NEW)
156
-
157
- ```bash
158
- mycontext workflow analyze # Analyze project with AI
159
- mycontext workflow generate # Generate and execute workflow
160
- mycontext workflow --interactive # Interactive workflow planning
161
- ```
162
-
163
- ### Streamlined Workflow (Recommended)
164
-
165
- ```bash
166
- mycontext init <project-name> # Initialize project
167
- mycontext generate-context-files # Generate PRD, features, specs
168
- mycontext generate architecture # Generate complete architecture
169
- mycontext build-app # Build complete application
170
- ```
171
-
172
- ### Traditional Component-First Workflow
173
-
174
- ```bash
175
- mycontext init <project-name> # Initialize project
176
- mycontext generate-context-files # Generate PRD, features, specs
177
- mycontext compile-prd # Compile context into PRD
178
- mycontext generate types # Generate TypeScript types
179
- mycontext generate brand # Generate brand guidelines
180
- mycontext generate components-list # Generate component list
181
- mycontext generate project-structure # Generate project structure
182
- mycontext generate-components <name|all> # Generate components
183
- mycontext preview <type> # Preview components/app
184
- mycontext build-app # Build complete application
185
- ```
186
-
187
- ### UI Specification
188
-
189
- ```bash
190
- mycontext refine spec <component> --desc "description" # Generate UI spec from description
191
- mycontext refine spec <component> --json-file <path> # Generate UI spec from JSON
192
- mycontext generate-components all --verbose # Auto-generate specs with components
193
- ```
194
-
195
- ### Setup & Configuration
196
-
197
- ```bash
198
- mycontext setup # Configure AI providers
199
- mycontext build-strategy # Choose build approach
200
- mycontext health-check # Verify installation
201
- ```
202
-
203
- ## ⚙️ Configuration
204
-
205
- ### API Keys (Required)
206
-
207
- ```bash
208
- # Create .mycontext/.env file
209
- echo 'MYCONTEXT_CLAUDE_API_KEY=sk-ant-xxx' > .mycontext/.env
210
- echo 'MYCONTEXT_XAI_API_KEY=xai-xxx' >> .mycontext/.env
211
- ```
212
-
213
- **Recommended providers:**
214
-
215
- - **Claude** (best for complex reasoning)
216
- - **X.AI Grok** (best for code generation)
217
- - **OpenAI** (most versatile)
218
- - **Qwen3** (free via OpenRouter)
219
-
220
- ## 📊 Project Structure
221
-
222
- ```
223
- my-app/
224
- ├── .mycontext/
225
- │ ├── 01-prd.md # Product Requirements
226
- │ ├── 02-a-features.md # Features specification
227
- │ ├── 02-b-user-flows.md # User flows
228
- │ ├── 02-c-edge-cases.md # Edge cases
229
- │ ├── 02-d-technical-specs.md # Technical specifications
230
- │ ├── 03-types.ts # TypeScript types
231
- │ ├── 04-branding.md # Branding & design system
232
- │ ├── 05-component-list.json # Generated component list
233
- │ └── .env # API keys
234
- ├── components/ # Generated components
235
- │ └── dashboard/
236
- │ ├── RevenueCard.tsx # Component file
237
- │ ├── RevenueCard.spec.md # UI specification
238
- │ └── index.ts # Export file
239
- ├── actions/ # Server actions (if full-stack)
240
- ├── app/ # Next.js routes (if full-stack)
241
- └── package.json
242
- ```
243
-
244
- ## 📋 UI Specification Example
245
-
246
- Generate detailed, plain-English specifications from simple descriptions:
247
-
248
- ```bash
249
- mycontext refine spec RevenueCard --desc "A card showing total revenue prominently with percentage change"
250
- ```
251
-
252
- **Output:**
253
-
254
- ```
255
- 📋 UI Specification for RevenueCard
256
-
257
- 📝 Compact Specification:
258
- **RevenueCard Component - Compact Spec**
259
-
260
- **Visual Hierarchy:**
261
- - Primary: Total Revenue, $125,430
262
- - Secondary: +12.5% from last month
263
-
264
- **Layout:** vertical arrangement
265
- **Spacing:** medium spacing between elements
266
- **Colors:** primary, success theme
267
-
268
- 📋 Detailed Specification:
269
- **RevenueCard Component - Detailed Implementation Spec**
270
-
271
- **Component Overview:**
272
- - Name: RevenueCard
273
- - Type: card
274
- - Description: A card component displaying revenue metrics...
275
-
276
- **Visual Hierarchy:**
277
- 1. **title**: Total Revenue
278
- - Prominence: medium (medium (~16px))
279
- 2. **value**: $125,430
280
- - Prominence: high (large (~32px))
281
- 3. **subtitle**: +12.5% from last month
282
- - Prominence: low (small (~12px))
283
-
284
- **Accessibility Requirements:**
285
- - All interactive elements must have aria-label or aria-labelledby
286
- - Focus management: tab order follows visual hierarchy
287
- - Color contrast: minimum 4.5:1 ratio for text
288
-
289
- **Responsive Adjustments:**
290
- - Mobile (< 768px): Reduce spacing to 12px, stack vertically
291
- - Desktop (> 768px): Standard spacing, maintain layout
292
- ```
293
-
294
- ## 🆚 MyContext + mycontext PM vs Others
295
-
296
- | Feature | MyContext + mycontext PM | Lovable | v0.dev | Bolt |
297
- | ------------------------- | ------------------------ | ---------- | ----------- | ----------- |
298
- | **AI Project Management** | ✅ Full System | ❌ None | ❌ None | ❌ None |
299
- | **Code Location** | Your machine | Cloud | Cloud | Cloud |
300
- | **End-to-End Automation** | ✅ Requirements→Deploy | ❌ Manual | ❌ Manual | ❌ Manual |
301
- | **Progress Monitoring** | ✅ Real-time | ❌ None | ❌ None | ❌ None |
302
- | **Validation Gates** | 12+ checkpoints | None | None | None |
303
- | **TypeScript Guarantee** | 100% | No | No | No |
304
- | **PM Integration** | ✅ Native | ❌ None | ❌ None | ❌ None |
305
- | **Pricing** | BYOK ($0-20/mo) | $20-200/mo | Usage-based | Usage-based |
306
-
307
- ## 🐛 Troubleshooting
308
-
309
- **"PRD Validation Failed"**
310
-
311
- ```bash
312
- mycontext compile-prd --force
313
- ```
314
-
315
- **"Component Build Failed"**
316
-
317
- ```bash
318
- # Automatic retry with error context (max 3 attempts)
319
- # Check .mycontext/progress/07-components/<component>.json
320
- ```
321
-
322
- **"API Key Issues"**
323
-
324
- ```bash
325
- mycontext setup # Reconfigure API keys
326
- mycontext health-check # Verify setup
327
- ```
328
-
329
- **"UI Spec Generation Failed"**
330
-
331
- ```bash
332
- # Check if templates exist
333
- ls src/templates/ui-spec-templates.json
334
-
335
- # Generate spec with verbose output
336
- mycontext refine spec ComponentName --desc "description" --verbose
337
-
338
- # Use JSON input instead of description
339
- mycontext refine spec ComponentName --json-file component.json
340
- ```
341
-
342
- **"PM Plan Import Failed"**
343
-
344
- ```bash
345
- # Validate PM plan structure first
346
- mycontext import-project-plan ./pm-plan.json --validate
347
-
348
- # Check for required fields in PM plan
349
- # Required: project.name, project.description, breakdown.tasks, myContext.framework
350
- ```
351
-
352
- **"Progress Export Issues"**
353
-
354
- ```bash
355
- # Check if project has been initialized
356
- mycontext export-progress --format summary
357
-
358
- # Ensure .mycontext directory exists with todos.json
359
- ls -la .mycontext/
360
- ```
361
-
362
- **"mycontext PM Synchronization Failed"**
363
-
364
- ```bash
365
- # Test webhook connectivity
366
- curl -X POST https://mycontext-pm.example.com/webhook \
367
- -H "Content-Type: application/json" \
368
- -d '{"test": "connection"}'
369
-
370
- # Check webhook URL format
371
- mycontext export-progress --webhook https://mycontext-pm.example.com/webhook
372
- ```
373
-
374
- ## 📚 Documentation
375
-
376
- - [Getting Started](https://github.com/farajabien/mycontext-cli#quick-start)
377
- - [AI Workflow Analysis](https://github.com/farajabien/mycontext-cli#ai-workflow-analysis-new)
378
- - [Component Generation](https://github.com/farajabien/mycontext-cli#traditional-component-first-workflow)
379
- - [System Architecture](https://github.com/farajabien/mycontext-cli#system-architecture)
380
- - [Build Strategies](https://github.com/farajabien/mycontext-cli#philosophy-component-first-development)
57
+ - **11 Specialized AI Agents** - Expert AI for design, validation, and generation
58
+ - **Intent Dictionary** - 30+ UI patterns with type-safe natural language mapping
59
+ - **Design Pipeline** - 8-phase design analysis for rich, contextual components
60
+ - **Feature Assembly** - Combine components into working features with auth & permissions
61
+ - **Zero-Error Guarantee** - 12+ validation checkpoints ensure production quality
381
62
 
382
63
  ## 🤝 Contributing
383
64
 
384
- Contributions are welcome! Please feel free to submit a Pull Request.
65
+ Contributions welcome! See our [Contributing Guide](https://github.com/farajabien/mycontext-cli/blob/main/CONTRIBUTING.md).
385
66
 
386
67
  ## 📄 License
387
68
 
388
- MIT © MyContext
69
+ MIT © MyContext - See [LICENSE](https://github.com/farajabien/mycontext-cli/blob/main/LICENSE) for details.
389
70
 
390
71
  ---
391
72
 
392
- **🤖 The future of AI-powered development: From requirements to production with mycontext PM oversight.**
393
-
394
73
  **Built by developers, for developers. Your code stays on your machine.** 🚀
74
+
75
+ [Full Documentation](https://github.com/farajabien/mycontext-cli/tree/main/docs) • [GitHub](https://github.com/farajabien/mycontext-cli) • [Issues](https://github.com/farajabien/mycontext-cli/issues)
@@ -1 +1 @@
1
- {"version":3,"file":"CodeGenSubAgent.d.ts","sourceRoot":"","sources":["../../../src/agents/implementations/CodeGenSubAgent.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,QAAQ,EACR,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AA6FhC,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;IAc3D,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;IAiM9C;;OAEG;YACW,sBAAsB;IAgIpC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAiF5B;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAuHlC;;OAEG;IACH,OAAO,CAAC,6BAA6B;IAyGrC,OAAO,CAAC,4BAA4B;IA4BpC,OAAO,CAAC,mBAAmB;IA2B3B,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;IA4QzC,OAAO,CAAC,mBAAmB;IA6B3B,OAAO,CAAC,uBAAuB;IAe/B,OAAO,CAAC,qBAAqB;IAoC7B,OAAO,CAAC,qBAAqB;YASf,oBAAoB;CAiCnC"}
1
+ {"version":3,"file":"CodeGenSubAgent.d.ts","sourceRoot":"","sources":["../../../src/agents/implementations/CodeGenSubAgent.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,QAAQ,EACR,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AA6FhC,qBAAa,eACX,YAAW,QAAQ,CAAC,wBAAwB,EAAE,yBAAyB,CAAC;IAExE,IAAI,SAAqB;IACzB,WAAW,SAC+F;IAC1G,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;IAc3D,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;IAqN9C;;OAEG;YACW,sBAAsB;IA2IpC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IA8I5B;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAuHlC;;OAEG;IACH,OAAO,CAAC,6BAA6B;IAyGrC,OAAO,CAAC,4BAA4B;IA4BpC,OAAO,CAAC,mBAAmB;IA2B3B,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;IA4QzC,OAAO,CAAC,mBAAmB;IA6B3B,OAAO,CAAC,uBAAuB;IAe/B,OAAO,CAAC,qBAAqB;IAoC7B,OAAO,CAAC,qBAAqB;YASf,oBAAoB;CAiCnC"}
@@ -38,10 +38,10 @@ exports.CodeGenSubAgent = void 0;
38
38
  * CodeGenSubAgent Implementation
39
39
  *
40
40
  * Specialized sub-agent for generating production-ready React components and TypeScript code.
41
- * Uses Claude Code for optimal code generation capabilities.
41
+ * Uses MyContext AI (fine-tuned GPT-4o Mini) for 95%+ accurate component generation.
42
42
  * Enhanced with shadcn/ui primitives and modern React patterns for Next.js 14+.
43
43
  */
44
- const hybridAIClient_1 = require("../../utils/hybridAIClient");
44
+ const ProviderChain_1 = require("../../clients/ProviderChain");
45
45
  const PromptConstructorAgent_1 = require("./PromptConstructorAgent");
46
46
  const fs = __importStar(require("fs"));
47
47
  const path = __importStar(require("path"));
@@ -137,7 +137,7 @@ const CANONICAL_SHADCN_LIST = [
137
137
  class CodeGenSubAgent {
138
138
  constructor() {
139
139
  this.name = "CodeGenSubAgent";
140
- this.description = "Expert React/TypeScript developer specializing in production-ready Next.js 14+ components with shadcn/ui";
140
+ this.description = "Expert React/TypeScript developer using MyContext AI for 95%+ accurate shadcn/ui component generation";
141
141
  const personality = (0, subAgentPersonalities_1.getSubAgentPersonality)(this.name);
142
142
  if (!personality) {
143
143
  throw new Error(`Personality not found for ${this.name}`);
@@ -203,9 +203,9 @@ class CodeGenSubAgent {
203
203
  };
204
204
  }
205
205
  async generateProductionReadyComponent(component, group, options) {
206
- // Try cloud-first via HybridAIClient (GitHub Models preferred), then fall back to local Ollama, then template
206
+ // Use MyContext AI (fine-tuned GPT-4o Mini) with fallbacks to Claude SDK and XAI
207
207
  try {
208
- const ai = new hybridAIClient_1.HybridAIClient();
208
+ const ai = (0, ProviderChain_1.getProviderChain)();
209
209
  const compObj = typeof component === "string"
210
210
  ? {
211
211
  name: this.generateComponentName(component),
@@ -300,7 +300,14 @@ class CodeGenSubAgent {
300
300
  console.log("❌ PromptConstructorAgent failed, trying LLM-based prompt construction...");
301
301
  try {
302
302
  // Option 2: Use LLM for prompt construction
303
- constructedPrompt = await this.constructPromptWithLLM(compObj, group, { prd, types, enhancedContext });
303
+ constructedPrompt = await this.constructPromptWithLLM(compObj, group, {
304
+ prd,
305
+ types,
306
+ enhancedContext,
307
+ designSystem: options?.context?.designSystem,
308
+ designIntent: options?.context?.designIntent,
309
+ visualTokens: options?.context?.visualTokens,
310
+ });
304
311
  console.log(`✅ Intelligent prompt constructed via LLM: ${constructedPrompt.contextSummary}`);
305
312
  }
306
313
  catch (llmPromptError) {
@@ -316,7 +323,16 @@ class CodeGenSubAgent {
316
323
  }
317
324
  const prompt = `${constructedPrompt.systemPrompt}\n\n${constructedPrompt.userPrompt}`;
318
325
  console.log("🔍 DEBUG: About to call AI for component generation");
319
- const { code } = await ai.generateComponent(prompt, {
326
+ const code = await ai.generateComponent(prompt, {
327
+ prd,
328
+ types,
329
+ brand: options?.context?.branding,
330
+ componentList: options?.context?.componentList,
331
+ projectStructure: options?.context?.projectStructure,
332
+ previousOutputs: options?.context?.previousOutputs,
333
+ userPrompt: prompt,
334
+ workingDirectory: options?.context?.workingDirectory,
335
+ }, {
320
336
  temperature: this.temperature,
321
337
  maxTokens: Math.max(this.maxTokens, 8000), // Ensure minimum 8000 tokens
322
338
  });
@@ -343,7 +359,7 @@ class CodeGenSubAgent {
343
359
  * Uses LLM to construct intelligent prompts for component generation
344
360
  */
345
361
  async constructPromptWithLLM(component, group, context) {
346
- const ai = new hybridAIClient_1.HybridAIClient();
362
+ const ai = (0, ProviderChain_1.getProviderChain)();
347
363
  const promptConstructionRequest = `
348
364
  You are a specialist in creating optimal prompts for React/TypeScript component generation.
349
365
 
@@ -405,18 +421,18 @@ Focus on:
405
421
  - Modern React patterns (hooks, etc.)
406
422
  - Server Component architecture for page.tsx files
407
423
  `;
408
- const response = await ai.generateComponent(promptConstructionRequest, {
424
+ const response = await ai.generateComponent(promptConstructionRequest, {}, {
409
425
  temperature: 0.3, // Lower temperature for more consistent prompt construction
410
426
  maxTokens: 2000,
411
427
  });
412
428
  try {
413
- console.log("🔍 DEBUG: CodeGen prompt construction response length:", response.code.length);
414
- console.log("🔍 DEBUG: CodeGen prompt construction response preview:", response.code.substring(0, 200));
429
+ console.log("🔍 DEBUG: CodeGen prompt construction response length:", response.length);
430
+ console.log("🔍 DEBUG: CodeGen prompt construction response preview:", response.substring(0, 200));
415
431
  // Extract JSON from the response
416
- const jsonMatch = response.code.match(/\{[\s\S]*\}/);
432
+ const jsonMatch = response.match(/\{[\s\S]*\}/);
417
433
  if (!jsonMatch) {
418
434
  console.warn("❌ DEBUG: No JSON found in LLM response, using fallback prompt construction");
419
- console.log("❌ DEBUG: Full response:", response.code);
435
+ console.log("❌ DEBUG: Full response:", response);
420
436
  return this.createFallbackPrompt(component, group, context);
421
437
  }
422
438
  console.log("✅ DEBUG: Found JSON match:", jsonMatch[0].substring(0, 100) + "...");
@@ -444,6 +460,43 @@ Focus on:
444
460
  createFallbackPrompt(component, group, context) {
445
461
  const componentName = component.name || "Component";
446
462
  const componentDescription = component.description || "A React component";
463
+ // Add design system context if available
464
+ let designSystemContext = "";
465
+ if (context.designSystem || context.designIntent || context.visualTokens) {
466
+ designSystemContext = "\n\n🎨 **DESIGN SYSTEM CONTEXT**:\n";
467
+ if (context.designSystem) {
468
+ designSystemContext += `\n**Visual Tokens:**
469
+ - Primary Color: ${context.designSystem.colors?.primary || "Not specified"}
470
+ - Secondary Color: ${context.designSystem.colors?.secondary || "Not specified"}
471
+ - Typography: ${context.designSystem.typography?.heading || "Not specified"} (headings), ${context.designSystem.typography?.body || "Not specified"} (body)
472
+ - Spacing Scale: ${context.designSystem.spacing?.base || "Not specified"}px base unit
473
+ - Border Radius: ${context.designSystem.borderRadius?.base || "Not specified"}px
474
+ - Shadows: ${context.designSystem.shadows?.base || "Not specified"}`;
475
+ }
476
+ if (context.designIntent) {
477
+ designSystemContext += `\n\n**Design Principles:**
478
+ - Design Anchors: ${context.designIntent.design_anchors?.join(", ") || "Not specified"}
479
+ - Key Principles: ${context.designIntent.key_principles?.join(", ") || "Not specified"}
480
+ - User Experience Focus: ${context.designIntent.user_experience_focus || "Not specified"}`;
481
+ }
482
+ if (context.visualTokens) {
483
+ designSystemContext += `\n\n**Component Tokens:**
484
+ - Button Styles: ${JSON.stringify(context.visualTokens.buttons || {})}
485
+ - Input Styles: ${JSON.stringify(context.visualTokens.inputs || {})}
486
+ - Card Styles: ${JSON.stringify(context.visualTokens.cards || {})}`;
487
+ }
488
+ designSystemContext += "\n\n**Design Implementation Requirements:**\n";
489
+ designSystemContext +=
490
+ "- Use the specified color palette for all UI elements\n";
491
+ designSystemContext +=
492
+ "- Apply consistent typography scale throughout the component\n";
493
+ designSystemContext +=
494
+ "- Follow the established spacing and border radius patterns\n";
495
+ designSystemContext +=
496
+ "- Implement component tokens for buttons, inputs, and cards\n";
497
+ designSystemContext +=
498
+ "- Ensure visual consistency with the overall design system";
499
+ }
447
500
  const systemPrompt = `You are an expert React/TypeScript developer specializing in production-ready Next.js 14+ components with shadcn/ui.
448
501
 
449
502
  📱 **MOBILE-FIRST DESIGN REQUIREMENTS**:
@@ -479,7 +532,7 @@ CRITICAL REQUIREMENTS:
479
532
  - Server Components for page.tsx files (no "use client")
480
533
  - Client Components for interactive functionality
481
534
 
482
- Generate production-ready, maintainable code that follows industry best practices.`;
535
+ Generate production-ready, maintainable code that follows industry best practices.${designSystemContext}`;
483
536
  const userPrompt = `Create a React component: ${componentName}
484
537
 
485
538
  Description: ${componentDescription}