mycontext-cli 2.0.3 → 2.0.4
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 +426 -103
- package/dist/README.md +426 -103
- package/dist/agents/implementations/ClaudeAgentWorkflow.d.ts.map +1 -1
- package/dist/agents/implementations/ClaudeAgentWorkflow.js +75 -4
- package/dist/agents/implementations/ClaudeAgentWorkflow.js.map +1 -1
- package/dist/agents/interfaces/SubAgent.d.ts +2 -0
- package/dist/agents/interfaces/SubAgent.d.ts.map +1 -1
- package/dist/cli.js +2 -38
- package/dist/cli.js.map +1 -1
- package/dist/commands/generate-components.d.ts +0 -5
- package/dist/commands/generate-components.d.ts.map +1 -1
- package/dist/commands/generate-components.js +0 -101
- package/dist/commands/generate-components.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +2 -6
- package/dist/commands/init.js.map +1 -1
- package/dist/config/build-strategies.json +173 -22
- package/dist/package.json +2 -2
- package/dist/utils/agentDefinitions.d.ts +5 -0
- package/dist/utils/agentDefinitions.d.ts.map +1 -1
- package/dist/utils/agentDefinitions.js +99 -1
- package/dist/utils/agentDefinitions.js.map +1 -1
- package/dist/utils/mcpTools.d.ts +189 -0
- package/dist/utils/mcpTools.d.ts.map +1 -1
- package/dist/utils/mcpTools.js +462 -1
- package/dist/utils/mcpTools.js.map +1 -1
- package/package.json +2 -2
- package/dist/commands/core.d.ts +0 -24
- package/dist/commands/core.d.ts.map +0 -1
- package/dist/commands/core.js +0 -410
- package/dist/commands/core.js.map +0 -1
|
@@ -1,12 +1,128 @@
|
|
|
1
1
|
{
|
|
2
2
|
"buildStrategies": {
|
|
3
3
|
"metadata": {
|
|
4
|
-
"version": "
|
|
5
|
-
"description": "MyContext CLI Build Strategy Framework",
|
|
6
|
-
"lastUpdated": "2025-
|
|
4
|
+
"version": "2.0.0",
|
|
5
|
+
"description": "MyContext CLI Build Strategy Framework - Component-First Edition",
|
|
6
|
+
"lastUpdated": "2025-01-04",
|
|
7
7
|
"author": "MyContext Team"
|
|
8
8
|
},
|
|
9
9
|
"strategies": [
|
|
10
|
+
{
|
|
11
|
+
"id": "component-first",
|
|
12
|
+
"name": "Component-First (Recommended)",
|
|
13
|
+
"description": "Generate and validate individual components with visual preview, then compose into complete application using Claude Agent SDK",
|
|
14
|
+
"icon": "🎨",
|
|
15
|
+
"complexity": "low",
|
|
16
|
+
"timeToFirstDemo": "3-5 days",
|
|
17
|
+
"bestFor": ["MVPs", "rapid prototyping", "solo developers", "internal tools", "standard patterns"],
|
|
18
|
+
"phases": [
|
|
19
|
+
{
|
|
20
|
+
"phase": 1,
|
|
21
|
+
"name": "Component Library Building",
|
|
22
|
+
"duration": "3-7 days",
|
|
23
|
+
"description": "Generate and validate core components one at a time with zero-error guarantees",
|
|
24
|
+
"tasks": [
|
|
25
|
+
"Run mycontext init to set up project structure",
|
|
26
|
+
"Generate authentication components (LoginForm, SignupForm, PasswordReset)",
|
|
27
|
+
"Validate each component (TypeScript, ESLint, build checks, tests)",
|
|
28
|
+
"Preview components in visual board (mycontext preview components)",
|
|
29
|
+
"Generate dashboard components (Sidebar, Header, DataTable, StatsCard)",
|
|
30
|
+
"Generate settings components (ProfileForm, SettingsPanel, AccountSettings)",
|
|
31
|
+
"Generate marketing components (Hero, Features, Pricing, Footer)",
|
|
32
|
+
"Build component library incrementally with validation at each step"
|
|
33
|
+
],
|
|
34
|
+
"deliverables": [
|
|
35
|
+
"10-20 validated, production-ready components",
|
|
36
|
+
"Visual component preview board",
|
|
37
|
+
"Zero TypeScript/ESLint/build errors guaranteed",
|
|
38
|
+
"Component tests passing (100% coverage on generated code)",
|
|
39
|
+
"Component documentation auto-generated"
|
|
40
|
+
],
|
|
41
|
+
"successCriteria": "All components validated and visible in preview board with zero errors"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"phase": 2,
|
|
45
|
+
"name": "AI-Powered Application Scaffolding",
|
|
46
|
+
"duration": "2-3 days",
|
|
47
|
+
"description": "Use Claude Agent SDK to detect components and generate intelligent integration layer",
|
|
48
|
+
"tasks": [
|
|
49
|
+
"Run mycontext build-app --interactive --complete-architecture",
|
|
50
|
+
"Claude Agent SDK detects existing validated components automatically",
|
|
51
|
+
"AI analyzes component names and groups (LoginForm → authentication)",
|
|
52
|
+
"AI maps components to Next.js routes intelligently (LoginForm → /login)",
|
|
53
|
+
"Generate server actions for component interactions (authenticateUser, createUser)",
|
|
54
|
+
"Generate custom hooks for shared logic (useAuth, useForm, useDashboard)",
|
|
55
|
+
"Create layouts for component grouping (AuthLayout, DashboardLayout)",
|
|
56
|
+
"Wire up routing, navigation, and state management",
|
|
57
|
+
"Validate scaffolding with build checks"
|
|
58
|
+
],
|
|
59
|
+
"deliverables": [
|
|
60
|
+
"Complete Next.js App Router structure (app/, actions/, hooks/)",
|
|
61
|
+
"Routes generated for page components with proper layouts",
|
|
62
|
+
"Server actions integrated with type-safe interfaces",
|
|
63
|
+
"Custom hooks created for reusable logic",
|
|
64
|
+
"Layouts applied with proper component composition",
|
|
65
|
+
"Zero-error scaffolding guaranteed"
|
|
66
|
+
],
|
|
67
|
+
"successCriteria": "Application scaffolding complete, all components integrated, app runs with zero errors"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"phase": 3,
|
|
71
|
+
"name": "Customization & Production Deployment",
|
|
72
|
+
"duration": "3-5 days",
|
|
73
|
+
"description": "Customize generated components for your unique use case and deploy to production",
|
|
74
|
+
"tasks": [
|
|
75
|
+
"Customize business logic in server actions (payment flows, data validation)",
|
|
76
|
+
"Adjust styling and branding (colors, fonts, logos)",
|
|
77
|
+
"Add unique product features (the 30% that makes your app special)",
|
|
78
|
+
"Integrate third-party services (Stripe, SendGrid, analytics)",
|
|
79
|
+
"Performance optimization (image optimization, code splitting)",
|
|
80
|
+
"Security hardening (rate limiting, input sanitization)",
|
|
81
|
+
"Final end-to-end testing",
|
|
82
|
+
"Deploy to Vercel/Netlify/self-hosted",
|
|
83
|
+
"Set up monitoring and analytics"
|
|
84
|
+
],
|
|
85
|
+
"deliverables": [
|
|
86
|
+
"Fully customized application with unique features",
|
|
87
|
+
"Production-ready deployment",
|
|
88
|
+
"Monitoring and analytics configured",
|
|
89
|
+
"Documentation for maintenance"
|
|
90
|
+
],
|
|
91
|
+
"successCriteria": "Application deployed, serving users, monitoring active"
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"pros": [
|
|
95
|
+
"Extremely fast - ship MVPs in 7-15 days, not months",
|
|
96
|
+
"Visual feedback from day 1 with component preview board",
|
|
97
|
+
"Zero-error components guaranteed before integration (TypeScript, ESLint, build)",
|
|
98
|
+
"Claude Agent SDK intelligently reuses and maps components to routes",
|
|
99
|
+
"Perfect for MVPs, internal tools, and rapid validation",
|
|
100
|
+
"Component library reusable across multiple projects",
|
|
101
|
+
"Focus on the 30% that's unique, not the 70% that's universal",
|
|
102
|
+
"Lower cost - generate standard patterns, pay developers for unique features"
|
|
103
|
+
],
|
|
104
|
+
"cons": [
|
|
105
|
+
"Best for standard patterns, not highly custom UIs (Figma, Notion)",
|
|
106
|
+
"Requires customization for unique business logic (your competitive advantage)",
|
|
107
|
+
"May need refactoring for complex domain-specific integrations",
|
|
108
|
+
"Not ideal for apps where custom design IS the product"
|
|
109
|
+
],
|
|
110
|
+
"workflow": {
|
|
111
|
+
"day1-2": "Generate 5-10 core components, preview in browser",
|
|
112
|
+
"day3-5": "Generate remaining components, validate all with tests",
|
|
113
|
+
"day6-7": "Run build-app, Claude maps components to routes, scaffolding generated",
|
|
114
|
+
"day8-12": "Customize business logic, add unique features",
|
|
115
|
+
"day13-15": "Testing, deployment, monitoring setup"
|
|
116
|
+
},
|
|
117
|
+
"cliCommands": [
|
|
118
|
+
"mycontext init my-app",
|
|
119
|
+
"mycontext generate-components LoginForm --with-tests",
|
|
120
|
+
"mycontext generate-components Dashboard --with-tests",
|
|
121
|
+
"mycontext preview components",
|
|
122
|
+
"mycontext build-app --interactive --complete-architecture",
|
|
123
|
+
"npm run build && vercel deploy"
|
|
124
|
+
]
|
|
125
|
+
},
|
|
10
126
|
{
|
|
11
127
|
"id": "foundation-first",
|
|
12
128
|
"name": "Foundation First",
|
|
@@ -427,46 +543,81 @@
|
|
|
427
543
|
}
|
|
428
544
|
],
|
|
429
545
|
"decisionMatrix": {
|
|
430
|
-
"
|
|
431
|
-
"recommended": ["
|
|
432
|
-
"
|
|
546
|
+
"mvpDevelopment": {
|
|
547
|
+
"recommended": ["component-first"],
|
|
548
|
+
"alternatives": ["vertical-slice", "iterative-scaffolding"],
|
|
549
|
+
"reasoning": "MVPs need speed and validation. Component-first gets you to production in 7-15 days with zero-error guarantees. Perfect for testing ideas quickly."
|
|
550
|
+
},
|
|
551
|
+
"rapidPrototyping": {
|
|
552
|
+
"recommended": ["component-first"],
|
|
553
|
+
"alternatives": ["iterative-scaffolding"],
|
|
554
|
+
"reasoning": "Component-first is specifically designed for rapid iteration with visual preview and automatic validation."
|
|
433
555
|
},
|
|
434
556
|
"personalProjects": {
|
|
435
|
-
"recommended": ["
|
|
436
|
-
"
|
|
557
|
+
"recommended": ["component-first", "iterative-scaffolding"],
|
|
558
|
+
"alternatives": ["horizontal-slice"],
|
|
559
|
+
"reasoning": "Personal projects benefit from speed, visual feedback, and component reusability. Component-first provides all three."
|
|
560
|
+
},
|
|
561
|
+
"internalTools": {
|
|
562
|
+
"recommended": ["component-first"],
|
|
563
|
+
"alternatives": ["horizontal-slice"],
|
|
564
|
+
"reasoning": "Internal tools follow standard patterns (auth, CRUD, dashboards). Component-first generates these in days."
|
|
565
|
+
},
|
|
566
|
+
"clientWork": {
|
|
567
|
+
"recommended": ["component-first", "vertical-slice"],
|
|
568
|
+
"alternatives": ["foundation-first", "hybrid-approach"],
|
|
569
|
+
"reasoning": "Clients need to see progress fast. Component-first delivers visual demos in days. Use foundation-first for complex enterprise clients."
|
|
437
570
|
},
|
|
438
571
|
"teamDevelopment": {
|
|
439
572
|
"recommended": ["horizontal-slice", "hybrid-approach"],
|
|
440
|
-
"
|
|
441
|
-
|
|
442
|
-
"mvpDevelopment": {
|
|
443
|
-
"recommended": ["vertical-slice", "iterative-scaffolding"],
|
|
444
|
-
"reasoning": "MVPs need quick results and demo-able features. Focus on core user journeys first."
|
|
573
|
+
"alternatives": ["component-first"],
|
|
574
|
+
"reasoning": "Teams can work in parallel on different features. Component-first works for small teams building standard patterns."
|
|
445
575
|
},
|
|
446
576
|
"enterpriseApplications": {
|
|
447
577
|
"recommended": ["foundation-first", "hybrid-approach"],
|
|
448
|
-
"
|
|
578
|
+
"alternatives": ["component-first"],
|
|
579
|
+
"reasoning": "Enterprise apps with complex domains need solid architecture. Use component-first for admin dashboards and internal tools."
|
|
580
|
+
},
|
|
581
|
+
"standardPatterns": {
|
|
582
|
+
"recommended": ["component-first"],
|
|
583
|
+
"alternatives": [],
|
|
584
|
+
"reasoning": "Apps built on standard patterns (auth, dashboards, CRUD, settings) are PERFECT for component-first. The 70/30 rule applies."
|
|
585
|
+
},
|
|
586
|
+
"uniqueCustomUI": {
|
|
587
|
+
"recommended": ["foundation-first", "vertical-slice"],
|
|
588
|
+
"alternatives": [],
|
|
589
|
+
"reasoning": "Apps where custom UI IS the product (Figma, Notion) need full control. Component-first is NOT ideal here."
|
|
449
590
|
}
|
|
450
591
|
},
|
|
451
592
|
"contextualFactors": {
|
|
452
593
|
"appComplexity": {
|
|
453
|
-
"simple": ["
|
|
454
|
-
"medium": ["vertical-slice", "hybrid-approach"],
|
|
594
|
+
"simple": ["component-first", "iterative-scaffolding"],
|
|
595
|
+
"medium": ["component-first", "vertical-slice", "hybrid-approach"],
|
|
455
596
|
"complex": ["foundation-first", "hybrid-approach"]
|
|
456
597
|
},
|
|
457
598
|
"userRoles": {
|
|
458
|
-
"single": ["
|
|
459
|
-
"multiple": ["
|
|
599
|
+
"single": ["component-first", "horizontal-slice"],
|
|
600
|
+
"multiple": ["component-first", "vertical-slice", "hybrid-approach"]
|
|
460
601
|
},
|
|
461
602
|
"timeline": {
|
|
462
|
-
"urgent": ["
|
|
463
|
-
"moderate": ["
|
|
603
|
+
"urgent": ["component-first", "iterative-scaffolding"],
|
|
604
|
+
"moderate": ["component-first", "horizontal-slice"],
|
|
464
605
|
"flexible": ["foundation-first", "hybrid-approach"]
|
|
465
606
|
},
|
|
466
607
|
"teamSize": {
|
|
467
|
-
"solo": ["
|
|
468
|
-
"small": ["
|
|
608
|
+
"solo": ["component-first", "iterative-scaffolding"],
|
|
609
|
+
"small": ["component-first", "horizontal-slice"],
|
|
469
610
|
"large": ["foundation-first", "horizontal-slice"]
|
|
611
|
+
},
|
|
612
|
+
"patternType": {
|
|
613
|
+
"standardPatterns": ["component-first"],
|
|
614
|
+
"mixedPatterns": ["component-first", "vertical-slice"],
|
|
615
|
+
"customPatterns": ["foundation-first", "hybrid-approach"]
|
|
616
|
+
},
|
|
617
|
+
"developmentGoal": {
|
|
618
|
+
"rapidValidation": ["component-first"],
|
|
619
|
+
"productionMVP": ["component-first", "vertical-slice"],
|
|
620
|
+
"enterpriseGrade": ["foundation-first", "hybrid-approach"]
|
|
470
621
|
}
|
|
471
622
|
},
|
|
472
623
|
"implementationGuidance": {
|
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mycontext-cli",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.0.4",
|
|
4
|
+
"description": "Component-first visual builder with zero-error guarantees. Generate and validate React/Next.js components one at a time, preview them visually, then scale to complete applications using Claude Agent SDK.",
|
|
5
5
|
"main": "dist/cli.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"mycontext-cli": "dist/cli.js",
|
|
@@ -45,6 +45,11 @@ export declare const refactoringAgent: AgentDefinition;
|
|
|
45
45
|
* Optimizes code for better performance
|
|
46
46
|
*/
|
|
47
47
|
export declare const performanceAgent: AgentDefinition;
|
|
48
|
+
/**
|
|
49
|
+
* Component-First Builder Agent
|
|
50
|
+
* Intelligently reuses existing validated components or generates new ones
|
|
51
|
+
*/
|
|
52
|
+
export declare const componentFirstBuilderAgent: AgentDefinition;
|
|
48
53
|
/**
|
|
49
54
|
* Get all agent definitions
|
|
50
55
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentDefinitions.d.ts","sourceRoot":"","sources":["../../src/utils/agentDefinitions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtE;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,eAyBrC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,eAoC/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,eA4BhC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,eAiC1B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,eAkC/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,eAgC3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,eA8B9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,eAmC9B,CAAC;AAEF;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"agentDefinitions.d.ts","sourceRoot":"","sources":["../../src/utils/agentDefinitions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtE;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,eAyBrC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,eAoC/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,eA4BhC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,eAiC1B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,eAkC/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,eAgC3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,eA8B9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,eAmC9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,eA4FxC,CAAC;AAEF;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAYxE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAG5E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,eAAe,CAapJ"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* and custom system prompts.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.performanceAgent = exports.refactoringAgent = exports.securityAgent = exports.architectureAgent = exports.testingAgent = exports.documentationAgent = exports.codeReviewerAgent = exports.componentGeneratorAgent = void 0;
|
|
9
|
+
exports.componentFirstBuilderAgent = exports.performanceAgent = exports.refactoringAgent = exports.securityAgent = exports.architectureAgent = exports.testingAgent = exports.documentationAgent = exports.codeReviewerAgent = exports.componentGeneratorAgent = void 0;
|
|
10
10
|
exports.getAllAgentDefinitions = getAllAgentDefinitions;
|
|
11
11
|
exports.getAgentDefinition = getAgentDefinition;
|
|
12
12
|
exports.getAgentsForTask = getAgentsForTask;
|
|
@@ -303,6 +303,103 @@ exports.performanceAgent = {
|
|
|
303
303
|
|
|
304
304
|
Provide measurable improvements with before/after comparisons where possible.`,
|
|
305
305
|
};
|
|
306
|
+
/**
|
|
307
|
+
* Component-First Builder Agent
|
|
308
|
+
* Intelligently reuses existing validated components or generates new ones
|
|
309
|
+
*/
|
|
310
|
+
exports.componentFirstBuilderAgent = {
|
|
311
|
+
description: 'Builds applications by intelligently reusing validated components and generating scaffolding',
|
|
312
|
+
tools: [
|
|
313
|
+
'Read', 'Write', 'Glob', 'Grep',
|
|
314
|
+
'DetectExistingComponents',
|
|
315
|
+
'MapComponentsToRoutes',
|
|
316
|
+
'GenerateScaffolding',
|
|
317
|
+
'AnalyzeComponent',
|
|
318
|
+
'ValidatePRD'
|
|
319
|
+
],
|
|
320
|
+
model: 'sonnet',
|
|
321
|
+
prompt: `You are a component-first application builder. Your workflow emphasizes reusing validated components over regenerating everything.
|
|
322
|
+
|
|
323
|
+
**Step 1: Detection Phase**
|
|
324
|
+
Use DetectExistingComponents to analyze the project:
|
|
325
|
+
- Check for existing validated components
|
|
326
|
+
- Review validation status (TypeScript, ESLint, build, tests)
|
|
327
|
+
- Analyze component groups and organization
|
|
328
|
+
- Make data-driven decision: REUSE vs GENERATE
|
|
329
|
+
|
|
330
|
+
**Step 2: Decision Making**
|
|
331
|
+
|
|
332
|
+
REUSE_COMPONENTS mode (3+ validated components found):
|
|
333
|
+
- ✅ Skip component generation entirely
|
|
334
|
+
- ✅ Use existing validated components as foundation
|
|
335
|
+
- ✅ Focus on scaffolding: routes, actions, hooks, layouts
|
|
336
|
+
- ✅ Generate integration layer only
|
|
337
|
+
|
|
338
|
+
PARTIAL_REUSE mode (1-2 validated components):
|
|
339
|
+
- Use existing components where available
|
|
340
|
+
- Generate missing components
|
|
341
|
+
- Create unified scaffolding
|
|
342
|
+
|
|
343
|
+
GENERATE_ALL mode (< 1 validated component):
|
|
344
|
+
- Generate components from scratch
|
|
345
|
+
- Validate each component (TypeScript, ESLint, build)
|
|
346
|
+
- Then generate scaffolding
|
|
347
|
+
|
|
348
|
+
**Step 3: Route Mapping**
|
|
349
|
+
Use MapComponentsToRoutes to create intelligent mappings:
|
|
350
|
+
- Analyze component names (LoginPage → /login, Dashboard → /dashboard)
|
|
351
|
+
- Consider component groups (auth, admin, forms)
|
|
352
|
+
- Read PRD context for app structure understanding
|
|
353
|
+
- Design optimal route hierarchy
|
|
354
|
+
- Identify required actions and hooks per component
|
|
355
|
+
|
|
356
|
+
**Step 4: Scaffolding Generation**
|
|
357
|
+
Use GenerateScaffolding to create:
|
|
358
|
+
|
|
359
|
+
Routes (app/ directory):
|
|
360
|
+
- Page components that import and use existing components
|
|
361
|
+
- Proper layouts for component groups (AuthLayout, DashboardLayout)
|
|
362
|
+
- Route handlers for dynamic routes
|
|
363
|
+
|
|
364
|
+
Server Actions (actions/ directory):
|
|
365
|
+
- Actions based on component needs (form submissions, auth, CRUD)
|
|
366
|
+
- Type-safe action interfaces
|
|
367
|
+
- Validation logic
|
|
368
|
+
- Error handling
|
|
369
|
+
|
|
370
|
+
Custom Hooks (hooks/ directory):
|
|
371
|
+
- Shared logic extraction (useForm, useAuth, useData)
|
|
372
|
+
- State management hooks
|
|
373
|
+
- API integration hooks
|
|
374
|
+
|
|
375
|
+
Layouts (components/layouts/):
|
|
376
|
+
- Group-specific layouts (AuthLayout, FormLayout)
|
|
377
|
+
- Shared UI patterns
|
|
378
|
+
|
|
379
|
+
**Best Practices:**
|
|
380
|
+
1. Always prefer reusing validated components - they're production-ready
|
|
381
|
+
2. Generate minimal, focused scaffolding - no over-engineering
|
|
382
|
+
3. Ensure type safety across all integrations
|
|
383
|
+
4. Follow Next.js 15 App Router patterns
|
|
384
|
+
5. Create clear component-to-route mappings
|
|
385
|
+
6. Add proper error boundaries
|
|
386
|
+
7. Include loading states
|
|
387
|
+
8. Follow established project patterns
|
|
388
|
+
|
|
389
|
+
**Communication:**
|
|
390
|
+
- Clearly explain detection results
|
|
391
|
+
- Show your decision (REUSE vs GENERATE)
|
|
392
|
+
- Provide component mapping summary
|
|
393
|
+
- List all generated scaffolding files
|
|
394
|
+
- Offer clear next steps
|
|
395
|
+
|
|
396
|
+
**Error Handling:**
|
|
397
|
+
- If component detection fails, fall back to GENERATE_ALL
|
|
398
|
+
- If mapping fails, provide manual mapping suggestions
|
|
399
|
+
- If scaffolding fails, report specific file errors
|
|
400
|
+
|
|
401
|
+
Your goal: Build production-ready applications that leverage existing validated components, minimizing regeneration and maximizing code reuse.`,
|
|
402
|
+
};
|
|
306
403
|
/**
|
|
307
404
|
* Get all agent definitions
|
|
308
405
|
*/
|
|
@@ -316,6 +413,7 @@ function getAllAgentDefinitions() {
|
|
|
316
413
|
security: exports.securityAgent,
|
|
317
414
|
refactoring: exports.refactoringAgent,
|
|
318
415
|
performance: exports.performanceAgent,
|
|
416
|
+
componentFirstBuilder: exports.componentFirstBuilderAgent,
|
|
319
417
|
};
|
|
320
418
|
}
|
|
321
419
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentDefinitions.js","sourceRoot":"","sources":["../../src/utils/agentDefinitions.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;
|
|
1
|
+
{"version":3,"file":"agentDefinitions.js","sourceRoot":"","sources":["../../src/utils/agentDefinitions.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAsZH,wDAYC;AAKD,gDAGC;AAKD,4CAaC;AAxbD;;;GAGG;AACU,QAAA,uBAAuB,GAAoB;IACtD,WAAW,EAAE,0FAA0F;IACvG,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,kBAAkB,CAAC;IACpD,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;sEAoB4D;CACrE,CAAC;AAEF;;;GAGG;AACU,QAAA,iBAAiB,GAAoB;IAChD,WAAW,EAAE,gEAAgE;IAC7E,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,YAAY,CAAC;IACjE,KAAK,EAAE,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,IAAI,EAAE,0BAAkB;QACxB,IAAI,EAAE,oBAAY;QAClB,SAAS,EAAE,yBAAiB;QAC5B,QAAQ,EAAE,qBAAa;QACvB,QAAQ,EAAE,wBAAgB;QAC1B,QAAQ,EAAE,wBAAgB;KAC3B,CAAC;IAEF,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC"}
|
package/dist/utils/mcpTools.d.ts
CHANGED
|
@@ -65,6 +65,77 @@ export declare const generateDocsTool: {
|
|
|
65
65
|
outputPath?: string | undefined;
|
|
66
66
|
}, extra: unknown) => Promise<CallToolResult>;
|
|
67
67
|
};
|
|
68
|
+
/**
|
|
69
|
+
* Detect existing validated components in the project
|
|
70
|
+
*/
|
|
71
|
+
export declare const detectExistingComponentsTool: {
|
|
72
|
+
name: string;
|
|
73
|
+
description: string;
|
|
74
|
+
inputSchema: {
|
|
75
|
+
projectPath: z.ZodString;
|
|
76
|
+
includeValidation: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
};
|
|
78
|
+
handler: (args: {
|
|
79
|
+
projectPath: string;
|
|
80
|
+
includeValidation?: boolean | undefined;
|
|
81
|
+
}, extra: unknown) => Promise<CallToolResult>;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Map components to routes intelligently
|
|
85
|
+
*/
|
|
86
|
+
export declare const mapComponentsToRoutesTool: {
|
|
87
|
+
name: string;
|
|
88
|
+
description: string;
|
|
89
|
+
inputSchema: {
|
|
90
|
+
components: z.ZodArray<z.ZodObject<{
|
|
91
|
+
name: z.ZodString;
|
|
92
|
+
group: z.ZodString;
|
|
93
|
+
path: z.ZodString;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
name: string;
|
|
96
|
+
path: string;
|
|
97
|
+
group: string;
|
|
98
|
+
}, {
|
|
99
|
+
name: string;
|
|
100
|
+
path: string;
|
|
101
|
+
group: string;
|
|
102
|
+
}>, "many">;
|
|
103
|
+
prdContext: z.ZodOptional<z.ZodString>;
|
|
104
|
+
architectureType: z.ZodEnum<["nextjs-app-router", "nextjs-pages", "react-spa"]>;
|
|
105
|
+
};
|
|
106
|
+
handler: (args: {
|
|
107
|
+
components: {
|
|
108
|
+
name: string;
|
|
109
|
+
path: string;
|
|
110
|
+
group: string;
|
|
111
|
+
}[];
|
|
112
|
+
architectureType: "nextjs-app-router" | "nextjs-pages" | "react-spa";
|
|
113
|
+
prdContext?: string | undefined;
|
|
114
|
+
}, extra: unknown) => Promise<CallToolResult>;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Generate scaffolding for existing components
|
|
118
|
+
*/
|
|
119
|
+
export declare const generateScaffoldingTool: {
|
|
120
|
+
name: string;
|
|
121
|
+
description: string;
|
|
122
|
+
inputSchema: {
|
|
123
|
+
componentMappings: z.ZodAny;
|
|
124
|
+
projectPath: z.ZodString;
|
|
125
|
+
generateRoutes: z.ZodDefault<z.ZodBoolean>;
|
|
126
|
+
generateActions: z.ZodDefault<z.ZodBoolean>;
|
|
127
|
+
generateHooks: z.ZodDefault<z.ZodBoolean>;
|
|
128
|
+
generateLayouts: z.ZodDefault<z.ZodBoolean>;
|
|
129
|
+
};
|
|
130
|
+
handler: (args: {
|
|
131
|
+
projectPath: string;
|
|
132
|
+
generateRoutes: boolean;
|
|
133
|
+
generateActions: boolean;
|
|
134
|
+
generateHooks: boolean;
|
|
135
|
+
generateLayouts: boolean;
|
|
136
|
+
componentMappings?: any;
|
|
137
|
+
}, extra: unknown) => Promise<CallToolResult>;
|
|
138
|
+
};
|
|
68
139
|
/**
|
|
69
140
|
* Get all available MCP tools
|
|
70
141
|
*/
|
|
@@ -112,6 +183,65 @@ export declare function getAllMCPTools(): ({
|
|
|
112
183
|
componentPath: string;
|
|
113
184
|
outputPath?: string | undefined;
|
|
114
185
|
}, extra: unknown) => Promise<CallToolResult>;
|
|
186
|
+
} | {
|
|
187
|
+
name: string;
|
|
188
|
+
description: string;
|
|
189
|
+
inputSchema: {
|
|
190
|
+
projectPath: z.ZodString;
|
|
191
|
+
includeValidation: z.ZodOptional<z.ZodBoolean>;
|
|
192
|
+
};
|
|
193
|
+
handler: (args: {
|
|
194
|
+
projectPath: string;
|
|
195
|
+
includeValidation?: boolean | undefined;
|
|
196
|
+
}, extra: unknown) => Promise<CallToolResult>;
|
|
197
|
+
} | {
|
|
198
|
+
name: string;
|
|
199
|
+
description: string;
|
|
200
|
+
inputSchema: {
|
|
201
|
+
components: z.ZodArray<z.ZodObject<{
|
|
202
|
+
name: z.ZodString;
|
|
203
|
+
group: z.ZodString;
|
|
204
|
+
path: z.ZodString;
|
|
205
|
+
}, "strip", z.ZodTypeAny, {
|
|
206
|
+
name: string;
|
|
207
|
+
path: string;
|
|
208
|
+
group: string;
|
|
209
|
+
}, {
|
|
210
|
+
name: string;
|
|
211
|
+
path: string;
|
|
212
|
+
group: string;
|
|
213
|
+
}>, "many">;
|
|
214
|
+
prdContext: z.ZodOptional<z.ZodString>;
|
|
215
|
+
architectureType: z.ZodEnum<["nextjs-app-router", "nextjs-pages", "react-spa"]>;
|
|
216
|
+
};
|
|
217
|
+
handler: (args: {
|
|
218
|
+
components: {
|
|
219
|
+
name: string;
|
|
220
|
+
path: string;
|
|
221
|
+
group: string;
|
|
222
|
+
}[];
|
|
223
|
+
architectureType: "nextjs-app-router" | "nextjs-pages" | "react-spa";
|
|
224
|
+
prdContext?: string | undefined;
|
|
225
|
+
}, extra: unknown) => Promise<CallToolResult>;
|
|
226
|
+
} | {
|
|
227
|
+
name: string;
|
|
228
|
+
description: string;
|
|
229
|
+
inputSchema: {
|
|
230
|
+
componentMappings: z.ZodAny;
|
|
231
|
+
projectPath: z.ZodString;
|
|
232
|
+
generateRoutes: z.ZodDefault<z.ZodBoolean>;
|
|
233
|
+
generateActions: z.ZodDefault<z.ZodBoolean>;
|
|
234
|
+
generateHooks: z.ZodDefault<z.ZodBoolean>;
|
|
235
|
+
generateLayouts: z.ZodDefault<z.ZodBoolean>;
|
|
236
|
+
};
|
|
237
|
+
handler: (args: {
|
|
238
|
+
projectPath: string;
|
|
239
|
+
generateRoutes: boolean;
|
|
240
|
+
generateActions: boolean;
|
|
241
|
+
generateHooks: boolean;
|
|
242
|
+
generateLayouts: boolean;
|
|
243
|
+
componentMappings?: any;
|
|
244
|
+
}, extra: unknown) => Promise<CallToolResult>;
|
|
115
245
|
})[];
|
|
116
246
|
/**
|
|
117
247
|
* Get MCP tools by name
|
|
@@ -160,5 +290,64 @@ export declare function getMCPToolByName(name: string): {
|
|
|
160
290
|
componentPath: string;
|
|
161
291
|
outputPath?: string | undefined;
|
|
162
292
|
}, extra: unknown) => Promise<CallToolResult>;
|
|
293
|
+
} | {
|
|
294
|
+
name: string;
|
|
295
|
+
description: string;
|
|
296
|
+
inputSchema: {
|
|
297
|
+
projectPath: z.ZodString;
|
|
298
|
+
includeValidation: z.ZodOptional<z.ZodBoolean>;
|
|
299
|
+
};
|
|
300
|
+
handler: (args: {
|
|
301
|
+
projectPath: string;
|
|
302
|
+
includeValidation?: boolean | undefined;
|
|
303
|
+
}, extra: unknown) => Promise<CallToolResult>;
|
|
304
|
+
} | {
|
|
305
|
+
name: string;
|
|
306
|
+
description: string;
|
|
307
|
+
inputSchema: {
|
|
308
|
+
components: z.ZodArray<z.ZodObject<{
|
|
309
|
+
name: z.ZodString;
|
|
310
|
+
group: z.ZodString;
|
|
311
|
+
path: z.ZodString;
|
|
312
|
+
}, "strip", z.ZodTypeAny, {
|
|
313
|
+
name: string;
|
|
314
|
+
path: string;
|
|
315
|
+
group: string;
|
|
316
|
+
}, {
|
|
317
|
+
name: string;
|
|
318
|
+
path: string;
|
|
319
|
+
group: string;
|
|
320
|
+
}>, "many">;
|
|
321
|
+
prdContext: z.ZodOptional<z.ZodString>;
|
|
322
|
+
architectureType: z.ZodEnum<["nextjs-app-router", "nextjs-pages", "react-spa"]>;
|
|
323
|
+
};
|
|
324
|
+
handler: (args: {
|
|
325
|
+
components: {
|
|
326
|
+
name: string;
|
|
327
|
+
path: string;
|
|
328
|
+
group: string;
|
|
329
|
+
}[];
|
|
330
|
+
architectureType: "nextjs-app-router" | "nextjs-pages" | "react-spa";
|
|
331
|
+
prdContext?: string | undefined;
|
|
332
|
+
}, extra: unknown) => Promise<CallToolResult>;
|
|
333
|
+
} | {
|
|
334
|
+
name: string;
|
|
335
|
+
description: string;
|
|
336
|
+
inputSchema: {
|
|
337
|
+
componentMappings: z.ZodAny;
|
|
338
|
+
projectPath: z.ZodString;
|
|
339
|
+
generateRoutes: z.ZodDefault<z.ZodBoolean>;
|
|
340
|
+
generateActions: z.ZodDefault<z.ZodBoolean>;
|
|
341
|
+
generateHooks: z.ZodDefault<z.ZodBoolean>;
|
|
342
|
+
generateLayouts: z.ZodDefault<z.ZodBoolean>;
|
|
343
|
+
};
|
|
344
|
+
handler: (args: {
|
|
345
|
+
projectPath: string;
|
|
346
|
+
generateRoutes: boolean;
|
|
347
|
+
generateActions: boolean;
|
|
348
|
+
generateHooks: boolean;
|
|
349
|
+
generateLayouts: boolean;
|
|
350
|
+
componentMappings?: any;
|
|
351
|
+
}, extra: unknown) => Promise<CallToolResult>;
|
|
163
352
|
} | undefined;
|
|
164
353
|
//# sourceMappingURL=mcpTools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcpTools.d.ts","sourceRoot":"","sources":["../../src/utils/mcpTools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;CAgFhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;CAkG3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;CAqF1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;CA0F5B,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc
|
|
1
|
+
{"version":3,"file":"mcp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