Graphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
TypeScript antigravity-skillsbusiness-knowledgeclaude-codeclaude-skillscodebase-analysiscodexcodex-skillsdeveloper-tools-ai-agentgemini-cli-skillskarpathy-llm-wikiknowledge-baseknowledge-graphmemoryopencode-skillspi-agentunderstandcodevibe-coding
test: make Windows test runs portable
KumamuKuma65ad0238ebfa
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 98254065..506da2a9 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -19,12 +19,20 @@ concurrency:jobs:ci:- runs-on: ubuntu-latest+ strategy:+ fail-fast: false+ matrix:+ os: [ubuntu-latest, windows-latest]+ runs-on: ${{ matrix.os }}steps:- uses: actions/checkout@v4- uses: pnpm/action-setup@v4+ - uses: actions/setup-python@v5+ with:+ python-version: '3.x'+- uses: actions/setup-node@v4with:node-version: 22@@ -48,3 +56,6 @@ jobs:- name: Test skillrun: pnpm test++ - name: Test Python skill helpers+ run: python -m unittest tests.skill.understand.test_merge_batch_graphs -vdiff --git a/pnpm-workspace.yaml b/pnpm-workspace.yamlindex 38e8d28c..2ff1c33d 100644--- a/pnpm-workspace.yaml+++ b/pnpm-workspace.yaml@@ -2,3 +2,18 @@ packages:- 'understand-anything-plugin/packages/*'- 'understand-anything-plugin'- 'homepage'+allowBuilds:+ '@tree-sitter-grammars/tree-sitter-kotlin': true+ esbuild: true+ sharp: true+ tree-sitter-c: true+ tree-sitter-c-sharp: true+ tree-sitter-cpp: true+ tree-sitter-go: true+ tree-sitter-java: true+ tree-sitter-javascript: true+ tree-sitter-php: true+ tree-sitter-python: true+ tree-sitter-ruby: true+ tree-sitter-rust: true+ tree-sitter-typescript: truediff --git a/tests/skill/understand/test_extract_import_map.test.mjs b/tests/skill/understand/test_extract_import_map.test.mjsindex f9706b63..5b47d2bd 100644--- a/tests/skill/understand/test_extract_import_map.test.mjs+++ b/tests/skill/understand/test_extract_import_map.test.mjs@@ -3,7 +3,7 @@ import { mkdtempSync, mkdirSync, writeFileSync, readFileSync, rmSync } from 'nodimport { tmpdir } from 'node:os';import { join, dirname, resolve } from 'node:path';import { spawnSync } from 'node:child_process';-import { fileURLToPath } from 'node:url';+import { fileURLToPath, pathToFileURL } from 'node:url';const __dirname = dirname(fileURLToPath(import.meta.url));const SCRIPT = resolve(__dirname, '../../../understand-anything-plugin/skills/understand/extract-import-map.mjs');@@ -1722,7 +1722,7 @@ describe('extract-import-map.mjs — tree-sitter init graceful failure', () => {{ path: 'src/lib.ts', language: 'typescript', fileCategory: 'code' },],},- ['--import', loaderPath],+ ['--import', pathToFileURL(loaderPath).href],);expect(result.status).toBe(0);diff --git a/tests/skill/understand/test_merge_batch_graphs.py b/tests/skill/understand/test_merge_batch_graphs.pyindex 7239bfe6..f31e9707 100644--- a/tests/skill/understand/test_merge_batch_graphs.py+++ b/tests/skill/understand/test_merge_batch_graphs.py@@ -979,7 +979,7 @@ class TestMultiPart(unittest.TestCase):import subprocessimport json as _jresult = subprocess.run(- ["python3", str(_MODULE_PATH), str(self.tmp)],+ [sys.executable, str(_MODULE_PATH), str(self.tmp)],capture_output=True, text=True,)out_path = self.intermediate / "assembled-graph.json"@@ -1098,7 +1098,7 @@ class TestUnrecognizedBatchFilename(unittest.TestCase):import subprocessimport json as _jresult = subprocess.run(- ["python3", str(_MODULE_PATH), str(self.tmp)],+ [sys.executable, str(_MODULE_PATH), str(self.tmp)],capture_output=True, text=True,)out_path = self.intermediate / "assembled-graph.json"diff --git a/understand-anything-plugin/pnpm-workspace.yaml b/understand-anything-plugin/pnpm-workspace.yamlindex dee51e92..19a92f21 100644--- a/understand-anything-plugin/pnpm-workspace.yaml+++ b/understand-anything-plugin/pnpm-workspace.yaml@@ -1,2 +1,16 @@packages:- "packages/*"+allowBuilds:+ '@tree-sitter-grammars/tree-sitter-kotlin': true+ esbuild: true+ tree-sitter-c: true+ tree-sitter-c-sharp: true+ tree-sitter-cpp: true+ tree-sitter-go: true+ tree-sitter-java: true+ tree-sitter-javascript: true+ tree-sitter-php: true+ tree-sitter-python: true+ tree-sitter-ruby: true+ tree-sitter-rust: true+ tree-sitter-typescript: truediff --git a/understand-anything-plugin/src/__tests__/merge-recover-imports.test.mjs b/understand-anything-plugin/src/__tests__/merge-recover-imports.test.mjsindex a98f0803..e4fffd56 100644--- a/understand-anything-plugin/src/__tests__/merge-recover-imports.test.mjs+++ b/understand-anything-plugin/src/__tests__/merge-recover-imports.test.mjs@@ -8,12 +8,28 @@ import { dirname, resolve } from "node:path";const __dirname = dirname(fileURLToPath(import.meta.url));const MERGE_SCRIPT = resolve(__dirname, "../../skills/understand/merge-batch-graphs.py");+const PYTHON = findPython();let projectRoot;let intermediateDir;+function findPython() {+ const candidates = [+ { command: "python3", args: [] },+ { command: "python", args: [] },+ { command: "py", args: ["-3"] },+ ];+ for (const candidate of candidates) {+ const probe = spawnSync(candidate.command, [...candidate.args, "--version"], {+ encoding: "utf-8",+ });+ if (!probe.error && probe.status === 0) return candidate;+ }+ throw new Error("Python 3 is required to run merge-batch-graphs.py tests");+}+function runMerge() {- const result = spawnSync("python3", [MERGE_SCRIPT, projectRoot], {+ const result = spawnSync(PYTHON.command, [...PYTHON.args, MERGE_SCRIPT, projectRoot], {encoding: "utf-8",});if (result.status !== 0) {@@ -163,7 +179,8 @@ describe("merge-batch-graphs.py imports recovery", () => {const { assembled, stderr } = runMerge();expect(assembled.edges.filter((e) => e.type === "imports")).toHaveLength(1);- expect(stderr).toContain("importMap recovery skipped — scan-result.json not found");+ expect(stderr).toContain("importMap recovery skipped");+ expect(stderr).toContain("scan-result.json not found");});it("never produces self-import edges", () => {diff --git a/understand-anything-plugin/src/__tests__/worktree-redirect.test.mjs b/understand-anything-plugin/src/__tests__/worktree-redirect.test.mjsindex f0ffcf31..d8d7655f 100644--- a/understand-anything-plugin/src/__tests__/worktree-redirect.test.mjs+++ b/understand-anything-plugin/src/__tests__/worktree-redirect.test.mjs@@ -6,7 +6,7 @@// below — there is no shared script to source (per-skill convention in this repo).import { describe, it, expect, beforeAll, afterAll } from "vitest";-import { execFileSync } from "node:child_process";+import { execFileSync, spawnSync } from "node:child_process";import { mkdtempSync, rmSync, mkdirSync, writeFileSync, realpathSync } from "node:fs";import { tmpdir } from "node:os";import { join } from "node:path";@@ -27,6 +27,10 @@ fiecho "$PROJECT_ROOT"`;+const bashProbe = spawnSync("bash", ["--version"], { encoding: "utf8" });+const hasBash = !bashProbe.error && bashProbe.status === 0;+const describeWithBash = hasBash ? describe : describe.skip;+function runResolve(projectRoot, env = {}) {// No `set -e` — the snippet relies on `git ... 2>/dev/null` returning empty// strings when not in a git repo; `set -e` would short-circuit instead.@@ -42,27 +46,27 @@ let mainRepo;let worktree;let subdir;-beforeAll(() => {- tmpRoot = realpathSync(mkdtempSync(join(tmpdir(), "ua-wt-")));- mainRepo = join(tmpRoot, "main");- worktree = join(tmpRoot, "wt");- subdir = join(worktree, "src", "deep");+describeWithBash("worktree-redirect snippet (issue #133)", () => {+ beforeAll(() => {+ tmpRoot = realpathSync(mkdtempSync(join(tmpdir(), "ua-wt-")));+ mainRepo = join(tmpRoot, "main");+ worktree = join(tmpRoot, "wt");+ subdir = join(worktree, "src", "deep");- execFileSync("git", ["init", "-q", "-b", "main", mainRepo]);- execFileSync("git", ["-C", mainRepo, "config", "user.email", "t@t"]);- execFileSync("git", ["-C", mainRepo, "config", "user.name", "t"]);- writeFileSync(join(mainRepo, "README.md"), "main\n");- execFileSync("git", ["-C", mainRepo, "add", "."]);- execFileSync("git", ["-C", mainRepo, "commit", "-q", "-m", "init"]);- execFileSync("git", ["-C", mainRepo, "worktree", "add", "-q", worktree]);- mkdirSync(subdir, { recursive: true });-});+ execFileSync("git", ["init", "-q", "-b", "main", mainRepo]);+ execFileSync("git", ["-C", mainRepo, "config", "user.email", "t@t"]);+ execFileSync("git", ["-C", mainRepo, "config", "user.name", "t"]);+ writeFileSync(join(mainRepo, "README.md"), "main\n");+ execFileSync("git", ["-C", mainRepo, "add", "."]);+ execFileSync("git", ["-C", mainRepo, "commit", "-q", "-m", "init"]);+ execFileSync("git", ["-C", mainRepo, "worktree", "add", "-q", worktree]);+ mkdirSync(subdir, { recursive: true });+ });-afterAll(() => {- if (tmpRoot) rmSync(tmpRoot, { recursive: true, force: true });-});+ afterAll(() => {+ if (tmpRoot) rmSync(tmpRoot, { recursive: true, force: true });+ });-describe("worktree-redirect snippet (issue #133)", () => {it("leaves PROJECT_ROOT alone in a normal checkout", () => {expect(runResolve(mainRepo)).toBe(mainRepo);});