metacoding 1.5.1 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +108 -514
  3. package/lib/cli.d.ts.map +1 -1
  4. package/lib/cli.js +18 -19
  5. package/lib/cli.js.map +1 -1
  6. package/lib/commands/init.d.ts +8 -14
  7. package/lib/commands/init.d.ts.map +1 -1
  8. package/lib/commands/init.js +105 -387
  9. package/lib/commands/init.js.map +1 -1
  10. package/lib/commands/update.d.ts +9 -9
  11. package/lib/commands/update.d.ts.map +1 -1
  12. package/lib/commands/update.js +141 -320
  13. package/lib/commands/update.js.map +1 -1
  14. package/lib/services/backup.d.ts +1 -1
  15. package/lib/services/backup.d.ts.map +1 -1
  16. package/lib/services/backup.js +10 -6
  17. package/lib/services/backup.js.map +1 -1
  18. package/lib/services/filesystem.d.ts.map +1 -1
  19. package/lib/services/filesystem.js +11 -5
  20. package/lib/services/filesystem.js.map +1 -1
  21. package/lib/services/gitignore-manager.js +5 -5
  22. package/lib/services/gitignore-manager.js.map +1 -1
  23. package/lib/services/project-detector.d.ts +9 -8
  24. package/lib/services/project-detector.d.ts.map +1 -1
  25. package/lib/services/project-detector.js +79 -197
  26. package/lib/services/project-detector.js.map +1 -1
  27. package/lib/services/skill-manager.d.ts +23 -0
  28. package/lib/services/skill-manager.d.ts.map +1 -0
  29. package/lib/services/skill-manager.js +212 -0
  30. package/lib/services/skill-manager.js.map +1 -0
  31. package/lib/types/index.d.ts +5 -15
  32. package/lib/types/index.d.ts.map +1 -1
  33. package/package.json +9 -17
  34. package/skills/metacoding-workflow/SKILL.md +52 -0
  35. package/skills/metacoding-workflow/agents/openai.yaml +4 -0
  36. package/skills/metacoding-workflow/assets/templates/changelog-entry.md +6 -0
  37. package/skills/metacoding-workflow/assets/templates/project-context.md +18 -0
  38. package/skills/metacoding-workflow/assets/templates/repeated-task-checklist.md +8 -0
  39. package/skills/metacoding-workflow/assets/templates/task-entry.md +9 -0
  40. package/skills/metacoding-workflow/assets/templates/test-plan.md +8 -0
  41. package/skills/metacoding-workflow/references/javascript.md +7 -0
  42. package/skills/metacoding-workflow/references/node.md +7 -0
  43. package/skills/metacoding-workflow/references/platform-adaptation.md +37 -0
  44. package/skills/metacoding-workflow/references/python.md +7 -0
  45. package/skills/metacoding-workflow/references/react.md +7 -0
  46. package/skills/metacoding-workflow/references/repository-organization.md +84 -0
  47. package/skills/metacoding-workflow/references/typescript.md +7 -0
  48. package/skills/metacoding-workflow/references/workflow-rules.md +54 -0
  49. package/skills/vendor-templates/claude-agent.md.template +41 -0
  50. package/lib/services/assistant-adapter.d.ts +0 -18
  51. package/lib/services/assistant-adapter.d.ts.map +0 -1
  52. package/lib/services/assistant-adapter.js +0 -246
  53. package/lib/services/assistant-adapter.js.map +0 -1
  54. package/lib/services/cursor.d.ts +0 -47
  55. package/lib/services/cursor.d.ts.map +0 -1
  56. package/lib/services/cursor.js +0 -314
  57. package/lib/services/cursor.js.map +0 -1
  58. package/lib/services/template-manager.d.ts +0 -23
  59. package/lib/services/template-manager.d.ts.map +0 -1
  60. package/lib/services/template-manager.js +0 -374
  61. package/lib/services/template-manager.js.map +0 -1
  62. package/lib/services/vscode.d.ts +0 -10
  63. package/lib/services/vscode.d.ts.map +0 -1
  64. package/lib/services/vscode.js +0 -108
  65. package/lib/services/vscode.js.map +0 -1
  66. package/templates/assistants/AGENTS.md +0 -203
  67. package/templates/assistants/CLAUDE.md +0 -156
  68. package/templates/assistants/GEMINI.md +0 -193
  69. package/templates/general/code-review.instructions.md +0 -265
  70. package/templates/general/copilot-instructions.md +0 -427
  71. package/templates/general/docs-update.instructions.md +0 -275
  72. package/templates/general/release.instructions.md +0 -242
  73. package/templates/general/template.json +0 -9
  74. package/templates/general/test-runner.instructions.md +0 -188
  75. package/templates/javascript/javascript.coding.instructions.md +0 -500
  76. package/templates/javascript/javascript.docs.instructions.md +0 -563
  77. package/templates/javascript/javascript.testing.instructions.md +0 -686
  78. package/templates/javascript/template.json +0 -36
  79. package/templates/node/nodejs.coding.instructions.md +0 -249
  80. package/templates/node/nodejs.docs.instructions.md +0 -261
  81. package/templates/node/nodejs.testing.instructions.md +0 -373
  82. package/templates/node/template.json +0 -23
  83. package/templates/python/python.coding.instructions.md +0 -338
  84. package/templates/python/python.docs.instructions.md +0 -1178
  85. package/templates/python/python.testing.instructions.md +0 -1073
  86. package/templates/python/template.json +0 -75
  87. package/templates/react/react.coding.instructions.md +0 -694
  88. package/templates/react/react.docs.instructions.md +0 -451
  89. package/templates/react/react.testing.instructions.md +0 -192
  90. package/templates/react/template.json +0 -14
  91. package/templates/react/test-runner.instructions.md +0 -135
  92. package/templates/typescript/template.json +0 -16
  93. package/templates/typescript/typescript.coding.instructions.md +0 -368
  94. package/templates/typescript/typescript.docs.instructions.md +0 -760
  95. package/templates/typescript/typescript.testing.instructions.md +0 -739
