mycontext-cli 2.0.1 โ†’ 2.0.2

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.
package/dist/README.md ADDED
@@ -0,0 +1,388 @@
1
+ # MyContext CLI
2
+
3
+ **๐Ÿง  AI-Powered Full-Stack App Generation with Production-Ready Guarantees**
4
+
5
+ [![npm version](https://badge.fury.io/js/mycontext-cli.svg)](https://www.npmjs.com/package/mycontext-cli)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+ [![Node Version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen)](https://nodejs.org)
8
+
9
+ Generate complete Next.js applications from natural language with **guaranteed zero linter/build errors** through AI-powered validation gates and automatic build checking.
10
+
11
+ ## ๐Ÿš€ Quick Start
12
+
13
+ ```bash
14
+ # Install globally
15
+ npm install -g mycontext-cli
16
+
17
+ # Build a complete app in one command
18
+ mycontext build-app --description "Your app idea" --interactive
19
+ ```
20
+
21
+ ## ๐Ÿ’ก Philosophy: "LLM as Compiler"
22
+
23
+ MyContext treats AI as a **compiler** that transforms requirements into production-ready code:
24
+ - **You write the spec** โ†’ PRD with user approval gates
25
+ - **AI compiles it** โ†’ Generates components with validation
26
+ - **System validates** โ†’ TypeScript, ESLint, build checks
27
+ - **You approve** โ†’ 12+ validation checkpoints
28
+
29
+ **Result:** Production-ready code with 0 errors guaranteed.
30
+
31
+ ---
32
+
33
+ ## ๐Ÿ“– Examples
34
+
35
+ ### Tic-Tac-Toe Game
36
+
37
+ ```bash
38
+ mycontext build-app \
39
+ --description "Tic-tac-toe with AI opponent, score tracking, and responsive design" \
40
+ --interactive \
41
+ --with-tests
42
+ ```
43
+
44
+ **Generated:**
45
+ - Game board component
46
+ - AI opponent (minimax algorithm)
47
+ - Score tracking system
48
+ - Reset functionality
49
+ - Responsive Tailwind design
50
+ - Unit tests
51
+
52
+ ### E-Commerce Platform
53
+
54
+ ```bash
55
+ mycontext build-app \
56
+ --description "E-commerce with product catalog, shopping cart, checkout, and admin dashboard" \
57
+ --interactive \
58
+ --complete-architecture
59
+ ```
60
+
61
+ **Generated:**
62
+ - Product listing & detail pages
63
+ - Shopping cart with persistence
64
+ - Checkout flow
65
+ - Admin dashboard
66
+ - Server actions for CRUD
67
+ - Next.js App Router routes
68
+ - Full TypeScript types
69
+
70
+ ### Todo App with Auth
71
+
72
+ ```bash
73
+ mycontext build-app \
74
+ --description "Todo app with user auth, categories, due dates, and dark mode" \
75
+ --interactive \
76
+ --with-tests
77
+ ```
78
+
79
+ ---
80
+
81
+ ## ๐ŸŽฏ Features
82
+
83
+ ### โœ… 230-Step Validated Workflow
84
+
85
+ Every app goes through **12 validation gates** where you approve:
86
+ 1. Features specification
87
+ 2. User flows
88
+ 3. Edge cases
89
+ 4. Technical specs
90
+ 5. **PRD (must read entire document)**
91
+ 6. TypeScript types
92
+ 7. Branding & design system
93
+ 8. Build strategy
94
+ 9. Component list
95
+ 10. Server actions (if full-stack)
96
+ 11. Routes (if full-stack)
97
+ 12. Final build validation
98
+
99
+ ### ๐Ÿ”จ Automatic Build Validation
100
+
101
+ **Every component** automatically passes through:
102
+ - โœ… TypeScript check (`tsc --noEmit`)
103
+ - โœ… ESLint validation
104
+ - โœ… Build check (`npm run build`)
105
+ - โœ… Unit tests (if `--with-tests`)
106
+
107
+ **Failed components retry automatically** with error context (max 3 attempts).
108
+
109
+ ### ๐Ÿ“Š Real-Time Progress Tracking
110
+
111
+ Track build progress via JSON files in `.mycontext/progress/`:
112
+ ```json
113
+ {
114
+ "currentPhase": "component_generation",
115
+ "currentStep": 95,
116
+ "totalSteps": 230,
117
+ "percentComplete": 41.3
118
+ }
119
+ ```
120
+
121
+ **Perfect for VS Code extensions & dashboards.**
122
+
123
+ ### ๐Ÿ—๏ธ Complete Architecture Generation
124
+
125
+ Generate full-stack apps with `--complete-architecture`:
126
+ - Next.js 15 App Router routes
127
+ - Server actions with validation
128
+ - Self-documenting components
129
+ - Type-safe throughout
130
+
131
+ ---
132
+
133
+ ## ๐Ÿ“‹ Commands
134
+
135
+ ### Build Complete App (Recommended)
136
+
137
+ ```bash
138
+ mycontext build-app --description "Your app" --interactive
139
+
140
+ # Options:
141
+ --output <dir> # Output directory (default: mycontext-app)
142
+ --interactive # Interactive mode with validation prompts
143
+ --with-tests # Generate unit tests
144
+ --complete-architecture # Generate server actions + routes
145
+ --architecture-type # nextjs-app-router | nextjs-pages | react-spa
146
+ --max-retries 3 # Max retry attempts
147
+ --verbose # Show detailed output
148
+ ```
149
+
150
+ ### Step-by-Step Workflow
151
+
152
+ ```bash
153
+ # 1. Initialize project
154
+ mycontext init my-app
155
+
156
+ # 2. Generate context files (with validation gates)
157
+ mycontext generate-context-files --description "Your app"
158
+
159
+ # 3. Compile PRD (requires approval)
160
+ mycontext compile-prd
161
+
162
+ # 4. Generate components (with build validation)
163
+ mycontext generate-components all --with-tests
164
+ ```
165
+
166
+ ### Other Commands
167
+
168
+ ```bash
169
+ mycontext setup # Configure AI providers
170
+ mycontext build-strategy # Interactive strategy selection
171
+ mycontext analyze # Analyze existing project
172
+ mycontext list [type] # List components/projects
173
+ mycontext preview <type> # Preview components
174
+ ```
175
+
176
+ ---
177
+
178
+ ## โš™๏ธ Configuration
179
+
180
+ ### API Keys (BYOK Model)
181
+
182
+ MyContext uses **your own API keys** - no billing from us.
183
+
184
+ **Recommended providers:**
185
+
186
+ ```bash
187
+ # Claude (best for complex reasoning)
188
+ echo 'MYCONTEXT_CLAUDE_API_KEY=sk-ant-xxx' > .mycontext/.env
189
+
190
+ # X.AI Grok (best for code generation)
191
+ echo 'MYCONTEXT_XAI_API_KEY=xai-xxx' > .mycontext/.env
192
+
193
+ # OpenAI (most versatile)
194
+ echo 'MYCONTEXT_OPENAI_API_KEY=sk-xxx' > .mycontext/.env
195
+ ```
196
+
197
+ **Free tier:**
198
+
199
+ ```bash
200
+ # Qwen3 (free via OpenRouter)
201
+ echo 'MYCONTEXT_QWEN_API_KEY=sk-or-xxx' > .mycontext/.env
202
+ ```
203
+
204
+ ### Project Structure
205
+
206
+ ```
207
+ my-app/
208
+ โ”œโ”€โ”€ .mycontext/
209
+ โ”‚ โ”œโ”€โ”€ 01-prd.md # Product Requirements
210
+ โ”‚ โ”œโ”€โ”€ 02-a-features.md # Features
211
+ โ”‚ โ”œโ”€โ”€ 02-b-user-flows.md # User flows
212
+ โ”‚ โ”œโ”€โ”€ 02-c-edge-cases.md # Edge cases
213
+ โ”‚ โ”œโ”€โ”€ 02-d-technical-specs.md # Tech specs
214
+ โ”‚ โ”œโ”€โ”€ 03-types.ts # TypeScript types
215
+ โ”‚ โ”œโ”€โ”€ 04-branding.md # Branding
216
+ โ”‚ โ”œโ”€โ”€ 05-component-list.json # Component list
217
+ โ”‚ โ”œโ”€โ”€ progress/ # Progress tracking
218
+ โ”‚ โ”‚ โ”œโ”€โ”€ master.json # Master progress
219
+ โ”‚ โ”‚ โ””โ”€โ”€ 07-components/ # Per-component progress
220
+ โ”‚ โ””โ”€โ”€ .env # API keys
221
+ โ”œโ”€โ”€ components/ # Generated components
222
+ โ”œโ”€โ”€ actions/ # Server actions (--complete-architecture)
223
+ โ”œโ”€โ”€ app/ # Routes (--complete-architecture)
224
+ โ””โ”€โ”€ package.json
225
+ ```
226
+
227
+ ---
228
+
229
+ ## ๐ŸŽ“ How It Works
230
+
231
+ ### 1. Context Generation
232
+ AI generates detailed context files based on your description. **You approve each one.**
233
+
234
+ ### 2. PRD Compilation
235
+ Context files are compiled into a comprehensive PRD. **You must read and approve.**
236
+
237
+ ### 3. Component Generation
238
+ Components are generated from PRD. **Each component automatically validated:**
239
+ ```
240
+ ๐Ÿ”จ Generating: LoginForm
241
+ โœ… Code Generated
242
+ โœ… TypeScript Check Passed
243
+ โœ… ESLint Passed
244
+ โœ… Build Passed
245
+ โœ… Tests Passed
246
+ ```
247
+
248
+ ### 4. Error Recovery
249
+ Failed components retry with error context:
250
+ ```
251
+ โŒ TypeScript check failed (3 errors)
252
+ - LoginForm.tsx:12:5 - TS2322: Type 'string' not assignable to 'number'
253
+
254
+ ๐Ÿ”„ Retry 1/3 (with error context)
255
+ โœ… Fixed and validated
256
+ ```
257
+
258
+ ### 5. Production Deploy
259
+ ```bash
260
+ cd my-app
261
+ npm run build # โœ… Zero errors guaranteed
262
+ vercel deploy # ๐Ÿš€ Deploy
263
+ ```
264
+
265
+ ---
266
+
267
+ ## ๐Ÿ”ง Advanced Usage
268
+
269
+ ### Build Strategy Selection
270
+
271
+ ```bash
272
+ mycontext build-strategy --recommend
273
+
274
+ # AI asks about:
275
+ - Project type (client work, personal, MVP, etc.)
276
+ - Complexity (simple, medium, complex)
277
+ - Timeline (urgent, moderate, flexible)
278
+ - Team size (solo, small, large)
279
+
280
+ # Recommends best approach:
281
+ ๐ŸŽฏ Vertical Slice - Build complete features end-to-end
282
+ โฐ Time to first demo: 2-3 weeks
283
+ ```
284
+
285
+ ### Complete Architecture
286
+
287
+ ```bash
288
+ mycontext build-app \
289
+ --description "Blog platform" \
290
+ --complete-architecture \
291
+ --architecture-type nextjs-app-router
292
+
293
+ # Generates:
294
+ # - app/blog/[slug]/page.tsx
295
+ # - actions/createPost.ts
296
+ # - actions/updatePost.ts
297
+ # - components/BlogPost.tsx
298
+ # - Full type system
299
+ ```
300
+
301
+ ### Existing Project Migration
302
+
303
+ ```bash
304
+ mycontext analyze # Analyze existing project
305
+ mycontext migrate --all # Migrate to MyContext structure
306
+ ```
307
+
308
+ ---
309
+
310
+ ## ๐Ÿ“Š Build Metrics
311
+
312
+ After successful build:
313
+
314
+ ```
315
+ ๐ŸŽ‰ Workflow Complete!
316
+
317
+ ๐Ÿ“Š Summary:
318
+ Duration: 12m 34s
319
+ Total Steps: 230/230
320
+ User Approvals: 12
321
+ Retries: 3
322
+
323
+ โœ… Build Checks:
324
+ TypeScript: 30 passed, 0 failed
325
+ ESLint: 30 passed, 0 failed
326
+ Build: 30 passed, 0 failed
327
+ Tests: 28 passed, 0 failed
328
+ ```
329
+
330
+ **Zero failures = Production-ready**
331
+
332
+ ---
333
+
334
+ ## ๐Ÿ†š MyContext vs Others
335
+
336
+ | Feature | MyContext | Lovable | v0.dev |
337
+ |---------|-----------|---------|--------|
338
+ | **Code Location** | Your machine | Cloud | Cloud |
339
+ | **Validation Gates** | 12+ checkpoints | None | None |
340
+ | **Build Validation** | Every component | None | None |
341
+ | **TypeScript Guarantee** | 100% | No | No |
342
+ | **Pricing** | BYOK ($0-20/mo) | $20-200/mo | Usage-based |
343
+ | **Deployment** | Anywhere | Limited | Vercel only |
344
+ | **Progress Tracking** | JSON files | None | None |
345
+
346
+ ---
347
+
348
+ ## ๐Ÿ“š Documentation
349
+
350
+ - [Complete Workflow](https://github.com/farajabien/mycontext-monorepo/blob/main/docs/BUILD_APP_PROCESS.md) - 230-step process
351
+ - [Integration Guide](https://github.com/farajabien/mycontext-monorepo/blob/main/docs/IMPLEMENTATION_SUMMARY.md) - VS Code integration
352
+ - [Quick Start](https://github.com/farajabien/mycontext-monorepo/blob/main/docs/QUICK_START_BUILD_APP.md) - User guide
353
+
354
+ ---
355
+
356
+ ## ๐Ÿ› Troubleshooting
357
+
358
+ **"PRD Validation Failed"**
359
+ ```bash
360
+ # Provide feedback and regenerate
361
+ mycontext compile-prd --force
362
+ ```
363
+
364
+ **"Component Build Failed"**
365
+ ```bash
366
+ # Automatic retry with error context (max 3 attempts)
367
+ # Check .mycontext/progress/07-components/<component>.json
368
+ ```
369
+
370
+ **"Progress Not Tracking"**
371
+ ```bash
372
+ # Verify progress directory exists
373
+ ls -la .mycontext/progress/
374
+ ```
375
+
376
+ ---
377
+
378
+ ## ๐Ÿค Contributing
379
+
380
+ See [CONTRIBUTING.md](https://github.com/farajabien/mycontext-monorepo/blob/main/CONTRIBUTING.md)
381
+
382
+ ## ๐Ÿ“„ License
383
+
384
+ MIT ยฉ MyContext
385
+
386
+ ---
387
+
388
+ **Built by developers, for developers. Your code stays on your machine.** ๐Ÿš€
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mycontext-cli",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "MyContext CLI - AI-powered full-stack application generator with complete architecture generation, server actions, Next.js 15 App Router, and self-documenting components",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {
@@ -11,7 +11,7 @@
11
11
  "build": "npm run build:clean && npm run build:compile && npm run build:copy",
12
12
  "build:clean": "rm -rf dist && ([ \"$npm_config_loglevel\" = \"silent\" ] || echo '๐Ÿงน Cleaned build directory')",
13
13
  "build:compile": "([ \"$npm_config_loglevel\" = \"silent\" ] || echo '๐Ÿ”จ Compiling TypeScript...') && tsc --noEmitOnError false",
14
- "build:copy": "([ \"$npm_config_loglevel\" = \"silent\" ] || echo '๐Ÿ“‹ Copying config files...') && cp -r src/config dist/ && cp package.json dist/ && ([ \"$npm_config_loglevel\" = \"silent\" ] || echo 'โœ… Build complete')",
14
+ "build:copy": "([ \"$npm_config_loglevel\" = \"silent\" ] || echo '๐Ÿ“‹ Copying config files...') && cp -r src/config dist/ && cp package.json dist/ && cp README.md dist/ && ([ \"$npm_config_loglevel\" = \"silent\" ] || echo 'โœ… Build complete')",
15
15
  "dev": "ts-node src/cli.ts",
16
16
  "start": "node dist/cli.js",
17
17
  "watch": "tsc --watch --pretty",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mycontext-cli",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "MyContext CLI - AI-powered full-stack application generator with complete architecture generation, server actions, Next.js 15 App Router, and self-documenting components",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {
@@ -11,7 +11,7 @@
11
11
  "build": "npm run build:clean && npm run build:compile && npm run build:copy",
12
12
  "build:clean": "rm -rf dist && ([ \"$npm_config_loglevel\" = \"silent\" ] || echo '๐Ÿงน Cleaned build directory')",
13
13
  "build:compile": "([ \"$npm_config_loglevel\" = \"silent\" ] || echo '๐Ÿ”จ Compiling TypeScript...') && tsc --noEmitOnError false",
14
- "build:copy": "([ \"$npm_config_loglevel\" = \"silent\" ] || echo '๐Ÿ“‹ Copying config files...') && cp -r src/config dist/ && cp package.json dist/ && ([ \"$npm_config_loglevel\" = \"silent\" ] || echo 'โœ… Build complete')",
14
+ "build:copy": "([ \"$npm_config_loglevel\" = \"silent\" ] || echo '๐Ÿ“‹ Copying config files...') && cp -r src/config dist/ && cp package.json dist/ && cp README.md dist/ && ([ \"$npm_config_loglevel\" = \"silent\" ] || echo 'โœ… Build complete')",
15
15
  "dev": "ts-node src/cli.ts",
16
16
  "start": "node dist/cli.js",
17
17
  "watch": "tsc --watch --pretty",