codanna-codebase-intelligence
Use codanna MCP tools for semantic code search, call graphs, and impact analysis before grep/find.
What this skill does
# Codanna Codebase Intelligence Codanna indexes your codebase and provides semantic search, call graphs, and dependency analysis via MCP tools. **Use codanna before grep/find** - it understands code structure, not just text patterns. ## When to Use - **Finding code**: "Where do we handle authentication?" → `semantic_search_docs` - **Understanding dependencies**: "What calls this function?" → `find_callers` - **Impact analysis**: "What breaks if I change this?" → `analyze_impact` - **Exploring symbols**: "Show me the Parser struct" → `find_symbol` ## Core Tools ### Discovery ``` # Natural language search - finds code by intent, not keywords semantic_search_docs query:"error handling patterns" limit:5 # Search symbols by name/pattern search_symbols query:"parse" kind:"function" # Get full details on a specific symbol find_symbol name:"process_file" ``` ### Relationships ``` # Who calls this function? (upstream) find_callers symbol:"validate_input" # What does this function call? (downstream) get_calls symbol:"process_request" # Full dependency graph - what breaks if I change this? analyze_impact symbol:"DatabaseConnection" depth:3 ``` ### Documentation (RAG) ``` # Search indexed markdown/docs search_documents query:"API authentication" collection:"docs" ``` ## Tool Selection Guide | Task | Tool | Example | |------|------|---------| | Find code by concept | `semantic_search_docs` | "database migrations" | | Find symbol by name | `search_symbols` | Pattern: "auth*" | | Get symbol details | `find_symbol` | Exact: "UserService" | | Trace callers | `find_callers` | "Who uses this?" | | Trace dependencies | `get_calls` | "What does this call?" | | Assess refactor risk | `analyze_impact` | "What breaks?" | ## Workflow Patterns ### Before Refactoring 1. `find_symbol` - understand current implementation 2. `find_callers` - identify all usage sites 3. `analyze_impact` - assess blast radius 4. Then proceed with changes ### Understanding Unfamiliar Code 1. `semantic_search_docs` - "how does X work" 2. `find_symbol` - get entry point details 3. `get_calls` - trace execution flow ### Finding Where to Add Code 1. `semantic_search_docs` - "similar patterns" 2. `find_callers` - how existing code integrates 3. Follow established patterns ## Why Codanna Over Grep | Grep/Find | Codanna | |-----------|---------| | Text matching | Semantic understanding | | String "parse" matches comments | `find_symbol` finds the actual function | | Manual call tracing | `find_callers` shows full graph | | Guessing impact | `analyze_impact` shows dependencies | ## Integration with Agent-Loops Codanna complements the agent-loops review workflow by providing structural code intelligence that diff-based review alone cannot offer. ### Pre-review impact analysis Before invoking `specialist-review.sh`, run codanna to understand the blast radius of your changes. This feeds grounded structural data into the review, helping reviewers focus on real downstream effects rather than guessing from the diff. ```bash # Gather impact data for changed symbols codanna mcp find_callers process_request --watch codanna mcp analyze_impact DatabaseConnection --watch --json ``` ### Multi-specialist review support In the multi-specialist review architecture (see `docs/development/plans/multi-specialist-review.md`), specialists can use codanna tools alongside Read/Grep/Glob for grounded analysis. Impact data can also inform specialist triage — determining which review perspectives to activate based on which parts of the codebase are structurally affected. ### Automatic index freshness The `--watch` flag on CLI commands checks for file changes and re-indexes before running, so impact data stays current throughout a review session without manual reindexing. The MCP server equivalent (`codanna serve --watch`) provides the same freshness guarantee for interactive sessions. ## Tips - Start broad with `semantic_search_docs`, then drill down with `find_symbol` - Use `analyze_impact` before any refactor touching shared code - `find_callers` with depth > 1 shows transitive callers - Results include file paths and line numbers - use for navigation
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.