From repo-analyze
Repository intelligence engine. Converts any codebase into a durable, compressed knowledge graph stored in .claude/repo-knowledge/. Use when asked to analyze a repo, understand a codebase, trace a flow, assess impact of changes, or refresh knowledge after commits.
How this skill is triggered — by the user, by Claude, or both
Slash command
/repo-analyze:repo-analyzeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
<essential_principles>
references/architecture.mdreferences/dependencies.mdreferences/discovery.mdreferences/file-selection.mdreferences/health-scoring.mdreferences/knowledge-store.mdreferences/permission-setup.mdreferences/recovery.mdreferences/specialized-detection.mdreferences/symbol-indexing.mdtemplates/analysis-report.mdtemplates/file-index.mdtemplates/impact-report.mdtemplates/knowledge-index.mdworkflows/full-analysis.mdworkflows/incremental-update.mdworkflows/on-demand.mdworkflows/plan-change.mdworkflows/status.md<essential_principles> Discover, never assume. Every repo is unique until proven otherwise. Architecture is permanent. Implementation is ephemeral. Capture structure, skip bodies. Read once. Compress aggressively. Recall precisely. Knowledge files are ground truth — never re-read a source file already captured there. Every file read must justify its token cost with architectural insight not already in the knowledge graph. Prior knowledge always wins. Check the knowledge store before touching any source file. </essential_principles>
<first_run_setup> One-time per machine — runs before the first analysis, then never again. This skill reads many files and writes a knowledge store; without standing permissions every action prompts. Make it silent once:
~/.claude/settings.json → permissions.allow. If it already contains Read and Write(.claude/repo-knowledge/**), setup is done — skip silently.references/permission-setup.md and apply it. This merges the analyzer's allow-rules into the user/global settings (covers every repo with a single approval — never per-repo). The user clicks yes once to the settings write.Scope is deliberately narrow: read access + writes confined to repo-knowledge/. Never request broad write/edit access to source code.
</first_run_setup>
<phase0_prior_knowledge_check> Run this before loading any workflow. Do not proceed until complete.
First classify the invocation intent:
/repo-analyze, --update, or --rebuild: the goal is to create or refresh the knowledge graph.--impact, --flow, --model, --module, --change, --status, or any post-analysis question: the goal is to use the graph to answer something. Never short-circuit a CONSUME request with "knowledge is current" — current knowledge is exactly what lets you answer it.Look for .claude/repo-knowledge/index.md at the target path.
Knowledge found — load it (~200 tokens). First run two integrity gates, then the freshness check:
Store status: COMPLETE (or other knowledge files exist but index.md doesn't), the last write was interrupted → the store is untrusted. Announce it and treat as a rebuild (load workflows/full-analysis.md).Schema version is missing or < 2, the graph predates the current format (no file-index/invariants/provenance). For BUILD → rebuild. For CONSUME → warn ("graph is schema v[X]; file-index/invariants may be absent — run --rebuild"), then answer from what exists.Git HEAD at last analysis, run git diff --name-only <last_commit> HEAD (or git log --oneline -5 if HEAD unknown):
workflows/incremental-update.md. No git → ask "Full re-analysis or incremental update?"--update to refresh") then proceed to the mode's workflow. --status just reports freshness.Knowledge NOT found:
workflows/full-analysis.md.workflows/full-analysis.md; on completion, run the requested mode's workflow and deliver the original answer. Do not drop the user's intent. Exception: --status → report "No knowledge graph found — run /repo-analyze to build one." and stop.--update → always BUILD; go to step 2/3 as a refresh.
--rebuild → always BUILD a clean full analysis, ignoring and overwriting any existing store (used when stale risk is HIGH, schema is outdated, the store is corrupt, or after a major refactor). Load workflows/full-analysis.md directly; do not run incremental.
Monorepo note: if the store is a multi-service layout (.claude/repo-knowledge/<service>/), Phase 0 reads the workspace-level index.md first, then resolves which service store the request targets (see on-demand.md / plan-change.md monorepo resolution).
</phase0_prior_knowledge_check>
<operating_modes> Detect mode from invocation after Phase 0 completes:
| Invocation | Mode | Load |
|---|---|---|
/repo-analyze or /repo-analyze <path> | Full analysis or incremental (Phase 0 decides) | see Phase 0 |
/repo-analyze --update | Force incremental update | workflows/incremental-update.md |
/repo-analyze --rebuild | Clean full re-analysis, overwrite store (stale/corrupt/schema-outdated) | workflows/full-analysis.md |
/repo-analyze --impact <target> | Impact report | workflows/on-demand.md |
/repo-analyze --flow <name> | Trace execution flow | workflows/on-demand.md |
/repo-analyze --model <name> | Data model deep-dive | workflows/on-demand.md |
/repo-analyze --module <name> | Module deep-dive | workflows/on-demand.md |
/repo-analyze --status | Coverage + freshness report | workflows/status.md |
/repo-analyze --change <intent> | Precise file change plan before editing | workflows/plan-change.md |
| Any question about the repo (post-analysis) | In-session query | see context_query below |
| </operating_modes> |
<context_query> When knowledge exists and the user asks a question rather than invoking a mode:
index.md Quick Reference (~200 tokens)routes.mddata-model.mdfile-index.mdfile-index.md, then run workflows/plan-change.mdflows.mdconfig.mdarchitecture.mdNever load a workflow for a context query. Workflows are for building or updating the knowledge graph, not answering questions from it. </context_query>
Execute before anything else. Stop if any check fails — report which check failed and what the user must provide.--impact, --flow, --model, --module: target name was provided<escalation_triggers> Stop and ask — never guess — when:
--impact / --flow / --model / --module target is ambiguous (matches multiple things)Wrong assumptions here corrupt the entire knowledge graph. </escalation_triggers>
<on_error>
The moment any workflow hits an error — unreadable file, failed git command, ambiguous structure, truncated read, parse failure — load references/recovery.md and apply its 5-step protocol (PAUSE → DIAGNOSE → ADAPT → RETRY → ESCALATE). Do not improvise error handling or silently skip. Max 3 retries per failure; on escalation, set PARTIAL_ANALYSIS: true / BLOCKED_AT: Phase N in index.md before stopping.
</on_error>
<first_message> State before doing anything:
Then proceed without waiting for confirmation unless an escalation trigger fires. </first_message>
<reference_index> Load only from within workflows as instructed — do not pre-load:
| Reference | Contents |
|---|---|
| discovery.md | Phase 1: prior-doc reuse (CLAUDE.md/AGENTS.md/README), manifests, entry points, directory classification, repo class, config surface, toolchain |
| architecture.md | Phase 2: bootstrap, routing patterns, data layer, auth, service layer |
| dependencies.md | Phase 3: module graph, external services, event/message systems |
| symbol-indexing.md | Phase 2.6: language vocabulary, grep extraction patterns (file:line without reads), cross-reference + propagation chain format |
| file-selection.md | Smart file selection tiers + token optimization rules |
| knowledge-store.md | Compression rules, knowledge file formats, freshness tracking |
| specialized-detection.md | Domain patterns: monorepo, event-driven, multi-tenant, mobile, CLI, Discord, content/declarative (docs, IaC, data, prompt/skill) |
| health-scoring.md | Repo health scoring rubrics |
| recovery.md | 5-step recovery protocol, error types, failure modes |
| permission-setup.md | One-time: merge analyzer allow-rules into ~/.claude/settings.json (first_run_setup) |
| </reference_index> |
<workflows_index>
| Workflow | When to use |
|---|---|
| full-analysis.md | First-time analysis; no prior knowledge |
| incremental-update.md | --update flag or prior knowledge exists with changes |
| on-demand.md | --impact, --flow, --model, --module |
| plan-change.md | --change <intent> — precise file change plan before editing |
| status.md | --status flag |
| </workflows_index> |
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub ded-lmfao/jinxx-repo-analyzer --plugin repo-analyze