From devlens
Queries a precomputed structural graph of TS/JS/React/Next.js/Node codebases, providing technical, business, and security summaries per node. Avoids whole-file reads during exploration or architecture/security review.
How this skill is triggered — by the user, by Claude, or both
Slash command
/devlens:devlens [init|architecture|diagram|summary|security-analysis|explain|tech-debt|impact|find|changes|guard][init|architecture|diagram|summary|security-analysis|explain|tech-debt|impact|find|changes|guard]This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
DevLens precomputes a structural graph of a repo: nodes (components, hooks, functions, routes, stores) joined by typed edges (CALLS, IMPORTS, READS_FROM, …), each carrying a **technical** summary, a **business/functional** summary, and a **security** assessment. Query it with the `devlens` CLI **before** opening files.
devlens CLIDevLens precomputes a structural graph of a repo: nodes (components, hooks, functions, routes, stores) joined by typed edges (CALLS, IMPORTS, READS_FROM, …), each carrying a technical summary, a business/functional summary, and a security assessment. Query it with the devlens CLI before opening files.
Why this saves tokens: a node summary is ~50 tokens; the underlying file is ~2000. Querying summaries, and using blast-radius/khop to fetch only the relevant slice, costs a fraction of reading files. Always pass --json. Reach for raw source (node-code) only as a last resort.
Standing rule — prefer summaries when available: whenever a node has a technical or functional (business) summary, read it (get-node / get-summaries -i technical|business) to understand the code instead of opening the file — it is far cheaper and usually enough. Only fall back to node-code or reading the file when no summary exists (structure-only graph) or the summary is genuinely insufficient to act. This applies to every subcommand below.
Run devlens --version. If it is missing: npm install -g @devlensio/cli (corporate proxy? see the install note — set NODE_EXTRA_CA_CERTS).
Determine state:
git rev-parse HEADgit status --porcelain (any output = uncommitted/untracked changes)devlens status --json → find the entry whose repoPath is this repo; read its latestCommit and summarizedCommits.Then apply, in order:
devlens analyze . --latest --json
This replaces the stored graph with the latest uncommitted-worktree graph. Structure only — do NOT summarize. Existing summaries are inherited for unchanged nodes; new/changed nodes simply have none yet. Then proceed.latestCommit == git HEAD) → use it directly.
summarizedCommits is 0 / doesn't cover it), STOP and ask the user for permission to summarize before running devlens analyze . --summarize --json. If they decline, continue structure-only and say what's limited.devlens analyze . --json
Then ask the user whether to summarize this commit (devlens analyze . --summarize --json). Proceed structure-only if they decline.Golden rule: structural analyze may run automatically; --summarize requires explicit user permission every time — it costs LLM calls. Never summarize silently.
You were invoked as /devlens $ARGUMENTS. Take the first word ($0) as the subcommand and read the matching recipe file in full, then follow it exactly.
Execution discipline (applies to every subcommand):
Routing table:
| Subcommand | Recipe |
|---|---|
init | ${CLAUDE_SKILL_DIR}/commands/init.md |
architecture | ${CLAUDE_SKILL_DIR}/commands/architecture.md |
diagram | ${CLAUDE_SKILL_DIR}/commands/diagram.md |
summary | ${CLAUDE_SKILL_DIR}/commands/summary.md |
security-analysis | ${CLAUDE_SKILL_DIR}/commands/security-analysis.md |
explain | ${CLAUDE_SKILL_DIR}/commands/explain.md |
tech-debt | ${CLAUDE_SKILL_DIR}/commands/tech-debt.md |
impact | ${CLAUDE_SKILL_DIR}/commands/impact.md |
find | ${CLAUDE_SKILL_DIR}/commands/find.md |
changes | ${CLAUDE_SKILL_DIR}/commands/changes.md |
guard | ${CLAUDE_SKILL_DIR}/commands/guard.md |
/devlens): briefly list the subcommands above with one line each, and point to ${CLAUDE_SKILL_DIR}/reference.md for the full CLI catalog and when to use each command. Do not run analysis./devlens), pick the subcommand that matches their request (e.g. "is this secure?" → security-analysis; "draw the architecture" → diagram).Every query command accepts -g <graphId> (defaults to the graph for the cwd) and -c <commit>. Default to the cwd graph unless the user specifies otherwise.
npx claudepluginhub devlensio/devlensoss --plugin devlensRuns a 7-phase codebase analysis using typegraph-mcp tools, producing a detailed architectural report. Useful when onboarding to an unfamiliar codebase or before making significant changes.
Builds a persistent knowledge graph of your codebase using Tree-sitter and SQLite, enabling Claude to read only relevant files — reducing tokens by up to 49x on coding tasks.
Explores codebases using SocratiCode semantic search, dependency graphs, and context artifacts. Activates when users ask about code structure, feature locations, or architecture.