mustard-claude 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +198 -0
  2. package/bin/mustard.js +5 -0
  3. package/dist/analyzers/llm.d.ts +13 -0
  4. package/dist/analyzers/llm.js +339 -0
  5. package/dist/analyzers/llm.js.map +1 -0
  6. package/dist/analyzers/semantic.d.ts +13 -0
  7. package/dist/analyzers/semantic.js +215 -0
  8. package/dist/analyzers/semantic.js.map +1 -0
  9. package/dist/cli.d.ts +1 -0
  10. package/dist/cli.js +42 -0
  11. package/dist/cli.js.map +1 -0
  12. package/dist/commands/init.d.ts +5 -0
  13. package/dist/commands/init.js +377 -0
  14. package/dist/commands/init.js.map +1 -0
  15. package/dist/commands/sync.d.ts +5 -0
  16. package/dist/commands/sync.js +235 -0
  17. package/dist/commands/sync.js.map +1 -0
  18. package/dist/commands/update.d.ts +8 -0
  19. package/dist/commands/update.js +237 -0
  20. package/dist/commands/update.js.map +1 -0
  21. package/dist/generators/claude-md-llm.d.ts +5 -0
  22. package/dist/generators/claude-md-llm.js +101 -0
  23. package/dist/generators/claude-md-llm.js.map +1 -0
  24. package/dist/generators/claude-md-template.d.ts +5 -0
  25. package/dist/generators/claude-md-template.js +273 -0
  26. package/dist/generators/claude-md-template.js.map +1 -0
  27. package/dist/generators/commands.d.ts +17 -0
  28. package/dist/generators/commands.js +845 -0
  29. package/dist/generators/commands.js.map +1 -0
  30. package/dist/generators/context.d.ts +11 -0
  31. package/dist/generators/context.js +621 -0
  32. package/dist/generators/context.js.map +1 -0
  33. package/dist/generators/hooks.d.ts +5 -0
  34. package/dist/generators/hooks.js +128 -0
  35. package/dist/generators/hooks.js.map +1 -0
  36. package/dist/generators/index.d.ts +11 -0
  37. package/dist/generators/index.js +541 -0
  38. package/dist/generators/index.js.map +1 -0
  39. package/dist/generators/prompts.d.ts +13 -0
  40. package/dist/generators/prompts.js +579 -0
  41. package/dist/generators/prompts.js.map +1 -0
  42. package/dist/generators/registry.d.ts +5 -0
  43. package/dist/generators/registry.js +93 -0
  44. package/dist/generators/registry.js.map +1 -0
  45. package/dist/scanners/dependencies.d.ts +7 -0
  46. package/dist/scanners/dependencies.js +195 -0
  47. package/dist/scanners/dependencies.js.map +1 -0
  48. package/dist/scanners/index.d.ts +6 -0
  49. package/dist/scanners/index.js +37 -0
  50. package/dist/scanners/index.js.map +1 -0
  51. package/dist/scanners/samples.d.ts +8 -0
  52. package/dist/scanners/samples.js +193 -0
  53. package/dist/scanners/samples.js.map +1 -0
  54. package/dist/scanners/stack.d.ts +5 -0
  55. package/dist/scanners/stack.js +294 -0
  56. package/dist/scanners/stack.js.map +1 -0
  57. package/dist/scanners/structure.d.ts +5 -0
  58. package/dist/scanners/structure.js +274 -0
  59. package/dist/scanners/structure.js.map +1 -0
  60. package/dist/services/grepai.d.ts +25 -0
  61. package/dist/services/grepai.js +89 -0
  62. package/dist/services/grepai.js.map +1 -0
  63. package/dist/services/ollama.d.ts +22 -0
  64. package/dist/services/ollama.js +86 -0
  65. package/dist/services/ollama.js.map +1 -0
  66. package/dist/services/package-manager.d.ts +95 -0
  67. package/dist/services/package-manager.js +164 -0
  68. package/dist/services/package-manager.js.map +1 -0
  69. package/dist/types.d.ts +233 -0
  70. package/dist/types.js +5 -0
  71. package/dist/types.js.map +1 -0
  72. package/package.json +56 -0
