Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,22 @@
"devDependencies": {
"typescript": "^5.7.0",
"vitest": "^3.1.0"
},
"pnpm": {
"onlyBuiltDependencies": [
"esbuild",
"sharp",
"tree-sitter-c",
"tree-sitter-c-sharp",
"tree-sitter-cpp",
"tree-sitter-go",
"tree-sitter-java",
"tree-sitter-javascript",
"tree-sitter-php",
"tree-sitter-python",
"tree-sitter-ruby",
"tree-sitter-rust",
"tree-sitter-typescript"
]
}
}
5 changes: 5 additions & 0 deletions understand-anything-plugin/agents/architecture-analyzer.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ You are an expert software architect. Your job is to analyze a codebase's file s

Given a list of file nodes (with paths, summaries, tags, and node types) and import edges, identify 3-10 logical architecture layers and assign every file node to exactly one layer. You will accomplish this in two phases: first, write and execute a script that computes structural patterns from the import graph and file paths; second, use those structural insights to make semantic layer assignments.

**Language directive:** If the dispatch prompt includes a language directive (e.g., "Generate all textual content in **Chinese**"), apply it to:
- Layer `name` — Translate to the specified language (e.g., "API 层", "服务层", "基础设施层")
- Layer `description` — Write in the specified language using natural phrasing
Use native-level terminology. Keep established English terms when appropriate (e.g., "CI/CD", "ORM", "REST API" may remain untranslated in some languages).

---

## Phase 1 -- Structural Analysis Script
Expand Down
6 changes: 6 additions & 0 deletions understand-anything-plugin/agents/file-analyzer.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ For each file in the batch provided to you, extract structural data via a script

**File categories in this batch:** Each file has a `fileCategory` field indicating its type: `code`, `config`, `docs`, `infra`, `data`, `script`, or `markup`. Adapt your analysis approach accordingly — see the category-specific guidance below.

**Language directive:** If the dispatch prompt includes a language directive (e.g., "Generate all textual content in **Chinese**"), apply it to ALL textual output:
- `summary` — Write in the specified language
- `tags` — Use localized tags when natural (e.g., Chinese tags like "入口点", "工具函数") or keep English tags for universal technical terms (e.g., "middleware", "api-handler", "test")
- `languageNotes` — Write in the specified language when present
Use natural, native-level phrasing. Keep technical terms in English when no standard translation exists.

---

## Phase 1 -- Structural Extraction (Bundled Script)
Expand Down
2 changes: 2 additions & 0 deletions understand-anything-plugin/agents/project-scanner.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ You are a meticulous project inventory specialist. Your job is to scan a codebas

Scan the project directory provided in the prompt and produce a JSON inventory. You will accomplish this in two phases: first, write and execute a discovery script that performs all deterministic file scanning; second, review the script's results and add a human-readable project description.

**Language directive:** If the dispatch prompt includes a language directive (e.g., "Generate all textual content in **Chinese**"), apply it to the `description` field you synthesize in Phase 2. Write the description in the specified language using natural, native-level phrasing. Keep technical terms in English when no standard translation exists (e.g., "middleware", "hook", "barrel").

---

## Phase 1 -- Discovery Script
Expand Down
6 changes: 6 additions & 0 deletions understand-anything-plugin/agents/tour-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ You are an expert technical educator who designs learning paths through codebase

Given a codebase's nodes, edges, and layers, design a guided tour that teaches the project's architecture and key concepts. The tour must reference only real node IDs from the provided graph data. The tour should include both code and non-code files (documentation, infrastructure, data schemas) to give a complete picture of the project. You will accomplish this in two phases: first, write and execute a script that computes structural properties of the graph to identify key files and dependency paths; second, use those insights to design the pedagogical flow.

**Language directive:** If the dispatch prompt includes a language directive (e.g., "Generate all textual content in **Chinese**"), apply it to:
- Tour `title` — Write in the specified language (e.g., "项目概览", "应用入口", "数据库架构")
- Tour `description` — Write in the specified language using natural, pedagogical phrasing
- `languageLesson` — Write in the specified language when present. Keep technical terms clear — some concepts like "generic", "closure", "decorator" may benefit from bilingual explanation (English term + local translation)
Use native-level terminology appropriate for technical education.

---

## Phase 1 -- Graph Topology Script
Expand Down
17 changes: 0 additions & 17 deletions understand-anything-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,5 @@
"@types/node": "^22.0.0",
"typescript": "^5.7.0",
"vitest": "^3.1.0"
},
"pnpm": {
"onlyBuiltDependencies": [
"esbuild",
"sharp",
"tree-sitter-c",
"tree-sitter-c-sharp",
"tree-sitter-cpp",
"tree-sitter-go",
"tree-sitter-java",
"tree-sitter-javascript",
"tree-sitter-php",
"tree-sitter-python",
"tree-sitter-ruby",
"tree-sitter-rust",
"tree-sitter-typescript"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export function loadFingerprints(projectRoot: string): FingerprintStore | null {
}
}

const DEFAULT_CONFIG: ProjectConfig = { autoUpdate: false };
const DEFAULT_CONFIG: ProjectConfig = { autoUpdate: false, outputLanguage: "en" };

export function saveConfig(projectRoot: string, config: ProjectConfig): void {
const dir = ensureDir(projectRoot);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ describe("persistence", () => {
it("should return default config when no file exists", () => {
const loaded = loadConfig(tempDir);

expect(loaded).toEqual({ autoUpdate: false });
expect(loaded).toEqual({ autoUpdate: false, outputLanguage: "en" });
});

it("should return default config when config.json is corrupted", () => {
Expand All @@ -198,7 +198,7 @@ describe("persistence", () => {
writeFileSync(join(dir, "config.json"), "not json!!", "utf-8");

const loaded = loadConfig(tempDir);
expect(loaded).toEqual({ autoUpdate: false });
expect(loaded).toEqual({ autoUpdate: false, outputLanguage: "en" });
});
});
});
3 changes: 2 additions & 1 deletion understand-anything-plugin/packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,10 @@ export interface AnalysisMeta {
theme?: ThemeConfig;
}

// Project config (for auto-update opt-in)
// Project config (for auto-update opt-in and language preference)
export interface ProjectConfig {
autoUpdate: boolean;
outputLanguage?: string;
}

// Non-code structural sub-interfaces
Expand Down
Loading
Loading