roam

Codebase comprehension via roam-code CLI. Use when exploring codebases, planning modifications, debugging failures, assessing PR risk, or checking architecture health. Triggers on: understanding project structure, pre-change safety checks, finding symbols/files, blast radius analysis, affected tests, health scoring, refactoring guidance, code review. Requires roam-code installed (`pip install roam-code`) and an indexed project (`roam init`).

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "roam" with this command: npx skills add cranot/roam-code/cranot-roam-code-roam

Roam — Codebase Comprehension Skill

Repository: https://github.com/Cranot/roam-code

Roam pre-indexes codebases into a semantic graph (symbols, dependencies, call graphs, architecture layers, git history) stored in a local SQLite DB. Query it via CLI instead of repeatedly grepping files and guessing structure.

Setup

Ensure roam-code is installed and the project is indexed:

pip install roam-code   # or: pipx install roam-code
cd <project-root>
roam init               # indexes codebase, creates .roam/index.db

After git pull or major changes, run roam index to refresh (incremental, near-instant if few files changed). After large refactors: roam index --force.

Command Decision Table

Use this table to pick the right command for the situation:

SituationCommand
First time in a reporoam understand then roam tour
Need a compact codebase overviewroam map or roam minimap
Find a symbol by nameroam search <pattern>
Need files to read for a symbolroam context <symbol>
Inspect a file's structureroam file <path>
Inspect a directoryroam module <path>
Before modifying a symbolroam preflight <symbol>
What breaks if I change X?roam impact <symbol>
Blast radius of uncommitted changesroam diff
Debugging a failureroam diagnose <symbol>
Which tests cover a symbol?roam affected-tests <symbol>
Check codebase healthroam health
Find hotspots (churn x complexity)roam weather
Detect dead/unused coderoam dead
PR risk assessmentroam pr-risk
Find dependency pathsroam trace <source> <target>
Who calls/imports this?roam uses <symbol>
Algorithm anti-patternsroam algo
Side effects of a functionroam effects <symbol>
Safe to delete?roam safe-delete <symbol>
Simulate a refactor`roam simulate move

Core Workflow

1. Orientation (first time in a repo)

roam understand        # tech stack, architecture, health, conventions
roam tour              # onboarding: key symbols, reading order, entry points
roam map               # project skeleton with top symbols by PageRank

2. Before Making Changes

Always run roam preflight <symbol> before modifying code. It combines blast radius + affected tests + complexity + coupling + fitness into one check:

roam preflight MyClass
# Output: blast radius, affected tests, complexity, coupling, fitness verdict

If you only need files to read:

roam context MyClass
# Output: definition file + callers + callees with exact line ranges

3. After Making Changes

roam diff              # blast radius of uncommitted changes
roam diff --staged     # blast radius of staged changes
roam pr-risk           # risk score (0-100) + suggested reviewers

4. Debugging

roam diagnose <symbol>  # root cause ranking by z-score risk
roam trace <A> <B>      # dependency path between two symbols
roam effects <symbol>   # DB writes, network I/O, filesystem, global mutation

Output Modes

  • Default: Human-readable text (also optimized for LLM consumption)
  • roam --json <cmd>: Structured JSON with consistent envelope
  • roam --budget N <cmd>: Token-capped output (N = max tokens)
  • roam --sarif <cmd>: SARIF 2.1.0 for CI integration

Prefer --json when you need to parse output programmatically. Prefer --budget 2000 when context window is tight.

Key Commands Reference

roam search <pattern>

Find symbols by name (regex). Results ranked by PageRank.

roam search "Auth.*Service"
roam search "handle_request" --kind fn

roam context <symbol>

AI-optimized file list with line ranges for reading. Supports --task modify|debug|review for context tuning.

roam context Flask
roam context myfile:MyFunction    # disambiguate with file prefix

roam preflight <symbol|file>

Compound pre-change check. Run this before every modification.

roam preflight UserController
roam preflight src/auth/login.py

roam health

Composite score (0-100). Use --gate for CI (reads .roam-gates.yml).

roam health
roam health --gate               # exit 5 on failure

roam diff

Blast radius of uncommitted or committed changes.

roam diff                       # uncommitted
roam diff --staged              # staged only
roam diff HEAD~3..HEAD          # commit range

roam algo

Detect algorithm anti-patterns (23 patterns: O(n^2) loops, N+1 queries, quadratic string building, etc.) with confidence levels and fix suggestions.

roam algo
roam algo --confidence high     # high-confidence only
roam algo --task nested-lookup  # specific pattern

roam impact <symbol>

Full blast radius using Personalized PageRank.

roam impact Flask

roam symbol <name>

Symbol definition + callers + callees + metrics.

roam symbol open_db
roam symbol --full open_db      # include source code

roam affected-tests <symbol|file>

Trace reverse call graph to find covering tests.

roam affected-tests UserService

roam agent-export --write

Auto-generate agent instructions for the project. Detects CLAUDE.md, AGENTS.md, .cursor/rules, etc.

roam agent-export --write
roam agent-export --agent-prompt    # compact ~500-token prompt

roam minimap --update

Inject/refresh annotated codebase snapshot in CLAUDE.md.

roam minimap --update           # update sentinel block in CLAUDE.md

Discovering More Commands

This skill covers the most common commands, but roam has 139 commands. To explore what's available:

roam --help                 # list all available commands
roam <command> --help       # detailed usage for a specific command

For full documentation, examples, and the latest features, see the roam-code repository.

Tips

  • One roam command replaces 5-10 grep/read cycles. Always try roam first.
  • Use roam search instead of grep/glob for finding symbols — it understands definitions vs. usage and ranks by importance.
  • roam context gives exact line ranges — more precise than reading whole files.
  • After git pull, run roam index to keep the graph fresh.
  • For disambiguation, use file:symbol syntax: roam symbol myfile:MyClass.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated
Coding

ai-dating

This skill enables dating and matchmaking workflows. Use it when a user asks to make friends, find a partner, run matchmaking, or provide dating preferences/profile updates. The skill should execute `dating-cli` commands to complete profile setup, task creation/update, match checking, contact reveal, and review.

Archived SourceRecently Updated