@@ -0,0 +1,54 @@
1
+ # Workflow Rules
2
+
3
+ ## Operating Sequence
4
+
5
+ 1. Ground in the repository.
6
+ - Read the relevant code, config, tests, docs, and `references/repository-organization.md` first.
7
+ - Ask questions only after inspection leaves material uncertainty.
8
+ 2. Capture task scope.
9
+ - State the goal, success criteria, and non-goals.
10
+ - Confirm consequences before mutating code when the change is broad or risky.
11
+ 3. Enforce mandatory TDD.
12
+ - Identify what should prove the change correct before implementation.
13
+ - Document test cases before writing test code or production code.
14
+ - Prefer updating an existing repo test artifact; otherwise adapt `assets/templates/test-plan.md`.
15
+ - Write or identify a failing test first whenever the change is testable.
16
+ - Only then implement the minimum production code needed to make the tests pass.
17
+ - Refactor only after the failing-to-passing loop is complete.
18
+ 4. Execute one bounded task.
19
+ - Do not mix unrelated features, cleanup, or opportunistic refactors.
20
+ - Add blocking related work as a subtask; defer unrelated work.
21
+ 5. Verify.
22
+ - Run the smallest relevant checks first, then broader checks when justified.
23
+ - Confirm observable behavior, not just compiler success.
24
+ 6. Update artifacts using MECE documentation rules.
25
+ - Refresh docs, task/status notes, changelog entries, or operational notes only when they materially changed.
26
+ - Update the one artifact that owns the concept instead of duplicating the same information.
27
+ - Keep system docs evergreen, task docs temporal, and test docs focused on test intent and status.
28
+ 7. Close the loop.
29
+ - If VCS work is in scope, produce or perform a clean commit-ready summary.
30
+ - If VCS work is out of scope, provide a concise handoff with verification status and remaining risks.
31
+
32
+ ## Scope Control
33
+
34
+ - Reject task switching during active implementation.
35
+ - Queue unrelated requests for later.
36
+ - Accept a related blocker only if the active task cannot complete without it.
37
+
38
+ ## Repeated Tasks
39
+
40
+ For multi-step or error-prone workflows such as release, deploy, migration, or onboarding:
41
+
42
+ - Look for an existing checklist first.
43
+ - If none exists, adapt `assets/templates/repeated-task-checklist.md`.
44
+ - Update the reusable checklist when a missing step is discovered.
45
+
46
+ ## Completion Standard
47
+
48
+ The task is not complete until:
49
+
50
+ - the implemented behavior matches the agreed scope
51
+ - mandatory TDD was followed or an explicit exception was recorded
52
+ - relevant checks have been run or an explicit limitation is recorded
53
+ - changed artifacts are updated or consciously deferred according to MECE ownership
54
+ - the user receives a clean summary of outcome, verification, and remaining risks
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: metacoding-workflow
3
+ description: Use this subagent for disciplined software delivery that requires repo grounding, scope capture, test intent before code, single-task execution, verification, documentation or status updates, and a clean completion handoff.
4
+ ---
5
+
6
+ # Metacoding Workflow
7
+
8
+ Use this subagent when the user wants structured implementation rather than ad hoc coding.
9
+
10
+ ## Start Here
11
+
12
+ 1. Read `.claude/metacoding-workflow/references/project-context.md`.
13
+ 2. Read `.claude/metacoding-workflow/references/workflow-rules.md`.
14
+ 3. Read `.claude/metacoding-workflow/references/repository-organization.md` before planning or editing.
15
+ 4. Read `.claude/metacoding-workflow/references/platform-adaptation.md` when repo artifacts or git context are missing.
16
+ 5. Load only the language reference that matches the task:
17
+ - `.claude/metacoding-workflow/references/typescript.md`
18
+ - `.claude/metacoding-workflow/references/javascript.md`
19
+ - `.claude/metacoding-workflow/references/node.md`
20
+ - `.claude/metacoding-workflow/references/react.md`
21
+ - `.claude/metacoding-workflow/references/python.md`
22
+
23
+ ## Core Rules
24
+
25
+ 1. Ground in the repo before asking clarifying questions.
26
+ 2. Capture scope and success criteria before changing code.
27
+ 3. Enforce mandatory TDD: document test intent, write or identify failing tests first, then implement production code.
28
+ 4. Work one bounded task at a time.
29
+ 5. Verify with tests and direct checks.
30
+ 6. Maintain MECE documentation by updating the one artifact that owns the changed concept.
31
+ 7. Finish with a VCS handoff, actual VCS action, or explicit completion confirmation.
32
+
33
+ ## Enforcement
34
+
35
+ - Do not skip directly to coding when repo inspection can reduce uncertainty.
36
+ - Do not bypass TDD unless the user explicitly accepts the exception and the reason is recorded.
37
+ - Do not switch to unrelated work mid-task; queue it for later.
38
+ - If a new blocker is required to finish the active task, treat it as a subtask.
39
+ - If git actions are unavailable or out of scope, stop at a clean handoff instead of forcing a commit.
40
+ - If repo workflow artifacts are missing, bootstrap them from `.claude/metacoding-workflow/assets/templates/` or explicitly propose them.
41
+ - Keep repository structure and documentation ownership aligned with `.claude/metacoding-workflow/references/repository-organization.md`.
@@ -1,18 +0,0 @@
1
- import { AssistantConfig, AssistantType, ProjectConfig } from '../types';
2
- export declare class AssistantAdapterService {
3
- private fileSystem;
4
- constructor();
5
- getAvailableAssistants(): AssistantConfig[];
6
- generateAssistantFiles(assistantTypes: AssistantType[], projectConfig: ProjectConfig, targetPath: string): Promise<string[]>;
7
- private generateAssistantFile;
8
- private substituteVariables;
9
- private getBuildCommand;
10
- private getTestCommand;
11
- private getLintCommand;
12
- private getTypecheckCommand;
13
- private getCodeStyleGuidelines;
14
- private getRepositoryStructure;
15
- detectExistingAssistants(projectPath: string): Promise<AssistantType[]>;
16
- hasExistingAssistantConfig(projectPath: string): Promise<boolean>;
17
- }
18
- //# sourceMappingURL=assistant-adapter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assistant-adapter.d.ts","sourceRoot":"","sources":["../../src/services/assistant-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAMzE,qBAAa,uBAAuB;IAClC,OAAO,CAAC,UAAU,CAAoB;;IAStC,sBAAsB,IAAI,eAAe,EAAE;IAgCrC,sBAAsB,CAC1B,cAAc,EAAE,aAAa,EAAE,EAC/B,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,EAAE,CAAC;YAgCN,qBAAqB;IAwFnC,OAAO,CAAC,mBAAmB;IA8B3B,OAAO,CAAC,eAAe;IAiBvB,OAAO,CAAC,cAAc;IAyBtB,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,mBAAmB;IAe3B,OAAO,CAAC,sBAAsB;IAmB9B,OAAO,CAAC,sBAAsB;IAyCxB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAuBvE,0BAA0B,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAIxE"}
@@ -1,246 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.AssistantAdapterService = void 0;
7
- const path_1 = __importDefault(require("path"));
8
- const filesystem_1 = require("./filesystem");
9
- class AssistantAdapterService {
10
- constructor() {
11
- this.fileSystem = new filesystem_1.FileSystemService();
12
- }
13
- getAvailableAssistants() {
14
- return [
15
- {
16
- type: 'copilot',
17
- fileName: '.github/copilot-instructions.md',
18
- description: 'GitHub Copilot - VS Code and IDEs',
19
- instructions: 'Existing copilot-instructions.md template'
20
- },
21
- {
22
- type: 'claude',
23
- fileName: 'CLAUDE.md',
24
- description: 'Claude Code - Terminal and project instructions',
25
- instructions: 'CLAUDE.md template with project instructions'
26
- },
27
- {
28
- type: 'codex',
29
- fileName: 'AGENTS.md',
30
- description: 'Codex/OpenAI - System message and agent instructions',
31
- instructions: 'AGENTS.md template with system message configuration'
32
- },
33
- {
34
- type: 'gemini',
35
- fileName: 'GEMINI.md',
36
- description: 'Gemini Code Assist - Style guide and configuration',
37
- instructions: 'GEMINI.md template with hierarchical discovery'
38
- }
39
- ];
40
- }
41
- async generateAssistantFiles(assistantTypes, projectConfig, targetPath) {
42
- const generatedFiles = [];
43
- if (!assistantTypes || !Array.isArray(assistantTypes)) {
44
- assistantTypes = ['copilot'];
45
- }
46
- if (assistantTypes.includes('all')) {
47
- assistantTypes = ['copilot', 'claude', 'codex', 'gemini'];
48
- }
49
- for (const assistantType of assistantTypes) {
50
- if (assistantType === 'all')
51
- continue;
52
- const filePath = await this.generateAssistantFile(assistantType, projectConfig, targetPath);
53
- if (filePath) {
54
- generatedFiles.push(filePath);
55
- }
56
- }
57
- return generatedFiles;
58
- }
59
- async generateAssistantFile(assistantType, projectConfig, targetPath) {
60
- try {
61
- let templatePath;
62
- let outputPath;
63
- switch (assistantType) {
64
- case 'copilot':
65
- templatePath = path_1.default.join(__dirname, '../..', 'templates', 'general', 'copilot-instructions.md');
66
- outputPath = path_1.default.join(targetPath, '.github', 'copilot-instructions.md');
67
- break;
68
- case 'claude':
69
- templatePath = path_1.default.join(__dirname, '../..', 'templates', 'assistants', 'CLAUDE.md');
70
- outputPath = path_1.default.join(targetPath, 'CLAUDE.md');
71
- break;
72
- case 'codex':
73
- templatePath = path_1.default.join(__dirname, '../..', 'templates', 'assistants', 'AGENTS.md');
74
- outputPath = path_1.default.join(targetPath, 'AGENTS.md');
75
- break;
76
- case 'gemini':
77
- templatePath = path_1.default.join(__dirname, '../..', 'templates', 'assistants', 'GEMINI.md');
78
- outputPath = path_1.default.join(targetPath, 'GEMINI.md');
79
- break;
80
- default:
81
- console.warn(`Unknown assistant type: ${assistantType}`);
82
- return null;
83
- }
84
- const templateContent = await this.fileSystem.readFile(templatePath);
85
- if (!templateContent) {
86
- console.warn(`Template not found for ${assistantType}: ${templatePath}`);
87
- return null;
88
- }
89
- const processedContent = this.substituteVariables(templateContent, projectConfig);
90
- const outputDir = path_1.default.dirname(outputPath);
91
- await this.fileSystem.ensureDirectoryExists(outputDir);
92
- await this.fileSystem.writeFile(outputPath, processedContent);
93
- return outputPath;
94
- }
95
- catch (error) {
96
- console.error(`Error generating ${assistantType} configuration:`, error);
97
- return null;
98
- }
99
- }
100
- substituteVariables(content, projectConfig) {
101
- const variables = {
102
- PROJECT_NAME: projectConfig.name,
103
- PROJECT_DESCRIPTION: projectConfig.description,
104
- TECH_STACK: projectConfig.techStack.join(', '),
105
- PROJECT_DOMAIN: projectConfig.projectType,
106
- ENVIRONMENT_TYPE: projectConfig.ideChoice === 'vscode' || projectConfig.ideChoice === 'cursor'
107
- ? 'IDE'
108
- : 'Terminal',
109
- BUILD_COMMAND: this.getBuildCommand(projectConfig),
110
- TEST_COMMAND: this.getTestCommand(projectConfig),
111
- LINT_COMMAND: this.getLintCommand(projectConfig),
112
- TYPECHECK_COMMAND: this.getTypecheckCommand(projectConfig),
113
- CODE_STYLE_GUIDELINES: this.getCodeStyleGuidelines(projectConfig),
114
- REPOSITORY_STRUCTURE: this.getRepositoryStructure(projectConfig),
115
- PROJECT_SPECIFIC_GUIDANCE: ''
116
- };
117
- let result = content;
118
- for (const [key, value] of Object.entries(variables)) {
119
- const regex = new RegExp(`{{${key}}}`, 'g');
120
- result = result.replace(regex, value);
121
- }
122
- return result;
123
- }
124
- getBuildCommand(projectConfig) {
125
- switch (projectConfig.projectType) {
126
- case 'react':
127
- case 'node':
128
- case 'typescript':
129
- case 'javascript':
130
- return 'npm run build';
131
- case 'python':
132
- return 'python -m build';
133
- default:
134
- return 'npm run build';
135
- }
136
- }
137
- getTestCommand(projectConfig) {
138
- if (projectConfig.testFramework) {
139
- switch (projectConfig.testFramework) {
140
- case 'jest':
141
- return 'npm test';
142
- case 'vitest':
143
- return 'npm run test';
144
- case 'pytest':
145
- return 'pytest';
146
- default:
147
- return 'npm test';
148
- }
149
- }
150
- switch (projectConfig.projectType) {
151
- case 'python':
152
- return 'pytest';
153
- default:
154
- return 'npm test';
155
- }
156
- }
157
- getLintCommand(projectConfig) {
158
- switch (projectConfig.projectType) {
159
- case 'python':
160
- return 'flake8 . && black --check .';
161
- default:
162
- return 'npm run lint';
163
- }
164
- }
165
- getTypecheckCommand(projectConfig) {
166
- switch (projectConfig.projectType) {
167
- case 'typescript':
168
- case 'react':
169
- return 'npm run typecheck || tsc --noEmit';
170
- case 'python':
171
- return 'mypy .';
172
- default:
173
- return 'echo "No type checking configured"';
174
- }
175
- }
176
- getCodeStyleGuidelines(projectConfig) {
177
- switch (projectConfig.projectType) {
178
- case 'react':
179
- return 'Use functional components with hooks, JSX best practices, semantic HTML';
180
- case 'typescript':
181
- case 'node':
182
- return 'Use TypeScript strict mode, explicit types, async/await patterns';
183
- case 'python':
184
- return 'Follow PEP 8, use type hints, prefer list comprehensions';
185
- case 'javascript':
186
- return 'Use ES6+ features, const/let over var, arrow functions';
187
- default:
188
- return 'Follow language-specific conventions and best practices';
189
- }
190
- }
191
- getRepositoryStructure(projectConfig) {
192
- const baseStructure = `
193
- /src # All source code
194
- /_meta # Development documentation
195
- /test # All test-related files
196
- /.github # GitHub-specific files`;
197
- switch (projectConfig.projectType) {
198
- case 'react':
199
- return `${baseStructure}
200
- /components # Reusable React components
201
- /hooks # Custom React hooks
202
- /pages # Page components
203
- /utils # Utility functions`;
204
- case 'node':
205
- case 'typescript':
206
- return `${baseStructure}
207
- /services # Business logic services
208
- /routes # API routes
209
- /middleware # Express middleware
210
- /utils # Utility functions`;
211
- case 'python':
212
- return `${baseStructure}
213
- /modules # Python modules
214
- /utils # Utility functions
215
- /config # Configuration files
216
- requirements.txt # Python dependencies`;
217
- default:
218
- return `${baseStructure}
219
- /components # Reusable components
220
- /services # Business logic
221
- /utils # Utility functions`;
222
- }
223
- }
224
- async detectExistingAssistants(projectPath) {
225
- const existingAssistants = [];
226
- const assistantFiles = [
227
- { type: 'copilot', path: '.github/copilot-instructions.md' },
228
- { type: 'claude', path: 'CLAUDE.md' },
229
- { type: 'codex', path: 'AGENTS.md' },
230
- { type: 'gemini', path: 'GEMINI.md' }
231
- ];
232
- for (const { type, path: filePath } of assistantFiles) {
233
- const fullPath = path_1.default.join(projectPath, filePath);
234
- if (await this.fileSystem.fileExists(fullPath)) {
235
- existingAssistants.push(type);
236
- }
237
- }
238
- return existingAssistants;
239
- }
240
- async hasExistingAssistantConfig(projectPath) {
241
- const existingAssistants = await this.detectExistingAssistants(projectPath);
242
- return existingAssistants.length > 0;
243
- }
244
- }
245
- exports.AssistantAdapterService = AssistantAdapterService;
246
- //# sourceMappingURL=assistant-adapter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assistant-adapter.js","sourceRoot":"","sources":["../../src/services/assistant-adapter.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,6CAAiD;AAKjD,MAAa,uBAAuB;IAGlC;QACE,IAAI,CAAC,UAAU,GAAG,IAAI,8BAAiB,EAAE,CAAC;IAC5C,CAAC;IAKD,sBAAsB;QACpB,OAAO;YACL;gBACE,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE,iCAAiC;gBAC3C,WAAW,EAAE,mCAAmC;gBAChD,YAAY,EAAE,2CAA2C;aAC1D;YACD;gBACE,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,WAAW;gBACrB,WAAW,EAAE,iDAAiD;gBAC9D,YAAY,EAAE,8CAA8C;aAC7D;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,QAAQ,EAAE,WAAW;gBACrB,WAAW,EAAE,sDAAsD;gBACnE,YAAY,EAAE,sDAAsD;aACrE;YACD;gBACE,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,WAAW;gBACrB,WAAW,EAAE,oDAAoD;gBACjE,YAAY,EAAE,gDAAgD;aAC/D;SACF,CAAC;IACJ,CAAC;IAKD,KAAK,CAAC,sBAAsB,CAC1B,cAA+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AC;YAChC,CAAC;QACH,CAAC;QAED,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IAKD,KAAK,CAAC,0BAA0B,CAAC,WAAmB;QAClD,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC,wBAAwB,CAAC,WAAW,CAAC,CAAC;QAC5E,OAAO,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC;IACvC,CAAC;CACF;AAhWD,0DAgWC"}
@@ -1,47 +0,0 @@
1
- import { TemplateManager } from './template-manager';
2
- import { FileSystemService } from './filesystem';
3
- export interface PatternRule {
4
- filename: string;
5
- content: string;
6
- pattern: string;
7
- }
8
- export interface InstallationResult {
9
- success: boolean;
10
- conflicts: string[];
11
- backups: string[];
12
- }
13
- export declare class CursorService {
14
- private templateManager;
15
- private fileSystemService;
16
- constructor(templateManager: TemplateManager, fileSystemService: FileSystemService);
17
- detectCursorIDE(): Promise<boolean>;
18
- validateCursorCompatibility(): Promise<boolean>;
19
- getCursorConfigPath(customPath?: string): string;
20
- generateWorkflowRules(projectPath: string, templateType: string, projectConfig?: any): Promise<string>;
21
- generatePatternRules(projectPath: string, templateType: string): Promise<PatternRule[]>;
22
- installCursorRules(projectPath: string, workflowContent: string, patternRules: PatternRule[]): Promise<InstallationResult>;
23
- backupExistingRules(projectPath: string): Promise<string[]>;
24
- processInstructionTemplate(instructionContent: string): string;
25
- processInstructionFile(instructionFile: {
26
- path: string;
27
- content: string;
28
- }, projectConfig?: any): string;
29
- mergeInstructionFiles(instructionFiles: Array<{
30
- path: string;
31
- content: string;
32
- }>, projectConfig?: any): string;
33
- extractPatternSpecificRules(instructionFile: {
34
- path: string;
35
- content: string;
36
- }, pattern: string): PatternRule;
37
- validateRulesContent(content: string): boolean;
38
- private createDefaultWorkflowRules;
39
- private createCursorRulesHeader;
40
- private determineFilePattern;
41
- private generateMdcFilename;
42
- private createMdcContent;
43
- private getMetacodingVersion;
44
- private applyTemplateSubstitution;
45
- private processInstructionContentOnly;
46
- }
47
- //# sourceMapp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