mycontext-cli 1.0.95 → 2.0.1
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/README.md +268 -295
- package/dist/agents/implementations/ClaudeAgentWorkflow.d.ts.map +1 -1
- package/dist/agents/implementations/ClaudeAgentWorkflow.js +38 -3
- package/dist/agents/implementations/ClaudeAgentWorkflow.js.map +1 -1
- package/dist/agents/implementations/WorkflowAgent.d.ts +8 -0
- package/dist/agents/implementations/WorkflowAgent.d.ts.map +1 -1
- package/dist/agents/implementations/WorkflowAgent.js +105 -11
- package/dist/agents/implementations/WorkflowAgent.js.map +1 -1
- package/dist/agents/interfaces/SubAgent.d.ts +5 -0
- package/dist/agents/interfaces/SubAgent.d.ts.map +1 -1
- package/dist/commands/build-app.d.ts +5 -0
- package/dist/commands/build-app.d.ts.map +1 -1
- package/dist/commands/build-app.js +127 -4
- package/dist/commands/build-app.js.map +1 -1
- package/dist/commands/compile-prd.d.ts.map +1 -1
- package/dist/commands/compile-prd.js +18 -54
- package/dist/commands/compile-prd.js.map +1 -1
- package/dist/commands/enhance.d.ts +21 -0
- package/dist/commands/enhance.d.ts.map +1 -1
- package/dist/commands/enhance.js +155 -12
- package/dist/commands/enhance.js.map +1 -1
- package/dist/commands/generate-components.d.ts +43 -0
- package/dist/commands/generate-components.d.ts.map +1 -1
- package/dist/commands/generate-components.js +270 -0
- package/dist/commands/generate-components.js.map +1 -1
- package/dist/constants/fileNames.d.ts +68 -0
- package/dist/constants/fileNames.d.ts.map +1 -0
- package/dist/constants/fileNames.js +102 -0
- package/dist/constants/fileNames.js.map +1 -0
- package/dist/interfaces/AIClient.d.ts +198 -0
- package/dist/interfaces/AIClient.d.ts.map +1 -0
- package/dist/interfaces/AIClient.js +40 -0
- package/dist/interfaces/AIClient.js.map +1 -0
- package/dist/package.json +4 -3
- package/dist/types/index.d.ts +423 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/agentDefinitions.d.ts +60 -0
- package/dist/utils/agentDefinitions.d.ts.map +1 -0
- package/dist/utils/agentDefinitions.js +344 -0
- package/dist/utils/agentDefinitions.js.map +1 -0
- package/dist/utils/aiClientFactory.d.ts +93 -0
- package/dist/utils/aiClientFactory.d.ts.map +1 -0
- package/dist/utils/aiClientFactory.js +290 -0
- package/dist/utils/aiClientFactory.js.map +1 -0
- package/dist/utils/aiClientRouter.d.ts +121 -0
- package/dist/utils/aiClientRouter.d.ts.map +1 -0
- package/dist/utils/aiClientRouter.js +401 -0
- package/dist/utils/aiClientRouter.js.map +1 -0
- package/dist/utils/buildValidator.d.ts +72 -0
- package/dist/utils/buildValidator.d.ts.map +1 -0
- package/dist/utils/buildValidator.js +338 -0
- package/dist/utils/buildValidator.js.map +1 -0
- package/dist/utils/claudeAgentClient.d.ts +79 -11
- package/dist/utils/claudeAgentClient.d.ts.map +1 -1
- package/dist/utils/claudeAgentClient.js +306 -1
- package/dist/utils/claudeAgentClient.js.map +1 -1
- package/dist/utils/claudeClient.d.ts +7 -3
- package/dist/utils/claudeClient.d.ts.map +1 -1
- package/dist/utils/claudeClient.js +28 -5
- package/dist/utils/claudeClient.js.map +1 -1
- package/dist/utils/completeArchitectureEngine.d.ts +67 -0
- package/dist/utils/completeArchitectureEngine.d.ts.map +1 -0
- package/dist/utils/completeArchitectureEngine.js +329 -0
- package/dist/utils/completeArchitectureEngine.js.map +1 -0
- package/dist/utils/contextLoader.d.ts +1 -12
- package/dist/utils/contextLoader.d.ts.map +1 -1
- package/dist/utils/contextLoader.js +29 -150
- package/dist/utils/contextLoader.js.map +1 -1
- package/dist/utils/contextManager.d.ts +2 -12
- package/dist/utils/contextManager.d.ts.map +1 -1
- package/dist/utils/contextManager.js +11 -6
- package/dist/utils/contextManager.js.map +1 -1
- package/dist/utils/mcpTools.d.ts +164 -0
- package/dist/utils/mcpTools.d.ts.map +1 -0
- package/dist/utils/mcpTools.js +385 -0
- package/dist/utils/mcpTools.js.map +1 -0
- package/dist/utils/progressTracker.d.ts +121 -0
- package/dist/utils/progressTracker.d.ts.map +1 -0
- package/dist/utils/progressTracker.js +334 -0
- package/dist/utils/progressTracker.js.map +1 -0
- package/dist/utils/routeGenerator.d.ts +56 -0
- package/dist/utils/routeGenerator.d.ts.map +1 -0
- package/dist/utils/routeGenerator.js +231 -0
- package/dist/utils/routeGenerator.js.map +1 -0
- package/dist/utils/serverActionGenerator.d.ts +56 -0
- package/dist/utils/serverActionGenerator.d.ts.map +1 -0
- package/dist/utils/serverActionGenerator.js +258 -0
- package/dist/utils/serverActionGenerator.js.map +1 -0
- package/dist/utils/streamingHandler.d.ts +98 -0
- package/dist/utils/streamingHandler.d.ts.map +1 -0
- package/dist/utils/streamingHandler.js +259 -0
- package/dist/utils/streamingHandler.js.map +1 -0
- package/dist/utils/validationGates.d.ts +58 -0
- package/dist/utils/validationGates.d.ts.map +1 -0
- package/dist/utils/validationGates.js +390 -0
- package/dist/utils/validationGates.js.map +1 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,415 +1,388 @@
|
|
|
1
1
|
# MyContext CLI
|
|
2
2
|
|
|
3
|
-
**🧠
|
|
3
|
+
**🧠 AI-Powered Full-Stack App Generation with Production-Ready Guarantees**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/mycontext-cli)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://nodejs.org)
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
Generate complete Next.js applications from natural language with **guaranteed zero linter/build errors** through AI-powered validation gates and automatic build checking.
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
npm install -g mycontext-cli
|
|
11
|
-
# or
|
|
12
|
-
pnpm add -g mycontext-cli
|
|
13
|
-
# or
|
|
14
|
-
yarn global add mycontext-cli
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Quick Start
|
|
11
|
+
## 🚀 Quick Start
|
|
18
12
|
|
|
19
13
|
```bash
|
|
20
|
-
#
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
# Set up AI provider (X.AI Grok recommended for best results)
|
|
24
|
-
echo 'MYCONTEXT_XAI_API_KEY=xai-xxx' > .mycontext/.env
|
|
25
|
-
|
|
26
|
-
# Generate context files (A/B/C/D workflow)
|
|
27
|
-
mycontext generate-context-files --description 'Modern todo app'
|
|
28
|
-
|
|
29
|
-
# Compile PRD from context files
|
|
30
|
-
mycontext compile-prd
|
|
14
|
+
# Install globally
|
|
15
|
+
npm install -g mycontext-cli
|
|
31
16
|
|
|
32
|
-
#
|
|
33
|
-
mycontext
|
|
17
|
+
# Build a complete app in one command
|
|
18
|
+
mycontext build-app --description "Your app idea" --interactive
|
|
34
19
|
```
|
|
35
20
|
|
|
36
|
-
##
|
|
21
|
+
## 💡 Philosophy: "LLM as Compiler"
|
|
37
22
|
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
- **🎯 Smart Planning**: Get personalized development approach recommendations
|
|
44
|
-
- **🔧 Developer-Friendly**: Built-in validation, testing, and preview capabilities
|
|
45
|
-
- **🆓 Free Tier**: Use Qwen3 Coder model for free testing, or premium X.AI/Claude for production
|
|
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
|
|
46
28
|
|
|
47
|
-
|
|
29
|
+
**Result:** Production-ready code with 0 errors guaranteed.
|
|
48
30
|
|
|
49
|
-
|
|
50
|
-
- **🔐 Fine-Grained Tool Permissions**: Granular control over AI capabilities with strict/permissive modes
|
|
51
|
-
- **🔌 MCP Integration**: Model Context Protocol support for external tools and services
|
|
52
|
-
- **⚡ Enhanced Workflows**: Intelligent agent coordination with automatic error handling and retry logic
|
|
53
|
-
- **🎯 Smart Fallbacks**: Seamless fallback to standard clients when Agent SDK isn't available
|
|
54
|
-
- **📊 Context Analytics**: Detailed context statistics and compression ratios
|
|
55
|
-
- **🛡️ Security Controls**: File size limits, directory restrictions, and tool validation
|
|
31
|
+
---
|
|
56
32
|
|
|
57
|
-
##
|
|
33
|
+
## 📖 Examples
|
|
58
34
|
|
|
59
|
-
###
|
|
35
|
+
### Tic-Tac-Toe Game
|
|
60
36
|
|
|
61
37
|
```bash
|
|
62
|
-
mycontext
|
|
63
|
-
|
|
64
|
-
|
|
38
|
+
mycontext build-app \
|
|
39
|
+
--description "Tic-tac-toe with AI opponent, score tracking, and responsive design" \
|
|
40
|
+
--interactive \
|
|
41
|
+
--with-tests
|
|
65
42
|
```
|
|
66
43
|
|
|
67
|
-
|
|
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
|
|
68
51
|
|
|
69
|
-
|
|
70
|
-
mycontext generate context # Generate PRD and context files
|
|
71
|
-
mycontext generate types # Generate TypeScript types
|
|
72
|
-
mycontext generate brand # Generate branding guidelines
|
|
73
|
-
mycontext generate components-list # Generate component list
|
|
74
|
-
mycontext compile-prd # Compile PRD from context files
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### Component Development
|
|
52
|
+
### E-Commerce Platform
|
|
78
53
|
|
|
79
54
|
```bash
|
|
80
|
-
mycontext
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
55
|
+
mycontext build-app \
|
|
56
|
+
--description "E-commerce with product catalog, shopping cart, checkout, and admin dashboard" \
|
|
57
|
+
--interactive \
|
|
58
|
+
--complete-architecture
|
|
84
59
|
```
|
|
85
60
|
|
|
86
|
-
|
|
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
|
|
87
69
|
|
|
88
|
-
|
|
89
|
-
mycontext validate <target> # Validate PRD or files
|
|
90
|
-
mycontext status # Check project status
|
|
91
|
-
mycontext list [type] # List components, projects, or files
|
|
92
|
-
mycontext promote # Promote components to production
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### Build Strategy Planning
|
|
70
|
+
### Todo App with Auth
|
|
96
71
|
|
|
97
72
|
```bash
|
|
98
|
-
mycontext build-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
mycontext build-strategy --compare # Compare all available strategies
|
|
103
|
-
mycontext build-strategy --context # Show loaded project context
|
|
104
|
-
mycontext build-strategy --list # List all saved strategy files
|
|
105
|
-
mycontext build-strategy --load <type> # Load saved strategy data
|
|
73
|
+
mycontext build-app \
|
|
74
|
+
--description "Todo app with user auth, categories, due dates, and dark mode" \
|
|
75
|
+
--interactive \
|
|
76
|
+
--with-tests
|
|
106
77
|
```
|
|
107
78
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
MyContext's **AI-Powered Build Strategy** feature helps you choose the right development approach for your project through interactive questions and AI-generated recommendations.
|
|
111
|
-
|
|
112
|
-
### How It Works
|
|
79
|
+
---
|
|
113
80
|
|
|
114
|
-
|
|
115
|
-
2. **AI Processing**: Uses AI to analyze your answers and project context
|
|
116
|
-
3. **Strategic Recommendations**: Generates personalized development strategies
|
|
117
|
-
4. **Strategy Comparison**: Shows different approaches with pros/cons and timelines
|
|
81
|
+
## 🎯 Features
|
|
118
82
|
|
|
119
|
-
###
|
|
83
|
+
### ✅ 230-Step Validated Workflow
|
|
120
84
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
|
126
98
|
|
|
127
|
-
###
|
|
99
|
+
### 🔨 Automatic Build Validation
|
|
128
100
|
|
|
129
|
-
|
|
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`)
|
|
130
106
|
|
|
131
|
-
|
|
132
|
-
- **Complexity Assessment**: Simple, medium, or complex application classification
|
|
133
|
-
- **Timeline Planning**: Urgent, moderate, or flexible development timelines
|
|
134
|
-
- **Team Size Consideration**: Solo developer, small team, or large team approaches
|
|
135
|
-
- **AI Recommendations**: Personalized strategy suggestions based on your answers
|
|
107
|
+
**Failed components retry automatically** with error context (max 3 attempts).
|
|
136
108
|
|
|
137
|
-
###
|
|
109
|
+
### 📊 Real-Time Progress Tracking
|
|
138
110
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
MVP Development
|
|
149
|
-
Enterprise Application
|
|
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
|
+
```
|
|
150
120
|
|
|
151
|
-
|
|
152
|
-
❯ Simple (few features, single user type)
|
|
153
|
-
Medium (multiple features, some complexity)
|
|
154
|
-
Complex (many features, multiple user types)
|
|
121
|
+
**Perfect for VS Code extensions & dashboards.**
|
|
155
122
|
|
|
156
|
-
|
|
157
|
-
❯ Urgent (need demo ASAP)
|
|
158
|
-
Moderate (balanced approach)
|
|
159
|
-
Flexible (quality over speed)
|
|
123
|
+
### 🏗️ Complete Architecture Generation
|
|
160
124
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
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
|
|
165
130
|
|
|
166
|
-
|
|
131
|
+
---
|
|
167
132
|
|
|
168
|
-
|
|
169
|
-
Build complete user journeys end-to-end
|
|
170
|
-
Time to first demo: 2-3 weeks
|
|
171
|
-
Complexity: medium
|
|
133
|
+
## 📋 Commands
|
|
172
134
|
|
|
173
|
-
|
|
174
|
-
Vertical slice approach recommended for balanced development with quick user value
|
|
135
|
+
### Build Complete App (Recommended)
|
|
175
136
|
|
|
176
|
-
|
|
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
|
|
177
148
|
```
|
|
178
149
|
|
|
179
|
-
###
|
|
180
|
-
|
|
181
|
-
All generated strategies are automatically saved as JSON files in `.mycontext/` for easy access and project tracking:
|
|
150
|
+
### Step-by-Step Workflow
|
|
182
151
|
|
|
183
152
|
```bash
|
|
184
|
-
#
|
|
185
|
-
mycontext
|
|
186
|
-
|
|
187
|
-
# Load specific strategy data
|
|
188
|
-
mycontext build-strategy --load recommendations
|
|
189
|
-
mycontext build-strategy --load plan
|
|
190
|
-
mycontext build-strategy --load tasks
|
|
191
|
-
mycontext build-strategy --load comparison
|
|
192
|
-
```
|
|
153
|
+
# 1. Initialize project
|
|
154
|
+
mycontext init my-app
|
|
193
155
|
|
|
194
|
-
|
|
156
|
+
# 2. Generate context files (with validation gates)
|
|
157
|
+
mycontext generate-context-files --description "Your app"
|
|
195
158
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
├── build-strategy-recommendations-2025-09-23.json
|
|
199
|
-
├── build-strategy-plan-2025-09-23.json
|
|
200
|
-
├── build-strategy-tasks-2025-09-23.json
|
|
201
|
-
└── build-strategy-comparison-2025-09-23.json
|
|
202
|
-
```
|
|
159
|
+
# 3. Compile PRD (requires approval)
|
|
160
|
+
mycontext compile-prd
|
|
203
161
|
|
|
204
|
-
|
|
162
|
+
# 4. Generate components (with build validation)
|
|
163
|
+
mycontext generate-components all --with-tests
|
|
164
|
+
```
|
|
205
165
|
|
|
206
|
-
|
|
166
|
+
### Other Commands
|
|
207
167
|
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
"recommended": [...],
|
|
215
|
-
"reasoning": "...",
|
|
216
|
-
"alternatives": [...]
|
|
217
|
-
}
|
|
218
|
-
}
|
|
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
|
|
219
174
|
```
|
|
220
175
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
### AI Providers
|
|
176
|
+
---
|
|
224
177
|
|
|
225
|
-
|
|
178
|
+
## ⚙️ Configuration
|
|
226
179
|
|
|
227
|
-
|
|
180
|
+
### API Keys (BYOK Model)
|
|
228
181
|
|
|
229
|
-
|
|
182
|
+
MyContext uses **your own API keys** - no billing from us.
|
|
230
183
|
|
|
231
|
-
|
|
232
|
-
echo 'MYCONTEXT_CLAUDE_API_KEY=sk-ant-xxx' > .mycontext/.env
|
|
233
|
-
```
|
|
184
|
+
**Recommended providers:**
|
|
234
185
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
- MCP (Model Context Protocol) integration
|
|
239
|
-
- Intelligent agent coordination
|
|
240
|
-
- Automatic error handling and retry logic
|
|
186
|
+
```bash
|
|
187
|
+
# Claude (best for complex reasoning)
|
|
188
|
+
echo 'MYCONTEXT_CLAUDE_API_KEY=sk-ant-xxx' > .mycontext/.env
|
|
241
189
|
|
|
242
|
-
|
|
190
|
+
# X.AI Grok (best for code generation)
|
|
191
|
+
echo 'MYCONTEXT_XAI_API_KEY=xai-xxx' > .mycontext/.env
|
|
243
192
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
193
|
+
# OpenAI (most versatile)
|
|
194
|
+
echo 'MYCONTEXT_OPENAI_API_KEY=sk-xxx' > .mycontext/.env
|
|
195
|
+
```
|
|
247
196
|
|
|
248
|
-
|
|
197
|
+
**Free tier:**
|
|
249
198
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
199
|
+
```bash
|
|
200
|
+
# Qwen3 (free via OpenRouter)
|
|
201
|
+
echo 'MYCONTEXT_QWEN_API_KEY=sk-or-xxx' > .mycontext/.env
|
|
202
|
+
```
|
|
253
203
|
|
|
254
|
-
|
|
255
|
-
```bash
|
|
256
|
-
echo 'MYCONTEXT_OPENAI_API_KEY=sk-xxx' > .mycontext/.env
|
|
257
|
-
```
|
|
204
|
+
### Project Structure
|
|
258
205
|
|
|
259
|
-
|
|
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
|
+
```
|
|
260
226
|
|
|
261
|
-
|
|
227
|
+
---
|
|
262
228
|
|
|
263
|
-
|
|
264
|
-
echo 'MYCONTEXT_QWEN_API_KEY=sk-or-xxx' > .mycontext/.env
|
|
265
|
-
```
|
|
229
|
+
## 🎓 How It Works
|
|
266
230
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
echo 'MYCONTEXT_GITHUB_TOKEN=ghp_xxx' > .mycontext/.env
|
|
270
|
-
```
|
|
231
|
+
### 1. Context Generation
|
|
232
|
+
AI generates detailed context files based on your description. **You approve each one.**
|
|
271
233
|
|
|
272
|
-
###
|
|
234
|
+
### 2. PRD Compilation
|
|
235
|
+
Context files are compiled into a comprehensive PRD. **You must read and approve.**
|
|
273
236
|
|
|
237
|
+
### 3. Component Generation
|
|
238
|
+
Components are generated from PRD. **Each component automatically validated:**
|
|
274
239
|
```
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
├── components/ # Generated components
|
|
282
|
-
└── package.json
|
|
240
|
+
🔨 Generating: LoginForm
|
|
241
|
+
✅ Code Generated
|
|
242
|
+
✅ TypeScript Check Passed
|
|
243
|
+
✅ ESLint Passed
|
|
244
|
+
✅ Build Passed
|
|
245
|
+
✅ Tests Passed
|
|
283
246
|
```
|
|
284
247
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
### Create a Todo App
|
|
288
|
-
|
|
289
|
-
```bash
|
|
290
|
-
mycontext init todo-app --description "A modern todo application with dark mode"
|
|
291
|
-
cd todo-app
|
|
292
|
-
mycontext generate-context-files
|
|
293
|
-
mycontext compile-prd
|
|
294
|
-
mycontext generate-components all --with-tests
|
|
248
|
+
### 4. Error Recovery
|
|
249
|
+
Failed components retry with error context:
|
|
295
250
|
```
|
|
251
|
+
❌ TypeScript check failed (3 errors)
|
|
252
|
+
- LoginForm.tsx:12:5 - TS2322: Type 'string' not assignable to 'number'
|
|
296
253
|
|
|
297
|
-
|
|
254
|
+
🔄 Retry 1/3 (with error context)
|
|
255
|
+
✅ Fixed and validated
|
|
256
|
+
```
|
|
298
257
|
|
|
258
|
+
### 5. Production Deploy
|
|
299
259
|
```bash
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
260
|
+
cd my-app
|
|
261
|
+
npm run build # ✅ Zero errors guaranteed
|
|
262
|
+
vercel deploy # 🚀 Deploy
|
|
303
263
|
```
|
|
304
264
|
|
|
305
|
-
|
|
265
|
+
---
|
|
306
266
|
|
|
307
|
-
|
|
308
|
-
mycontext build-app --description "E-commerce platform" --interactive
|
|
309
|
-
```
|
|
267
|
+
## 🔧 Advanced Usage
|
|
310
268
|
|
|
311
|
-
###
|
|
269
|
+
### Build Strategy Selection
|
|
312
270
|
|
|
313
271
|
```bash
|
|
314
|
-
# Get AI-powered strategy recommendations
|
|
315
272
|
mycontext build-strategy --recommend
|
|
316
273
|
|
|
317
|
-
#
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
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)
|
|
322
279
|
|
|
323
|
-
#
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
# Show project context analysis
|
|
327
|
-
mycontext build-strategy --context
|
|
280
|
+
# Recommends best approach:
|
|
281
|
+
🎯 Vertical Slice - Build complete features end-to-end
|
|
282
|
+
⏰ Time to first demo: 2-3 weeks
|
|
328
283
|
```
|
|
329
284
|
|
|
330
|
-
|
|
285
|
+
### Complete Architecture
|
|
331
286
|
|
|
332
|
-
|
|
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
|
+
```
|
|
333
300
|
|
|
334
|
-
|
|
301
|
+
### Existing Project Migration
|
|
335
302
|
|
|
336
303
|
```bash
|
|
337
|
-
#
|
|
338
|
-
mycontext
|
|
304
|
+
mycontext analyze # Analyze existing project
|
|
305
|
+
mycontext migrate --all # Migrate to MyContext structure
|
|
339
306
|
```
|
|
340
307
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
- **Automatic Compaction**: Context is compressed when it exceeds size limits
|
|
344
|
-
- **Smart Preservation**: Recent outputs and important data are preserved
|
|
345
|
-
- **Context Analytics**: Detailed statistics on context size and compression ratios
|
|
346
|
-
- **Memory Management**: Persistent context storage across sessions
|
|
308
|
+
---
|
|
347
309
|
|
|
348
|
-
|
|
310
|
+
## 📊 Build Metrics
|
|
349
311
|
|
|
350
|
-
|
|
312
|
+
After successful build:
|
|
351
313
|
|
|
352
|
-
```
|
|
353
|
-
|
|
354
|
-
|
|
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
|
|
355
328
|
```
|
|
356
329
|
|
|
357
|
-
**
|
|
358
|
-
|
|
359
|
-
- **Strict**: Deny by default, require explicit permission
|
|
360
|
-
- **Permissive**: Allow by default, block specific tools
|
|
361
|
-
- **Custom**: Fine-grained control over individual tools
|
|
330
|
+
**Zero failures = Production-ready**
|
|
362
331
|
|
|
363
|
-
|
|
332
|
+
---
|
|
364
333
|
|
|
365
|
-
|
|
366
|
-
- Directory access controls
|
|
367
|
-
- API call rate limiting
|
|
368
|
-
- Tool validation and restrictions
|
|
334
|
+
## 🆚 MyContext vs Others
|
|
369
335
|
|
|
370
|
-
|
|
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 |
|
|
371
345
|
|
|
372
|
-
|
|
346
|
+
---
|
|
373
347
|
|
|
374
|
-
|
|
375
|
-
# Set up MCP integration
|
|
376
|
-
mycontext setup-mcp --provider instantdb
|
|
377
|
-
```
|
|
348
|
+
## 📚 Documentation
|
|
378
349
|
|
|
379
|
-
|
|
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
|
|
380
353
|
|
|
381
|
-
|
|
382
|
-
- **GitHub**: Repository and issue management
|
|
383
|
-
- **Custom**: Your own MCP servers
|
|
354
|
+
---
|
|
384
355
|
|
|
385
|
-
|
|
356
|
+
## 🐛 Troubleshooting
|
|
386
357
|
|
|
387
|
-
|
|
358
|
+
**"PRD Validation Failed"**
|
|
359
|
+
```bash
|
|
360
|
+
# Provide feedback and regenerate
|
|
361
|
+
mycontext compile-prd --force
|
|
362
|
+
```
|
|
388
363
|
|
|
364
|
+
**"Component Build Failed"**
|
|
389
365
|
```bash
|
|
390
|
-
#
|
|
391
|
-
mycontext
|
|
366
|
+
# Automatic retry with error context (max 3 attempts)
|
|
367
|
+
# Check .mycontext/progress/07-components/<component>.json
|
|
392
368
|
```
|
|
393
369
|
|
|
394
|
-
**
|
|
370
|
+
**"Progress Not Tracking"**
|
|
371
|
+
```bash
|
|
372
|
+
# Verify progress directory exists
|
|
373
|
+
ls -la .mycontext/progress/
|
|
374
|
+
```
|
|
395
375
|
|
|
396
|
-
|
|
397
|
-
- **Error Recovery**: Automatic retry logic with exponential backoff
|
|
398
|
-
- **Context Awareness**: Each step builds on previous context
|
|
399
|
-
- **Progress Tracking**: Detailed progress reporting and analytics
|
|
376
|
+
---
|
|
400
377
|
|
|
401
|
-
##
|
|
378
|
+
## 🤝 Contributing
|
|
402
379
|
|
|
403
|
-
|
|
404
|
-
- [API Reference](https://mycontext.fbien.com/docs/api)
|
|
405
|
-
- [Examples](https://mycontext.fbien.com/docs/examples)
|
|
380
|
+
See [CONTRIBUTING.md](https://github.com/farajabien/mycontext-monorepo/blob/main/CONTRIBUTING.md)
|
|
406
381
|
|
|
407
|
-
##
|
|
382
|
+
## 📄 License
|
|
408
383
|
|
|
409
|
-
|
|
410
|
-
- [Discord Community](https://discord.gg/mycontext)
|
|
411
|
-
- [Documentation](https://mycontext.fbien.com/docs)
|
|
384
|
+
MIT © MyContext
|
|
412
385
|
|
|
413
|
-
|
|
386
|
+
---
|
|
414
387
|
|
|
415
|
-
|
|
388
|
+
**Built by developers, for developers. Your code stays on your machine.** 🚀
|