@autonav/core 1.0.0 → 1.1.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.
- package/dist/cli/nav-init.js +307 -1
- package/dist/cli/nav-init.js.map +1 -1
- package/dist/confirmation/index.d.ts +31 -0
- package/dist/confirmation/index.d.ts.map +1 -0
- package/dist/confirmation/index.js +104 -0
- package/dist/confirmation/index.js.map +1 -0
- package/dist/repo-analyzer/index.d.ts +13 -0
- package/dist/repo-analyzer/index.d.ts.map +1 -0
- package/dist/repo-analyzer/index.js +148 -0
- package/dist/repo-analyzer/index.js.map +1 -0
- package/dist/repo-scanner/index.d.ts +48 -0
- package/dist/repo-scanner/index.d.ts.map +1 -0
- package/dist/repo-scanner/index.js +385 -0
- package/dist/repo-scanner/index.js.map +1 -0
- package/dist/skill-generator/index.d.ts +52 -0
- package/dist/skill-generator/index.d.ts.map +1 -0
- package/dist/skill-generator/index.js +236 -0
- package/dist/skill-generator/index.js.map +1 -0
- package/dist/templates/CLAUDE-import.md.template +90 -0
- package/dist/templates/CLAUDE.md.template +7 -9
- package/package.json +2 -1
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { query } from "@anthropic-ai/claude-agent-sdk";
|
|
2
|
+
/**
|
|
3
|
+
* Repository Analyzer
|
|
4
|
+
*
|
|
5
|
+
* Uses Claude to analyze scan results and infer navigator configuration.
|
|
6
|
+
*/
|
|
7
|
+
// Model to use for analysis
|
|
8
|
+
const ANALYSIS_MODEL = "claude-sonnet-4-5";
|
|
9
|
+
/**
|
|
10
|
+
* Build the analysis prompt from scan results
|
|
11
|
+
*/
|
|
12
|
+
function buildAnalysisPrompt(scanResult) {
|
|
13
|
+
const { files, directoryStructure, projectMetadata, stats } = scanResult;
|
|
14
|
+
// Build file content section
|
|
15
|
+
const fileContents = files
|
|
16
|
+
.filter((f) => f.content)
|
|
17
|
+
.map((f) => `### ${f.relativePath}\n\`\`\`\n${f.content}\n\`\`\``)
|
|
18
|
+
.join("\n\n");
|
|
19
|
+
return `You are analyzing a repository to create a knowledge navigator configuration.
|
|
20
|
+
|
|
21
|
+
## Repository Structure
|
|
22
|
+
|
|
23
|
+
\`\`\`
|
|
24
|
+
${directoryStructure}
|
|
25
|
+
\`\`\`
|
|
26
|
+
|
|
27
|
+
## Project Metadata
|
|
28
|
+
|
|
29
|
+
${projectMetadata.name ? `- **Name**: ${projectMetadata.name}` : ""}
|
|
30
|
+
${projectMetadata.description ? `- **Description**: ${projectMetadata.description}` : ""}
|
|
31
|
+
${projectMetadata.language ? `- **Language**: ${projectMetadata.language}` : ""}
|
|
32
|
+
${projectMetadata.keywords?.length ? `- **Keywords**: ${projectMetadata.keywords.join(", ")}` : ""}
|
|
33
|
+
${projectMetadata.dependencies?.length ? `- **Dependencies**: ${projectMetadata.dependencies.slice(0, 10).join(", ")}${projectMetadata.dependencies.length > 10 ? "..." : ""}` : ""}
|
|
34
|
+
|
|
35
|
+
## Scan Statistics
|
|
36
|
+
|
|
37
|
+
- Total files: ${stats.totalFiles}
|
|
38
|
+
- Files scanned: ${stats.scannedFiles}
|
|
39
|
+
- Strategy used: ${stats.strategy}
|
|
40
|
+
|
|
41
|
+
## File Contents
|
|
42
|
+
|
|
43
|
+
${fileContents}
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
Based on this repository analysis, provide a navigator configuration. Respond with ONLY a JSON object in this exact format:
|
|
48
|
+
|
|
49
|
+
\`\`\`json
|
|
50
|
+
{
|
|
51
|
+
"purpose": "A one-sentence description of what this repository/project does",
|
|
52
|
+
"scope": "Topics this navigator should cover (in-scope) and what it should NOT cover (out-of-scope)",
|
|
53
|
+
"audience": "Who would use this navigator and what communication style is appropriate",
|
|
54
|
+
"suggestedKnowledgePaths": ["array", "of", "paths", "to", "use", "as", "knowledge"],
|
|
55
|
+
"confidence": 0.85
|
|
56
|
+
}
|
|
57
|
+
\`\`\`
|
|
58
|
+
|
|
59
|
+
Guidelines:
|
|
60
|
+
- purpose: Be specific and accurate based on the actual code/docs
|
|
61
|
+
- scope: List specific topics, not vague categories
|
|
62
|
+
- audience: Consider the project type (library, application, internal tool, etc.)
|
|
63
|
+
- suggestedKnowledgePaths: Include paths that contain useful documentation (README.md, docs/, etc.)
|
|
64
|
+
- confidence: 0.0-1.0, how confident you are in this analysis (lower if repo has minimal docs)
|
|
65
|
+
|
|
66
|
+
Respond ONLY with the JSON block, no other text.`;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Parse the analysis response from Claude
|
|
70
|
+
*/
|
|
71
|
+
function parseAnalysisResponse(response) {
|
|
72
|
+
// Extract JSON from response
|
|
73
|
+
const jsonMatch = response.match(/```json\s*([\s\S]*?)```/);
|
|
74
|
+
const jsonStr = jsonMatch?.[1] ?? response;
|
|
75
|
+
try {
|
|
76
|
+
const parsed = JSON.parse(jsonStr.trim());
|
|
77
|
+
// Validate required fields
|
|
78
|
+
if (typeof parsed.purpose !== "string" ||
|
|
79
|
+
typeof parsed.scope !== "string" ||
|
|
80
|
+
typeof parsed.audience !== "string" ||
|
|
81
|
+
!Array.isArray(parsed.suggestedKnowledgePaths) ||
|
|
82
|
+
typeof parsed.confidence !== "number") {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
purpose: parsed.purpose,
|
|
87
|
+
scope: parsed.scope,
|
|
88
|
+
audience: parsed.audience,
|
|
89
|
+
suggestedKnowledgePaths: parsed.suggestedKnowledgePaths,
|
|
90
|
+
confidence: Math.max(0, Math.min(1, parsed.confidence)),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Analyze a scanned repository using Claude
|
|
99
|
+
*/
|
|
100
|
+
export async function analyzeRepository(scanResult) {
|
|
101
|
+
const prompt = buildAnalysisPrompt(scanResult);
|
|
102
|
+
try {
|
|
103
|
+
const queryInstance = query({
|
|
104
|
+
prompt,
|
|
105
|
+
options: {
|
|
106
|
+
model: ANALYSIS_MODEL,
|
|
107
|
+
permissionMode: "bypassPermissions",
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
let responseText = "";
|
|
111
|
+
for await (const message of queryInstance) {
|
|
112
|
+
if (message.type === "assistant") {
|
|
113
|
+
const content = message.message.content;
|
|
114
|
+
const textBlocks = content.filter((b) => b.type === "text");
|
|
115
|
+
responseText = textBlocks.map((b) => b.text).join("\n");
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const result = parseAnalysisResponse(responseText);
|
|
119
|
+
if (!result) {
|
|
120
|
+
// Return a default with low confidence if parsing failed
|
|
121
|
+
return {
|
|
122
|
+
purpose: scanResult.projectMetadata.description || "A software project",
|
|
123
|
+
scope: "This repository's code and documentation",
|
|
124
|
+
audience: "Developers working with this codebase",
|
|
125
|
+
suggestedKnowledgePaths: scanResult.files
|
|
126
|
+
.filter((f) => f.type === "readme" || f.type === "docs")
|
|
127
|
+
.map((f) => f.relativePath)
|
|
128
|
+
.slice(0, 5),
|
|
129
|
+
confidence: 0.3,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
return result;
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
// Return a fallback on error
|
|
136
|
+
return {
|
|
137
|
+
purpose: scanResult.projectMetadata.description || scanResult.projectMetadata.name || "A software project",
|
|
138
|
+
scope: "This repository's code and documentation",
|
|
139
|
+
audience: "Developers working with this codebase",
|
|
140
|
+
suggestedKnowledgePaths: scanResult.files
|
|
141
|
+
.filter((f) => f.type === "readme" || f.type === "docs")
|
|
142
|
+
.map((f) => f.relativePath)
|
|
143
|
+
.slice(0, 5),
|
|
144
|
+
confidence: 0.2,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","s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qBAC1B,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;gBACd,UAAU,EAAE,GAAG;aAChB,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,6BAA6B;QAC7B,OAAO;YACL,OAAO,EAAE,UAAU,CAAC,eAAe,CAAC,WAAW,IAAI,UAAU,CAAC,eAAe,CAAC,IAAI,IAAI,oBAAoB;YAC1G,KAAK,EAAE,0CAA0C;YACjD,QAAQ,EAAE,uCAAuC;YACjD,uBAAuB,EAAE,UAAU,CAAC,KAAK;iBACtC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC;iBACvD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC;iBAC1B,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;YACd,UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repository Scanner
|
|
3
|
+
*
|
|
4
|
+
* Scans an existing repository to understand its structure and content
|
|
5
|
+
* for importing as a knowledge base.
|
|
6
|
+
*/
|
|
7
|
+
export interface ScannedFile {
|
|
8
|
+
path: string;
|
|
9
|
+
relativePath: string;
|
|
10
|
+
type: "readme" | "config" | "docs" | "source" | "other";
|
|
11
|
+
size: number;
|
|
12
|
+
content?: string;
|
|
13
|
+
modifiedAt: Date;
|
|
14
|
+
}
|
|
15
|
+
export interface ProjectMetadata {
|
|
16
|
+
name?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
keywords?: string[];
|
|
19
|
+
language?: string;
|
|
20
|
+
dependencies?: string[];
|
|
21
|
+
}
|
|
22
|
+
export interface ScanStats {
|
|
23
|
+
totalFiles: number;
|
|
24
|
+
totalSize: number;
|
|
25
|
+
scannedFiles: number;
|
|
26
|
+
scannedSize: number;
|
|
27
|
+
strategy: "full" | "truncated" | "sampled";
|
|
28
|
+
}
|
|
29
|
+
export interface ScanResult {
|
|
30
|
+
files: ScannedFile[];
|
|
31
|
+
directoryStructure: string;
|
|
32
|
+
projectMetadata: ProjectMetadata;
|
|
33
|
+
stats: ScanStats;
|
|
34
|
+
warnings: string[];
|
|
35
|
+
}
|
|
36
|
+
export interface ScanOptions {
|
|
37
|
+
/** Maximum total content to read in bytes (default: 100KB) */
|
|
38
|
+
maxContentSize?: number;
|
|
39
|
+
/** Whether to respect .gitignore (default: true) */
|
|
40
|
+
respectGitignore?: boolean;
|
|
41
|
+
/** Additional paths to skip */
|
|
42
|
+
skipPaths?: string[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Scan a repository to understand its structure and content
|
|
46
|
+
*/
|
|
47
|
+
export declare function scanRepository(repoPath: string, options?: ScanOptions): Promise<ScanResult>;
|
|
48
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/repo-scanner/index.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;CAC5C;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,eAAe,CAAC;IACjC,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,8DAA8D;IAC9D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oDAAoD;IACpD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAiYD;;GAEG;AACH,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,UAAU,CAAC,CAiErB"}
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import ignore from "ignore";
|
|
4
|
+
// Default paths to always skip
|
|
5
|
+
const DEFAULT_SKIP_PATHS = [
|
|
6
|
+
"node_modules",
|
|
7
|
+
".git",
|
|
8
|
+
"dist",
|
|
9
|
+
"build",
|
|
10
|
+
".next",
|
|
11
|
+
".nuxt",
|
|
12
|
+
"vendor",
|
|
13
|
+
"__pycache__",
|
|
14
|
+
".venv",
|
|
15
|
+
"venv",
|
|
16
|
+
"target", // Rust
|
|
17
|
+
".cargo",
|
|
18
|
+
"coverage",
|
|
19
|
+
".nyc_output",
|
|
20
|
+
".cache",
|
|
21
|
+
".parcel-cache",
|
|
22
|
+
".turbo",
|
|
23
|
+
];
|
|
24
|
+
// File priority for scanning (lower = higher priority)
|
|
25
|
+
const FILE_PRIORITY = {
|
|
26
|
+
"README.md": 1,
|
|
27
|
+
"README": 1,
|
|
28
|
+
"readme.md": 1,
|
|
29
|
+
"package.json": 2,
|
|
30
|
+
"Cargo.toml": 2,
|
|
31
|
+
"pyproject.toml": 2,
|
|
32
|
+
"go.mod": 2,
|
|
33
|
+
"composer.json": 2,
|
|
34
|
+
"pom.xml": 2,
|
|
35
|
+
"build.gradle": 2,
|
|
36
|
+
"ARCHITECTURE.md": 3,
|
|
37
|
+
"CONTRIBUTING.md": 3,
|
|
38
|
+
"CHANGELOG.md": 4,
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Categorize a file based on its path and name
|
|
42
|
+
*/
|
|
43
|
+
function categorizeFile(relativePath) {
|
|
44
|
+
const basename = path.basename(relativePath).toLowerCase();
|
|
45
|
+
const ext = path.extname(relativePath).toLowerCase();
|
|
46
|
+
// READMEs
|
|
47
|
+
if (basename.startsWith("readme")) {
|
|
48
|
+
return "readme";
|
|
49
|
+
}
|
|
50
|
+
// Config files
|
|
51
|
+
if (["package.json", "cargo.toml", "pyproject.toml", "go.mod", "composer.json", "pom.xml", "build.gradle"].includes(basename)) {
|
|
52
|
+
return "config";
|
|
53
|
+
}
|
|
54
|
+
// Documentation
|
|
55
|
+
if (relativePath.startsWith("docs/") || relativePath.startsWith("doc/")) {
|
|
56
|
+
return "docs";
|
|
57
|
+
}
|
|
58
|
+
if (ext === ".md" || ext === ".rst" || ext === ".txt") {
|
|
59
|
+
return "docs";
|
|
60
|
+
}
|
|
61
|
+
// Source code
|
|
62
|
+
if ([".ts", ".js", ".py", ".rs", ".go", ".java", ".rb", ".php", ".c", ".cpp", ".h"].includes(ext)) {
|
|
63
|
+
return "source";
|
|
64
|
+
}
|
|
65
|
+
return "other";
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Get priority for a file (lower = scan first)
|
|
69
|
+
*/
|
|
70
|
+
function getFilePriority(relativePath) {
|
|
71
|
+
const basename = path.basename(relativePath);
|
|
72
|
+
if (FILE_PRIORITY[basename]) {
|
|
73
|
+
return FILE_PRIORITY[basename];
|
|
74
|
+
}
|
|
75
|
+
const type = categorizeFile(relativePath);
|
|
76
|
+
switch (type) {
|
|
77
|
+
case "readme":
|
|
78
|
+
return 1;
|
|
79
|
+
case "config":
|
|
80
|
+
return 2;
|
|
81
|
+
case "docs":
|
|
82
|
+
return 5;
|
|
83
|
+
case "source":
|
|
84
|
+
return 10;
|
|
85
|
+
default:
|
|
86
|
+
return 100;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Build a tree-like directory structure string
|
|
91
|
+
*/
|
|
92
|
+
function buildDirectoryTree(files, repoPath) {
|
|
93
|
+
// Get unique directories
|
|
94
|
+
const dirs = new Set();
|
|
95
|
+
const filesByDir = new Map();
|
|
96
|
+
for (const file of files) {
|
|
97
|
+
const dir = path.dirname(file.relativePath);
|
|
98
|
+
if (dir !== ".") {
|
|
99
|
+
// Add all parent directories
|
|
100
|
+
const parts = dir.split(path.sep);
|
|
101
|
+
for (let i = 1; i <= parts.length; i++) {
|
|
102
|
+
dirs.add(parts.slice(0, i).join(path.sep));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
const parent = dir === "." ? "" : dir;
|
|
106
|
+
if (!filesByDir.has(parent)) {
|
|
107
|
+
filesByDir.set(parent, []);
|
|
108
|
+
}
|
|
109
|
+
filesByDir.get(parent).push(path.basename(file.relativePath));
|
|
110
|
+
}
|
|
111
|
+
// Build tree
|
|
112
|
+
const lines = [path.basename(repoPath) + "/"];
|
|
113
|
+
const sortedDirs = Array.from(dirs).sort();
|
|
114
|
+
// Add top-level files
|
|
115
|
+
const rootFiles = filesByDir.get("") || [];
|
|
116
|
+
for (const file of rootFiles.slice(0, 10)) {
|
|
117
|
+
lines.push(`├── ${file}`);
|
|
118
|
+
}
|
|
119
|
+
if (rootFiles.length > 10) {
|
|
120
|
+
lines.push(`├── ... (${rootFiles.length - 10} more files)`);
|
|
121
|
+
}
|
|
122
|
+
// Add directories (limited)
|
|
123
|
+
for (const dir of sortedDirs.slice(0, 20)) {
|
|
124
|
+
const depth = dir.split(path.sep).length;
|
|
125
|
+
const indent = "│ ".repeat(depth - 1);
|
|
126
|
+
lines.push(`${indent}├── ${path.basename(dir)}/`);
|
|
127
|
+
}
|
|
128
|
+
if (sortedDirs.length > 20) {
|
|
129
|
+
lines.push(`... (${sortedDirs.length - 20} more directories)`);
|
|
130
|
+
}
|
|
131
|
+
return lines.join("\n");
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Parse project metadata from config files
|
|
135
|
+
*/
|
|
136
|
+
function parseProjectMetadata(files) {
|
|
137
|
+
const metadata = {};
|
|
138
|
+
for (const file of files) {
|
|
139
|
+
if (!file.content)
|
|
140
|
+
continue;
|
|
141
|
+
const basename = path.basename(file.relativePath).toLowerCase();
|
|
142
|
+
try {
|
|
143
|
+
if (basename === "package.json") {
|
|
144
|
+
const pkg = JSON.parse(file.content);
|
|
145
|
+
metadata.name = pkg.name;
|
|
146
|
+
metadata.description = pkg.description;
|
|
147
|
+
metadata.keywords = pkg.keywords;
|
|
148
|
+
metadata.language = "TypeScript/JavaScript";
|
|
149
|
+
metadata.dependencies = [
|
|
150
|
+
...Object.keys(pkg.dependencies || {}),
|
|
151
|
+
...Object.keys(pkg.devDependencies || {}),
|
|
152
|
+
].slice(0, 20);
|
|
153
|
+
}
|
|
154
|
+
else if (basename === "cargo.toml") {
|
|
155
|
+
metadata.language = "Rust";
|
|
156
|
+
// Basic TOML parsing for name
|
|
157
|
+
const nameMatch = file.content.match(/name\s*=\s*"([^"]+)"/);
|
|
158
|
+
if (nameMatch)
|
|
159
|
+
metadata.name = nameMatch[1];
|
|
160
|
+
const descMatch = file.content.match(/description\s*=\s*"([^"]+)"/);
|
|
161
|
+
if (descMatch)
|
|
162
|
+
metadata.description = descMatch[1];
|
|
163
|
+
}
|
|
164
|
+
else if (basename === "pyproject.toml") {
|
|
165
|
+
metadata.language = "Python";
|
|
166
|
+
const nameMatch = file.content.match(/name\s*=\s*"([^"]+)"/);
|
|
167
|
+
if (nameMatch)
|
|
168
|
+
metadata.name = nameMatch[1];
|
|
169
|
+
}
|
|
170
|
+
else if (basename === "go.mod") {
|
|
171
|
+
metadata.language = "Go";
|
|
172
|
+
const moduleMatch = file.content.match(/module\s+(\S+)/);
|
|
173
|
+
if (moduleMatch)
|
|
174
|
+
metadata.name = moduleMatch[1];
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
// Ignore parse errors
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return metadata;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Load .gitignore patterns
|
|
185
|
+
*/
|
|
186
|
+
function loadGitignore(repoPath) {
|
|
187
|
+
const ig = ignore();
|
|
188
|
+
const gitignorePath = path.join(repoPath, ".gitignore");
|
|
189
|
+
if (fs.existsSync(gitignorePath)) {
|
|
190
|
+
const content = fs.readFileSync(gitignorePath, "utf-8");
|
|
191
|
+
ig.add(content);
|
|
192
|
+
}
|
|
193
|
+
return ig;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Phase 1: Discover all files without reading content
|
|
197
|
+
*/
|
|
198
|
+
function discoverFiles(repoPath, options) {
|
|
199
|
+
const warnings = [];
|
|
200
|
+
const files = [];
|
|
201
|
+
const skipPaths = new Set([...DEFAULT_SKIP_PATHS, ...(options.skipPaths || [])]);
|
|
202
|
+
const ig = options.respectGitignore !== false ? loadGitignore(repoPath) : null;
|
|
203
|
+
function walk(dir, relativeTo) {
|
|
204
|
+
let entries;
|
|
205
|
+
try {
|
|
206
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
207
|
+
}
|
|
208
|
+
catch {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
for (const entry of entries) {
|
|
212
|
+
const fullPath = path.join(dir, entry.name);
|
|
213
|
+
const relativePath = path.relative(relativeTo, fullPath);
|
|
214
|
+
// Skip hidden files and directories (except .github)
|
|
215
|
+
if (entry.name.startsWith(".") && entry.name !== ".github") {
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
218
|
+
// Skip configured paths
|
|
219
|
+
if (skipPaths.has(entry.name)) {
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
// Check gitignore
|
|
223
|
+
if (ig && ig.ignores(relativePath)) {
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
if (entry.isDirectory()) {
|
|
227
|
+
walk(fullPath, relativeTo);
|
|
228
|
+
}
|
|
229
|
+
else if (entry.isFile()) {
|
|
230
|
+
try {
|
|
231
|
+
const stats = fs.statSync(fullPath);
|
|
232
|
+
files.push({
|
|
233
|
+
relativePath,
|
|
234
|
+
size: stats.size,
|
|
235
|
+
modifiedAt: stats.mtime,
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
catch {
|
|
239
|
+
// Skip files we can't stat
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
walk(repoPath, repoPath);
|
|
245
|
+
if (files.length > 10000) {
|
|
246
|
+
warnings.push(`Large repository detected: ${files.length} files. Using sampling strategy.`);
|
|
247
|
+
}
|
|
248
|
+
return { files, warnings };
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Phase 2: Determine scanning strategy based on total size
|
|
252
|
+
*/
|
|
253
|
+
function determineScanStrategy(files, maxContentSize) {
|
|
254
|
+
// Calculate total size of text files we care about
|
|
255
|
+
const textFiles = files.filter((f) => {
|
|
256
|
+
const type = categorizeFile(f.relativePath);
|
|
257
|
+
return type !== "other" && type !== "source";
|
|
258
|
+
});
|
|
259
|
+
const totalTextSize = textFiles.reduce((sum, f) => sum + f.size, 0);
|
|
260
|
+
// Sort by priority
|
|
261
|
+
const sorted = [...textFiles].sort((a, b) => {
|
|
262
|
+
const priorityDiff = getFilePriority(a.relativePath) - getFilePriority(b.relativePath);
|
|
263
|
+
if (priorityDiff !== 0)
|
|
264
|
+
return priorityDiff;
|
|
265
|
+
// Prefer newer files
|
|
266
|
+
return 0;
|
|
267
|
+
});
|
|
268
|
+
if (totalTextSize <= maxContentSize) {
|
|
269
|
+
// Small repo: read everything
|
|
270
|
+
return {
|
|
271
|
+
strategy: "full",
|
|
272
|
+
filesToScan: sorted.map((f) => f.relativePath),
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
// Need to sample - accumulate until we hit budget
|
|
276
|
+
const filesToScan = [];
|
|
277
|
+
let accumulatedSize = 0;
|
|
278
|
+
for (const file of sorted) {
|
|
279
|
+
if (accumulatedSize + file.size > maxContentSize) {
|
|
280
|
+
// If this file alone is bigger than remaining budget, truncate
|
|
281
|
+
if (accumulatedSize < maxContentSize * 0.5) {
|
|
282
|
+
filesToScan.push(file.relativePath);
|
|
283
|
+
accumulatedSize += Math.min(file.size, maxContentSize - accumulatedSize);
|
|
284
|
+
}
|
|
285
|
+
break;
|
|
286
|
+
}
|
|
287
|
+
filesToScan.push(file.relativePath);
|
|
288
|
+
accumulatedSize += file.size;
|
|
289
|
+
}
|
|
290
|
+
return {
|
|
291
|
+
strategy: totalTextSize > maxContentSize * 2 ? "sampled" : "truncated",
|
|
292
|
+
filesToScan,
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Phase 3: Read file contents
|
|
297
|
+
*/
|
|
298
|
+
function readFileContents(repoPath, filesToScan, discoveredFiles, maxContentSize) {
|
|
299
|
+
const scannedFiles = [];
|
|
300
|
+
let totalRead = 0;
|
|
301
|
+
const fileMap = new Map(discoveredFiles.map((f) => [f.relativePath, f]));
|
|
302
|
+
for (const relativePath of filesToScan) {
|
|
303
|
+
const fileInfo = fileMap.get(relativePath);
|
|
304
|
+
if (!fileInfo)
|
|
305
|
+
continue;
|
|
306
|
+
const fullPath = path.join(repoPath, relativePath);
|
|
307
|
+
const remainingBudget = maxContentSize - totalRead;
|
|
308
|
+
if (remainingBudget <= 0)
|
|
309
|
+
break;
|
|
310
|
+
try {
|
|
311
|
+
// Read file, potentially truncating
|
|
312
|
+
const fd = fs.openSync(fullPath, "r");
|
|
313
|
+
const buffer = Buffer.alloc(Math.min(fileInfo.size, remainingBudget, 50000)); // Max 50KB per file
|
|
314
|
+
const bytesRead = fs.readSync(fd, buffer, 0, buffer.length, 0);
|
|
315
|
+
fs.closeSync(fd);
|
|
316
|
+
let content = buffer.subarray(0, bytesRead).toString("utf-8");
|
|
317
|
+
// If truncated, add indicator
|
|
318
|
+
if (bytesRead < fileInfo.size) {
|
|
319
|
+
content += "\n\n[... content truncated ...]";
|
|
320
|
+
}
|
|
321
|
+
scannedFiles.push({
|
|
322
|
+
path: fullPath,
|
|
323
|
+
relativePath,
|
|
324
|
+
type: categorizeFile(relativePath),
|
|
325
|
+
size: fileInfo.size,
|
|
326
|
+
content,
|
|
327
|
+
modifiedAt: fileInfo.modifiedAt,
|
|
328
|
+
});
|
|
329
|
+
totalRead += bytesRead;
|
|
330
|
+
}
|
|
331
|
+
catch {
|
|
332
|
+
// Skip files we can't read
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return scannedFiles;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Scan a repository to understand its structure and content
|
|
339
|
+
*/
|
|
340
|
+
export async function scanRepository(repoPath, options = {}) {
|
|
341
|
+
const resolvedPath = path.resolve(repoPath);
|
|
342
|
+
// Validate path exists and is a directory
|
|
343
|
+
if (!fs.existsSync(resolvedPath)) {
|
|
344
|
+
throw new Error(`Path does not exist: ${repoPath}`);
|
|
345
|
+
}
|
|
346
|
+
if (!fs.statSync(resolvedPath).isDirectory()) {
|
|
347
|
+
throw new Error(`Path is not a directory: ${repoPath}`);
|
|
348
|
+
}
|
|
349
|
+
const maxContentSize = options.maxContentSize ?? 100 * 1024; // 100KB default
|
|
350
|
+
const warnings = [];
|
|
351
|
+
// Phase 1: Discover
|
|
352
|
+
const { files: discoveredFiles, warnings: discoverWarnings } = discoverFiles(resolvedPath, options);
|
|
353
|
+
warnings.push(...discoverWarnings);
|
|
354
|
+
if (discoveredFiles.length === 0) {
|
|
355
|
+
throw new Error(`No files found in repository: ${repoPath}`);
|
|
356
|
+
}
|
|
357
|
+
// Phase 2: Determine strategy
|
|
358
|
+
const { strategy, filesToScan } = determineScanStrategy(discoveredFiles, maxContentSize);
|
|
359
|
+
// Phase 3: Read content
|
|
360
|
+
const scannedFiles = readFileContents(resolvedPath, filesToScan, discoveredFiles, maxContentSize);
|
|
361
|
+
// Build results
|
|
362
|
+
const directoryStructure = buildDirectoryTree(discoveredFiles.map((f) => ({
|
|
363
|
+
path: path.join(resolvedPath, f.relativePath),
|
|
364
|
+
relativePath: f.relativePath,
|
|
365
|
+
type: categorizeFile(f.relativePath),
|
|
366
|
+
size: f.size,
|
|
367
|
+
modifiedAt: f.modifiedAt,
|
|
368
|
+
})), resolvedPath);
|
|
369
|
+
const projectMetadata = parseProjectMetadata(scannedFiles);
|
|
370
|
+
const stats = {
|
|
371
|
+
totalFiles: discoveredFiles.length,
|
|
372
|
+
totalSize: discoveredFiles.reduce((sum, f) => sum + f.size, 0),
|
|
373
|
+
scannedFiles: scannedFiles.length,
|
|
374
|
+
scannedSize: scannedFiles.reduce((sum, f) => sum + (f.content?.length || 0), 0),
|
|
375
|
+
strategy,
|
|
376
|
+
};
|
|
377
|
+
return {
|
|
378
|
+
files: scannedFiles,
|
|
379
|
+
directoryStructure,
|
|
380
|
+
projectMetadata,
|
|
381
|
+
stats,
|
|
382
|
+
warnings,
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/repo-scanner/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,M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CAAC,CAAC;QAC1B,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,YAAY,CAAC;QAC7C,YAAY,EAAE,CAAC,CAAC,YAAY;QAC5B,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,YAAY,CAAC;QACpC,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,UAAU,EAAE,CAAC,CAAC,UAAU;KACzB,CAAC,CAAC,EACH,YAAY,CACb,CAAC;IAEF,MAAM,eAAe,GAAG,oBAAoB,CAAC,YAAY,CAAC,CAAC;IAE3D,MAAM,KAAK,GAAc;QACvB,UAAU,EAAE,eAAe,CAAC,MAAM;QAClC,SAAS,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9D,YAAY,EAAE,YAAY,CAAC,MAAM;QACjC,WAAW,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;QAC/E,QAAQ;KACT,CAAC;IAEF,OAAO;QACL,KAAK,EAAE,YAAY;QACnB,kBAAkB;QAClB,eAAe;QACf,KAAK;QACL,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates global Claude Code skills for navigators, enabling
|
|
5
|
+
* inter-navigator communication via the "ask <navname>" pattern.
|
|
6
|
+
*/
|
|
7
|
+
export interface SkillConfig {
|
|
8
|
+
/** Navigator name (used for skill name: ask-<navname>) */
|
|
9
|
+
navigatorName: string;
|
|
10
|
+
/** Absolute path to the navigator directory */
|
|
11
|
+
navigatorPath: string;
|
|
12
|
+
/** Navigator description/purpose */
|
|
13
|
+
description: string;
|
|
14
|
+
/** Topics the navigator covers */
|
|
15
|
+
scope?: string;
|
|
16
|
+
/** Who uses this navigator */
|
|
17
|
+
audience?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Get the global skills directory path
|
|
21
|
+
*/
|
|
22
|
+
export declare function getGlobalSkillsDir(): string;
|
|
23
|
+
/**
|
|
24
|
+
* Check if a skill already exists
|
|
25
|
+
*/
|
|
26
|
+
export declare function skillExists(skillName: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Generate the skill name from navigator name
|
|
29
|
+
*/
|
|
30
|
+
export declare function getSkillName(navigatorName: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Generate the SKILL.md content for a navigator
|
|
33
|
+
*/
|
|
34
|
+
export declare function generateSkillContent(config: SkillConfig): string;
|
|
35
|
+
/**
|
|
36
|
+
* Create a global skill for a navigator
|
|
37
|
+
*
|
|
38
|
+
* @param config - Skill configuration
|
|
39
|
+
* @param options - Options for skill creation
|
|
40
|
+
* @returns Path to the created skill directory, or null if skipped
|
|
41
|
+
*/
|
|
42
|
+
export declare function createNavigatorSkill(config: SkillConfig, options?: {
|
|
43
|
+
force?: boolean;
|
|
44
|
+
quiet?: boolean;
|
|
45
|
+
}): Promise<string | null>;
|
|
46
|
+
/**
|
|
47
|
+
* Remove a navigator skill
|
|
48
|
+
*/
|
|
49
|
+
export declare function removeNavigatorSkill(navigatorName: string, options?: {
|
|
50
|
+
quiet?: boolean;
|
|
51
|
+
}): boolean;
|
|
52
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/skill-generator/index.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,MAAM,WAAW,WAAW;IAC1B,0DAA0D;IAC1D,aAAa,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,aAAa,EAAE,MAAM,CAAC;IACtB,oCAAoC;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAGtD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAI1D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAgKhE;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,WAAW,EACnB,OAAO,GAAE;IACP,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;CACZ,GACL,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA4BxB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAChC,OAAO,CAkBT"}
|