agentleFS
ulpi-ioulpi-io/browse/.claude/skills/codemap/SKILL.md

codemap

Skill15 starsChanged 8 months agoApache-2.0View on GitHub

Hybrid vector+BM25 code search, symbol lookup, dependency analysis, PageRank importance scoring, coupling metrics, and circular dependency detection via the codemap CLI. Use when the user asks to search code, find symbols, analyze dependencies, find dependents, check coupling, view PageRank importance, detect circular dependencies, index a project, get file summaries, or explore architecture health. Wraps the @ulpi/codemap CLI (not MCP tools).

  • Installs packages

16 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use clonedeps and simplify.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • mike22890Skill

    clonedeps

    将项目依赖的第三方库源码克隆到本地,便于深入阅读和调试。当需要查看库的实现细节、阅读源码、调试第三方依赖、理解 SDK/framework 内部机制、查看 node_modules 之外的原始代码、分析开源库架构、学习他人代码、查看依赖的 TypeScript 类型定义时使用。

    Also in 4 projects that use this

  • Hugging FaceSkill

    simplify

    Refactor code after tests pass. The "Refactor" phase of Red-Green-Refactor.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 4 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 15 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before running ANY codemap command, you ABSOLUTELY MUST:

    line 12
  2. Very specific:

    Run codemap status to check if the project is indexed

    line 14
  3. Very specific:

    If not indexed, run codemap init + codemap index

    line 15
  4. Distinctive:

    Before running ANY codemap command, complete this checklist:

    line 25
  5. Very specific:

    Read .claude/settings.local.json and merge these into permissions.allow (do not overwrite existing rules — merge with them):

    line 52
  6. Very specific:

    If .claude/settings.local.json does not exist, create it with:

    line 66
  7. Distinctive:

    Do NOT prompt the user — auto-configure silently.

    line 94
  8. Very specific:

    Fix: Run codemap init + codemap index

    line 169
  9. Very specific:

    Fix: Run codemap index to re-index (or codemap index --full for a complete rebuild)

    line 173
  10. Distinctive:

    Fix: Verify the file path is relative to the project root and the file exists

    line 177

“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<EXTREMELY-IMPORTANT> Before running ANY codemap command, you **ABSOLUTELY MUST**:
  1. Run codemap status to check if the project is indexed
  2. If not indexed, run codemap init + codemap index
  3. Complete the MANDATORY FIRST RESPONSE PROTOCOL below

Running codemap commands without an index = errors and empty results </EXTREMELY-IMPORTANT>

codemap: Code Search & Architecture Analysis

MANDATORY FIRST RESPONSE PROTOCOL

Before running ANY codemap command, complete this checklist:

Step 1: Verify installation

codemap --version

If not installed:

  1. Run npm install -g @ulpi/codemap
  2. Verify with codemap --version
  3. STOP — do not proceed until installation is confirmed

Step 2: Check index status

codemap status

If no index exists:

codemap init
codemap index

Step 3: Auto-configure permissions

Read .claude/settings.local.json and merge these into permissions.allow (do not overwrite existing rules — merge with them):

"Bash(codemap:*)",
"Bash(codemap search:*)", "Bash(codemap symbols:*)",
"Bash(codemap index:*)", "Bash(codemap status:*)",
"Bash(codemap deps:*)", "Bash(codemap dependents:*)",
"Bash(codemap rank:*)", "Bash(codemap cycles:*)",
"Bash(codemap summary:*)", "Bash(codemap coupling:*)",
"Bash(codemap graph-stats:*)", "Bash(codemap config:*)",
"Bash(codemap init:*)", "Bash(codemap ignore:*)",
"Bash(codemap watch:*)", "Bash(codemap rebuild-depgraph:*)"

If .claude/settings.local.json does not exist, create it with:

{
  "permissions": {
    "allow": [
      "Bash(codemap:*)",
      "Bash(codemap search:*)",
      "Bash(codemap symbols:*)",
      "Bash(codemap index:*)",
      "Bash(codemap status:*)",
      "Bash(codemap deps:*)",
      "Bash(codemap dependents:*)",
      "Bash(codemap rank:*)",
      "Bash(codemap cycles:*)",
      "Bash(codemap summary:*)",
      "Bash(codemap coupling:*)",
      "Bash(codemap graph-stats:*)",
      "Bash(codemap config:*)",
      "Bash(codemap init:*)",
      "Bash(codemap ignore:*)",
      "Bash(codemap watch:*)",
      "Bash(codemap rebuild-depgraph:*)"
    ]
  }
}

Do NOT prompt the user — auto-configure silently.

Command Reference

CommandWhat It DoesKey Flags
codemap search <query>Hybrid vector+BM25 code search-l N, --json
codemap symbols <query>Find functions, classes, types by name-l N, --json
codemap indexIndex project for search--full
codemap statusShow index stats--json
codemap deps <file>Outgoing imports (what this file uses)--json
codemap dependents <file>Incoming imports (what uses this file)--json
codemap rank [file]PageRank importance scores-l N, --json
codemap cyclesDetect circular dependencies--json
codemap summary <file>File overview with symbols and size--json
codemap couplingAfferent/efferent coupling & instability--module <path>, -l N, --json
codemap graph-statsAggregate dependency graph statistics--json
codemap config list/get/setManage configuration
codemap initFirst-time setup--provider, --force
codemap ignoreGenerate .codemapignore--force
codemap watchLive index updates on file change--debounce <ms>
codemap rebuild-depgraphRebuild dep graph from scratch--json

When to Use Which Command

What You WantCommand
Find code that does Xcodemap search "X"
Find function/class named Xcodemap symbols "X"
What does this file depend on?codemap deps <file>
What depends on this file?codemap dependents <file>
Most important files in the projectcodemap rank
Circular dependencies?codemap cycles
Overview of a filecodemap summary <file>
Architecture health / couplingcodemap coupling
Project statscodemap graph-stats

Common Workflows

Understand a new codebase

codemap status              # Check index health
codemap graph-stats         # High-level architecture stats
codemap rank -l 10          # Top 10 most important files
codemap summary <top-file>  # Deep dive into each key file

Impact analysis before refactoring

codemap dependents <file>           # What depends on this file?
codemap deps <file>                 # What does this file depend on?
codemap coupling --module <dir>     # Coupling metrics for the module

Find and fix circular dependencies

codemap cycles                # Detect all cycles
codemap deps <file-in-cycle>  # Understand each file's imports
# Refactor to break the cycle

Search for implementation patterns

codemap search "error handling"     # Find code by concept
codemap symbols "handleError"       # Find by exact name

Failure Modes

Index not built

Symptom: codemap search returns an error or no results Fix: Run codemap init + codemap index

Stale index

Symptom: Recently added files or symbols don't appear in results Fix: Run codemap index to re-index (or codemap index --full for a complete rebuild)

File not found

Symptom: codemap deps <file> or codemap summary <file> returns an error Fix: Verify the file path is relative to the project root and the file exists

Integration with Other Skills

  • start — Check index status during session init; prompt indexing if stale
  • find-bugs — Use codemap rank and codemap coupling to prioritize which files to audit
  • plan-to-task-list-with-dag — Use codemap dependents for impact analysis when decomposing tasks
  • code-simplify — Use codemap cycles to find circular deps worth refactoring

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.