Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

codebase-comprehension-algorithms

FreeNo executable scriptsNot checked

Mapping an unfamiliar codebase into feature/business domains — answering "what is this about", "which files implement feature X", "where is the architectural…

pproencaby pproenca★ 231 GitHub stars

About this skill

Community Codebase Comprehension And Domain Mapping Algorithms Best Practices

A practitioner-oriented reference of the algorithms that work for mapping a codebase into understandable feature/business domains. Most of these techniques live in the Software Architecture Recovery and Mining Software Repositories literatures and are invisible to working engineers — yet they're the right tools for the job a coding agent is asked to do every day: "what does this codebase do, and where?"

The 47 rules are organized by execution-lifecycle impact: a wrong decision early in the pipeline (which graph to build, which identifiers to keep) propagates through everything downstream. The three CRITICAL categories (graph-, clust-, valid-) are the ones a wrong call cannot be recovered from later. Read them first.

Scope: proven algorithms with peer-reviewed citations or canonical books — Newman Networks, Leskovec-Rajaraman-Ullman Mining of Massive Datasets, Ganter-Wille Formal Concept Analysis, plus 40+ ICSE / FSE / TSE / PNAS / JMLR papers. No tutorial sites, no Stack Overflow, no marketing posts. Deliberately deferred to a future version: GNN/CodeBERT/code2vec (not "proven over decades" yet) and refactoring-recipe stuff (covered by sibling skills like react-refactor and typescript-refactor).

When to Apply

Use these rules when:

  • Onboarding an agent into an unfamiliar codebase: "explain what this codebase does, by domain"
  • Producing an architecture map: "what are the main subsystems and how do they connect?"
  • Locating a feature: "which files implement payments / authentication / search?"
  • Reviewing a refactor: "did this change respect the architectural boundaries?"
  • Detecting architectural debt: "what files have surprising coupling?"
  • Validating an existing decomposition: "does the README's architecture match the code?"
  • Picking algorithms for any of the above — the user wants something that's proven, not vibes

Rule Categories By Priority

# Category Prefix Impact What it does
1 Graph Construction & Edge Weighting graph- CRITICAL Which graph to build; omnipresent filter; cycle handling; multilayer
2 Community Detection & Clustering clust- CRITICAL Leiden, Infomap, SBM, MCL, Walktrap, spectral, HDBSCAN
3 Validation & Quality Metrics valid- CRITICAL MoJoFM, ARI/NMI, resolution limit, consensus, co-change prediction, ablation
4 Identifier & Lexical Preprocessing lex- HIGH Samurai splitting, abbreviation expansion, TF-IDF/BM25, stemming, V-O parsing
5 Software-Specific Architecture Recovery arch- HIGH Bunch + MQ, ACDC, Limbo, Reflexion, DSM
6 Topic Modelling on Source Code topic- HIGH LDA, LSI/SVD, NMF, HDP, coherence-based K selection
7 Evolutionary Coupling & Co-Change Mining evol- HIGH Lift / confidence / support, large-commit filter, temporal decay, logical coupling
8 Information-Theoretic Methods info- MEDIUM-HIGH Normalized Compression Distance, Mutual Information, MDL, code naturalness
9 Centrality, Hierarchy & Labelling rank- MEDIUM PageRank, HITS, betweenness, TextRank/YAKE labels

Quick Reference

1. Graph Construction & Edge Weighting (CRITICAL)

2. Community Detection & Clustering (CRITICAL)

Full SKILL.md on GitHub

Install codebase-comprehension-algorithms in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

AGENTS.mdassets/templates/_template.mdmetadata.jsonreferences/_sections.mdreferences/arch-acdc-subgraph-patterns.mdreferences/arch-bunch-with-mq-fitness.mdreferences/arch-dsm-partitioning.mdreferences/arch-limbo-information-bottleneck.mdreferences/arch-reflexion-model.mdreferences/clust-hdbscan-density-based.mdreferences/clust-infomap-mdl-on-random-walks.mdreferences/clust-leiden-not-louvain.mdreferences/clust-mcl-markov-clustering.mdreferences/clust-spectral-laplacian-fiedler.mdreferences/clust-stochastic-block-model.mdreferences/clust-walktrap-short-random-walks.mdreferences/evol-filter-large-commits.mdreferences/evol-logical-coupling-as-architectural-signal.mdreferences/evol-mine-cochange-with-lift-and-confidence.mdreferences/evol-temporal-decay-on-edge-weights.mdreferences/graph-bipartite-file-term-for-joint-structure.mdreferences/graph-collapse-sccs-before-clustering.mdreferences/graph-combine-signals-in-multilayer-graphs.mdreferences/graph-filter-omnipresent-utilities-before-clustering.mdreferences/graph-pick-edge-type-by-question-asked.mdreferences/graph-weight-edges-by-information-content.mdreferences/info-mdl-for-model-selection.mdreferences/info-mutual-information-as-coupling.mdreferences/info-naturalness-of-code-as-quality-signal.mdreferences/info-normalized-compression-distance.mdreferences/lex-build-programming-language-stop-words.mdreferences/lex-expand-abbreviations-with-context.mdreferences/lex-extract-verb-object-pattern-from-method-names.mdreferences/lex-split-identifiers-with-samurai.mdreferences/lex-stem-versus-subword-tokenization.mdreferences/lex-tf-idf-and-bm25-on-identifiers.mdreferences/rank-betweenness-centrality-for-bottlenecks.mdreferences/rank-hits-hubs-and-authorities.mdreferences/rank-pagerank-for-module-importance.mdreferences/rank-textrank-for-cluster-labels.md

FAQ

What does the codebase-comprehension-algorithms skill do?

Mapping an unfamiliar codebase into feature/business domains — answering "what is this about", "which files implement feature X", "where is the architectural spine", or reviewing a refactor that crosses module boundaries. 47 algorithms across 9 categories — graph construction (omnipresent filter, multilayer, SCC), lexical preprocessing (Samurai, TF-IDF), community detection (Leiden, Infomap, SBM, MCL, Walktrap, spectral, HDBSCAN), architecture recovery (Bunch+MQ, ACDC, Limbo, Reflexion, DSM), topic modelling (LDA, LSI, NMF, HDP), evolutionary coupling (Gall, ROSE), information-theoretic (NCD, MI, MDL, naturalness), centrality (PageRank, HITS, betweenness, TextRank), validation (MoJoFM, ARI/NMI, resolution limit, consensus, co-change prediction, ablation). Trigger without explicit "clustering" mention — codebase grokking, dependency mapping, domain extraction, architecture-recovery validation all apply.

How do I install the codebase-comprehension-algorithms skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the codebase-comprehension-algorithms skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare codebase-comprehension-algorithms with