From repo-intel
Use when user asks to "analyze git history", "show hotspots", "coldspots", "file coupling", "code ownership", "bus factor", "bugspots", "area health", "project norms", "test gaps", "untested files", "diff risk", "stale docs", "doc drift", "contributors", "repo health", "release cadence", "file history", "conventions", "AST symbols", "find dependents", "pain spots", "onboard to codebase", "where can I help", "find <concept>", "find auth code", "find worker pool", "summarize this repo", "repo summary", "what does this project do", "enrich repo-intel", "generate descriptors", "entry points", "where does this start", "slop fixes", "clean slop", "slop targets", "deslop targets", "semantic find", "find similar function", "semantic duplicate", "stylistic outlier", "embed update", "embed status", "embed reset", "repo-intel init/update/enrich/status/query/embed". Builds and queries a cached repo-intel artifact using the agent-analyzer binary; spawns Haiku subagents post-init for descriptors and a 3-depth narrative summary; opt-in embedder unlocks semantic find, stylistic outliers, and semantic duplicate detection.
npx claudepluginhub agent-sh/agentsys --plugin repo-intelThis skill uses the workspace's default tool permissions.
Build and maintain a cached repo-intel artifact using the agent-analyzer binary. Covers git history, AST symbols, project metadata, doc-code sync, and (after `enrich`) LLM-generated per-file descriptors and a 3-depth narrative summary.
Conducts multi-round deep research on GitHub repos via API and web searches, generating markdown reports with executive summaries, timelines, metrics, and Mermaid diagrams.
Dynamically discovers and combines enabled skills into cohesive, unexpected delightful experiences like interactive HTML or themed artifacts. Activates on 'surprise me', inspiration, or boredom cues.
Generates images from structured JSON prompts via Python script execution. Supports reference images and aspect ratios for characters, scenes, products, visuals.
Build and maintain a cached repo-intel artifact using the agent-analyzer binary. Covers git history, AST symbols, project metadata, doc-code sync, and (after enrich) LLM-generated per-file descriptors and a 3-depth narrative summary.
const allArgs = '$ARGUMENTS'.split(' ').filter(Boolean);
const positional = allArgs.filter(a => !a.startsWith('--'));
const action = positional[0] || 'status';
const queryType = action === 'query' ? positional[1] : null;
const queryArg = action === 'query' ? positional[2] || null : null;
/repo-intel init) - full scan/repo-intel update) - only new commits since last run/repo-intel enrich) - spawn the repo-intel-summarizer and repo-intel-weighter Haiku subagents to populate the artifact's summary (3 depths) and fileDescriptors (top-500 most-active files). The Rust binary itself never calls an LLM - this orchestration runs in JS and pipes the agent JSON back through set-summary / set-descriptors./repo-intel status)/repo-intel query <type>)const pluginRoot = '$CLAUDE_PLUGIN_ROOT';
const binary = require(`${pluginRoot}/lib/binary`);
const repoIntel = require(`${pluginRoot}/lib/repo-intel`);
The binary is resolved and auto-downloaded if needed via binary.ensureBinary(). The binary module is bundled with this plugin - no external dependency required.
Artifact is stored in the platform state directory:
.claude/repo-intel.json.opencode/repo-intel.json.codex/repo-intel.jsonAll queries delegate to agent-analyzer repo-intel query <type>.
| Query | Description |
|---|---|
hotspots | Recency-weighted most-changed files |
coldspots | Least-changed files with no recent activity |
bugspots | Files with highest bug-fix density (fix/change ratio) |
coupling <file> | Files that change together with <file> |
ownership <path> | Who owns a directory or file |
bus-factor | Detailed bus factor with critical owners and at-risk areas |
norms | Commit message conventions detected from history |
areas | Directory-level health overview |
contributors | Contributors sorted by commit count with staleness |
release-info | Release cadence and last release |
health | Repository health summary |
file-history <file> | Detailed history for a specific file |
conventions | Commit message style, prefixes, scope usage |
test-gaps | Hot source files with no co-changing test file |
diff-risk <files> | Score changed files by composite risk |
doc-drift | Doc files with low code coupling (likely stale) |
onboard | Newcomer-oriented repo summary |
can-i-help | Contributor guidance matching skills to areas needing work |
entry-points | Every place execution can start (binaries, main functions, npm scripts) |
| Query | Description |
|---|---|
painspots | Files ranked by hotspot x (1 + bug_rate) x (1 + complexity/30) |
symbols <file> | AST exports, imports, and definitions for a file |
dependents <symbol> | Files that import a given symbol (reverse dependency) |
| Query | Description |
|---|---|
stale-docs | Doc files with stale references to source symbols |
/repo-intel enrich first)| Query | Description |
|---|---|
find <concept> | Concept-to-file search. Replaces grep -r <concept> with a ranked list and a one-line why per result. Without descriptors, scores from path/symbol/import/doc-header substring matches; with descriptors (populated by enrich), also catches semantic synonyms (worker ↔ executor) by matching against the per-file LLM descriptor. |
summary [--depth 1|3|10] | Cached 3-depth narrative description of the repo. depth1 = one sentence, depth3 = one paragraph, depth10 = one-page technical overview. Generated by the repo-intel-summarizer Haiku agent at enrich time. |
/deslop)| Query | Description |
|---|---|
slop-fixes | Pinpoint structured fix actions for Haiku-tier execution: tracked artifacts, stale CI configs, duplicate tooling, orphan exports, empty catches, tautological tests. Each finding has a file + line range + action so the agent applies it without further research. |
slop-targets | Ranked targets for Sonnet (file-level) and Opus (cross-file) scans. Sonnet: defensive cargo cult, bot-authored, could-be-shorter. Opus: cliché clusters, wrapper towers, single-impl traits, high-bug communities. With the embedder installed, also: stylistic outliers, semantic duplicates. |
| Action | Description |
|---|---|
embed status | Show whether the embedder is installed, which variant + detail level, sidecar size and last-update time. |
embed update | Delta re-embed only files whose content hash differs from the existing sidecar. Falls back to full scan if no sidecar exists. Pipes JSON to set-embeddings. |
embed reset | Clear the cached embedder preference so the next /repo-intel enrich re-prompts. Does not delete the sidecar or downloaded model — use this when changing model variant or detail level. |
Two Haiku-backed Task subagents fire when /repo-intel enrich runs:
repo-intel-weighter reads the top-500 most-active files in batches of 30, returns 1-2 sentence concrete descriptors per file as JSON between marker blocks. The skill parses the markers and pipes the JSON to agent-analyzer repo-intel set-descriptors --input -.repo-intel-summarizer reads README + manifests + top-10 hotspot file headers, returns {depth1, depth3, depth10, inputHash} as JSON between marker blocks. The skill parses and pipes to set-summary --input -.The Rust binary itself never makes LLM calls. All orchestration lives here.
enrich also runs agent-analyzer-embed when the user has opted in. The choice is captured by two AskUserQuestion prompts on first use, persisted in <stateDir>/sources/preference.json:
embedder — none (default), small (BGE-small Q8 ~30 MB), or big (EmbeddingGemma-300M Q4 ~195 MB)embedderDetail — compact (per-file × 128 dim), balanced (per-function × 256 dim, recommended), maximum (per-function × 768 dim)Subsequent enrich runs read the cached preference and proceed silently. The embed binary downloads the model file on first use (cached next to the binary in ~/.agent-sh/bin/); model files are not bundled in the binary.
Embeddings live in a sidecar file <map_stem>.embeddings.bin next to the JSON artifact (packed fp16, deterministic). The main JSON stays diffable; the sidecar is opaque binary.
When the embedder is not installed, all queries that benefit from embeddings (find, slop-targets) work in their AST/graph-only mode — same shape, weaker signals.
binary.ensureBinary() firstlastCommitDate (not wall clock)lastSeen > 90 days before lastCommitDate(recentChanges * 2 + totalChanges) / (totalChanges + 1)--limit (default 10)