package/README.md ADDED
@@ -0,0 +1,198 @@
1
+ # Mustard CLI v2.0
2
+
3
+ Framework-agnostic CLI for setting up and updating Claude Code projects.
4
+
5
+ ## Features
6
+
7
+ - **Stack Detection**: Automatically detects languages and frameworks
8
+ - **Semantic Analysis**: Uses grepai for intelligent code understanding
9
+ - **LLM-Powered**: Leverages Ollama for context-aware file generation
10
+ - **Template Fallback**: Works without external dependencies
11
+ - **Safe Updates**: Update core files without losing customizations
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ # Install globally
17
+ npm install -g mustard-cli
18
+
19
+ # Or run directly with npx
20
+ npx mustard-cli init
21
+ ```
22
+
23
+ ## Commands
24
+
25
+ ### `mustard init` - Initialize New Project
26
+
27
+ Creates a complete `.claude/` structure for your project.
28
+
29
+ ```bash
30
+ # Navigate to your project
31
+ cd my-project
32
+
33
+ # Initialize .claude/ structure
34
+ mustard init
35
+
36
+ # With options
37
+ mustard init --force # Overwrite existing .claude/
38
+ mustard init --yes # Skip confirmation prompts
39
+ mustard init --no-ollama # Skip Ollama (use templates)
40
+ mustard init --no-grepai # Skip semantic analysis
41
+ mustard init --verbose # Show detailed output
42
+ ```
43
+
44
+ ### `mustard update` - Update Existing Project
45
+
46
+ Updates Mustard core files while preserving your customizations.
47
+
48
+ ```bash
49
+ # Update core files (preserves CLAUDE.md and context/)
50
+ mustard update
51
+
52
+ # With options
53
+ mustard update --force # Skip backup and confirmation
54
+ mustard update --include-claude-md # Also update CLAUDE.md
55
+ mustard update --no-ollama # Skip Ollama analysis
56
+ mustard update --no-grepai # Skip semantic analysis
57
+ mustard update --verbose # Show detailed output
58
+ ```
59
+
60
+ #### What Gets Updated vs Preserved
61
+
62
+ | Updated (Core) | Preserved (Client) |
63
+ |----------------|-------------------|
64
+ | `commands/*.md` | `CLAUDE.md` |
65
+ | `prompts/*.md` | `context/*.md` (except README) |
66
+ | `hooks/*.js` | `context/examples/*` |
67
+ | `core/*.md` | `docs/*` |
68
+ | `scripts/*.js` | |
69
+ | `settings.json` (merged) | |
70
+ | `entity-registry.json` | |
71
+
72
+ ## What It Does
73
+
74
+ 1. **Scans** your project to detect:
75
+ - Languages (TypeScript, C#, Python, Java, Go, Rust)
76
+ - Frameworks (React, Next.js, .NET, FastAPI, etc.)
77
+ - Architecture patterns (MVC, Clean, Feature-based)
78
+ - Naming conventions
79
+
80
+ 2. **Analyzes** code semantically (with grepai):
81
+ - Finds services, repositories, endpoints
82
+ - Discovers entities/models
83
+ - Maps call graphs
84
+
85
+ 3. **Generates** a customized `.claude/` structure:
86
+ - `CLAUDE.md` - Main instructions file
87
+ - `prompts/` - Specialized agent prompts
88
+ - `commands/` - Pipeline commands
89
+ - `hooks/` - Enforcement hooks
90
+ - `entity-registry.json` - Entity mapping
91
+
92
+ ## Supported Stacks
93
+
94
+ | Language | Frameworks |
95
+ |----------|------------|
96
+ | TypeScript/JavaScript | React, Next.js, Node, Express |
97
+ | C# | .NET, ASP.NET Core, FastEndpoints |
98
+ | Python | FastAPI, Django, Flask |
99
+ | Java | Spring Boot, Quarkus |
100
+ | Go | Gin, Echo, Fiber |
101
+ | Rust | Actix, Axum |
102
+
103
+ ## Dependencies
104
+
105
+ ### Required
106
+
107
+ - Node.js 18+
108
+
109
+ ### Optional (Enhanced Features)
110
+
111
+ - **Ollama** - For LLM-powered analysis and generation
112
+ - Install: https://ollama.ai
113
+ - Run: `ollama pull llama3.2`
114
+
115
+ - **grepai** - For semantic code search
116
+ - Provides better entity discovery
117
+ - Enables call graph tracing
118
+
119
+ ## Generated Structure
120
+
121
+ ```text
122
+ .claude/
123
+ ├── CLAUDE.md # Main instructions
124
+ ├── entity-registry.json # Entity mapping
125
+ ├── settings.json # Claude Code settings
126
+ ├── prompts/
127
+ │ ├── _index.md
128
+ │ ├── orchestrator.md
129
+ │ ├── backend.md # If backend detected
130
+ │ ├── frontend.md # If frontend detected
131
+ │ ├── database.md # If ORM detected
132
+ │ ├── bugfix.md
133
+ │ └── review.md
134
+ ├── commands/
135
+ │ ├── feature.md
136
+ │ ├── bugfix.md
137
+ │ ├── approve.md
138
+ │ ├── complete.md
139
+ │ ├── resume.md
140
+ │ ├── commit.md
141
+ │ ├── commit-push.md
142
+ │ ├── validate.md
143
+ │ ├── status.md
144
+ │ ├── sync-registry.md
145
+ │ └── install-deps.md
146
+ ├── hooks/
147
+ │ ├── enforce-pipeline.js
148
+ │ └── enforce-grepai.js
149
+ ├── core/
150
+ │ ├── enforcement.md
151
+ │ ├── naming-conventions.md
152
+ │ └── pipeline.md
153
+ ├── scripts/
154
+ │ └── statusline.js
155
+ └── context/
156
+ ├── README.md
157
+ ├── architecture.md
158
+ ├── patterns.md
159
+ ├── naming.md
160
+ └── examples/
161
+ ```
162
+
163
+ ## Commands After Setup
164
+
165
+ | Command | Description |
166
+ |---------|-------------|
167
+ | `/mtd-pipeline-feature <name>` | Start a new feature pipeline |
168
+ | `/mtd-pipeline-bugfix <error>` | Start a bugfix pipeline |
169
+ | `/mtd-pipeline-approve` | Approve spec for implementation |
170
+ | `/mtd-pipeline-complete` | Complete current pipeline |
171
+ | `/mtd-git-commit` | Create a commit |
172
+ | `/mtd-validate-build` | Run build/type-check |
173
+ | `/mtd-validate-status` | Show project status |
174
+
175
+ ## Development
176
+
177
+ ```bash
178
+ # Clone
179
+ git clone <repo>
180
+ cd mustard/cli
181
+
182
+ # Install dependencies
183
+ npm install
184
+
185
+ # Build
186
+ npm run build
187
+
188
+ # Run locally
189
+ node bin/mustard.js init
190
+ node bin/mustard.js update
191
+
192
+ # Test with npx
193
+ npx . init
194
+ ```
195
+
196
+ ## License
197
+
198
+ MIT
package/bin/mustard.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { run } from '../dist/cli.js';
4
+
5
+ run();
@@ -0,0 +1,13 @@
1
+ import type { ProjectInfo, Analysis, CodeSample, OllamaOptions, GeneratedPrompts } from '../types.js';
2
+ /**
3
+ * Analyze code snippets using Ollama LLM
4
+ */
5
+ export declare function analyzeCode(codeSnippets: CodeSample[], options?: OllamaOptions): Promise<Analysis>;
6
+ /**
7
+ * Generate CLAUDE.md content using Ollama
8
+ */
9
+ export declare function generateClaudeMd(projectInfo: ProjectInfo, analysis: Analysis, options?: OllamaOptions): Promise<string | null>;
10
+ /**
11
+ * Generate specialized prompts using Ollama
12
+ */
13
+ export declare function generatePrompts(projectInfo: ProjectInfo, analysis: Analysis, options?: OllamaOptions): Promise<Partial<GeneratedPrompts>>;
@@ -0,0 +1,339 @@
1
+ import * as ollama from '../services/ollama.js';
2
+ /**
3
+ * Analyze code snippets using Ollama LLM
4
+ */
5
+ export async function analyzeCode(codeSnippets, options = {}) {
6
+ const { model = 'llama3.2' } = options;
7
+ const snippetsText = codeSnippets
8
+ .filter(s => s && s.content)
9
+ .map(s => `### ${s.file}\n\`\`\`\n${s.content}\n\`\`\``)
10
+ .join('\n\n');
11
+ if (!snippetsText) {
12
+ return getDefaultAnalysis();
13
+ }
14
+ const prompt = `You are a code analyzer. Analyze the following code snippets and extract structured information about the project.
15
+
16
+ ## Code snippets:
17
+ ${snippetsText}
18
+
19
+ ## Extract in JSON format:
20
+ {
21
+ "architecture": {
22
+ "type": "mvc|clean|feature-based|layered|other",
23
+ "description": "brief description of the architecture"
24
+ },
25
+ "patterns": ["repository", "service-layer", "dto", "mapper", ...],
26
+ "naming": {
27
+ "classes": "PascalCase|camelCase|snake_case",
28
+ "files": "PascalCase|kebab-case|snake_case|camelCase",
29
+ "folders": "singular|plural"
30
+ },
31
+ "rules": [
32
+ "rule 1 that Claude should follow when working on this codebase",
33
+ "rule 2...",
34
+ "rule 3..."
35
+ ],
36
+ "frameworks": ["framework1", "framework2", ...]
37
+ }
38
+
39
+ Return ONLY the JSON, no explanations.`;
40
+ try {
41
+ const response = await ollama.generateJSON(prompt, { model });
42
+ return {
43
+ ...getDefaultAnalysis(),
44
+ ...response
45
+ };
46
+ }
47
+ catch (error) {
48
+ const message = error instanceof Error ? error.message : 'Unknown error';
49
+ console.error('Ollama analysis failed:', message);
50
+ return getDefaultAnalysis();
51
+ }
52
+ }
53
+ /**
54
+ * Generate CLAUDE.md content using Ollama
55
+ */
56
+ export async function generateClaudeMd(projectInfo, analysis, options = {}) {
57
+ const { model = 'llama3.2' } = options;
58
+ const prompt = `You are a documentation generator for Claude Code (an AI coding assistant).
59
+ Generate a CLAUDE.md file for this project.
60
+
61
+ ## Project Information:
62
+ - Name: ${projectInfo.name}
63
+ - Type: ${projectInfo.type}
64
+ - Stacks: ${projectInfo.stacks.map(s => `${s.name} ${s.version ?? ''}`).join(', ')}
65
+ - Architecture: ${analysis.architecture?.type ?? 'unknown'}
66
+ - Package Manager: ${projectInfo.packageManager ?? 'npm'}
67
+
68
+ ## Detected Patterns:
69
+ ${JSON.stringify(analysis.patterns ?? [], null, 2)}
70
+
71
+ ## Naming Conventions:
72
+ ${JSON.stringify(projectInfo.patterns ?? {}, null, 2)}
73
+
74
+ ## Rules:
75
+ ${(analysis.rules ?? []).map(r => `- ${r}`).join('\n')}
76
+
77
+ ## Generate a CLAUDE.md that includes:
78
+ 1. Quick Reference section with naming conventions
79
+ 2. Project state section (ports, technologies)
80
+ 3. Available commands adapted for the detected stack
81
+ 4. Structure explanation
82
+ 5. Specific rules Claude should follow
83
+ 6. Entity Registry usage instructions
84
+
85
+ Use markdown formatting. Be specific to this project.
86
+ Include a section about the pipeline (/mtd-pipeline-feature, /mtd-pipeline-bugfix commands).
87
+ Include grepai as the preferred search tool.
88
+
89
+ Return ONLY the markdown content, no code blocks wrapping it.`;
90
+ try {
91
+ const response = await ollama.generate(prompt, { model });
92
+ return response;
93
+ }
94
+ catch (error) {
95
+ const message = error instanceof Error ? error.message : 'Unknown error';
96
+ console.error('Ollama CLAUDE.md generation failed:', message);
97
+ return null;
98
+ }
99
+ }
100
+ /**
101
+ * Generate specialized prompts using Ollama
102
+ */
103
+ export async function generatePrompts(projectInfo, analysis, options = {}) {
104
+ const { model = 'llama3.2' } = options;
105
+ const prompts = {};
106
+ // Determine which prompts to generate based on stacks
107
+ const hasBackend = projectInfo.stacks.some(s => ['dotnet', 'node', 'python', 'java', 'go', 'rust'].includes(s.name));
108
+ const hasFrontend = projectInfo.stacks.some(s => ['react', 'nextjs', 'vue', 'angular', 'svelte'].includes(s.name));
109
+ const hasDatabase = projectInfo.stacks.some(s => ['drizzle', 'prisma', 'typeorm', 'sequelize'].includes(s.name));
110
+ // Generate orchestrator prompt (always)
111
+ prompts.orchestrator = await generateOrchestratorPrompt(projectInfo, analysis, { model });
112
+ // Generate backend prompt
113
+ if (hasBackend) {
114
+ prompts.backend = await generateBackendPrompt(projectInfo, analysis, { model });
115
+ }
116
+ // Generate frontend prompt
117
+ if (hasFrontend) {
118
+ prompts.frontend = await generateFrontendPrompt(projectInfo, analysis, { model });
119
+ }
120
+ // Generate database prompt
121
+ if (hasDatabase) {
122
+ prompts.database = await generateDatabasePrompt(projectInfo, analysis, { model });
123
+ }
124
+ return prompts;
125
+ }
126
+ /**
127
+ * Generate orchestrator prompt
128
+ */
129
+ async function generateOrchestratorPrompt(projectInfo, analysis, options) {
130
+ const prompt = `Generate a prompt file for an "Orchestrator" agent that coordinates development work.
131
+
132
+ Project: ${projectInfo.name}
133
+ Stacks: ${projectInfo.stacks.map(s => s.name).join(', ')}
134
+
135
+ The orchestrator should:
136
+ 1. NOT implement code directly - always delegate
137
+ 2. Follow a pipeline: Explore -> Spec -> Implement -> Review -> Complete
138
+ 3. Coordinate between backend, frontend, and database specialists
139
+
140
+ Return markdown content for the prompt file. Include:
141
+ - Identity section explaining the role
142
+ - Pipeline steps
143
+ - Delegation rules
144
+ - Task template examples`;
145
+ try {
146
+ return await ollama.generate(prompt, options);
147
+ }
148
+ catch {
149
+ return getDefaultOrchestratorPrompt();
150
+ }
151
+ }
152
+ /**
153
+ * Generate backend prompt
154
+ */
155
+ async function generateBackendPrompt(projectInfo, analysis, options) {
156
+ const backendStack = projectInfo.stacks.find(s => ['dotnet', 'node', 'python', 'java', 'go', 'rust'].includes(s.name));
157
+ const prompt = `Generate a prompt file for a "Backend Specialist" agent.
158
+
159
+ Project: ${projectInfo.name}
160
+ Backend Stack: ${backendStack?.name ?? 'unknown'} ${backendStack?.version ?? ''}
161
+ Architecture: ${analysis.architecture?.type ?? 'unknown'}
162
+ Patterns: ${(analysis.patterns ?? []).join(', ')}
163
+
164
+ The backend specialist should:
165
+ 1. Implement API endpoints, services, business logic
166
+ 2. Follow the project's architecture patterns
167
+ 3. Use proper dependency injection
168
+ 4. Handle errors appropriately
169
+
170
+ Return markdown content for the prompt file.`;
171
+ try {
172
+ return await ollama.generate(prompt, options);
173
+ }
174
+ catch {
175
+ return getDefaultBackendPrompt(backendStack?.name);
176
+ }
177
+ }
178
+ /**
179
+ * Generate frontend prompt
180
+ */
181
+ async function generateFrontendPrompt(projectInfo, analysis, options) {
182
+ const frontendStack = projectInfo.stacks.find(s => ['react', 'nextjs', 'vue', 'angular', 'svelte'].includes(s.name));
183
+ const prompt = `Generate a prompt file for a "Frontend Specialist" agent.
184
+
185
+ Project: ${projectInfo.name}
186
+ Frontend Stack: ${frontendStack?.name ?? 'unknown'} ${frontendStack?.version ?? ''}
187
+
188
+ The frontend specialist should:
189
+ 1. Implement React components, hooks, pages
190
+ 2. Follow the project's component patterns
191
+ 3. Handle state management properly
192
+ 4. Ensure type safety with TypeScript
193
+
194
+ Return markdown content for the prompt file.`;
195
+ try {
196
+ return await ollama.generate(prompt, options);
197
+ }
198
+ catch {
199
+ return getDefaultFrontendPrompt(frontendStack?.name);
200
+ }
201
+ }
202
+ /**
203
+ * Generate database prompt
204
+ */
205
+ async function generateDatabasePrompt(projectInfo, analysis, options) {
206
+ const dbStack = projectInfo.stacks.find(s => ['drizzle', 'prisma', 'typeorm', 'sequelize'].includes(s.name));
207
+ const prompt = `Generate a prompt file for a "Database Specialist" agent.
208
+
209
+ Project: ${projectInfo.name}
210
+ ORM/Schema: ${dbStack?.name ?? 'unknown'}
211
+
212
+ The database specialist should:
213
+ 1. Create and modify database schemas
214
+ 2. Handle migrations properly
215
+ 3. Follow naming conventions for tables and columns
216
+ 4. Ensure referential integrity
217
+
218
+ Return markdown content for the prompt file.`;
219
+ try {
220
+ return await ollama.generate(prompt, options);
221
+ }
222
+ catch {
223
+ return getDefaultDatabasePrompt(dbStack?.name);
224
+ }
225
+ }
226
+ /**
227
+ * Default analysis when Ollama is unavailable
228
+ */
229
+ function getDefaultAnalysis() {
230
+ return {
231
+ architecture: { type: 'unknown', description: '', confidence: 'low' },
232
+ patterns: [],
233
+ naming: {
234
+ classes: 'PascalCase',
235
+ files: 'kebab-case',
236
+ },
237
+ rules: [],
238
+ frameworks: [],
239
+ entities: []
240
+ };
241
+ }
242
+ /**
243
+ * Default orchestrator prompt
244
+ */
245
+ function getDefaultOrchestratorPrompt() {
246
+ return `# Orchestrator
247
+
248
+ ## Identity
249
+ You are the Orchestrator agent. You coordinate development work but do NOT implement code directly.
250
+
251
+ ## Pipeline
252
+ 1. **EXPLORE**: Analyze requirements using Task(Explore)
253
+ 2. **SPEC**: Create specification for approval
254
+ 3. **IMPLEMENT**: Delegate to specialized agents
255
+ 4. **REVIEW**: Validate implementation
256
+ 5. **COMPLETE**: Update registry and finalize
257
+
258
+ ## Rules
259
+ - Never write code directly
260
+ - Always delegate to specialized agents
261
+ - Follow the pipeline strictly
262
+ `;
263
+ }
264
+ /**
265
+ * Default backend prompt
266
+ */
267
+ function getDefaultBackendPrompt(stack = 'unknown') {
268
+ return `# Backend Specialist
269
+
270
+ ## Identity
271
+ You are the Backend Specialist. You implement server-side code.
272
+
273
+ ## Stack
274
+ ${stack}
275
+
276
+ ## Responsibilities
277
+ - Implement API endpoints
278
+ - Create services and business logic
279
+ - Handle data access
280
+ - Manage authentication/authorization
281
+
282
+ ## Rules
283
+ - Follow project architecture patterns
284
+ - Use dependency injection
285
+ - Handle errors properly
286
+ - Write clean, testable code
287
+ `;
288
+ }
289
+ /**
290
+ * Default frontend prompt
291
+ */
292
+ function getDefaultFrontendPrompt(stack = 'react') {
293
+ return `# Frontend Specialist
294
+
295
+ ## Identity
296
+ You are the Frontend Specialist. You implement client-side code.
297
+
298
+ ## Stack
299
+ ${stack}
300
+
301
+ ## Responsibilities
302
+ - Create React components
303
+ - Implement custom hooks
304
+ - Handle state management
305
+ - Build responsive UI
306
+
307
+ ## Rules
308
+ - Follow component patterns
309
+ - Ensure type safety
310
+ - Handle loading/error states
311
+ - Write accessible code
312
+ `;
313
+ }
314
+ /**
315
+ * Default database prompt
316
+ */
317
+ function getDefaultDatabasePrompt(orm = 'unknown') {
318
+ return `# Database Specialist
319
+
320
+ ## Identity
321
+ You are the Database Specialist. You manage database schemas and migrations.
322
+
323
+ ## ORM
324
+ ${orm}
325
+
326
+ ## Responsibilities
327
+ - Create database schemas
328
+ - Handle migrations
329
+ - Design relationships
330
+ - Optimize queries
331
+
332
+ ## Rules
333
+ - Follow naming conventions
334
+ - Ensure referential integrity
335
+ - Use appropriate data types
336
+ - Document schema changes
337
+ `;
338
+ }
339
+ //# sourceMappingURL=llm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm.js","sourceRoot":"","sources":["../../src/analyzers/llm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAGhD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,YAA0B,EAAE,UAAyB,EAAE;IACvF,MAAM,EAAE,KAAK,GAAG,UAAU,EAAE,GAAG,OAAO,CAAC;IAEvC,MAAM,YAAY,GAAG,YAAY;SAC9B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;SAC3B,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,OAAO,UAAU,CAAC;SACvD,IAAI,CAAC,MAAM,CAAC,CAAC;IAEhB,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,kBAAkB,EAAE,CAAC;IAC9B,CAAC;IAED,MAAM,MAAM,GAAG;;;EAGf,YAAY;;;;;;;;;;;;;;;;;;;;;;uCAsByB,CAAC;IAEtC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,YAAY,CAAoB,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QACjF,OAAO;YACL,GAAG,kBAAkB,EAAE;YACvB,GAAG,QAAQ;SACZ,CAAC;IACJ,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OA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Options, CodeSampleOptions } from '../types.js';
2
+ /**
3
+ * Discover patterns using semantic search
4
+ */
5
+ export declare function discoverPatterns(options?: DiscoverOptions): Promise<DiscoveredPatterns>;
6
+ /**
7
+ * Discover entities in the codebase
8
+ */
9
+ export declare function discoverEntities(stacks?: Stack[]): Promise<Entity[]>;
10
+ /**
11
+ * Get code samples for each pattern type
12
+ */
13
+ export declare function getCodeSamples(patterns: DiscoveredPatterns, options?: CodeSampleOptions): Promise<CodeSamples>;