(files: string[], sourceDir: string, targetDir: string)
| 497 | } |
| 498 | |
| 499 | async function importClaudeFiles(files: string[], sourceDir: string, targetDir: string) { |
| 500 | await fs.mkdir(targetDir, { recursive: true }) |
| 501 | let importedCount = 0 |
| 502 | |
| 503 | for (const file of files) { |
| 504 | const rel = path.relative(sourceDir, file) |
| 505 | const dest = path.join(targetDir, rel) |
| 506 | await fs.mkdir(path.dirname(dest), { recursive: true }) |
| 507 | |
| 508 | const exists = await fs |
| 509 | .stat(dest) |
| 510 | .then(() => true) |
| 511 | .catch(() => false) |
| 512 | if (exists) continue |
| 513 | |
| 514 | await fs.copyFile(file, dest) |
| 515 | importedCount += 1 |
| 516 | } |
| 517 | |
| 518 | log.info("claude commands import", { importedCount }) |
| 519 | return importedCount |
| 520 | } |
| 521 | |
| 522 | async function findProjectClaudeMcpFile(): Promise<string | undefined> { |
| 523 | const found = await Filesystem.findUp(CLAUDE_MCP_PROJECT_FILE, process.cwd()) |
no outgoing calls
no test coverage detected