
Understand
Rebuild codebase understanding baselines so your agent’s /understand workflow and auto-update change detection stay accurate.
Overview
Understand is an agent skill most often used in Build (also Ship, Operate) that builds structural fingerprints and codebase maps so agents can navigate and auto-update project understanding.
Install
npx skills add https://github.com/lum1104/understand-anything --skill understandWhat is this skill?
- Runs build-fingerprints.mjs during /understand full rebuild (Phase 7 step 2.5)
- Writes .understand-anything/fingerprints.json for incremental auto-update detection
- Accepts projectRoot, sourceFilePaths, and gitCommitHash via input JSON
- Resolves @understand-anything/core the same way as extract-structure.mjs
- Exits 0 on success including zero analyzed files; non-zero on hard errors
- Phase 7 step 2.5 fingerprint build in /understand full rebuild
Adoption & trust: 1.1k installs on skills.sh; 54.9k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your agent keeps re-learning the repo from scratch because there is no reliable structural fingerprint baseline for incremental updates.
Who is it for?
Developers using Claude Code or similar agents on medium-to-large repos who run /understand full rebuilds after major refactors.
Skip if: One-file scripts or greenfield folders where a manual README is enough and you will not use auto-update.
When should I use this skill?
Running /understand full rebuild, fixing broken auto-update baselines, or onboarding an agent to a non-trivial repository.
What do I get? / Deliverables
A fingerprints.json baseline under .understand-anything ties to your git commit so /understand and auto-update can detect structural changes incrementally.
- .understand-anything/fingerprints.json
- Structural fingerprint store keyed to git commit
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Codebase comprehension is shelved under Build because it supports implementation and agent navigation before ship and operate cycles. Agent-tooling fits skills that maintain machine-readable project maps and fingerprints for coding agents.
Where it fits
You clone a forked SaaS repo and run a full /understand rebuild so the agent knows module boundaries before feature work.
You regenerate fingerprints after splitting packages so generated docs match the new folder layout.
Before a large PR, you refresh baselines to see which structural areas the diff touches.
After hotfix week, you update fingerprints so auto-update does not miss renamed core files.
How it compares
Maintains a living structural map for agents—not a one-off code review checklist.
Common Questions / FAQ
Who is understand for?
Solo builders and indie teams who rely on coding agents and want persistent, incrementally updated codebase understanding.
When should I use understand?
Use it in Build/agent-tooling when onboarding or rebuilding maps; in Ship/review when validating you grasp affected modules; in Operate/iterate after production fixes that reshaped project structure.
Is understand safe to install?
It runs Node against your source tree; review the Security Audits panel on this page and run fingerprint builds in a repo you trust before enabling automated auto-update.
SKILL.md
READMESKILL.md - Understand
#!/usr/bin/env node /** * build-fingerprints.mjs * * Builds the structural-fingerprint baseline used by auto-update's * incremental change detection. Runs once per /understand full rebuild * (Phase 7 step 2.5), generating .understand-anything/fingerprints.json. * * Replaces the LLM-written fingerprint script that previously sat in * SKILL.md as a code example — that example had the wrong signature * for buildFingerprintStore() and never successfully produced a baseline, * which silently broke auto-update for every install (see issue #152). * * Usage: * node build-fingerprints.mjs <input.json> * * Input JSON: * { projectRoot: string, sourceFilePaths: string[], gitCommitHash: string } * * Writes: <projectRoot>/.understand-anything/fingerprints.json * Exit code: 0 on success (including 0 files analyzed); non-zero on error. */ import { createRequire } from 'node:module'; import { dirname, resolve } from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; import { readFileSync } from 'node:fs'; const __dirname = dirname(fileURLToPath(import.meta.url)); // skills/understand/ -> plugin root is two dirs up const pluginRoot = resolve(__dirname, '../..'); const require = createRequire(resolve(pluginRoot, 'package.json')); // --------------------------------------------------------------------------- // Resolve @understand-anything/core (matches extract-structure.mjs). // pathToFileURL() is required for Windows: dynamic import() of a raw // "C:\..." path throws ERR_UNSUPPORTED_ESM_URL_SCHEME. // --------------------------------------------------------------------------- let core; try { core = await import(pathToFileURL(require.resolve('@understand-anything/core')).href); } catch { core = await import(pathToFileURL(resolve(pluginRoot, 'packages/core/dist/index.js')).href); } const { TreeSitterPlugin, PluginRegistry, builtinLanguageConfigs, registerAllParsers, buildFingerprintStore, saveFingerprints, } = core; async function main() { const [, , inputPath] = process.argv; if (!inputPath) { process.stderr.write('Usage: node build-fingerprints.mjs <input.json>\n'); process.exit(1); } const { projectRoot, sourceFilePaths, gitCommitHash } = JSON.parse( readFileSync(inputPath, 'utf-8'), ); if (!projectRoot || !Array.isArray(sourceFilePaths) || typeof gitCommitHash !== 'string') { throw new Error( 'Invalid input: requires { projectRoot: string, sourceFilePaths: string[], gitCommitHash: string }', ); } // Create tree-sitter plugin with all configs that have WASM grammars, // mirroring extract-structure.mjs so the baseline matches the comparison // logic used during auto-updates. const tsConfigs = builtinLanguageConfigs.filter((c) => c.treeSitter); const tsPlugin = new TreeSitterPlugin(tsConfigs); await tsPlugin.init(); const registry = new PluginRegistry(); registry.register(tsPlugin); registerAllParsers(registry); const store = buildFingerprintStore(projectRoot, sourceFilePaths, registry, gitCommitHash); saveFingerprints(projectRoot, store); const fileCount = Object.keys(store.files).length; process.stdout.write(`Fingerprints baseline: ${fileCount} files\n`); } await main(); #!/usr/bin/env node /** * compute-batches.mjs — Phase 1.5 of /understand * * Reads scan-result.json, runs Louvain community detection on the import * graph, and writes batches.json containing batches + neighborMap. * * Usage: * node compute-batches.mjs <project-root> [--changed-files=<path>] * * Input: <project-root>/.understand-anything/intermediate/scan-result.json * Output: <project-root>/.understand-anything/intermediate/batches.json */ import { readFileSync, writeFileSync, existsSync, realpathSync } from 'node:fs'; import { readFile } from 'node:fs/promises'; import { dirname, join, resolve } from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; import { createRequire } from 'node:module'; /** * Ch