@claudetools/cli 0.9.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/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +106 -0
- package/dist/cli.js.map +1 -0
- package/dist/onboard/agents-md-builder.d.ts +14 -0
- package/dist/onboard/agents-md-builder.d.ts.map +1 -0
- package/dist/onboard/agents-md-builder.js +378 -0
- package/dist/onboard/agents-md-builder.js.map +1 -0
- package/dist/onboard/context7-fetcher.d.ts +27 -0
- package/dist/onboard/context7-fetcher.d.ts.map +1 -0
- package/dist/onboard/context7-fetcher.js +116 -0
- package/dist/onboard/context7-fetcher.js.map +1 -0
- package/dist/onboard/docs-generator.d.ts +8 -0
- package/dist/onboard/docs-generator.d.ts.map +1 -0
- package/dist/onboard/docs-generator.js +250 -0
- package/dist/onboard/docs-generator.js.map +1 -0
- package/dist/onboard/index.d.ts +11 -0
- package/dist/onboard/index.d.ts.map +1 -0
- package/dist/onboard/index.js +128 -0
- package/dist/onboard/index.js.map +1 -0
- package/dist/onboard/stack-detector.d.ts +4 -0
- package/dist/onboard/stack-detector.d.ts.map +1 -0
- package/dist/onboard/stack-detector.js +324 -0
- package/dist/onboard/stack-detector.js.map +1 -0
- package/dist/onboard/types.d.ts +80 -0
- package/dist/onboard/types.d.ts.map +1 -0
- package/dist/onboard/types.js +5 -0
- package/dist/onboard/types.js.map +1 -0
- package/dist/onboard/web-research.d.ts +11 -0
- package/dist/onboard/web-research.d.ts.map +1 -0
- package/dist/onboard/web-research.js +209 -0
- package/dist/onboard/web-research.js.map +1 -0
- package/dist/setup.d.ts +3 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +190 -0
- package/dist/setup.js.map +1 -0
- package/dist/templates/agents-md.d.ts +10 -0
- package/dist/templates/agents-md.d.ts.map +1 -0
- package/dist/templates/agents-md.js +125 -0
- package/dist/templates/agents-md.js.map +1 -0
- package/dist/templates/claude-md.d.ts +12 -0
- package/dist/templates/claude-md.d.ts.map +1 -0
- package/dist/templates/claude-md.js +62 -0
- package/dist/templates/claude-md.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// Stack Detector
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Detects project technology stack from manifest files
|
|
5
|
+
import { existsSync, readFileSync } from 'fs';
|
|
6
|
+
import { join } from 'path';
|
|
7
|
+
// Framework detection patterns
|
|
8
|
+
const FRAMEWORK_PATTERNS = {
|
|
9
|
+
// Frontend
|
|
10
|
+
'next': { category: 'fullstack', context7Id: 'next.js' },
|
|
11
|
+
'react': { category: 'frontend', context7Id: 'react' },
|
|
12
|
+
'vue': { category: 'frontend', context7Id: 'vue' },
|
|
13
|
+
'svelte': { category: 'frontend', context7Id: 'svelte' },
|
|
14
|
+
'angular': { category: 'frontend', context7Id: 'angular' },
|
|
15
|
+
'solid-js': { category: 'frontend', context7Id: 'solid' },
|
|
16
|
+
'qwik': { category: 'frontend', context7Id: 'qwik' },
|
|
17
|
+
'astro': { category: 'fullstack', context7Id: 'astro' },
|
|
18
|
+
'@remix-run/react': { category: 'fullstack', context7Id: 'remix' },
|
|
19
|
+
'@tanstack/start': { category: 'fullstack', context7Id: 'tanstack-start' },
|
|
20
|
+
'nuxt': { category: 'fullstack', context7Id: 'nuxt' },
|
|
21
|
+
'sveltekit': { category: 'fullstack', context7Id: 'sveltekit' },
|
|
22
|
+
// Backend
|
|
23
|
+
'express': { category: 'backend', context7Id: 'express' },
|
|
24
|
+
'fastify': { category: 'backend', context7Id: 'fastify' },
|
|
25
|
+
'hono': { category: 'backend', context7Id: 'hono' },
|
|
26
|
+
'elysia': { category: 'backend', context7Id: 'elysia' },
|
|
27
|
+
'koa': { category: 'backend', context7Id: 'koa' },
|
|
28
|
+
'nestjs': { category: 'backend', context7Id: 'nestjs' },
|
|
29
|
+
'@nestjs/core': { category: 'backend', context7Id: 'nestjs' },
|
|
30
|
+
// Mobile/Desktop
|
|
31
|
+
'react-native': { category: 'mobile', context7Id: 'react-native' },
|
|
32
|
+
'expo': { category: 'mobile', context7Id: 'expo' },
|
|
33
|
+
'electron': { category: 'desktop', context7Id: 'electron' },
|
|
34
|
+
'tauri': { category: 'desktop', context7Id: 'tauri' },
|
|
35
|
+
};
|
|
36
|
+
// Library categories
|
|
37
|
+
const LIBRARY_CATEGORIES = {
|
|
38
|
+
// Database/ORM
|
|
39
|
+
'drizzle-orm': 'database',
|
|
40
|
+
'prisma': 'database',
|
|
41
|
+
'@prisma/client': 'database',
|
|
42
|
+
'mongoose': 'database',
|
|
43
|
+
'typeorm': 'database',
|
|
44
|
+
'sequelize': 'database',
|
|
45
|
+
'kysely': 'database',
|
|
46
|
+
'better-sqlite3': 'database',
|
|
47
|
+
// State Management
|
|
48
|
+
'zustand': 'state-management',
|
|
49
|
+
'jotai': 'state-management',
|
|
50
|
+
'recoil': 'state-management',
|
|
51
|
+
'@reduxjs/toolkit': 'state-management',
|
|
52
|
+
'redux': 'state-management',
|
|
53
|
+
'mobx': 'state-management',
|
|
54
|
+
'pinia': 'state-management',
|
|
55
|
+
// Data Fetching
|
|
56
|
+
'@tanstack/react-query': 'data-fetching',
|
|
57
|
+
'swr': 'data-fetching',
|
|
58
|
+
'@trpc/client': 'data-fetching',
|
|
59
|
+
'@trpc/server': 'data-fetching',
|
|
60
|
+
'axios': 'data-fetching',
|
|
61
|
+
// Validation
|
|
62
|
+
'zod': 'validation',
|
|
63
|
+
'yup': 'validation',
|
|
64
|
+
'valibot': 'validation',
|
|
65
|
+
'joi': 'validation',
|
|
66
|
+
'arktype': 'validation',
|
|
67
|
+
// Authentication
|
|
68
|
+
'next-auth': 'authentication',
|
|
69
|
+
'@auth/core': 'authentication',
|
|
70
|
+
'lucia': 'authentication',
|
|
71
|
+
'better-auth': 'authentication',
|
|
72
|
+
'@clerk/nextjs': 'authentication',
|
|
73
|
+
'passport': 'authentication',
|
|
74
|
+
// UI Components
|
|
75
|
+
'@radix-ui/react-*': 'ui-components',
|
|
76
|
+
'@shadcn/ui': 'ui-components',
|
|
77
|
+
'@mantine/core': 'ui-components',
|
|
78
|
+
'@chakra-ui/react': 'ui-components',
|
|
79
|
+
'@mui/material': 'ui-components',
|
|
80
|
+
'antd': 'ui-components',
|
|
81
|
+
// Styling
|
|
82
|
+
'tailwindcss': 'styling',
|
|
83
|
+
'styled-components': 'styling',
|
|
84
|
+
'@emotion/react': 'styling',
|
|
85
|
+
'sass': 'styling',
|
|
86
|
+
};
|
|
87
|
+
// Dev tool categories
|
|
88
|
+
const DEV_TOOL_CATEGORIES = {
|
|
89
|
+
// Testing
|
|
90
|
+
'vitest': 'testing',
|
|
91
|
+
'jest': 'testing',
|
|
92
|
+
'@testing-library/react': 'testing',
|
|
93
|
+
'playwright': 'testing',
|
|
94
|
+
'cypress': 'testing',
|
|
95
|
+
// Linting
|
|
96
|
+
'eslint': 'linting',
|
|
97
|
+
'prettier': 'linting',
|
|
98
|
+
'@typescript-eslint/eslint-plugin': 'linting',
|
|
99
|
+
'biome': 'linting',
|
|
100
|
+
// Bundling
|
|
101
|
+
'vite': 'bundling',
|
|
102
|
+
'webpack': 'bundling',
|
|
103
|
+
'esbuild': 'bundling',
|
|
104
|
+
'rollup': 'bundling',
|
|
105
|
+
'tsup': 'bundling',
|
|
106
|
+
'turbo': 'bundling',
|
|
107
|
+
};
|
|
108
|
+
export function detectStack(projectPath) {
|
|
109
|
+
const stack = {
|
|
110
|
+
frameworks: [],
|
|
111
|
+
libraries: [],
|
|
112
|
+
devTools: [],
|
|
113
|
+
primaryLanguage: 'unknown',
|
|
114
|
+
packageManager: 'unknown',
|
|
115
|
+
};
|
|
116
|
+
// Detect package manager and parse manifest
|
|
117
|
+
const packageJsonPath = join(projectPath, 'package.json');
|
|
118
|
+
if (existsSync(packageJsonPath)) {
|
|
119
|
+
stack.primaryLanguage = 'typescript';
|
|
120
|
+
parsePackageJson(packageJsonPath, stack);
|
|
121
|
+
stack.packageManager = detectPackageManager(projectPath);
|
|
122
|
+
}
|
|
123
|
+
// Python projects
|
|
124
|
+
const requirementsPath = join(projectPath, 'requirements.txt');
|
|
125
|
+
const pyprojectPath = join(projectPath, 'pyproject.toml');
|
|
126
|
+
if (existsSync(requirementsPath) || existsSync(pyprojectPath)) {
|
|
127
|
+
stack.primaryLanguage = 'python';
|
|
128
|
+
if (existsSync(pyprojectPath)) {
|
|
129
|
+
stack.packageManager = 'poetry';
|
|
130
|
+
parsePyproject(pyprojectPath, stack);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
stack.packageManager = 'pip';
|
|
134
|
+
parseRequirements(requirementsPath, stack);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
// Go projects
|
|
138
|
+
const goModPath = join(projectPath, 'go.mod');
|
|
139
|
+
if (existsSync(goModPath)) {
|
|
140
|
+
stack.primaryLanguage = 'go';
|
|
141
|
+
stack.packageManager = 'go';
|
|
142
|
+
parseGoMod(goModPath, stack);
|
|
143
|
+
}
|
|
144
|
+
// Rust projects
|
|
145
|
+
const cargoPath = join(projectPath, 'Cargo.toml');
|
|
146
|
+
if (existsSync(cargoPath)) {
|
|
147
|
+
stack.primaryLanguage = 'rust';
|
|
148
|
+
stack.packageManager = 'cargo';
|
|
149
|
+
parseCargoToml(cargoPath, stack);
|
|
150
|
+
}
|
|
151
|
+
return stack;
|
|
152
|
+
}
|
|
153
|
+
function parsePackageJson(path, stack) {
|
|
154
|
+
try {
|
|
155
|
+
const content = JSON.parse(readFileSync(path, 'utf-8'));
|
|
156
|
+
const allDeps = {
|
|
157
|
+
...content.dependencies,
|
|
158
|
+
...content.devDependencies,
|
|
159
|
+
...content.peerDependencies,
|
|
160
|
+
};
|
|
161
|
+
// Check for TypeScript
|
|
162
|
+
if (allDeps['typescript'] || existsSync(join(path, '..', 'tsconfig.json'))) {
|
|
163
|
+
stack.primaryLanguage = 'typescript';
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
stack.primaryLanguage = 'javascript';
|
|
167
|
+
}
|
|
168
|
+
for (const [name, version] of Object.entries(allDeps)) {
|
|
169
|
+
const versionStr = String(version).replace(/^[\^~]/, '');
|
|
170
|
+
// Check frameworks
|
|
171
|
+
const frameworkKey = Object.keys(FRAMEWORK_PATTERNS).find(key => name === key || name.startsWith(key + '/'));
|
|
172
|
+
if (frameworkKey) {
|
|
173
|
+
const info = FRAMEWORK_PATTERNS[frameworkKey];
|
|
174
|
+
stack.frameworks.push({
|
|
175
|
+
name: frameworkKey,
|
|
176
|
+
version: versionStr,
|
|
177
|
+
category: info.category,
|
|
178
|
+
context7Id: info.context7Id,
|
|
179
|
+
});
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
// Check dev tools
|
|
183
|
+
const devToolKey = Object.keys(DEV_TOOL_CATEGORIES).find(key => name === key || name.startsWith(key + '/'));
|
|
184
|
+
if (devToolKey && content.devDependencies?.[name]) {
|
|
185
|
+
stack.devTools.push({
|
|
186
|
+
name: devToolKey,
|
|
187
|
+
version: versionStr,
|
|
188
|
+
category: DEV_TOOL_CATEGORIES[devToolKey],
|
|
189
|
+
});
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
// Check libraries
|
|
193
|
+
const libraryKey = Object.keys(LIBRARY_CATEGORIES).find(key => name === key || (key.endsWith('*') && name.startsWith(key.slice(0, -1))));
|
|
194
|
+
if (libraryKey) {
|
|
195
|
+
stack.libraries.push({
|
|
196
|
+
name,
|
|
197
|
+
version: versionStr,
|
|
198
|
+
category: LIBRARY_CATEGORIES[libraryKey],
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
catch {
|
|
204
|
+
// Silent fail
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
function detectPackageManager(projectPath) {
|
|
208
|
+
if (existsSync(join(projectPath, 'pnpm-lock.yaml')))
|
|
209
|
+
return 'pnpm';
|
|
210
|
+
if (existsSync(join(projectPath, 'yarn.lock')))
|
|
211
|
+
return 'yarn';
|
|
212
|
+
if (existsSync(join(projectPath, 'bun.lockb')))
|
|
213
|
+
return 'bun';
|
|
214
|
+
if (existsSync(join(projectPath, 'package-lock.json')))
|
|
215
|
+
return 'npm';
|
|
216
|
+
return 'npm';
|
|
217
|
+
}
|
|
218
|
+
function parsePyproject(path, stack) {
|
|
219
|
+
try {
|
|
220
|
+
const content = readFileSync(path, 'utf-8');
|
|
221
|
+
// Detect common Python frameworks
|
|
222
|
+
if (content.includes('fastapi')) {
|
|
223
|
+
stack.frameworks.push({
|
|
224
|
+
name: 'fastapi',
|
|
225
|
+
version: '',
|
|
226
|
+
category: 'backend',
|
|
227
|
+
context7Id: 'fastapi',
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
if (content.includes('django')) {
|
|
231
|
+
stack.frameworks.push({
|
|
232
|
+
name: 'django',
|
|
233
|
+
version: '',
|
|
234
|
+
category: 'backend',
|
|
235
|
+
context7Id: 'django',
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
if (content.includes('flask')) {
|
|
239
|
+
stack.frameworks.push({
|
|
240
|
+
name: 'flask',
|
|
241
|
+
version: '',
|
|
242
|
+
category: 'backend',
|
|
243
|
+
context7Id: 'flask',
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
catch {
|
|
248
|
+
// Silent fail
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
function parseRequirements(path, stack) {
|
|
252
|
+
try {
|
|
253
|
+
const content = readFileSync(path, 'utf-8');
|
|
254
|
+
const lines = content.split('\n');
|
|
255
|
+
for (const line of lines) {
|
|
256
|
+
const trimmed = line.trim();
|
|
257
|
+
if (!trimmed || trimmed.startsWith('#'))
|
|
258
|
+
continue;
|
|
259
|
+
const name = trimmed.split(/[=<>!]/)[0]?.toLowerCase();
|
|
260
|
+
if (!name)
|
|
261
|
+
continue;
|
|
262
|
+
if (name === 'fastapi') {
|
|
263
|
+
stack.frameworks.push({ name: 'fastapi', version: '', category: 'backend', context7Id: 'fastapi' });
|
|
264
|
+
}
|
|
265
|
+
else if (name === 'django') {
|
|
266
|
+
stack.frameworks.push({ name: 'django', version: '', category: 'backend', context7Id: 'django' });
|
|
267
|
+
}
|
|
268
|
+
else if (name === 'flask') {
|
|
269
|
+
stack.frameworks.push({ name: 'flask', version: '', category: 'backend', context7Id: 'flask' });
|
|
270
|
+
}
|
|
271
|
+
else if (name === 'pytest') {
|
|
272
|
+
stack.devTools.push({ name: 'pytest', version: '', category: 'testing' });
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
catch {
|
|
277
|
+
// Silent fail
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
function parseGoMod(path, stack) {
|
|
281
|
+
try {
|
|
282
|
+
const content = readFileSync(path, 'utf-8');
|
|
283
|
+
if (content.includes('github.com/gin-gonic/gin')) {
|
|
284
|
+
stack.frameworks.push({ name: 'gin', version: '', category: 'backend', context7Id: 'gin' });
|
|
285
|
+
}
|
|
286
|
+
if (content.includes('github.com/gofiber/fiber')) {
|
|
287
|
+
stack.frameworks.push({ name: 'fiber', version: '', category: 'backend', context7Id: 'fiber' });
|
|
288
|
+
}
|
|
289
|
+
if (content.includes('github.com/labstack/echo')) {
|
|
290
|
+
stack.frameworks.push({ name: 'echo', version: '', category: 'backend', context7Id: 'echo' });
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
catch {
|
|
294
|
+
// Silent fail
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
function parseCargoToml(path, stack) {
|
|
298
|
+
try {
|
|
299
|
+
const content = readFileSync(path, 'utf-8');
|
|
300
|
+
if (content.includes('actix-web')) {
|
|
301
|
+
stack.frameworks.push({ name: 'actix-web', version: '', category: 'backend', context7Id: 'actix' });
|
|
302
|
+
}
|
|
303
|
+
if (content.includes('axum')) {
|
|
304
|
+
stack.frameworks.push({ name: 'axum', version: '', category: 'backend', context7Id: 'axum' });
|
|
305
|
+
}
|
|
306
|
+
if (content.includes('rocket')) {
|
|
307
|
+
stack.frameworks.push({ name: 'rocket', version: '', category: 'backend', context7Id: 'rocket' });
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
catch {
|
|
311
|
+
// Silent fail
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
export function getStackSummary(stack) {
|
|
315
|
+
const parts = [];
|
|
316
|
+
if (stack.primaryLanguage !== 'unknown') {
|
|
317
|
+
parts.push(stack.primaryLanguage);
|
|
318
|
+
}
|
|
319
|
+
for (const framework of stack.frameworks) {
|
|
320
|
+
parts.push(`${framework.name} ${framework.version}`.trim());
|
|
321
|
+
}
|
|
322
|
+
return parts.join(' + ') || 'Unknown stack';
|
|
323
|
+
}
|
|
324
|
+
//# sourceMappingURL=stack-detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stack-detector.js","sourceRoot":"","sources":["../../src/onboard/stack-detector.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,iBAAiB;AACjB,gFAAgF;AAChF,uDAAuD;AAEvD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,+BAA+B;AAC/B,MAAM,kBAAkB,GAAiF;IACvG,WAAW;IACX,MAAM,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE;IACxD,OAAO,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE;IACtD,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE;IAClD,QAAQ,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE;IACxD,SAAS,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE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I,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC;QAChG,CAAC;QACD,IAAI,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC/B,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC;QACpG,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,cAAc;IAChB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAgB;IAC9C,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,IAAI,KAAK,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;QACxC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IACpC,CAAC;IAED,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;QACzC,KAAK,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,eAAe,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export interface StackInfo {
|
|
2
|
+
frameworks: FrameworkInfo[];
|
|
3
|
+
libraries: LibraryInfo[];
|
|
4
|
+
devTools: DevToolInfo[];
|
|
5
|
+
primaryLanguage: string;
|
|
6
|
+
packageManager: 'npm' | 'pnpm' | 'yarn' | 'bun' | 'pip' | 'poetry' | 'go' | 'cargo' | 'unknown';
|
|
7
|
+
}
|
|
8
|
+
export interface FrameworkInfo {
|
|
9
|
+
name: string;
|
|
10
|
+
version: string;
|
|
11
|
+
category: 'frontend' | 'backend' | 'fullstack' | 'mobile' | 'desktop';
|
|
12
|
+
context7Id?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface LibraryInfo {
|
|
15
|
+
name: string;
|
|
16
|
+
version: string;
|
|
17
|
+
category: string;
|
|
18
|
+
context7Id?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface DevToolInfo {
|
|
21
|
+
name: string;
|
|
22
|
+
version: string;
|
|
23
|
+
category: 'testing' | 'linting' | 'bundling' | 'ci' | 'other';
|
|
24
|
+
}
|
|
25
|
+
export interface DocumentationFile {
|
|
26
|
+
path: string;
|
|
27
|
+
title: string;
|
|
28
|
+
category: 'frameworks' | 'libraries' | 'tooling' | 'patterns';
|
|
29
|
+
content: string;
|
|
30
|
+
source: 'context7' | 'web-research' | 'generated';
|
|
31
|
+
lastUpdated: string;
|
|
32
|
+
}
|
|
33
|
+
export interface DocsMetadata {
|
|
34
|
+
generatedAt: string;
|
|
35
|
+
projectPath: string;
|
|
36
|
+
stack: StackInfo;
|
|
37
|
+
files: Array<{
|
|
38
|
+
path: string;
|
|
39
|
+
title: string;
|
|
40
|
+
source: string;
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
43
|
+
export interface AgentsMdContent {
|
|
44
|
+
projectName: string;
|
|
45
|
+
projectPath: string;
|
|
46
|
+
generatedAt: string;
|
|
47
|
+
stack: StackInfo;
|
|
48
|
+
directoryTree: string;
|
|
49
|
+
entryPoints: EntryPoint[];
|
|
50
|
+
conventions: Convention[];
|
|
51
|
+
documentationLinks: DocumentationLink[];
|
|
52
|
+
}
|
|
53
|
+
export interface EntryPoint {
|
|
54
|
+
path: string;
|
|
55
|
+
description: string;
|
|
56
|
+
exports?: string[];
|
|
57
|
+
}
|
|
58
|
+
export interface Convention {
|
|
59
|
+
name: string;
|
|
60
|
+
pattern: string;
|
|
61
|
+
description: string;
|
|
62
|
+
}
|
|
63
|
+
export interface DocumentationLink {
|
|
64
|
+
title: string;
|
|
65
|
+
path: string;
|
|
66
|
+
description?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface Context7Library {
|
|
69
|
+
libraryId: string;
|
|
70
|
+
name: string;
|
|
71
|
+
description?: string;
|
|
72
|
+
}
|
|
73
|
+
export interface WebResearchResult {
|
|
74
|
+
library: string;
|
|
75
|
+
bestPractices: string[];
|
|
76
|
+
commonPatterns: string[];
|
|
77
|
+
gotchas: string[];
|
|
78
|
+
source: string;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/onboard/types.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,SAAS,EAAE,WAAW,EAAE,CAAC;IACzB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,CAAC;CACjG;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,IAAI,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WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/onboard/types.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,uBAAuB;AACvB,gFAAgF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { WebResearchResult } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get research results for a library
|
|
4
|
+
* Uses built-in knowledge base with web research as supplement
|
|
5
|
+
*/
|
|
6
|
+
export declare function researchLibrary(libraryName: string): Promise<WebResearchResult>;
|
|
7
|
+
/**
|
|
8
|
+
* Research multiple libraries in parallel
|
|
9
|
+
*/
|
|
10
|
+
export declare function researchLibraries(libraryNames: string[]): Promise<WebResearchResult[]>;
|
|
11
|
+
//# sourceMappingURL=web-research.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-research.d.ts","sourceRoot":"","sources":["../../src/onboard/web-research.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAiLpD;;;GAGG;AACH,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAqBrF;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,YAAY,EAAE,MAAM,EAAE,GACrB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAE9B"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// Web Research
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Supplements Context7 documentation with web-sourced best practices
|
|
5
|
+
// Common best practices for popular libraries (fallback when web search unavailable)
|
|
6
|
+
const KNOWN_BEST_PRACTICES = {
|
|
7
|
+
react: {
|
|
8
|
+
bestPractices: [
|
|
9
|
+
'Use functional components with hooks over class components',
|
|
10
|
+
'Memoize expensive computations with useMemo and callbacks with useCallback',
|
|
11
|
+
'Lift state up only when necessary, prefer local state',
|
|
12
|
+
'Use React.lazy and Suspense for code splitting',
|
|
13
|
+
'Keep components small and focused on a single responsibility',
|
|
14
|
+
],
|
|
15
|
+
commonPatterns: [
|
|
16
|
+
'Container/Presentational pattern for separating logic from UI',
|
|
17
|
+
'Custom hooks for reusable stateful logic',
|
|
18
|
+
'Compound components for flexible component APIs',
|
|
19
|
+
'Render props for sharing cross-cutting concerns',
|
|
20
|
+
],
|
|
21
|
+
gotchas: [
|
|
22
|
+
'Avoid inline function definitions in JSX (creates new references)',
|
|
23
|
+
'Don\'t forget cleanup in useEffect return functions',
|
|
24
|
+
'Keys in lists should be stable and unique identifiers',
|
|
25
|
+
'State updates are batched and asynchronous',
|
|
26
|
+
],
|
|
27
|
+
source: 'built-in',
|
|
28
|
+
},
|
|
29
|
+
next: {
|
|
30
|
+
bestPractices: [
|
|
31
|
+
'Use Server Components by default, Client Components when needed',
|
|
32
|
+
'Implement proper loading and error states with loading.tsx and error.tsx',
|
|
33
|
+
'Use generateStaticParams for static generation of dynamic routes',
|
|
34
|
+
'Leverage Next.js Image component for automatic optimization',
|
|
35
|
+
'Use Server Actions for form submissions and mutations',
|
|
36
|
+
],
|
|
37
|
+
commonPatterns: [
|
|
38
|
+
'App Router with nested layouts for shared UI',
|
|
39
|
+
'Route groups for organizing without affecting URL structure',
|
|
40
|
+
'Parallel routes for simultaneous page sections',
|
|
41
|
+
'Intercepting routes for modal patterns',
|
|
42
|
+
],
|
|
43
|
+
gotchas: [
|
|
44
|
+
'Client Components cannot directly import Server Components',
|
|
45
|
+
'Cookies and headers only work in Server Components/Actions',
|
|
46
|
+
'Dynamic routes with revalidate may cache unexpectedly',
|
|
47
|
+
'Use the next/navigation router, not next/router in App Router',
|
|
48
|
+
],
|
|
49
|
+
source: 'built-in',
|
|
50
|
+
},
|
|
51
|
+
typescript: {
|
|
52
|
+
bestPractices: [
|
|
53
|
+
'Prefer type over interface for union types and type aliases',
|
|
54
|
+
'Use strict mode and enable all strict checks',
|
|
55
|
+
'Avoid any, use unknown for truly unknown types',
|
|
56
|
+
'Use const assertions for literal types',
|
|
57
|
+
'Prefer readonly for immutable data structures',
|
|
58
|
+
],
|
|
59
|
+
commonPatterns: [
|
|
60
|
+
'Discriminated unions for type-safe state machines',
|
|
61
|
+
'Utility types (Partial, Pick, Omit) for type transformations',
|
|
62
|
+
'Generic constraints with extends for type safety',
|
|
63
|
+
'Branded types for nominal typing',
|
|
64
|
+
],
|
|
65
|
+
gotchas: [
|
|
66
|
+
'Object.keys returns string[], not keyof T',
|
|
67
|
+
'Type narrowing doesn\'t work across function boundaries',
|
|
68
|
+
'Excess property checking only works on object literals',
|
|
69
|
+
'Index signatures make all properties potentially undefined',
|
|
70
|
+
],
|
|
71
|
+
source: 'built-in',
|
|
72
|
+
},
|
|
73
|
+
zod: {
|
|
74
|
+
bestPractices: [
|
|
75
|
+
'Define schemas once, infer types from them',
|
|
76
|
+
'Use transform for parsing and normalization',
|
|
77
|
+
'Leverage refinements for complex validation rules',
|
|
78
|
+
'Export both schema and inferred type together',
|
|
79
|
+
],
|
|
80
|
+
commonPatterns: [
|
|
81
|
+
'z.infer<typeof schema> for type inference',
|
|
82
|
+
'Composing schemas with extend, merge, pick, omit',
|
|
83
|
+
'Custom error messages with message option',
|
|
84
|
+
'Preprocessing with preprocess for data normalization',
|
|
85
|
+
],
|
|
86
|
+
gotchas: [
|
|
87
|
+
'Default values apply after parsing, not before',
|
|
88
|
+
'Coercion happens before validation',
|
|
89
|
+
'safeParse doesn\'t throw, returns result object',
|
|
90
|
+
'Optional vs nullable vs nullish have different behaviors',
|
|
91
|
+
],
|
|
92
|
+
source: 'built-in',
|
|
93
|
+
},
|
|
94
|
+
'drizzle-orm': {
|
|
95
|
+
bestPractices: [
|
|
96
|
+
'Define schema in separate files, import for migrations',
|
|
97
|
+
'Use prepared statements for frequently executed queries',
|
|
98
|
+
'Leverage relations for type-safe joins',
|
|
99
|
+
'Use transactions for multi-step operations',
|
|
100
|
+
],
|
|
101
|
+
commonPatterns: [
|
|
102
|
+
'Schema-first approach with drizzle-kit',
|
|
103
|
+
'Separate schema.ts and relations.ts files',
|
|
104
|
+
'Use db.$with for CTEs and complex queries',
|
|
105
|
+
'Custom types for application-specific columns',
|
|
106
|
+
],
|
|
107
|
+
gotchas: [
|
|
108
|
+
'Relations are not automatically included in queries',
|
|
109
|
+
'Push vs migrate have different use cases',
|
|
110
|
+
'Column names in schema must match database exactly',
|
|
111
|
+
'Timestamps need explicit defaults in PostgreSQL',
|
|
112
|
+
],
|
|
113
|
+
source: 'built-in',
|
|
114
|
+
},
|
|
115
|
+
prisma: {
|
|
116
|
+
bestPractices: [
|
|
117
|
+
'Use @unique for fields that should be unique',
|
|
118
|
+
'Define relations explicitly on both sides',
|
|
119
|
+
'Use select and include to optimize queries',
|
|
120
|
+
'Implement soft deletes with middleware',
|
|
121
|
+
],
|
|
122
|
+
commonPatterns: [
|
|
123
|
+
'Repository pattern wrapping Prisma client',
|
|
124
|
+
'Middleware for logging, soft deletes, timing',
|
|
125
|
+
'Extensions for custom client methods',
|
|
126
|
+
'Raw queries for complex operations',
|
|
127
|
+
],
|
|
128
|
+
gotchas: [
|
|
129
|
+
'Prisma client must be regenerated after schema changes',
|
|
130
|
+
'N+1 queries are easy to create with relations',
|
|
131
|
+
'DateTime is stored in UTC, convert on display',
|
|
132
|
+
'Unique constraints on optional fields can cause issues',
|
|
133
|
+
],
|
|
134
|
+
source: 'built-in',
|
|
135
|
+
},
|
|
136
|
+
tailwindcss: {
|
|
137
|
+
bestPractices: [
|
|
138
|
+
'Use design tokens via theme configuration',
|
|
139
|
+
'Prefer component extraction over @apply for reuse',
|
|
140
|
+
'Use arbitrary values sparingly, prefer config',
|
|
141
|
+
'Leverage responsive prefixes mobile-first',
|
|
142
|
+
],
|
|
143
|
+
commonPatterns: [
|
|
144
|
+
'Group related utilities with prose plugin',
|
|
145
|
+
'Custom variants for complex selectors',
|
|
146
|
+
'JIT mode for development efficiency',
|
|
147
|
+
'Content configuration for tree-shaking',
|
|
148
|
+
],
|
|
149
|
+
gotchas: [
|
|
150
|
+
'Dynamic class names are not detected by PurgeCSS',
|
|
151
|
+
'Conflicting utilities follow source order',
|
|
152
|
+
'Some utilities require specific parent elements',
|
|
153
|
+
'Dark mode requires explicit configuration',
|
|
154
|
+
],
|
|
155
|
+
source: 'built-in',
|
|
156
|
+
},
|
|
157
|
+
vitest: {
|
|
158
|
+
bestPractices: [
|
|
159
|
+
'Use describe blocks to organize related tests',
|
|
160
|
+
'Prefer toEqual for object comparison',
|
|
161
|
+
'Mock external dependencies at module boundaries',
|
|
162
|
+
'Use beforeEach for test isolation',
|
|
163
|
+
],
|
|
164
|
+
commonPatterns: [
|
|
165
|
+
'Arrange-Act-Assert structure for tests',
|
|
166
|
+
'Factory functions for test data creation',
|
|
167
|
+
'Snapshot testing for UI components',
|
|
168
|
+
'In-source testing for utility functions',
|
|
169
|
+
],
|
|
170
|
+
gotchas: [
|
|
171
|
+
'Module mocks must be before imports',
|
|
172
|
+
'Async tests need await or return promise',
|
|
173
|
+
'Timer mocks require useFakeTimers()',
|
|
174
|
+
'Coverage thresholds can block CI',
|
|
175
|
+
],
|
|
176
|
+
source: 'built-in',
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* Get research results for a library
|
|
181
|
+
* Uses built-in knowledge base with web research as supplement
|
|
182
|
+
*/
|
|
183
|
+
export async function researchLibrary(libraryName) {
|
|
184
|
+
const normalizedName = libraryName.toLowerCase().replace(/@/g, '').replace(/\//g, '-');
|
|
185
|
+
// Check built-in knowledge base
|
|
186
|
+
for (const [key, value] of Object.entries(KNOWN_BEST_PRACTICES)) {
|
|
187
|
+
if (normalizedName.includes(key) || key.includes(normalizedName)) {
|
|
188
|
+
return {
|
|
189
|
+
library: libraryName,
|
|
190
|
+
...value,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
// Return empty result if no built-in knowledge
|
|
195
|
+
return {
|
|
196
|
+
library: libraryName,
|
|
197
|
+
bestPractices: [],
|
|
198
|
+
commonPatterns: [],
|
|
199
|
+
gotchas: [],
|
|
200
|
+
source: 'none',
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Research multiple libraries in parallel
|
|
205
|
+
*/
|
|
206
|
+
export async function researchLibraries(libraryNames) {
|
|
207
|
+
return Promise.all(libraryNames.map(name => researchLibrary(name)));
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=web-research.js.map
|