From tea-rags
Investigates code structure, usage, architecture, and risks before changes. Routes to explain, trace, pre-generation, or exemplar strategies based on user intent.
How this skill is triggered — by the user, by Claude, or both
Slash command
/tea-rags:exploreThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
| User intent contains | Strategy | Skip if |
| User intent contains | Strategy | Skip if |
|---|---|---|
| "how does X work", "explain Y", "what does Z do" | EXPLAIN | active bug → bug-hunt |
| "where is X used", "find all X", "imports of X" | TRACE | structural-only → use find_symbol direct |
| "before I refactor X", "what should I know about Y" | PRE-GEN | already mid-refactor → executing-plans |
| "best example of X", "antipatterns in Y" | EXEMPLAR | no rerank corpus → ripgrep |
🛑 If unsure, ask user. NEVER assume strategy from partial signals.
If $ARGUMENTS contains risk-assessment signals ("risk surface", "risk zones",
"code health", "assess risks", "problematic areas") → delegate
risk-assessment/SKILL.md. Runs BEFORE intent table — risk intent overrides
EXPLAIN/TRACE/PRE-GEN/EXEMPLAR keywords.
Graph-shape questions answered from real call/import edges (codegraph DuckDB), which content matching cannot derive. When $ARGUMENTS matches row below, route to that sub-pattern — checks run AFTER risk-assessment but BEFORE the EXPLAIN/TRACE/PRE-GEN/EXEMPLAR table (edge truth beats content matching for graph shape). Evaluate top-to-bottom; first match wins.
| Priority | Intent contains | Sub-pattern |
|---|---|---|
| 1 | "циклы", "cycle", "circular dependency", "dependency loop" | references/cycle-pattern.md |
| 2 | "кто использует/вызывает X", "callers of X", "callees of X", "trace flow" | references/usage-pattern.md |
| 3 | "где начинается", "entry point", "main flow", "входная точка", "where X starts" | references/entry-point-pattern.md |
| 4 | "архитектура", "structure", "backbone", "что центральное", "how X is organized" | references/architecture-pattern.md |
Match on intent phrasing, not symbol substrings. Classify by request's verb
frame, NOT by characters inside symbol name. "what does X call?" / "who calls
X?" always USAGE (row 2) even when X named findCycles / CycleDetector — word
"cycle" inside target symbol does NOT make it CYCLE (row 1) request. Row 1 fires
only on graph-shape phrasing about the loop itself ("circular dependency",
"dependency loop", "cycles in ").
Codegraph availability: sub-patterns need codegraph index. Prime digest
lists codegraph.symbols under ## Enrichment when active; when that line
absent, graph tools (get_callers / get_callees / find_cycles) not
registered — absent from tool list, not returning empty. Check prime first.
Codegraph off → fall back to content-matching table below — TRACE covers usage,
EXPLAIN covers architecture — never read absent tool as positive fact. Each
sub-pattern states own fallback.
| Strategy | Keywords (any match) |
|---|---|
| Collect | all, every, each, find all, list all, enumerate, gather, all implementations, all uses, all instances, everywhere, wherever |
| Spread | across, across modules, between modules, compare implementations, variations of, side by side, divergence, per module |
| Antipattern | antipattern, smell, debt, violation, deprecated, fragile, risky, refactor, cleanup, too complex, duplicate, decompose |
| Reference | best, correct, canonical, reference implementation, cleanest, template, pattern to follow, recommended way, good example |
Exception: If EXPLAIN reference (sub-pattern table) has specific pattern for this intent (e.g., "What calls X?" with "all call sites"), EXPLAIN pattern wins over keyword classification. EXPLAIN more specific than generic Collect.
Unified code investigation. Breadth-first discovery → depth-first tracing → output shaped by intent (human explanation OR pre-generation context).
Use tea-rags tools for code discovery. Built-in Search/Grep/Glob prohibited. Search results complete — no ripgrep verification passes.
Translate $ARGUMENTS to English (if not already). If user's language differs, optionally run secondary query in original language for non-English docs.
Apply Intent Classification table above. Then:
risk-assessment/SKILL.md.Extract pathPattern from $ARGUMENTS:
Explicit markers — in/inside/within/under/from <X> → **/<X>/**
Directory matching — if word looks like directory name:
**/<word>/** and **/<word>s/** (plural)Do NOT hardcode aliases — filesystem is source of truth.
If user provides code snippet or chunk (not a question) → skip BREADTH, go straight to find_similar with code as input. Then EXPLAIN similarities.
BREADTH (search) → pick interesting results →
LATERAL (find_similar) — same pattern elsewhere?
DEPTH (find_symbol) — trace specific symbol?
→ explain to developer
Search with query=$ARGUMENTS. Tool selection: behavior/intent → semantic_search, known symbol → hybrid_search, bare symbol name → hybrid_search.
Scan results: files, modules, patterns. Note domain boundaries.
For each interesting result:
Repeat as needed. Fewer deep dives > many shallow ones.
Format answer per strategy reference selected in Step 0:
npx claudepluginhub artk0de/tearags-mcp --plugin tea-ragsPerforms deep codebase exploration with parallel agents to discover architecture, find files, trace data flows, analyze patterns, and assess code health. Invoke for repo walkthroughs or feature tracing.
Explains, traces, audits, or explores code in read-only mode without modifying it. Answers questions like 'how does X work' or 'where is Y called' with evidence.
Traces actual code paths in codebases to analyze architecture, data flows, integrations, patterns, and provide recommendations across 5 evidence-based iterations. Use for deep 'how does X work' queries or complex system reviews.