@mytechtoday/augment-extensions 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/dist/__test_rule-install-hooks.d.ts +2 -0
- package/cli/dist/__test_rule-install-hooks.d.ts.map +1 -0
- package/cli/dist/__test_rule-install-hooks.js +4 -0
- package/cli/dist/__test_rule-install-hooks.js.map +1 -0
- package/cli/dist/commands/show.d.ts +4 -0
- package/cli/dist/commands/show.d.ts.map +1 -1
- package/cli/dist/commands/show.js +72 -2
- package/cli/dist/commands/show.js.map +1 -1
- package/cli/dist/parsers/php-parser.d.ts +127 -0
- package/cli/dist/parsers/php-parser.d.ts.map +1 -0
- package/cli/dist/parsers/php-parser.js +290 -0
- package/cli/dist/parsers/php-parser.js.map +1 -0
- package/cli/dist/utils/ai-prompts.d.ts +32 -0
- package/cli/dist/utils/ai-prompts.d.ts.map +1 -0
- package/cli/dist/utils/ai-prompts.js +192 -0
- package/cli/dist/utils/ai-prompts.js.map +1 -0
- package/cli/dist/utils/ai-summary.d.ts +42 -0
- package/cli/dist/utils/ai-summary.d.ts.map +1 -0
- package/cli/dist/utils/ai-summary.js +177 -0
- package/cli/dist/utils/ai-summary.js.map +1 -0
- package/cli/dist/utils/config-loader.d.ts +90 -0
- package/cli/dist/utils/config-loader.d.ts.map +1 -0
- package/cli/dist/utils/config-loader.js +223 -0
- package/cli/dist/utils/config-loader.js.map +1 -0
- package/cli/dist/webview/inspection-webview-provider.d.ts +49 -0
- package/cli/dist/webview/inspection-webview-provider.d.ts.map +1 -0
- package/cli/dist/webview/inspection-webview-provider.js +386 -0
- package/cli/dist/webview/inspection-webview-provider.js.map +1 -0
- package/package.json +3 -1
|
@@ -0,0 +1,290 @@
|
|
|
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.phpParser = exports.PHPParser = void 0;
|
|
40
|
+
const fs = __importStar(require("fs"));
|
|
41
|
+
// @ts-ignore - php-parser doesn't have TypeScript definitions
|
|
42
|
+
const php_parser_1 = __importDefault(require("php-parser"));
|
|
43
|
+
/**
|
|
44
|
+
* PHP Parser class
|
|
45
|
+
*/
|
|
46
|
+
class PHPParser {
|
|
47
|
+
constructor() {
|
|
48
|
+
this.engine = new php_parser_1.default({
|
|
49
|
+
parser: {
|
|
50
|
+
php7: true,
|
|
51
|
+
php8: true,
|
|
52
|
+
extractDoc: true,
|
|
53
|
+
suppressErrors: false
|
|
54
|
+
},
|
|
55
|
+
ast: {
|
|
56
|
+
withPositions: true,
|
|
57
|
+
withSource: false
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Parse PHP file and extract elements
|
|
63
|
+
*/
|
|
64
|
+
parseFile(filePath) {
|
|
65
|
+
try {
|
|
66
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
67
|
+
return this.parseContent(content);
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
return {
|
|
71
|
+
namespaces: [],
|
|
72
|
+
classes: [],
|
|
73
|
+
functions: [],
|
|
74
|
+
constants: [],
|
|
75
|
+
traits: [],
|
|
76
|
+
interfaces: [],
|
|
77
|
+
errors: [{ message: `Failed to read file: ${error}` }]
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Parse PHP content string
|
|
83
|
+
*/
|
|
84
|
+
parseContent(content) {
|
|
85
|
+
const result = {
|
|
86
|
+
namespaces: [],
|
|
87
|
+
classes: [],
|
|
88
|
+
functions: [],
|
|
89
|
+
constants: [],
|
|
90
|
+
traits: [],
|
|
91
|
+
interfaces: [],
|
|
92
|
+
errors: []
|
|
93
|
+
};
|
|
94
|
+
try {
|
|
95
|
+
const ast = this.engine.parseCode(content);
|
|
96
|
+
this.extractElements(ast, result);
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
result.errors.push({
|
|
100
|
+
message: `Parse error: ${error.message || error}`,
|
|
101
|
+
line: error.lineNumber || error.line
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
return result;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Extract elements from AST
|
|
108
|
+
*/
|
|
109
|
+
extractElements(ast, result, currentNamespace) {
|
|
110
|
+
if (!ast || !ast.children) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
for (const node of ast.children) {
|
|
114
|
+
if (!node)
|
|
115
|
+
continue;
|
|
116
|
+
switch (node.kind) {
|
|
117
|
+
case 'namespace':
|
|
118
|
+
this.extractNamespace(node, result);
|
|
119
|
+
// Recursively process namespace children
|
|
120
|
+
if (node.children) {
|
|
121
|
+
const namespaceName = this.getNamespaceName(node);
|
|
122
|
+
this.extractElements({ children: node.children }, result, namespaceName);
|
|
123
|
+
}
|
|
124
|
+
break;
|
|
125
|
+
case 'class':
|
|
126
|
+
this.extractClass(node, result, currentNamespace);
|
|
127
|
+
break;
|
|
128
|
+
case 'function':
|
|
129
|
+
this.extractFunction(node, result, currentNamespace);
|
|
130
|
+
break;
|
|
131
|
+
case 'const':
|
|
132
|
+
case 'constantstatement':
|
|
133
|
+
this.extractConstant(node, result);
|
|
134
|
+
break;
|
|
135
|
+
case 'trait':
|
|
136
|
+
this.extractTrait(node, result, currentNamespace);
|
|
137
|
+
break;
|
|
138
|
+
case 'interface':
|
|
139
|
+
this.extractInterface(node, result, currentNamespace);
|
|
140
|
+
break;
|
|
141
|
+
default:
|
|
142
|
+
// Recursively process children
|
|
143
|
+
if (node.children) {
|
|
144
|
+
this.extractElements({ children: node.children }, result, currentNamespace);
|
|
145
|
+
}
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Get namespace name from node
|
|
152
|
+
*/
|
|
153
|
+
getNamespaceName(node) {
|
|
154
|
+
if (node.name) {
|
|
155
|
+
if (typeof node.name === 'string') {
|
|
156
|
+
return node.name;
|
|
157
|
+
}
|
|
158
|
+
if (node.name.name) {
|
|
159
|
+
return node.name.name;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return '';
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Extract namespace
|
|
166
|
+
*/
|
|
167
|
+
extractNamespace(node, result) {
|
|
168
|
+
const namespace = {
|
|
169
|
+
name: this.getNamespaceName(node),
|
|
170
|
+
line: node.loc?.start?.line || 0
|
|
171
|
+
};
|
|
172
|
+
result.namespaces.push(namespace);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Extract class
|
|
176
|
+
*/
|
|
177
|
+
extractClass(node, result, currentNamespace) {
|
|
178
|
+
const className = node.name?.name || node.name || '';
|
|
179
|
+
const phpClass = {
|
|
180
|
+
name: className,
|
|
181
|
+
namespace: currentNamespace,
|
|
182
|
+
extends: node.extends?.name || undefined,
|
|
183
|
+
implements: node.implements?.map((i) => i.name || i) || [],
|
|
184
|
+
isAbstract: node.isAbstract || false,
|
|
185
|
+
isFinal: node.isFinal || false,
|
|
186
|
+
line: node.loc?.start?.line || 0,
|
|
187
|
+
docComment: this.extractDocComment(node)
|
|
188
|
+
};
|
|
189
|
+
result.classes.push(phpClass);
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Extract function
|
|
193
|
+
*/
|
|
194
|
+
extractFunction(node, result, currentNamespace) {
|
|
195
|
+
const functionName = node.name?.name || node.name || '';
|
|
196
|
+
const phpFunction = {
|
|
197
|
+
name: functionName,
|
|
198
|
+
namespace: currentNamespace,
|
|
199
|
+
parameters: this.extractParameters(node.arguments || []),
|
|
200
|
+
returnType: node.type?.name || node.type || undefined,
|
|
201
|
+
line: node.loc?.start?.line || 0,
|
|
202
|
+
docComment: this.extractDocComment(node)
|
|
203
|
+
};
|
|
204
|
+
result.functions.push(phpFunction);
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Extract constant
|
|
208
|
+
*/
|
|
209
|
+
extractConstant(node, result) {
|
|
210
|
+
const constants = node.constants || [node];
|
|
211
|
+
for (const constant of constants) {
|
|
212
|
+
const phpConstant = {
|
|
213
|
+
name: constant.name?.name || constant.name || '',
|
|
214
|
+
value: this.extractValue(constant.value),
|
|
215
|
+
line: constant.loc?.start?.line || node.loc?.start?.line || 0,
|
|
216
|
+
docComment: this.extractDocComment(node)
|
|
217
|
+
};
|
|
218
|
+
result.constants.push(phpConstant);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Extract trait
|
|
223
|
+
*/
|
|
224
|
+
extractTrait(node, result, currentNamespace) {
|
|
225
|
+
const traitName = node.name?.name || node.name || '';
|
|
226
|
+
const phpTrait = {
|
|
227
|
+
name: traitName,
|
|
228
|
+
namespace: currentNamespace,
|
|
229
|
+
line: node.loc?.start?.line || 0,
|
|
230
|
+
docComment: this.extractDocComment(node)
|
|
231
|
+
};
|
|
232
|
+
result.traits.push(phpTrait);
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Extract interface
|
|
236
|
+
*/
|
|
237
|
+
extractInterface(node, result, currentNamespace) {
|
|
238
|
+
const interfaceName = node.name?.name || node.name || '';
|
|
239
|
+
const phpInterface = {
|
|
240
|
+
name: interfaceName,
|
|
241
|
+
namespace: currentNamespace,
|
|
242
|
+
extends: node.extends?.map((e) => e.name || e) || [],
|
|
243
|
+
line: node.loc?.start?.line || 0,
|
|
244
|
+
docComment: this.extractDocComment(node)
|
|
245
|
+
};
|
|
246
|
+
result.interfaces.push(phpInterface);
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Extract function parameters
|
|
250
|
+
*/
|
|
251
|
+
extractParameters(params) {
|
|
252
|
+
return params.map(param => ({
|
|
253
|
+
name: param.name?.name || param.name || '',
|
|
254
|
+
type: param.type?.name || param.type || undefined,
|
|
255
|
+
default: this.extractValue(param.value)
|
|
256
|
+
}));
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Extract value from node
|
|
260
|
+
*/
|
|
261
|
+
extractValue(node) {
|
|
262
|
+
if (!node)
|
|
263
|
+
return undefined;
|
|
264
|
+
if (typeof node === 'string' || typeof node === 'number')
|
|
265
|
+
return String(node);
|
|
266
|
+
if (node.value !== undefined)
|
|
267
|
+
return String(node.value);
|
|
268
|
+
if (node.raw !== undefined)
|
|
269
|
+
return node.raw;
|
|
270
|
+
return undefined;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Extract PHPDoc comment
|
|
274
|
+
*/
|
|
275
|
+
extractDocComment(node) {
|
|
276
|
+
if (node.leadingComments && node.leadingComments.length > 0) {
|
|
277
|
+
const lastComment = node.leadingComments[node.leadingComments.length - 1];
|
|
278
|
+
if (lastComment.kind === 'doc') {
|
|
279
|
+
return lastComment.value;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return undefined;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
exports.PHPParser = PHPParser;
|
|
286
|
+
/**
|
|
287
|
+
* Export singleton instance
|
|
288
|
+
*/
|
|
289
|
+
exports.phpParser = new PHPParser();
|
|
290
|
+
//# sourceMappingURL=php-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"php-parser.js","sourceRoot":"","sources":["../../src/parsers/php-parser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AAEzB,8DAA8D;AAC9D,4DAAgC;AAiEhC;;GAEG;AACH,MAAa,SAAS;IAGpB;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,oBAAM,CAAC;YACvB,MAAM,EAAE;gBACN,IAAI,EAAE,IAAI;gBACV,IAAI,EAAE,IAAI;gBACV,UAAU,EAAE,IAAI;gBAChB,cAAc,EAAE,KAAK;aACtB;YACD,GAAG,EAAE;gBACH,aAAa,EAAE,IAAI;gBACnB,UAAU,EAAE,KAAK;aAClB;SACF,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACI,SAAS,CAAC,QAAgB;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;AAED;;GAEG;AACU,QAAA,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Prompt Generation Utilities
|
|
3
|
+
*
|
|
4
|
+
* Generates AI-ready prompts from module inspection results
|
|
5
|
+
*/
|
|
6
|
+
import { Module } from './module-system';
|
|
7
|
+
export interface PromptTemplate {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
generate: (module: Module, context?: any) => string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Generate a code review prompt from module standards
|
|
14
|
+
*/
|
|
15
|
+
export declare function generateCodeReviewPrompt(module: Module, codeSnippet?: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Generate a module summary prompt for AI context
|
|
18
|
+
*/
|
|
19
|
+
export declare function generateModuleSummaryPrompt(module: Module): string;
|
|
20
|
+
/**
|
|
21
|
+
* Generate an optimization suggestion prompt
|
|
22
|
+
*/
|
|
23
|
+
export declare function generateOptimizationPrompt(module: Module, targetFile?: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Generate a refactoring recommendation prompt
|
|
26
|
+
*/
|
|
27
|
+
export declare function generateRefactoringPrompt(module: Module, complexity?: any): string;
|
|
28
|
+
/**
|
|
29
|
+
* Get all available prompt templates
|
|
30
|
+
*/
|
|
31
|
+
export declare function getPromptTemplates(): PromptTemplate[];
|
|
32
|
+
//# sourceMappingURL=ai-prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-prompts.d.ts","sourceRoot":"","sources":["../../src/utils/ai-prompts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC;CACrD;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CA2BrF;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CA6BlE;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CA0CtF;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,GAAG,GAAG,MAAM,CA0ClF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,cAAc,EAAE,CAuBrD"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* AI Prompt Generation Utilities
|
|
4
|
+
*
|
|
5
|
+
* Generates AI-ready prompts from module inspection results
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.generateCodeReviewPrompt = generateCodeReviewPrompt;
|
|
9
|
+
exports.generateModuleSummaryPrompt = generateModuleSummaryPrompt;
|
|
10
|
+
exports.generateOptimizationPrompt = generateOptimizationPrompt;
|
|
11
|
+
exports.generateRefactoringPrompt = generateRefactoringPrompt;
|
|
12
|
+
exports.getPromptTemplates = getPromptTemplates;
|
|
13
|
+
/**
|
|
14
|
+
* Generate a code review prompt from module standards
|
|
15
|
+
*/
|
|
16
|
+
function generateCodeReviewPrompt(module, codeSnippet) {
|
|
17
|
+
const prompt = `# Code Review Request
|
|
18
|
+
|
|
19
|
+
## Standards Module
|
|
20
|
+
**Module**: ${module.fullName}
|
|
21
|
+
**Version**: ${module.metadata.version}
|
|
22
|
+
**Type**: ${module.metadata.type}
|
|
23
|
+
|
|
24
|
+
## Standards to Apply
|
|
25
|
+
${module.metadata.description}
|
|
26
|
+
|
|
27
|
+
## Rules
|
|
28
|
+
${module.rules?.map((rule, i) => `${i + 1}. ${rule}`).join('\n') || 'No specific rules defined'}
|
|
29
|
+
|
|
30
|
+
## Task
|
|
31
|
+
Please review the following code against these standards:
|
|
32
|
+
|
|
33
|
+
${codeSnippet ? `\`\`\`\n${codeSnippet}\n\`\`\`` : '[Paste your code here]'}
|
|
34
|
+
|
|
35
|
+
## Expected Output
|
|
36
|
+
1. Compliance assessment
|
|
37
|
+
2. Violations found (if any)
|
|
38
|
+
3. Specific recommendations
|
|
39
|
+
4. Code examples for fixes
|
|
40
|
+
`;
|
|
41
|
+
return prompt;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Generate a module summary prompt for AI context
|
|
45
|
+
*/
|
|
46
|
+
function generateModuleSummaryPrompt(module) {
|
|
47
|
+
const prompt = `# Module Summary for AI Context
|
|
48
|
+
|
|
49
|
+
**Module**: ${module.fullName}
|
|
50
|
+
**Version**: ${module.metadata.version}
|
|
51
|
+
**Type**: ${module.metadata.type}
|
|
52
|
+
**Description**: ${module.metadata.description}
|
|
53
|
+
|
|
54
|
+
## Purpose
|
|
55
|
+
This module provides ${module.metadata.type} guidelines for ${module.fullName}.
|
|
56
|
+
|
|
57
|
+
## Key Rules
|
|
58
|
+
${module.rules?.slice(0, 10).map((rule, i) => `${i + 1}. ${rule}`).join('\n') || 'No rules defined'}
|
|
59
|
+
|
|
60
|
+
## Examples Available
|
|
61
|
+
${module.examples?.slice(0, 5).map((ex, i) => `${i + 1}. ${ex}`).join('\n') || 'No examples available'}
|
|
62
|
+
|
|
63
|
+
## Character Count
|
|
64
|
+
Approximately ${module.metadata.augment?.characterCount || 'unknown'} characters
|
|
65
|
+
|
|
66
|
+
## Usage
|
|
67
|
+
When working on ${module.metadata.type} tasks, reference this module for:
|
|
68
|
+
- Coding standards and conventions
|
|
69
|
+
- Best practices and patterns
|
|
70
|
+
- Example implementations
|
|
71
|
+
- Common pitfalls to avoid
|
|
72
|
+
`;
|
|
73
|
+
return prompt;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Generate an optimization suggestion prompt
|
|
77
|
+
*/
|
|
78
|
+
function generateOptimizationPrompt(module, targetFile) {
|
|
79
|
+
const prompt = `# Code Optimization Request
|
|
80
|
+
|
|
81
|
+
## Context
|
|
82
|
+
**Standards Module**: ${module.fullName}
|
|
83
|
+
**Target**: ${targetFile || 'Current codebase'}
|
|
84
|
+
|
|
85
|
+
## Optimization Goals
|
|
86
|
+
Based on ${module.fullName} standards, suggest optimizations for:
|
|
87
|
+
|
|
88
|
+
1. **Performance**
|
|
89
|
+
- Identify bottlenecks
|
|
90
|
+
- Suggest algorithmic improvements
|
|
91
|
+
- Recommend caching strategies
|
|
92
|
+
|
|
93
|
+
2. **Code Quality**
|
|
94
|
+
- Reduce complexity
|
|
95
|
+
- Improve readability
|
|
96
|
+
- Enhance maintainability
|
|
97
|
+
|
|
98
|
+
3. **Best Practices**
|
|
99
|
+
- Apply ${module.metadata.type} patterns
|
|
100
|
+
- Follow naming conventions
|
|
101
|
+
- Implement proper error handling
|
|
102
|
+
|
|
103
|
+
4. **Security**
|
|
104
|
+
- Identify vulnerabilities
|
|
105
|
+
- Suggest secure alternatives
|
|
106
|
+
- Implement input validation
|
|
107
|
+
|
|
108
|
+
## Standards Reference
|
|
109
|
+
${module.rules?.slice(0, 5).map((rule, i) => `${i + 1}. ${rule}`).join('\n') || 'See module for full standards'}
|
|
110
|
+
|
|
111
|
+
## Expected Output
|
|
112
|
+
For each optimization:
|
|
113
|
+
- Current issue
|
|
114
|
+
- Recommended solution
|
|
115
|
+
- Code example
|
|
116
|
+
- Impact assessment (high/medium/low)
|
|
117
|
+
`;
|
|
118
|
+
return prompt;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Generate a refactoring recommendation prompt
|
|
122
|
+
*/
|
|
123
|
+
function generateRefactoringPrompt(module, complexity) {
|
|
124
|
+
const prompt = `# Refactoring Recommendations
|
|
125
|
+
|
|
126
|
+
## Module Standards
|
|
127
|
+
**Module**: ${module.fullName}
|
|
128
|
+
**Type**: ${module.metadata.type}
|
|
129
|
+
|
|
130
|
+
## Refactoring Goals
|
|
131
|
+
Refactor code to align with ${module.fullName} standards:
|
|
132
|
+
|
|
133
|
+
### 1. Structure Improvements
|
|
134
|
+
- Organize code according to ${module.metadata.type} patterns
|
|
135
|
+
- Separate concerns appropriately
|
|
136
|
+
- Improve modularity
|
|
137
|
+
|
|
138
|
+
### 2. Naming Conventions
|
|
139
|
+
- Apply consistent naming from standards
|
|
140
|
+
- Improve variable/function names
|
|
141
|
+
- Use descriptive identifiers
|
|
142
|
+
|
|
143
|
+
### 3. Code Simplification
|
|
144
|
+
- Reduce cyclomatic complexity
|
|
145
|
+
- Extract reusable functions
|
|
146
|
+
- Eliminate code duplication
|
|
147
|
+
|
|
148
|
+
### 4. Documentation
|
|
149
|
+
- Add inline comments
|
|
150
|
+
- Document public APIs
|
|
151
|
+
- Include usage examples
|
|
152
|
+
|
|
153
|
+
## Standards to Follow
|
|
154
|
+
${module.rules?.map((rule, i) => `${i + 1}. ${rule}`).join('\n') || 'See module for full standards'}
|
|
155
|
+
|
|
156
|
+
## Output Format
|
|
157
|
+
For each refactoring:
|
|
158
|
+
1. Current code pattern
|
|
159
|
+
2. Recommended pattern
|
|
160
|
+
3. Step-by-step migration guide
|
|
161
|
+
4. Benefits of change
|
|
162
|
+
`;
|
|
163
|
+
return prompt;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Get all available prompt templates
|
|
167
|
+
*/
|
|
168
|
+
function getPromptTemplates() {
|
|
169
|
+
return [
|
|
170
|
+
{
|
|
171
|
+
name: 'code-review',
|
|
172
|
+
description: 'Generate code review prompt with module standards',
|
|
173
|
+
generate: (module, context) => generateCodeReviewPrompt(module, context?.code)
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: 'module-summary',
|
|
177
|
+
description: 'Generate module summary for AI context',
|
|
178
|
+
generate: (module) => generateModuleSummaryPrompt(module)
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: 'optimization',
|
|
182
|
+
description: 'Generate optimization suggestions prompt',
|
|
183
|
+
generate: (module, context) => generateOptimizationPrompt(module, context?.file)
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: 'refactoring',
|
|
187
|
+
description: 'Generate refactoring recommendations prompt',
|
|
188
|
+
generate: (module, context) => generateRefactoringPrompt(module, context?.complexity)
|
|
189
|
+
}
|
|
190
|
+
];
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=ai-prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-prompts.js","sourceRoot":"","sources":["../../src/utils/ai-prompts.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAaH,4DA2BC;AAKD,kEA6BC;AAKD,gEA0CC;AAKD,8DA0CC;AAKD,gDAuBC;AA1LD;;GAEG;AACH,SAAgB,wBAAwB,CAAC,MAAc,EAAE,WAAoB;IAC3E,MAAM,MAAM,GAAG;;;cAGH,MAAM,CAAC,QAAQ;eACd,MAAM,CAAC,QAAQ,CAAC,OAAO;YAC1B,MAAM,CAAC,QAAQ,CAAC,IAAI;;;EAG9B,MAAM,CAAC,QAAQ,CAAC,WAAW;;;EAG3B,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,2BAA2B;;;;;EAK7F,WAAW,CAAC,CAAC,CAAC,WAAW,WAAW,UAAU,CAAC,CAAC,CAAC,wBAAwB;;;;;;;CAO1E,CAAC;IAEA,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,SAAgB,2BAA2B,CAAC,MAAc;IACxD,MAAM,MAAM,GAA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MAAM,EAAE,OAAO,EAAE,UAAU,CAAC;SACtF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Summary Generation Utilities
|
|
3
|
+
*
|
|
4
|
+
* Generates concise summaries of modules for AI context
|
|
5
|
+
*/
|
|
6
|
+
import { Module } from './module-system';
|
|
7
|
+
export interface ModuleSummary {
|
|
8
|
+
name: string;
|
|
9
|
+
version: string;
|
|
10
|
+
type: string;
|
|
11
|
+
description: string;
|
|
12
|
+
keyRules: string[];
|
|
13
|
+
exampleCount: number;
|
|
14
|
+
characterCount: number;
|
|
15
|
+
tags: string[];
|
|
16
|
+
summary: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Generate a concise summary of a module
|
|
20
|
+
*/
|
|
21
|
+
export declare function generateModuleSummary(module: Module): ModuleSummary;
|
|
22
|
+
/**
|
|
23
|
+
* Generate a detailed AI-friendly summary
|
|
24
|
+
*/
|
|
25
|
+
export declare function generateDetailedSummary(module: Module, includeContent?: boolean): string;
|
|
26
|
+
/**
|
|
27
|
+
* Generate a JSON summary for programmatic use
|
|
28
|
+
*/
|
|
29
|
+
export declare function generateJSONSummary(module: Module): string;
|
|
30
|
+
/**
|
|
31
|
+
* Generate a compact one-line summary
|
|
32
|
+
*/
|
|
33
|
+
export declare function generateCompactSummary(module: Module): string;
|
|
34
|
+
/**
|
|
35
|
+
* Generate AI context string for injection
|
|
36
|
+
*/
|
|
37
|
+
export declare function generateAIContext(module: Module): string;
|
|
38
|
+
/**
|
|
39
|
+
* Generate a summary with optimization suggestions
|
|
40
|
+
*/
|
|
41
|
+
export declare function generateSummaryWithSuggestions(module: Module): string;
|
|
42
|
+
//# sourceMappingURL=ai-summary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-summary.d.ts","sourceRoot":"","sources":["../../src/utils/ai-summary.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAIzC,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAqBnE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,GAAE,OAAe,GAAG,MAAM,CAsC/F;AAkCD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAG1D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAG7D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAexD;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAcrE"}
|