mycontext-cli 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/implementations/ArchitectAgent.d.ts +4 -0
- package/dist/agents/implementations/ArchitectAgent.d.ts.map +1 -1
- package/dist/agents/implementations/ArchitectAgent.js +27 -3
- package/dist/agents/implementations/ArchitectAgent.js.map +1 -1
- package/dist/agents/implementations/BackendDevAgent.d.ts +3 -0
- package/dist/agents/implementations/BackendDevAgent.d.ts.map +1 -1
- package/dist/agents/implementations/BackendDevAgent.js +45 -3
- package/dist/agents/implementations/BackendDevAgent.js.map +1 -1
- package/dist/agents/implementations/DocsSubAgent.d.ts +1 -0
- package/dist/agents/implementations/DocsSubAgent.d.ts.map +1 -1
- package/dist/agents/implementations/DocsSubAgent.js +4 -1
- package/dist/agents/implementations/DocsSubAgent.js.map +1 -1
- package/dist/agents/implementations/InteractiveAgent.d.ts +35 -0
- package/dist/agents/implementations/InteractiveAgent.d.ts.map +1 -0
- package/dist/agents/implementations/InteractiveAgent.js +309 -0
- package/dist/agents/implementations/InteractiveAgent.js.map +1 -0
- package/dist/agents/implementations/ProjectSetupAgent.d.ts +23 -0
- package/dist/agents/implementations/ProjectSetupAgent.d.ts.map +1 -0
- package/dist/agents/implementations/ProjectSetupAgent.js +231 -0
- package/dist/agents/implementations/ProjectSetupAgent.js.map +1 -0
- package/dist/agents/implementations/SecurityAgent.d.ts +4 -0
- package/dist/agents/implementations/SecurityAgent.d.ts.map +1 -1
- package/dist/agents/implementations/SecurityAgent.js +27 -3
- package/dist/agents/implementations/SecurityAgent.js.map +1 -1
- package/dist/agents/implementations/WorkflowAgent.d.ts +31 -0
- package/dist/agents/implementations/WorkflowAgent.d.ts.map +1 -0
- package/dist/agents/implementations/WorkflowAgent.js +381 -0
- package/dist/agents/implementations/WorkflowAgent.js.map +1 -0
- package/dist/agents/interfaces/SubAgent.d.ts +66 -0
- package/dist/agents/interfaces/SubAgent.d.ts.map +1 -1
- package/dist/agents/personalities/definitions.d.ts.map +1 -1
- package/dist/agents/personalities/definitions.js +52 -0
- package/dist/agents/personalities/definitions.js.map +1 -1
- package/dist/cli.js +65 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/build-app.d.ts +4 -18
- package/dist/commands/build-app.d.ts.map +1 -1
- package/dist/commands/build-app.js +52 -478
- package/dist/commands/build-app.js.map +1 -1
- package/dist/commands/compile-prd.d.ts +18 -0
- package/dist/commands/compile-prd.d.ts.map +1 -0
- package/dist/commands/compile-prd.js +217 -0
- package/dist/commands/compile-prd.js.map +1 -0
- package/dist/commands/generate-context-files.d.ts +26 -0
- package/dist/commands/generate-context-files.d.ts.map +1 -0
- package/dist/commands/generate-context-files.js +320 -0
- package/dist/commands/generate-context-files.js.map +1 -0
- package/dist/commands/generate.d.ts +1 -0
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +156 -14
- package/dist/commands/generate.js.map +1 -1
- package/dist/config/api.js +1 -1
- package/dist/config/api.js.map +1 -1
- package/dist/config/api.ts +1 -1
- package/dist/utils/hybridAIClient.d.ts.map +1 -1
- package/dist/utils/hybridAIClient.js +4 -1
- package/dist/utils/hybridAIClient.js.map +1 -1
- package/package.json +4 -2
- package/dist/utils/ollamaClient.d.ts +0 -30
- package/dist/utils/ollamaClient.d.ts.map +0 -1
- package/dist/utils/ollamaClient.js +0 -226
- package/dist/utils/ollamaClient.js.map +0 -1
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.CompilePRDCommand = void 0;
|
|
40
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
41
|
+
const fs = __importStar(require("fs-extra"));
|
|
42
|
+
const path_1 = __importDefault(require("path"));
|
|
43
|
+
const hybridAIClient_1 = require("../utils/hybridAIClient");
|
|
44
|
+
const spinner_1 = require("../utils/spinner");
|
|
45
|
+
class CompilePRDCommand {
|
|
46
|
+
constructor() {
|
|
47
|
+
this.aiClient = new hybridAIClient_1.HybridAIClient();
|
|
48
|
+
}
|
|
49
|
+
async execute(options) {
|
|
50
|
+
const projectPath = options.projectPath || process.cwd();
|
|
51
|
+
const contextDir = path_1.default.join(projectPath, ".mycontext");
|
|
52
|
+
console.log(chalk_1.default.blue.bold("📋 Compiling PRD from Context Files"));
|
|
53
|
+
console.log(chalk_1.default.gray("Generating comprehensive PRD from A/B/C/D context files...\n"));
|
|
54
|
+
// Check if context files exist
|
|
55
|
+
const contextFiles = await this.checkContextFiles(contextDir);
|
|
56
|
+
if (contextFiles.missing.length > 0) {
|
|
57
|
+
console.error(chalk_1.default.red("❌ Missing required context files:"));
|
|
58
|
+
contextFiles.missing.forEach((file) => console.error(chalk_1.default.gray(` • ${file}`)));
|
|
59
|
+
console.error(chalk_1.default.red("\nPlease run 'mycontext generate-context-files' first.\n"));
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
// Check if PRD already exists
|
|
63
|
+
const prdPath = path_1.default.join(contextDir, "02-prd.md");
|
|
64
|
+
if ((await fs.pathExists(prdPath)) && !options.force) {
|
|
65
|
+
console.log(chalk_1.default.yellow("⚠️ PRD already exists at .mycontext/02-prd.md"));
|
|
66
|
+
console.log(chalk_1.default.yellow("Use --force to overwrite existing PRD.\n"));
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
// Read context files
|
|
71
|
+
const contextData = await this.readContextFiles(contextDir, contextFiles.existing);
|
|
72
|
+
// Generate PRD
|
|
73
|
+
await this.generatePRD(contextDir, contextData);
|
|
74
|
+
console.log(chalk_1.default.green.bold("\n✅ PRD Compiled Successfully!"));
|
|
75
|
+
console.log(chalk_1.default.gray("\nGenerated file:"));
|
|
76
|
+
console.log(chalk_1.default.gray(" • 02-prd.md - Comprehensive Product Requirements Document"));
|
|
77
|
+
console.log(chalk_1.default.blue.bold("\n📋 Next Steps:"));
|
|
78
|
+
console.log(chalk_1.default.gray("1. Review the compiled PRD"));
|
|
79
|
+
console.log(chalk_1.default.gray("2. Run 'mycontext generate types' to generate TypeScript types"));
|
|
80
|
+
console.log(chalk_1.default.gray("3. Run 'mycontext generate brand-kit' to create brand guidelines"));
|
|
81
|
+
console.log(chalk_1.default.gray("4. Run 'mycontext generate components-list' to plan components"));
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
console.error(chalk_1.default.red("❌ PRD compilation failed:"), error);
|
|
85
|
+
throw error;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async checkContextFiles(contextDir) {
|
|
89
|
+
const requiredFiles = [
|
|
90
|
+
"01a-features.md",
|
|
91
|
+
"01b-user-flows.md",
|
|
92
|
+
"01c-edge-cases.md",
|
|
93
|
+
"01d-technical-specs.md",
|
|
94
|
+
];
|
|
95
|
+
const existing = [];
|
|
96
|
+
const missing = [];
|
|
97
|
+
for (const file of requiredFiles) {
|
|
98
|
+
if (await fs.pathExists(path_1.default.join(contextDir, file))) {
|
|
99
|
+
existing.push(file);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
missing.push(file);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return { existing, missing };
|
|
106
|
+
}
|
|
107
|
+
async readContextFiles(contextDir, files) {
|
|
108
|
+
const contextData = {};
|
|
109
|
+
for (const file of files) {
|
|
110
|
+
const filePath = path_1.default.join(contextDir, file);
|
|
111
|
+
const content = await fs.readFile(filePath, "utf-8");
|
|
112
|
+
contextData[file] = content;
|
|
113
|
+
}
|
|
114
|
+
return contextData;
|
|
115
|
+
}
|
|
116
|
+
async generatePRD(contextDir, contextData) {
|
|
117
|
+
const spinner = new spinner_1.EnhancedSpinner("Compiling PRD from context files...");
|
|
118
|
+
spinner.start();
|
|
119
|
+
try {
|
|
120
|
+
const prompt = this.buildPRDPrompt(contextData);
|
|
121
|
+
const response = await this.aiClient.generateText(prompt, {
|
|
122
|
+
temperature: 0.7,
|
|
123
|
+
maxTokens: 4000,
|
|
124
|
+
});
|
|
125
|
+
const content = this.formatPRDContent(response.text, contextData);
|
|
126
|
+
await fs.writeFile(path_1.default.join(contextDir, "02-prd.md"), content);
|
|
127
|
+
spinner.succeed("PRD compiled");
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
spinner.fail("PRD compilation failed");
|
|
131
|
+
throw error;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
buildPRDPrompt(contextData) {
|
|
135
|
+
const features = contextData["01a-features.md"] || "";
|
|
136
|
+
const userFlows = contextData["01b-user-flows.md"] || "";
|
|
137
|
+
const edgeCases = contextData["01c-edge-cases.md"] || "";
|
|
138
|
+
const technicalSpecs = contextData["01d-technical-specs.md"] || "";
|
|
139
|
+
return `You are a product manager creating a comprehensive Product Requirements Document (PRD) by compiling information from multiple context files.
|
|
140
|
+
|
|
141
|
+
Create a well-structured PRD that synthesizes the following context:
|
|
142
|
+
|
|
143
|
+
## Features Context:
|
|
144
|
+
${features}
|
|
145
|
+
|
|
146
|
+
## User Flows Context:
|
|
147
|
+
${userFlows}
|
|
148
|
+
|
|
149
|
+
## Edge Cases Context:
|
|
150
|
+
${edgeCases}
|
|
151
|
+
|
|
152
|
+
## Technical Specifications Context:
|
|
153
|
+
${technicalSpecs}
|
|
154
|
+
|
|
155
|
+
Generate a comprehensive PRD that includes:
|
|
156
|
+
|
|
157
|
+
1. **Executive Summary** - High-level project overview and objectives
|
|
158
|
+
2. **Product Overview** - What we're building and why
|
|
159
|
+
3. **Target Users** - User personas and target audience
|
|
160
|
+
4. **Core Features** - Primary functionality organized by priority
|
|
161
|
+
5. **User Stories** - Detailed user stories with acceptance criteria
|
|
162
|
+
6. **User Experience** - Key user flows and interaction patterns
|
|
163
|
+
7. **Technical Requirements** - Architecture, technology stack, and constraints
|
|
164
|
+
8. **Non-Functional Requirements** - Performance, security, accessibility
|
|
165
|
+
9. **Success Metrics** - How we measure success
|
|
166
|
+
10. **Timeline and Milestones** - Development phases and deliverables
|
|
167
|
+
11. **Risks and Mitigation** - Potential issues and solutions
|
|
168
|
+
12. **Dependencies** - External dependencies and integrations
|
|
169
|
+
|
|
170
|
+
Ensure the PRD is:
|
|
171
|
+
- Comprehensive yet concise
|
|
172
|
+
- Well-organized with clear sections
|
|
173
|
+
- Includes specific, measurable requirements
|
|
174
|
+
- Addresses both functional and non-functional needs
|
|
175
|
+
- Provides clear guidance for development teams
|
|
176
|
+
|
|
177
|
+
Format the output as a professional markdown document with clear headings, bullet points, and structured content.`;
|
|
178
|
+
}
|
|
179
|
+
formatPRDContent(response, contextData) {
|
|
180
|
+
const timestamp = new Date().toISOString();
|
|
181
|
+
const contextFiles = Object.keys(contextData).join(", ");
|
|
182
|
+
return `# Product Requirements Document (PRD)
|
|
183
|
+
|
|
184
|
+
${response}
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Document Information
|
|
189
|
+
|
|
190
|
+
- **Generated**: ${timestamp}
|
|
191
|
+
- **Source Context Files**: ${contextFiles}
|
|
192
|
+
- **Generated by**: MyContext CLI - AI-powered component generation platform
|
|
193
|
+
- **Version**: 1.0
|
|
194
|
+
|
|
195
|
+
## Context File References
|
|
196
|
+
|
|
197
|
+
This PRD was compiled from the following context files:
|
|
198
|
+
${Object.keys(contextData)
|
|
199
|
+
.map((file) => `- \`${file}\` - ${this.getContextFileDescription(file)}`)
|
|
200
|
+
.join("\n")}
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
*This document serves as the single source of truth for product requirements and should be updated as the project evolves.*
|
|
204
|
+
`;
|
|
205
|
+
}
|
|
206
|
+
getContextFileDescription(filename) {
|
|
207
|
+
const descriptions = {
|
|
208
|
+
"01a-features.md": "Product features and capabilities",
|
|
209
|
+
"01b-user-flows.md": "User journey maps and interaction patterns",
|
|
210
|
+
"01c-edge-cases.md": "Error scenarios and edge conditions",
|
|
211
|
+
"01d-technical-specs.md": "Architecture and technical requirements",
|
|
212
|
+
};
|
|
213
|
+
return descriptions[filename] || "Context file";
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
exports.CompilePRDCommand = CompilePRDCommand;
|
|
217
|
+
//# sourceMappingURL=compile-prd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile-prd.js","sourceRoot":"","sources":["../../src/commands/compile-prd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAA0B;AAC1B,6CAA+B;AAC/B,gDAAwB;AACxB,4DAAyD;AACzD,8CAAmD;AAQnD,MAAa,iBAAiB;IAG5B;QACE,IAAI,CAAC,QAAQ,GAAG,IAAI,+BAAc,EAAE,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAA0B;QACtC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QACzD,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;QAExD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC,CAAC;QACpE,OAAO,CAAC,GAAG,CACT,eAAK,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAC3E,CAAC;QAEF,+BAA+B;QAC/B,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAC9D,IAAI,YAAY,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpC,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC,CAAC;YAC9D,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CACpC,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAC1C,CAAC;YACF,OAAO,CAAC,KAAK,CACX,eAAK,CAAC,GAAG,CAAC,0DAA0D,CAAC,CACtE,CAAC;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G,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC3C,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEzD,OAAO;;EAET,QAAQ;;;;;;mBAMS,SAAS;8BACE,YAAY;;;;;;;EAOxC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;aACvB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,QAAQ,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,EAAE,CAAC;aACxE,IAAI,CAAC,IAAI,CAAC;;;;CAIZ,CAAC;IACA,CAAC;IAEO,yBAAyB,CAAC,QAAgB;QAChD,MAAM,YAAY,GAA2B;YAC3C,iBAAiB,EAAE,mCAAmC;YACtD,mBAAmB,EAAE,4CAA4C;YACjE,mBAAmB,EAAE,qCAAqC;YAC1D,wBAAwB,EAAE,yCAAyC;SACpE,CAAC;QAEF,OAAO,YAAY,CAAC,QAAQ,CAAC,IAAI,cAAc,CAAC;IAClD,CAAC;CACF;AAzOD,8CAyOC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
interface ContextFilesOptions {
|
|
2
|
+
description?: string;
|
|
3
|
+
projectPath?: string;
|
|
4
|
+
verbose?: boolean;
|
|
5
|
+
force?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class GenerateContextFilesCommand {
|
|
8
|
+
private aiClient;
|
|
9
|
+
constructor();
|
|
10
|
+
execute(options: ContextFilesOptions): Promise<void>;
|
|
11
|
+
private checkExistingFiles;
|
|
12
|
+
private generateFeaturesFile;
|
|
13
|
+
private generateUserFlowsFile;
|
|
14
|
+
private generateEdgeCasesFile;
|
|
15
|
+
private generateTechnicalSpecsFile;
|
|
16
|
+
private buildFeaturesPrompt;
|
|
17
|
+
private buildUserFlowsPrompt;
|
|
18
|
+
private buildEdgeCasesPrompt;
|
|
19
|
+
private buildTechnicalSpecsPrompt;
|
|
20
|
+
private formatFeaturesContent;
|
|
21
|
+
private formatUserFlowsContent;
|
|
22
|
+
private formatEdgeCasesContent;
|
|
23
|
+
private formatTechnicalSpecsContent;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=generate-context-files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-context-files.d.ts","sourceRoot":"","sources":["../../src/commands/generate-context-files.ts"],"names":[],"mappings":"AAOA,UAAU,mBAAmB;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,qBAAa,2BAA2B;IACtC,OAAO,CAAC,QAAQ,CAAiB;;IAM3B,OAAO,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;YAwE5C,kBAAkB;YAkBlB,oBAAoB;YAwBpB,qBAAqB;YAwBrB,qBAAqB;YAwBrB,0BAA0B;IA2BxC,OAAO,CAAC,mBAAmB;IA0B3B,OAAO,CAAC,oBAAoB;IA0B5B,OAAO,CAAC,oBAAoB;IA4B5B,OAAO,CAAC,yBAAyB;IA4BjC,OAAO,CAAC,qBAAqB;IAW7B,OAAO,CAAC,sBAAsB;IAW9B,OAAO,CAAC,sBAAsB;IAW9B,OAAO,CAAC,2BAA2B;CAUpC"}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.GenerateContextFilesCommand = void 0;
|
|
40
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
41
|
+
const fs = __importStar(require("fs-extra"));
|
|
42
|
+
const path_1 = __importDefault(require("path"));
|
|
43
|
+
const hybridAIClient_1 = require("../utils/hybridAIClient");
|
|
44
|
+
const spinner_1 = require("../utils/spinner");
|
|
45
|
+
class GenerateContextFilesCommand {
|
|
46
|
+
constructor() {
|
|
47
|
+
this.aiClient = new hybridAIClient_1.HybridAIClient();
|
|
48
|
+
}
|
|
49
|
+
async execute(options) {
|
|
50
|
+
const projectPath = options.projectPath || process.cwd();
|
|
51
|
+
const contextDir = path_1.default.join(projectPath, ".mycontext");
|
|
52
|
+
console.log(chalk_1.default.blue.bold("📝 Generating Context Files (A/B/C/D)"));
|
|
53
|
+
console.log(chalk_1.default.gray("Creating comprehensive project context from description...\n"));
|
|
54
|
+
// Ensure .mycontext directory exists
|
|
55
|
+
await fs.ensureDir(contextDir);
|
|
56
|
+
// Check if context files already exist
|
|
57
|
+
const existingFiles = await this.checkExistingFiles(contextDir);
|
|
58
|
+
if (existingFiles.length > 0 && !options.force) {
|
|
59
|
+
console.log(chalk_1.default.yellow("⚠️ Context files already exist:"));
|
|
60
|
+
existingFiles.forEach((file) => console.log(chalk_1.default.gray(` • ${file}`)));
|
|
61
|
+
console.log(chalk_1.default.yellow("\nUse --force to overwrite existing files.\n"));
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
// Generate each context file
|
|
66
|
+
await this.generateFeaturesFile(contextDir, options.description);
|
|
67
|
+
await this.generateUserFlowsFile(contextDir, options.description);
|
|
68
|
+
await this.generateEdgeCasesFile(contextDir, options.description);
|
|
69
|
+
await this.generateTechnicalSpecsFile(contextDir, options.description);
|
|
70
|
+
console.log(chalk_1.default.green.bold("\n✅ Context Files Generated Successfully!"));
|
|
71
|
+
console.log(chalk_1.default.gray("\nGenerated files:"));
|
|
72
|
+
console.log(chalk_1.default.gray(" • 01a-features.md - Product features and capabilities"));
|
|
73
|
+
console.log(chalk_1.default.gray(" • 01b-user-flows.md - User journey maps and interactions"));
|
|
74
|
+
console.log(chalk_1.default.gray(" • 01c-edge-cases.md - Error scenarios and edge conditions"));
|
|
75
|
+
console.log(chalk_1.default.gray(" • 01d-technical-specs.md - Architecture and technical requirements"));
|
|
76
|
+
console.log(chalk_1.default.blue.bold("\n📋 Next Steps:"));
|
|
77
|
+
console.log(chalk_1.default.gray("1. Review and refine the generated context files"));
|
|
78
|
+
console.log(chalk_1.default.gray("2. Run 'mycontext compile-prd' to generate the PRD"));
|
|
79
|
+
console.log(chalk_1.default.gray("3. Run 'mycontext generate types' to generate TypeScript types"));
|
|
80
|
+
console.log(chalk_1.default.gray("4. Run 'mycontext generate brand-kit' to create brand guidelines"));
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
console.error(chalk_1.default.red("❌ Context file generation failed:"), error);
|
|
84
|
+
throw error;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
async checkExistingFiles(contextDir) {
|
|
88
|
+
const files = [
|
|
89
|
+
"01a-features.md",
|
|
90
|
+
"01b-user-flows.md",
|
|
91
|
+
"01c-edge-cases.md",
|
|
92
|
+
"01d-technical-specs.md",
|
|
93
|
+
];
|
|
94
|
+
const existingFiles = [];
|
|
95
|
+
for (const file of files) {
|
|
96
|
+
if (await fs.pathExists(path_1.default.join(contextDir, file))) {
|
|
97
|
+
existingFiles.push(file);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return existingFiles;
|
|
101
|
+
}
|
|
102
|
+
async generateFeaturesFile(contextDir, description) {
|
|
103
|
+
const spinner = new spinner_1.EnhancedSpinner("Generating features...");
|
|
104
|
+
spinner.start();
|
|
105
|
+
try {
|
|
106
|
+
const prompt = this.buildFeaturesPrompt(description);
|
|
107
|
+
const response = await this.aiClient.generateText(prompt, {
|
|
108
|
+
temperature: 0.7,
|
|
109
|
+
maxTokens: 2000,
|
|
110
|
+
});
|
|
111
|
+
const content = this.formatFeaturesContent(response.text);
|
|
112
|
+
await fs.writeFile(path_1.default.join(contextDir, "01a-features.md"), content);
|
|
113
|
+
spinner.succeed("Features generated");
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
spinner.fail("Features generation failed");
|
|
117
|
+
throw error;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
async generateUserFlowsFile(contextDir, description) {
|
|
121
|
+
const spinner = new spinner_1.EnhancedSpinner("Generating user flows...");
|
|
122
|
+
spinner.start();
|
|
123
|
+
try {
|
|
124
|
+
const prompt = this.buildUserFlowsPrompt(description);
|
|
125
|
+
const response = await this.aiClient.generateText(prompt, {
|
|
126
|
+
temperature: 0.7,
|
|
127
|
+
maxTokens: 2000,
|
|
128
|
+
});
|
|
129
|
+
const content = this.formatUserFlowsContent(response.text);
|
|
130
|
+
await fs.writeFile(path_1.default.join(contextDir, "01b-user-flows.md"), content);
|
|
131
|
+
spinner.succeed("User flows generated");
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
spinner.fail("User flows generation failed");
|
|
135
|
+
throw error;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
async generateEdgeCasesFile(contextDir, description) {
|
|
139
|
+
const spinner = new spinner_1.EnhancedSpinner("Generating edge cases...");
|
|
140
|
+
spinner.start();
|
|
141
|
+
try {
|
|
142
|
+
const prompt = this.buildEdgeCasesPrompt(description);
|
|
143
|
+
const response = await this.aiClient.generateText(prompt, {
|
|
144
|
+
temperature: 0.7,
|
|
145
|
+
maxTokens: 2000,
|
|
146
|
+
});
|
|
147
|
+
const content = this.formatEdgeCasesContent(response.text);
|
|
148
|
+
await fs.writeFile(path_1.default.join(contextDir, "01c-edge-cases.md"), content);
|
|
149
|
+
spinner.succeed("Edge cases generated");
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
spinner.fail("Edge cases generation failed");
|
|
153
|
+
throw error;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
async generateTechnicalSpecsFile(contextDir, description) {
|
|
157
|
+
const spinner = new spinner_1.EnhancedSpinner("Generating technical specs...");
|
|
158
|
+
spinner.start();
|
|
159
|
+
try {
|
|
160
|
+
const prompt = this.buildTechnicalSpecsPrompt(description);
|
|
161
|
+
const response = await this.aiClient.generateText(prompt, {
|
|
162
|
+
temperature: 0.7,
|
|
163
|
+
maxTokens: 2000,
|
|
164
|
+
});
|
|
165
|
+
const content = this.formatTechnicalSpecsContent(response.text);
|
|
166
|
+
await fs.writeFile(path_1.default.join(contextDir, "01d-technical-specs.md"), content);
|
|
167
|
+
spinner.succeed("Technical specs generated");
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
spinner.fail("Technical specs generation failed");
|
|
171
|
+
throw error;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
buildFeaturesPrompt(description) {
|
|
175
|
+
return `You are a product manager creating a comprehensive features document for a web application.
|
|
176
|
+
|
|
177
|
+
${description ? `Project Description: ${description}` : "Generate features for a modern web application."}
|
|
178
|
+
|
|
179
|
+
Create a detailed features document that includes:
|
|
180
|
+
|
|
181
|
+
1. **Core Features** - Primary functionality that defines the product
|
|
182
|
+
2. **User Features** - Features that directly benefit end users
|
|
183
|
+
3. **Admin Features** - Administrative and management capabilities
|
|
184
|
+
4. **Technical Features** - Backend, API, and infrastructure features
|
|
185
|
+
5. **Integration Features** - Third-party integrations and APIs
|
|
186
|
+
6. **Security Features** - Authentication, authorization, and data protection
|
|
187
|
+
7. **Performance Features** - Optimization and scalability features
|
|
188
|
+
8. **Accessibility Features** - WCAG compliance and inclusive design
|
|
189
|
+
|
|
190
|
+
For each feature, include:
|
|
191
|
+
- Feature name and description
|
|
192
|
+
- User value proposition
|
|
193
|
+
- Acceptance criteria
|
|
194
|
+
- Priority level (High/Medium/Low)
|
|
195
|
+
- Dependencies on other features
|
|
196
|
+
|
|
197
|
+
Format the output as a well-structured markdown document with clear sections and bullet points.`;
|
|
198
|
+
}
|
|
199
|
+
buildUserFlowsPrompt(description) {
|
|
200
|
+
return `You are a UX designer creating comprehensive user flow documentation for a web application.
|
|
201
|
+
|
|
202
|
+
${description ? `Project Description: ${description}` : "Generate user flows for a modern web application."}
|
|
203
|
+
|
|
204
|
+
Create detailed user flow documentation that includes:
|
|
205
|
+
|
|
206
|
+
1. **Primary User Journeys** - Main user paths through the application
|
|
207
|
+
2. **Authentication Flows** - Login, signup, password reset, etc.
|
|
208
|
+
3. **Core Feature Flows** - How users interact with main features
|
|
209
|
+
4. **Error Handling Flows** - What happens when things go wrong
|
|
210
|
+
5. **Admin/Management Flows** - Administrative user journeys
|
|
211
|
+
6. **Mobile vs Desktop Flows** - Responsive design considerations
|
|
212
|
+
7. **Accessibility Flows** - Screen reader and keyboard navigation paths
|
|
213
|
+
|
|
214
|
+
For each flow, include:
|
|
215
|
+
- Flow name and description
|
|
216
|
+
- Step-by-step user actions
|
|
217
|
+
- System responses and feedback
|
|
218
|
+
- Decision points and branches
|
|
219
|
+
- Error states and recovery
|
|
220
|
+
- Success criteria
|
|
221
|
+
|
|
222
|
+
Format the output as a well-structured markdown document with clear sections, numbered steps, and flow diagrams in text format.`;
|
|
223
|
+
}
|
|
224
|
+
buildEdgeCasesPrompt(description) {
|
|
225
|
+
return `You are a QA engineer creating comprehensive edge cases and error scenarios documentation for a web application.
|
|
226
|
+
|
|
227
|
+
${description ? `Project Description: ${description}` : "Generate edge cases for a modern web application."}
|
|
228
|
+
|
|
229
|
+
Create detailed edge cases documentation that includes:
|
|
230
|
+
|
|
231
|
+
1. **Input Validation Edge Cases** - Invalid, malformed, or extreme input scenarios
|
|
232
|
+
2. **Network Edge Cases** - Offline, slow connections, timeouts, API failures
|
|
233
|
+
3. **Browser Edge Cases** - Different browsers, versions, disabled features
|
|
234
|
+
4. **Device Edge Cases** - Mobile, tablet, desktop, different screen sizes
|
|
235
|
+
5. **Data Edge Cases** - Empty data, large datasets, concurrent modifications
|
|
236
|
+
6. **Security Edge Cases** - Injection attacks, XSS, CSRF, unauthorized access
|
|
237
|
+
7. **Performance Edge Cases** - High load, memory constraints, slow operations
|
|
238
|
+
8. **Accessibility Edge Cases** - Screen readers, keyboard-only navigation, high contrast
|
|
239
|
+
9. **Integration Edge Cases** - Third-party service failures, API changes
|
|
240
|
+
10. **Business Logic Edge Cases** - Boundary conditions, race conditions
|
|
241
|
+
|
|
242
|
+
For each edge case, include:
|
|
243
|
+
- Scenario description
|
|
244
|
+
- Expected behavior
|
|
245
|
+
- Potential impact
|
|
246
|
+
- Mitigation strategies
|
|
247
|
+
- Testing approach
|
|
248
|
+
|
|
249
|
+
Format the output as a well-structured markdown document with clear sections and detailed scenarios.`;
|
|
250
|
+
}
|
|
251
|
+
buildTechnicalSpecsPrompt(description) {
|
|
252
|
+
return `You are a technical architect creating comprehensive technical specifications for a web application.
|
|
253
|
+
|
|
254
|
+
${description ? `Project Description: ${description}` : "Generate technical specs for a modern web application."}
|
|
255
|
+
|
|
256
|
+
Create detailed technical specifications that include:
|
|
257
|
+
|
|
258
|
+
1. **Architecture Overview** - System design, components, and relationships
|
|
259
|
+
2. **Technology Stack** - Frontend, backend, database, deployment technologies
|
|
260
|
+
3. **API Specifications** - Endpoints, request/response formats, authentication
|
|
261
|
+
4. **Database Design** - Schema, relationships, indexing, data flow
|
|
262
|
+
5. **Security Requirements** - Authentication, authorization, data protection
|
|
263
|
+
6. **Performance Requirements** - Response times, throughput, scalability
|
|
264
|
+
7. **Deployment Architecture** - Infrastructure, CI/CD, monitoring
|
|
265
|
+
8. **Integration Requirements** - Third-party services, APIs, webhooks
|
|
266
|
+
9. **Development Standards** - Code style, testing, documentation
|
|
267
|
+
10. **Monitoring and Logging** - Error tracking, analytics, performance monitoring
|
|
268
|
+
|
|
269
|
+
For each specification, include:
|
|
270
|
+
- Requirement description
|
|
271
|
+
- Technical approach
|
|
272
|
+
- Implementation details
|
|
273
|
+
- Dependencies
|
|
274
|
+
- Success criteria
|
|
275
|
+
|
|
276
|
+
Format the output as a well-structured markdown document with clear sections and technical details.`;
|
|
277
|
+
}
|
|
278
|
+
formatFeaturesContent(response) {
|
|
279
|
+
return `# Product Features
|
|
280
|
+
|
|
281
|
+
${response}
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
*Generated by MyContext CLI - AI-powered component generation platform*
|
|
285
|
+
*Last updated: ${new Date().toISOString()}*
|
|
286
|
+
`;
|
|
287
|
+
}
|
|
288
|
+
formatUserFlowsContent(response) {
|
|
289
|
+
return `# User Flows
|
|
290
|
+
|
|
291
|
+
${response}
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
*Generated by MyContext CLI - AI-powered component generation platform*
|
|
295
|
+
*Last updated: ${new Date().toISOString()}*
|
|
296
|
+
`;
|
|
297
|
+
}
|
|
298
|
+
formatEdgeCasesContent(response) {
|
|
299
|
+
return `# Edge Cases and Error Scenarios
|
|
300
|
+
|
|
301
|
+
${response}
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
*Generated by MyContext CLI - AI-powered component generation platform*
|
|
305
|
+
*Last updated: ${new Date().toISOString()}*
|
|
306
|
+
`;
|
|
307
|
+
}
|
|
308
|
+
formatTechnicalSpecsContent(response) {
|
|
309
|
+
return `# Technical Specifications
|
|
310
|
+
|
|
311
|
+
${response}
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
*Generated by MyContext CLI - AI-powered component generation platform*
|
|
315
|
+
*Last updated: ${new Date().toISOString()}*
|
|
316
|
+
`;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
exports.GenerateContextFilesCommand = GenerateContextFilesCommand;
|
|
320
|
+
//# sourceMappingURL=generate-context-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-context-files.js","sourceRoot":"","sources":["../../src/commands/generate-context-files.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAA0B;AAC1B,6CAA+B;AAC/B,gDAAwB;AACxB,4DAAyD;AACzD,8CAAmD;AASnD,MAAa,2BAA2B;IAGtC;QACE,IAAI,CAAC,QAAQ,GAAG,IAAI,+BAAc,EAAE,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAA4B;QACxC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QACzD,MAAM,UAAU,GAAG,cAAI,CAAC,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AwB,WAAW,EAAE,CAAC,CAAC,CAAC,mDAAmD;;;;;;;;;;;;;;;;;;;;;;qGAsBN,CAAC;IACpG,CAAC;IAEO,yBAAyB,CAAC,WAAoB;QACpD,OAAO;;EAET,WAAW,CAAC,CAAC,CAAC,wBAAwB,WAAW,EAAE,CAAC,CAAC,CAAC,wDAAwD;;;;;;;;;;;;;;;;;;;;;;oGAsBZ,CAAC;IACnG,CAAC;IAEO,qBAAqB,CAAC,QAAgB;QAC5C,OAAO;;EAET,QAAQ;;;;iBAIO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;CACxC,CAAC;IACA,CAAC;IAEO,sBAAsB,CAAC,QAAgB;QAC7C,OAAO;;EAET,QAAQ;;;;iBAIO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;CACxC,CAAC;IACA,CAAC;IAEO,sBAAsB,CAAC,QAAgB;QAC7C,OAAO;;EAET,QAAQ;;;;iBAIO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;CACxC,CAAC;IACA,CAAC;IAEO,2BAA2B,CAAC,QAAgB;QAClD,OAAO;;EAET,QAAQ;;;;iBAIO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;CACxC,CAAC;IACA,CAAC;CACF;AA3VD,kEA2VC"}
|
|
@@ -20,6 +20,7 @@ export declare class GenerateCommand {
|
|
|
20
20
|
private resolveInputContext;
|
|
21
21
|
generateContext(projectContext: any, options: GenerateOptions): Promise<GenerationResult>;
|
|
22
22
|
generateTypes(projectContext: any, options: GenerateOptions): Promise<GenerationResult>;
|
|
23
|
+
private generateTypesTemplate;
|
|
23
24
|
private parseAndStructureTypes;
|
|
24
25
|
private generateTypesIndex;
|
|
25
26
|
private generateTypesDatabase;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAqB,gBAAgB,EAAE,MAAM,UAAU,CAAC;AA2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