mycontext-cli 1.0.94 → 2.0.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.
- package/README.md +446 -130
- package/dist/agents/implementations/ClaudeAgentWorkflow.d.ts +110 -0
- package/dist/agents/implementations/ClaudeAgentWorkflow.d.ts.map +1 -0
- package/dist/agents/implementations/ClaudeAgentWorkflow.js +590 -0
- package/dist/agents/implementations/ClaudeAgentWorkflow.js.map +1 -0
- package/dist/agents/implementations/WorkflowAgent.d.ts +5 -0
- package/dist/agents/implementations/WorkflowAgent.d.ts.map +1 -1
- package/dist/agents/implementations/WorkflowAgent.js +98 -10
- 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 +5 -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/claudeAgentClient.d.ts +166 -0
- package/dist/utils/claudeAgentClient.d.ts.map +1 -0
- package/dist/utils/claudeAgentClient.js +714 -0
- package/dist/utils/claudeAgentClient.js.map +1 -0
- 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 +76 -0
- package/dist/utils/contextManager.d.ts.map +1 -0
- package/dist/utils/contextManager.js +327 -0
- package/dist/utils/contextManager.js.map +1 -0
- package/dist/utils/hybridAIClient.d.ts +25 -1
- package/dist/utils/hybridAIClient.d.ts.map +1 -1
- package/dist/utils/hybridAIClient.js +69 -2
- package/dist/utils/hybridAIClient.js.map +1 -1
- package/dist/utils/mcpAgentIntegration.d.ts +104 -0
- package/dist/utils/mcpAgentIntegration.d.ts.map +1 -0
- package/dist/utils/mcpAgentIntegration.js +382 -0
- package/dist/utils/mcpAgentIntegration.js.map +1 -0
- 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/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/toolPermissions.d.ts +105 -0
- package/dist/utils/toolPermissions.d.ts.map +1 -0
- package/dist/utils/toolPermissions.js +408 -0
- package/dist/utils/toolPermissions.js.map +1 -0
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
**🧠 The AI That Actually Understands Your Project**
|
|
4
4
|
|
|
5
|
-
AI-powered tool that generates production-ready
|
|
5
|
+
AI-powered tool that generates production-ready full-stack applications through an advanced agent-driven workflow that deeply understands your project context.
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/mycontext-cli)
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
9
|
+
[](https://nodejs.org)
|
|
6
10
|
|
|
7
11
|
## Installation
|
|
8
12
|
|
|
@@ -14,7 +18,7 @@ pnpm add -g mycontext-cli
|
|
|
14
18
|
yarn global add mycontext-cli
|
|
15
19
|
```
|
|
16
20
|
|
|
17
|
-
## Quick Start
|
|
21
|
+
## ⚡ Quick Start
|
|
18
22
|
|
|
19
23
|
```bash
|
|
20
24
|
# Initialize a new project
|
|
@@ -24,34 +28,290 @@ mycontext init my-project
|
|
|
24
28
|
echo 'MYCONTEXT_XAI_API_KEY=xai-xxx' > .mycontext/.env
|
|
25
29
|
|
|
26
30
|
# Generate context files (A/B/C/D workflow)
|
|
27
|
-
mycontext generate-context-files --description 'Modern
|
|
31
|
+
mycontext generate-context-files --description 'Modern e-commerce app'
|
|
28
32
|
|
|
29
33
|
# Compile PRD from context files
|
|
30
34
|
mycontext compile-prd
|
|
31
35
|
|
|
32
|
-
# Generate
|
|
33
|
-
mycontext generate-components all --
|
|
36
|
+
# 🆕 Generate complete full-stack architecture (NEW!)
|
|
37
|
+
mycontext generate-components all --complete-architecture
|
|
38
|
+
|
|
39
|
+
# Or use build-app for complete workflow
|
|
40
|
+
mycontext build-app --description "E-commerce platform" --complete-architecture
|
|
34
41
|
```
|
|
35
42
|
|
|
36
|
-
## Features
|
|
43
|
+
## ✨ Features
|
|
44
|
+
|
|
45
|
+
### 🎯 Complete Architecture Generation (NEW!)
|
|
46
|
+
|
|
47
|
+
Generate production-ready full-stack applications with **a single command**:
|
|
48
|
+
|
|
49
|
+
- **🏗️ Server Actions** - Next.js server actions with validation, middleware, and caching
|
|
50
|
+
- **🛣️ App Router Routes** - Complete Next.js 15 App Router structure with layouts
|
|
51
|
+
- **📚 Self-Documenting Components** - Components with comprehensive inline documentation
|
|
52
|
+
- **📋 Architecture Plans** - Complete project architecture specification
|
|
53
|
+
- **🔒 Type-Safe Throughout** - Full TypeScript support across the stack
|
|
54
|
+
|
|
55
|
+
### Core Features
|
|
37
56
|
|
|
38
57
|
- **🤖 AI-Powered Generation**: Uses advanced AI models to understand your project context
|
|
39
|
-
- **⚡ Fast Setup**: Initialize projects in seconds with Next.js, TypeScript, and Tailwind CSS
|
|
58
|
+
- **⚡ Fast Setup**: Initialize projects in seconds with Next.js 15, TypeScript, and Tailwind CSS
|
|
40
59
|
- **🎨 Component Generation**: Create production-ready React components with Shadcn UI
|
|
41
60
|
- **📋 Context-Aware**: Generates PRDs, types, and branding based on your project
|
|
42
|
-
- **🧠 Interactive Strategy Planning**: AI-powered build strategy recommendations
|
|
61
|
+
- **🧠 Interactive Strategy Planning**: AI-powered build strategy recommendations
|
|
43
62
|
- **🎯 Smart Planning**: Get personalized development approach recommendations
|
|
44
63
|
- **🔧 Developer-Friendly**: Built-in validation, testing, and preview capabilities
|
|
45
64
|
- **🆓 Free Tier**: Use Qwen3 Coder model for free testing, or premium X.AI/Claude for production
|
|
46
65
|
|
|
47
|
-
|
|
66
|
+
### 🚀 Claude Agent SDK Integration (v2.0.0) 🆕
|
|
67
|
+
|
|
68
|
+
MyContext v2.0 features **complete Claude Agent SDK integration** with intelligent routing and specialized AI agents:
|
|
69
|
+
|
|
70
|
+
#### **8 Specialized AI Agents**
|
|
71
|
+
|
|
72
|
+
Each agent is pre-configured with specific expertise, tools, and system prompts:
|
|
73
|
+
|
|
74
|
+
1. **🎨 Component Generator** - Production-ready React components
|
|
75
|
+
- Tools: `Read`, `Write`, `Glob`, `AnalyzeComponent`
|
|
76
|
+
- Expert in: Next.js 15, TypeScript, Shadcn UI, Tailwind CSS
|
|
77
|
+
|
|
78
|
+
2. **🔍 Code Reviewer** - Quality analysis and best practices
|
|
79
|
+
- Tools: `Read`, `Grep`, `Glob`, `AnalyzeComponent`, `CheckTypes`
|
|
80
|
+
- Expert in: SOLID principles, performance, security, testing
|
|
81
|
+
|
|
82
|
+
3. **📚 Documentation Writer** - Comprehensive docs generation
|
|
83
|
+
- Tools: `Read`, `Write`, `Glob`, `GenerateDocs`, `AnalyzeComponent`
|
|
84
|
+
- Expert in: API docs, component guides, architecture overviews
|
|
85
|
+
|
|
86
|
+
4. **🧪 Testing Agent** - Unit and integration tests
|
|
87
|
+
- Tools: `Read`, `Write`, `Glob`, `AnalyzeComponent`
|
|
88
|
+
- Expert in: Jest, React Testing Library, E2E testing
|
|
89
|
+
|
|
90
|
+
5. **🏗️ Architecture Designer** - System design and structure
|
|
91
|
+
- Tools: `Read`, `Glob`, `Grep`, `ValidatePRD`
|
|
92
|
+
- Expert in: Scalability, folder structure, data flow, API design
|
|
93
|
+
|
|
94
|
+
6. **🔒 Security Auditor** - Vulnerability detection
|
|
95
|
+
- Tools: `Read`, `Grep`, `Glob`
|
|
96
|
+
- Expert in: XSS, CSRF, SQL injection, authentication, authorization
|
|
97
|
+
|
|
98
|
+
7. **♻️ Refactoring Specialist** - Code quality improvements
|
|
99
|
+
- Tools: `Read`, `Write`, `Edit`, `AnalyzeComponent`
|
|
100
|
+
- Expert in: Clean code, design patterns, performance optimization
|
|
101
|
+
|
|
102
|
+
8. **⚡ Performance Optimizer** - Speed and efficiency
|
|
103
|
+
- Tools: `Read`, `Glob`, `Grep`, `AnalyzeComponent`
|
|
104
|
+
- Expert in: React performance, Core Web Vitals, bundle optimization
|
|
105
|
+
|
|
106
|
+
#### **4 Custom MCP Tools**
|
|
107
|
+
|
|
108
|
+
1. **AnalyzeComponent** - Deep component structure analysis
|
|
109
|
+
- Analyzes: Imports, hooks, props, TypeScript types, dependencies
|
|
110
|
+
- Returns: Detailed component report with insights
|
|
111
|
+
|
|
112
|
+
2. **ValidatePRD** - PRD completeness checker
|
|
113
|
+
- Checks: Required sections, content length, code examples
|
|
114
|
+
- Returns: Quality score (0-100) with recommendations
|
|
115
|
+
|
|
116
|
+
3. **CheckTypes** - TypeScript validation
|
|
117
|
+
- Validates: Type safety, `any` usage, prop types
|
|
118
|
+
- Returns: Type issues and suggestions
|
|
119
|
+
|
|
120
|
+
4. **GenerateDocs** - Auto-documentation generator
|
|
121
|
+
- Generates: Component docs with props, usage, dependencies
|
|
122
|
+
- Returns: Markdown documentation
|
|
123
|
+
|
|
124
|
+
#### **Intelligent Routing**
|
|
125
|
+
|
|
126
|
+
MyContext automatically chooses between **Agent SDK** and **Direct API** based on operation complexity:
|
|
127
|
+
|
|
128
|
+
| Operation Type | Client Used | Why |
|
|
129
|
+
|----------------|-------------|-----|
|
|
130
|
+
| `build-app` | **Agent SDK** | Complex workflow + Tools + Streaming |
|
|
131
|
+
| `generate-components` | **Agent SDK** | File operations + Context management |
|
|
132
|
+
| `enhance <file>` | **Agent SDK** | Refactoring agent + File R/W |
|
|
133
|
+
| `agent-flow` | **Agent SDK** | Multi-step workflow orchestration |
|
|
134
|
+
| Simple text gen | **Direct API** | Fast, single-shot operations |
|
|
135
|
+
|
|
136
|
+
#### **Core Features**
|
|
137
|
+
|
|
138
|
+
- **🧠 Advanced Context Management**: Automatic compaction and intelligent memory
|
|
139
|
+
- **🔐 Fine-Grained Tool Permissions**: Granular control over AI capabilities
|
|
140
|
+
- **🔌 MCP Integration**: Model Context Protocol for custom tools
|
|
141
|
+
- **⚡ Enhanced Workflows**: Intelligent agent coordination with error handling
|
|
142
|
+
- **🎯 Smart Fallbacks**: Seamless fallback to standard clients
|
|
143
|
+
- **📊 Real-Time Progress**: Streaming updates with token tracking
|
|
144
|
+
- **🪝 Hook System**: Lifecycle events (PreToolUse, PostToolUse, SessionStart)
|
|
145
|
+
- **📈 Performance Tracking**: Operation statistics and metrics
|
|
146
|
+
|
|
147
|
+
#### **Usage Examples**
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# Use specific agent
|
|
151
|
+
mycontext enhance Button.tsx --prompt "Add dark mode support"
|
|
152
|
+
# → Uses Refactoring Agent automatically
|
|
153
|
+
|
|
154
|
+
# Component generation with analysis
|
|
155
|
+
mycontext generate-components ProductCard
|
|
156
|
+
# → Uses Component Generator + AnalyzeComponent tool
|
|
157
|
+
|
|
158
|
+
# Security audit
|
|
159
|
+
mycontext audit auth/ --agent security
|
|
160
|
+
# → Uses Security Agent with Read/Grep tools
|
|
161
|
+
|
|
162
|
+
# Generate tests
|
|
163
|
+
mycontext generate test LoginForm.tsx --agent testing
|
|
164
|
+
# → Uses Testing Agent with component analysis
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
#### **How It Works**
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
// MyContext analyzes your operation
|
|
171
|
+
const operation = {
|
|
172
|
+
type: 'enhance',
|
|
173
|
+
target: 'Button.tsx',
|
|
174
|
+
complexity: 'moderate',
|
|
175
|
+
requiresTools: true, // Needs Read/Write
|
|
176
|
+
requiresStreaming: false
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
// Router intelligently selects client
|
|
180
|
+
if (complexity === 'complex' || requiresTools) {
|
|
181
|
+
→ Use Agent SDK with appropriate agent
|
|
182
|
+
} else {
|
|
183
|
+
→ Use Direct API for speed
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Agent SDK handles the rest
|
|
187
|
+
- Loads refactoring agent
|
|
188
|
+
- Grants Read/Write/Edit permissions
|
|
189
|
+
- Streams progress in real-time
|
|
190
|
+
- Validates output with CheckTypes
|
|
191
|
+
- Returns enhanced component
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## 🎯 Complete Architecture Generation
|
|
195
|
+
|
|
196
|
+
### What Gets Generated
|
|
197
|
+
|
|
198
|
+
When using `--complete-architecture`, MyContext generates a **production-ready full-stack application**:
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
project/
|
|
202
|
+
├── .mycontext/
|
|
203
|
+
│ └── architecture-plan.json # Complete architecture specification
|
|
204
|
+
├── components/
|
|
205
|
+
│ └── .mycontext/
|
|
206
|
+
│ ├── ProductCatalog/
|
|
207
|
+
│ │ └── ProductCatalog.tsx # Self-documenting components
|
|
208
|
+
│ ├── ProductGrid/
|
|
209
|
+
│ └── ProductCard/
|
|
210
|
+
├── actions/
|
|
211
|
+
│ ├── productCatalogActions.ts # Server actions with validation
|
|
212
|
+
│ ├── productGridActions.ts
|
|
213
|
+
│ └── productCardActions.ts
|
|
214
|
+
└── app/
|
|
215
|
+
├── page.tsx # Next.js 15 App Router
|
|
216
|
+
├── layout.tsx
|
|
217
|
+
├── products/
|
|
218
|
+
│ ├── page.tsx
|
|
219
|
+
│ ├── layout.tsx
|
|
220
|
+
│ ├── new/
|
|
221
|
+
│ │ └── page.tsx # Create forms
|
|
222
|
+
│ └── [id]/
|
|
223
|
+
│ ├── page.tsx # Dynamic routes
|
|
224
|
+
│ └── edit/
|
|
225
|
+
│ └── page.tsx # Edit forms
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Usage
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
# Generate complete architecture with specific type
|
|
232
|
+
mycontext generate-components all --complete-architecture --architecture-type nextjs-app-router
|
|
233
|
+
|
|
234
|
+
# Only generate server actions
|
|
235
|
+
mycontext generate-components all --server-actions
|
|
236
|
+
|
|
237
|
+
# Only generate routes
|
|
238
|
+
mycontext generate-components all --routes
|
|
239
|
+
|
|
240
|
+
# Use build-app for complete workflow with interactive prompts
|
|
241
|
+
mycontext build-app --description "E-commerce platform" --interactive --complete-architecture
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Architecture Types
|
|
245
|
+
|
|
246
|
+
- **nextjs-app-router** (default) - Next.js 15 App Router with React Server Components
|
|
247
|
+
- **nextjs-pages** - Next.js Pages Router for compatibility
|
|
248
|
+
- **react-spa** - React Single Page Application
|
|
249
|
+
|
|
250
|
+
### Self-Documenting Components
|
|
251
|
+
|
|
252
|
+
Every generated component includes comprehensive documentation:
|
|
253
|
+
|
|
254
|
+
```typescript
|
|
255
|
+
/**
|
|
256
|
+
* Component: ProductCard
|
|
257
|
+
* Level: 3 (Atomic Component)
|
|
258
|
+
* Type: display
|
|
259
|
+
*
|
|
260
|
+
* Dependencies:
|
|
261
|
+
* - ProductGrid (parent)
|
|
262
|
+
* - ProductCatalog (ancestor)
|
|
263
|
+
*
|
|
264
|
+
* Server Actions:
|
|
265
|
+
* - getProduct: Fetch single product by ID
|
|
266
|
+
*
|
|
267
|
+
* Purpose: Display individual product information in a card format
|
|
268
|
+
*
|
|
269
|
+
* User Expectations:
|
|
270
|
+
* - Users expect clear product images, titles, and prices
|
|
271
|
+
* - Users expect to be able to click to view product details
|
|
272
|
+
* - Users expect loading states while data fetches
|
|
273
|
+
*
|
|
274
|
+
* Data Flow:
|
|
275
|
+
* ProductGrid → ProductCard (product data)
|
|
276
|
+
* ProductCard → getProduct (server action)
|
|
277
|
+
* getProduct → Database.products (Product)
|
|
278
|
+
*/
|
|
279
|
+
export function ProductCard({ product }: ProductCardProps) {
|
|
280
|
+
// Component implementation
|
|
281
|
+
}
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
## 📚 Commands
|
|
48
285
|
|
|
49
286
|
### Project Setup
|
|
50
287
|
|
|
51
288
|
```bash
|
|
52
289
|
mycontext init <project-name> # Initialize new project
|
|
290
|
+
mycontext init . --analyze # Analyze existing project
|
|
53
291
|
mycontext setup # Configure AI providers
|
|
54
|
-
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### 🆕 Complete App Building (Enhanced)
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
# Basic build
|
|
298
|
+
mycontext build-app --description "E-commerce platform"
|
|
299
|
+
|
|
300
|
+
# 🆕 Complete architecture build (NEW!)
|
|
301
|
+
mycontext build-app --description "E-commerce platform" --complete-architecture
|
|
302
|
+
|
|
303
|
+
# 🆕 Interactive mode with prompts (NEW!)
|
|
304
|
+
mycontext build-app --description "E-commerce platform" --interactive
|
|
305
|
+
|
|
306
|
+
# 🆕 Specific architecture type (NEW!)
|
|
307
|
+
mycontext build-app --description "Blog" --complete-architecture --architecture-type nextjs-pages
|
|
308
|
+
|
|
309
|
+
# Options:
|
|
310
|
+
# --complete-architecture Generate with actions, routes, full docs
|
|
311
|
+
# --architecture-type nextjs-app-router | nextjs-pages | react-spa
|
|
312
|
+
# --server-actions Generate server actions (default: true)
|
|
313
|
+
# --routes Generate Next.js routes (default: true)
|
|
314
|
+
# --interactive Interactive mode with guided prompts
|
|
55
315
|
```
|
|
56
316
|
|
|
57
317
|
### Context Generation
|
|
@@ -64,10 +324,25 @@ mycontext generate components-list # Generate component list
|
|
|
64
324
|
mycontext compile-prd # Compile PRD from context files
|
|
65
325
|
```
|
|
66
326
|
|
|
67
|
-
### Component Development
|
|
327
|
+
### 🆕 Component Development (Enhanced)
|
|
68
328
|
|
|
69
329
|
```bash
|
|
70
|
-
|
|
330
|
+
# Basic component generation
|
|
331
|
+
mycontext generate-components <target>
|
|
332
|
+
|
|
333
|
+
# 🆕 Complete architecture generation (NEW!)
|
|
334
|
+
mycontext generate-components all --complete-architecture
|
|
335
|
+
|
|
336
|
+
# 🆕 With specific architecture type (NEW!)
|
|
337
|
+
mycontext generate-components all --complete-architecture --architecture-type nextjs-app-router
|
|
338
|
+
|
|
339
|
+
# 🆕 Only server actions (NEW!)
|
|
340
|
+
mycontext generate-components all --server-actions
|
|
341
|
+
|
|
342
|
+
# 🆕 Only routes (NEW!)
|
|
343
|
+
mycontext generate-components all --routes
|
|
344
|
+
|
|
345
|
+
# Other commands
|
|
71
346
|
mycontext enhance <component> # Enhance existing components
|
|
72
347
|
mycontext refine <component> # Refine components with AI
|
|
73
348
|
mycontext preview <type> # Preview components or brand
|
|
@@ -86,25 +361,18 @@ mycontext promote # Promote components to production
|
|
|
86
361
|
|
|
87
362
|
```bash
|
|
88
363
|
mycontext build-strategy # Interactive strategy selection
|
|
89
|
-
mycontext build-strategy --recommend
|
|
90
|
-
mycontext build-strategy --plan
|
|
91
|
-
mycontext build-strategy --tasks
|
|
92
|
-
mycontext build-strategy --compare
|
|
93
|
-
mycontext build-strategy --context
|
|
94
|
-
mycontext build-strategy --list
|
|
364
|
+
mycontext build-strategy --recommend # Get AI-powered strategy recommendations
|
|
365
|
+
mycontext build-strategy --plan # Generate detailed build plan
|
|
366
|
+
mycontext build-strategy --tasks # Generate task list for current phase
|
|
367
|
+
mycontext build-strategy --compare # Compare all available strategies
|
|
368
|
+
mycontext build-strategy --context # Show loaded project context
|
|
369
|
+
mycontext build-strategy --list # List all saved strategy files
|
|
95
370
|
mycontext build-strategy --load <type> # Load saved strategy data
|
|
96
371
|
```
|
|
97
372
|
|
|
98
|
-
## Build Strategy Planning
|
|
99
|
-
|
|
100
|
-
MyContext's **AI-Powered Build Strategy** feature helps you choose the right development approach for your project through interactive questions and AI-generated recommendations.
|
|
373
|
+
## 🎯 Build Strategy Planning
|
|
101
374
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
1. **Interactive Questions**: Asks about your project type, complexity, timeline, and team size
|
|
105
|
-
2. **AI Processing**: Uses AI to analyze your answers and project context
|
|
106
|
-
3. **Strategic Recommendations**: Generates personalized development strategies
|
|
107
|
-
4. **Strategy Comparison**: Shows different approaches with pros/cons and timelines
|
|
375
|
+
MyContext's **AI-Powered Build Strategy** feature helps you choose the right development approach through interactive questions and AI-generated recommendations.
|
|
108
376
|
|
|
109
377
|
### Available Strategies
|
|
110
378
|
|
|
@@ -114,16 +382,6 @@ MyContext's **AI-Powered Build Strategy** feature helps you choose the right dev
|
|
|
114
382
|
- **🔄 Iterative Scaffolding**: Small chunks everywhere, refine later
|
|
115
383
|
- **⚡ Hybrid Approach**: Combines multiple strategies based on project needs
|
|
116
384
|
|
|
117
|
-
### Interactive Strategy Selection
|
|
118
|
-
|
|
119
|
-
The system provides:
|
|
120
|
-
|
|
121
|
-
- **Project Type Selection**: Choose from client work, personal projects, team development, etc.
|
|
122
|
-
- **Complexity Assessment**: Simple, medium, or complex application classification
|
|
123
|
-
- **Timeline Planning**: Urgent, moderate, or flexible development timelines
|
|
124
|
-
- **Team Size Consideration**: Solo developer, small team, or large team approaches
|
|
125
|
-
- **AI Recommendations**: Personalized strategy suggestions based on your answers
|
|
126
|
-
|
|
127
385
|
### Example Workflow
|
|
128
386
|
|
|
129
387
|
```bash
|
|
@@ -148,11 +406,6 @@ $ mycontext build-strategy --recommend
|
|
|
148
406
|
Moderate (balanced approach)
|
|
149
407
|
Flexible (quality over speed)
|
|
150
408
|
|
|
151
|
-
? What's your team size?
|
|
152
|
-
❯ Solo developer
|
|
153
|
-
Small team (2-5 people)
|
|
154
|
-
Large team (6+ people)
|
|
155
|
-
|
|
156
409
|
✅ Recommended Strategies:
|
|
157
410
|
|
|
158
411
|
🎯 Vertical Slice
|
|
@@ -163,52 +416,10 @@ $ mycontext build-strategy --recommend
|
|
|
163
416
|
💡 Reasoning:
|
|
164
417
|
Vertical slice approach recommended for balanced development with quick user value
|
|
165
418
|
|
|
166
|
-
💾 Saved to:
|
|
419
|
+
💾 Saved to: .mycontext/build-strategy-recommendations-2025-10-02.json
|
|
167
420
|
```
|
|
168
421
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
All generated strategies are automatically saved as JSON files in `.mycontext/` for easy access and project tracking:
|
|
172
|
-
|
|
173
|
-
```bash
|
|
174
|
-
# List all saved strategy files
|
|
175
|
-
mycontext build-strategy --list
|
|
176
|
-
|
|
177
|
-
# Load specific strategy data
|
|
178
|
-
mycontext build-strategy --load recommendations
|
|
179
|
-
mycontext build-strategy --load plan
|
|
180
|
-
mycontext build-strategy --load tasks
|
|
181
|
-
mycontext build-strategy --load comparison
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
**File Structure:**
|
|
185
|
-
|
|
186
|
-
```
|
|
187
|
-
.mycontext/
|
|
188
|
-
├── build-strategy-recommendations-2025-09-23.json
|
|
189
|
-
├── build-strategy-plan-2025-09-23.json
|
|
190
|
-
├── build-strategy-tasks-2025-09-23.json
|
|
191
|
-
└── build-strategy-comparison-2025-09-23.json
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
**File Format:**
|
|
195
|
-
|
|
196
|
-
Each saved strategy file contains:
|
|
197
|
-
|
|
198
|
-
```json
|
|
199
|
-
{
|
|
200
|
-
"type": "recommendations",
|
|
201
|
-
"generatedAt": "2025-09-23T11:05:52.000Z",
|
|
202
|
-
"projectPath": "/path/to/project",
|
|
203
|
-
"data": {
|
|
204
|
-
"recommended": [...],
|
|
205
|
-
"reasoning": "...",
|
|
206
|
-
"alternatives": [...]
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
## Configuration
|
|
422
|
+
## ⚙️ Configuration
|
|
212
423
|
|
|
213
424
|
### AI Providers
|
|
214
425
|
|
|
@@ -216,32 +427,38 @@ MyContext supports multiple AI providers with intelligent fallback:
|
|
|
216
427
|
|
|
217
428
|
#### **Recommended (Premium)**
|
|
218
429
|
|
|
219
|
-
1. **
|
|
430
|
+
1. **🚀 Claude Agent SDK** (NEW!)
|
|
431
|
+
```bash
|
|
432
|
+
echo 'MYCONTEXT_CLAUDE_API_KEY=sk-ant-xxx' > .mycontext/.env
|
|
433
|
+
```
|
|
434
|
+
- Advanced context management and compaction
|
|
435
|
+
- Fine-grained tool permissions
|
|
436
|
+
- MCP integration
|
|
437
|
+
- Best for complex workflows
|
|
220
438
|
|
|
439
|
+
2. **X.AI (Grok) - Best for Code Generation**
|
|
221
440
|
```bash
|
|
222
441
|
echo 'MYCONTEXT_XAI_API_KEY=xai-xxx' > .mycontext/.env
|
|
223
442
|
```
|
|
224
443
|
|
|
225
|
-
|
|
226
|
-
|
|
444
|
+
3. **Claude (Anthropic)**
|
|
227
445
|
```bash
|
|
228
446
|
echo 'MYCONTEXT_CLAUDE_API_KEY=sk-ant-xxx' > .mycontext/.env
|
|
229
447
|
```
|
|
230
448
|
|
|
231
|
-
|
|
449
|
+
4. **OpenAI (GPT-4)**
|
|
232
450
|
```bash
|
|
233
451
|
echo 'MYCONTEXT_OPENAI_API_KEY=sk-xxx' > .mycontext/.env
|
|
234
452
|
```
|
|
235
453
|
|
|
236
|
-
#### **Testing &
|
|
237
|
-
|
|
238
|
-
4. **Qwen3 Coder (FREE)**
|
|
454
|
+
#### **Testing & Free Tier**
|
|
239
455
|
|
|
456
|
+
5. **Qwen3 Coder (FREE)**
|
|
240
457
|
```bash
|
|
241
458
|
echo 'MYCONTEXT_QWEN_API_KEY=sk-or-xxx' > .mycontext/.env
|
|
242
459
|
```
|
|
243
460
|
|
|
244
|
-
|
|
461
|
+
6. **GitHub Models**
|
|
245
462
|
```bash
|
|
246
463
|
echo 'MYCONTEXT_GITHUB_TOKEN=ghp_xxx' > .mycontext/.env
|
|
247
464
|
```
|
|
@@ -250,72 +467,171 @@ MyContext supports multiple AI providers with intelligent fallback:
|
|
|
250
467
|
|
|
251
468
|
```
|
|
252
469
|
my-project/
|
|
253
|
-
├── .mycontext/
|
|
254
|
-
│ ├──
|
|
255
|
-
│ ├──
|
|
256
|
-
│ ├──
|
|
257
|
-
│
|
|
258
|
-
├──
|
|
470
|
+
├── .mycontext/ # MyContext configuration
|
|
471
|
+
│ ├── 01a-features.md # Feature specifications
|
|
472
|
+
│ ├── 01b-user-flows.md # User flow documentation
|
|
473
|
+
│ ├── 01c-edge-cases.md # Edge case scenarios
|
|
474
|
+
│ ├── 01d-technical-specs.md # Technical requirements
|
|
475
|
+
│ ├── 02-prd.md # Compiled PRD
|
|
476
|
+
│ ├── 02-types.ts # TypeScript types
|
|
477
|
+
│ ├── 03-branding.md # Branding guidelines
|
|
478
|
+
│ ├── 04-component-list.json # Component hierarchy
|
|
479
|
+
│ ├── architecture-plan.json # 🆕 Complete architecture spec
|
|
480
|
+
│ └── .env # Environment variables
|
|
481
|
+
├── components/ # Generated components
|
|
482
|
+
│ └── .mycontext/ # MyContext-generated components
|
|
483
|
+
├── actions/ # 🆕 Server actions
|
|
484
|
+
├── app/ # 🆕 Next.js App Router
|
|
259
485
|
└── package.json
|
|
260
486
|
```
|
|
261
487
|
|
|
262
|
-
## Examples
|
|
488
|
+
## 🚀 Examples
|
|
263
489
|
|
|
264
|
-
### Create
|
|
490
|
+
### Create Complete E-commerce App
|
|
265
491
|
|
|
266
492
|
```bash
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
493
|
+
# Initialize project
|
|
494
|
+
mycontext init ecommerce-app
|
|
495
|
+
|
|
496
|
+
# Set up AI provider
|
|
497
|
+
echo 'MYCONTEXT_XAI_API_KEY=xai-xxx' > ecommerce-app/.mycontext/.env
|
|
498
|
+
cd ecommerce-app
|
|
499
|
+
|
|
500
|
+
# 🆕 Generate complete architecture (NEW!)
|
|
501
|
+
mycontext build-app --description "E-commerce platform with products, cart, and checkout" --complete-architecture
|
|
502
|
+
|
|
503
|
+
# Start development
|
|
504
|
+
npm run dev
|
|
272
505
|
```
|
|
273
506
|
|
|
507
|
+
**Result**: Production-ready e-commerce app with:
|
|
508
|
+
- Product catalog with server actions
|
|
509
|
+
- Shopping cart functionality
|
|
510
|
+
- Checkout flow with forms
|
|
511
|
+
- Complete Next.js App Router structure
|
|
512
|
+
- Self-documenting components
|
|
513
|
+
|
|
274
514
|
### Work with Existing Project
|
|
275
515
|
|
|
276
516
|
```bash
|
|
277
517
|
mycontext init . --analyze
|
|
278
518
|
mycontext generate-context-files
|
|
279
|
-
mycontext generate-components
|
|
519
|
+
mycontext generate-components all --complete-architecture
|
|
280
520
|
```
|
|
281
521
|
|
|
282
|
-
### Build
|
|
522
|
+
### Build Todo App with Architecture
|
|
283
523
|
|
|
284
524
|
```bash
|
|
285
|
-
mycontext
|
|
525
|
+
mycontext init todo-app --description "Modern todo application"
|
|
526
|
+
cd todo-app
|
|
527
|
+
mycontext generate-context-files
|
|
528
|
+
mycontext compile-prd
|
|
529
|
+
mycontext generate-components all --complete-architecture --with-tests
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
## 📊 What Makes MyContext Different?
|
|
533
|
+
|
|
534
|
+
### Traditional Approach
|
|
286
535
|
```
|
|
536
|
+
Time: 8-12 hours
|
|
537
|
+
- Manual server action creation: 2-4 hours
|
|
538
|
+
- Manual route setup: 1-2 hours
|
|
539
|
+
- Manual documentation: 1-2 hours
|
|
540
|
+
- Manual testing setup: 2-3 hours
|
|
541
|
+
- Manual integration: 1-2 hours
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
### MyContext Approach
|
|
545
|
+
```
|
|
546
|
+
Time: 2-3 hours
|
|
547
|
+
- Generate complete architecture: 15 minutes
|
|
548
|
+
- Review and customize: 1-2 hours
|
|
549
|
+
- Ready for production ✅
|
|
550
|
+
|
|
551
|
+
Savings: 6-10 hours (60-75% reduction)
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
### Key Advantages
|
|
555
|
+
|
|
556
|
+
✅ **Production-Ready** - Server actions, routes, validation built-in
|
|
557
|
+
✅ **Self-Documenting** - Components explain themselves
|
|
558
|
+
✅ **Type-Safe** - Full TypeScript throughout
|
|
559
|
+
✅ **Best Practices** - Auth, caching, error handling
|
|
560
|
+
✅ **Scalable** - Proper architecture from start
|
|
561
|
+
|
|
562
|
+
## 🔧 Advanced Features
|
|
287
563
|
|
|
288
|
-
###
|
|
564
|
+
### Claude Agent SDK
|
|
289
565
|
|
|
290
566
|
```bash
|
|
291
|
-
#
|
|
292
|
-
mycontext build-
|
|
567
|
+
# Automatic context management
|
|
568
|
+
mycontext build-app --description "Complex enterprise application"
|
|
293
569
|
|
|
294
|
-
#
|
|
295
|
-
mycontext
|
|
570
|
+
# MCP integration
|
|
571
|
+
mycontext setup-mcp --provider instantdb
|
|
296
572
|
|
|
297
|
-
#
|
|
298
|
-
mycontext
|
|
573
|
+
# Fine-grained permissions
|
|
574
|
+
mycontext setup
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
### InstantDB Integration
|
|
299
578
|
|
|
300
|
-
|
|
301
|
-
|
|
579
|
+
```bash
|
|
580
|
+
# Set up InstantDB with MCP
|
|
581
|
+
mycontext setup-instantdb
|
|
302
582
|
|
|
303
|
-
#
|
|
304
|
-
mycontext build-strategy --context
|
|
583
|
+
# Default for all MyContext apps
|
|
305
584
|
```
|
|
306
585
|
|
|
307
|
-
## Documentation
|
|
586
|
+
## 📖 Documentation
|
|
308
587
|
|
|
309
|
-
- [Full Documentation](https://mycontext.fbien.com
|
|
310
|
-
- [API Reference](https://mycontext.fbien.com/
|
|
311
|
-
- [Examples](https://mycontext.fbien.com/
|
|
588
|
+
- [Full Documentation](https://docs.mycontext.fbien.com)
|
|
589
|
+
- [API Reference](https://docs.mycontext.fbien.com/api)
|
|
590
|
+
- [Examples](https://docs.mycontext.fbien.com/examples)
|
|
591
|
+
- [Complete Architecture Guide](https://docs.mycontext.fbien.com/complete-architecture)
|
|
312
592
|
|
|
313
|
-
## Support
|
|
593
|
+
## 🤝 Support
|
|
314
594
|
|
|
315
|
-
- [GitHub Issues](https://github.com/mycontext/
|
|
595
|
+
- [GitHub Issues](https://github.com/farajabien/mycontext/issues)
|
|
316
596
|
- [Discord Community](https://discord.gg/mycontext)
|
|
317
|
-
- [Documentation](https://mycontext.fbien.com
|
|
318
|
-
|
|
319
|
-
##
|
|
597
|
+
- [Documentation](https://docs.mycontext.fbien.com)
|
|
598
|
+
|
|
599
|
+
## 🎯 Roadmap
|
|
600
|
+
|
|
601
|
+
### Current (v2.0.0) 🆕
|
|
602
|
+
- ✅ **Complete Claude Agent SDK Integration**
|
|
603
|
+
- ✅ 8 Specialized AI agents (Code Review, Testing, Security, etc.)
|
|
604
|
+
- ✅ 4 Custom MCP tools (Component Analysis, PRD Validation, etc.)
|
|
605
|
+
- ✅ Intelligent routing (Agent SDK vs Direct API)
|
|
606
|
+
- ✅ Streaming progress with real-time feedback
|
|
607
|
+
- ✅ Hook system for lifecycle events
|
|
608
|
+
- ✅ Fine-grained tool permissions
|
|
609
|
+
- ✅ Setting sources for reproducible builds
|
|
610
|
+
- ✅ Complete architecture generation
|
|
611
|
+
- ✅ Server actions with validation
|
|
612
|
+
- ✅ Next.js App Router routes
|
|
613
|
+
- ✅ Self-documenting components
|
|
614
|
+
|
|
615
|
+
### Upcoming (v2.1.0)
|
|
616
|
+
- 🔄 Database schema generation (Prisma/Drizzle)
|
|
617
|
+
- 🔄 API documentation (OpenAPI/Swagger)
|
|
618
|
+
- 🔄 E2E test generation (Playwright/Cypress)
|
|
619
|
+
- 🔄 Deployment configuration (Docker, CI/CD)
|
|
620
|
+
- 🔄 More specialized agents (Database, API, DevOps)
|
|
621
|
+
|
|
622
|
+
### Future
|
|
623
|
+
- GraphQL resolver generation
|
|
624
|
+
- tRPC procedure generation
|
|
625
|
+
- WebSocket/real-time actions
|
|
626
|
+
- Monitoring & logging setup
|
|
627
|
+
- Multi-agent collaboration workflows
|
|
628
|
+
|
|
629
|
+
## 📄 License
|
|
320
630
|
|
|
321
631
|
MIT © MyContext
|
|
632
|
+
|
|
633
|
+
---
|
|
634
|
+
|
|
635
|
+
**Made with ❤️ by the MyContext team**
|
|
636
|
+
|
|
637
|
+
[⭐ Star us on GitHub](https://github.com/farajabien/mycontext) | [📖 Read the Docs](https://docs.mycontext.fbien.com) | [🐦 Follow on Twitter](https://twitter.com/mycontext)
|