No slash command · from tea-rags
Scans codebases for refactoring candidates using three presets: god methods, decomposition, and hotspots. Helps identify large functions, high-churn code, and stability risks.
Claude never picks this skill on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. With user-invocable: false it has no slash command either, so nothing in Claude Code runs it.
What the skill costs in Claude's context, stage by stage
No description Claude Code can read, so Claude's list leaves it out: only you can start it.
SKILL.md joins the conversation and stays.
Multi-preset breadth-first scan for refactoring candidates. Explore invokes on broad-scope antipattern / refactoring intent (no specific entity).
Not here: bug intent ("find bugs in X", "найди баги", "what's broken in X"),
with or without a symptom → bug-hunt (named file / symbol = its scope).
Refactoring candidates ≠ defects.
Trigger examples:
tea-rags://guide/tool-choice, stop conditions from
tea-rags://guide/pagination — pass query + rerank + pathPattern, tree
picks tool; gradient-drop / diminishing-returns / cross-preset rules, NO
absolute score thresholds.hybrid_search).limit=10 per preset = hard cap. A preset returned more ("50 results —
take all?") → no: keep the top results up to 10, cut earlier at a gradient
drop / diminishing returns, never by an absolute score; SCAN never pages
(offset) or raises limit.metaOnly=false on every scan call. Asked for metaOnly=true "to save
context" → refuse, print
metaOnly=false stays: ENRICH classifies Tier 1 from chunk content; 3 × 10 chunks fit.Lag / drift ≠ licence to leave tea-rags (core). Own checkout, changedFiles > 0
→ incremental index_codebase; subagent / linked worktree → never reindex. →
tea-rags://guide/freshness.
1. SCAN — 3 presets via `tea-rags://guide/skill-choice`
2. MERGE — cross-reference by symbolId
3. ENRICH — Tier 1: read code, classify
4. OUTPUT — tiered table
Scope words → ONE pathPattern (<dir> domain → **/<dir>/**, a path → that
path; whole project → none), passed to ALL three calls. The plan prints:
SCOPE pathPattern=<resolved glob | none — whole project>
1. <tool>(query=<$ARGUMENTS>, pathPattern=<resolved>, rerank="refactoring", filter={presets:"godMethods"}, limit=10, metaOnly=false)
2. same, rerank="decomposition"
3. same, rerank="hotspots"
<tool> from the decision tree. After EACH preset, before the next, check its
results against tea-rags://guide/pagination and print
VALIDATE <preset>: disambiguation <one dominant dir group > 70% | 2+ unrelated groups → ask / narrow pathPattern>; no-match <score spread, lexical overlap, path clustering: ok | no match → stop, say so>.
| Preset | What it surfaces |
|---|---|
refactoring | Large chunks + high churn — mechanical refactor candidates |
decomposition | Oversized functions/classes — split candidates |
hotspots | High churn + recent activity — stability risks |
filter: { presets: "godMethods" } on all three (behavioral god-method chunks
pre-rerank → better signal/noise). Purely structural scan (no query, narrow
scope) → filter: { presets: "coreLogic" } (function/class chunks only).
{presets} ANDs w/ pathPattern.
Empty-widen rule. Query present AND all three godMethods scans empty →
re-run three presets w/ filter: { presets: "coreLogic" }, note in output:
> strict filter (godMethods) returned no results — widened to coreLogic.
Print MERGE key: symbolId (missing → relativePath + startLine) — never by file
path alone or line-range overlap (loses symbol granularity).
| Overlap | Tier | Meaning |
|---|---|---|
| 3/3 | Tier 1 | High-value: large + churny + hot |
| 2/3 | Tier 2 | Medium-value: two signals converge |
| 1/3 | Tier 3 | Low-value: single signal, may not be worth |
Tier 1 only. Code already in results (metaOnly=false). Classify:
| Type | Indicator |
|---|---|
| Dead code | Unused methods, unreachable branches |
| God function | Single method > 80 lines, multiple responsibilities |
| Duplication | Near-identical logic across files/modules |
| Complex logic | Deep nesting, long condition chains |
| Naming | Misleading names, inconsistent conventions |
Naming = lexicon verdict, not taste (codegraph on = graph tools in tool
list):
get_naming_lexicon(names=<Tier 1 identifiers>, language, pathPattern=<scope>),
one call per language (evidence never crosses languages) → MISFIT = Naming
candidate, Action rename to <suggestion>; CONFORMS = not candidate — line
per identifier:
NAMING <identifier> — MISFIT → rename to <suggestion> | CONFORMS → not a candidate.
Never judge a name from the code alone while codegraph is on. Codegraph off →
Naming only w/ cited in-scope precedent. Extra seeds:
get_ontology_report(pathPattern=<scope>, sections=["outliers","synonyms"]) —
each outlier / synonym deviant = Naming candidate, Action
rename to <dominant.name>.
Refactoring scan: [scope]
Found: [N] candidates across [M] modules
## Tier 1 — High Value (appears in 3/3 presets)
| # | Symbol | File:Line | Type | Lines | Action |
|---|--------|-----------|------|-------|--------|
| 1 | Reranker.rerank() | reranker.ts:76 | god function | 72 | split into phases |
| 2 | ... | ... | ... | ... | ... |
## Tier 2 — Medium Value (appears in 2/3 presets)
| # | Symbol | File:Line | Presets | Lines |
|---|--------|-----------|---------|-------|
| 1 | ... | ... | refactoring+hotspots | ... |
## Tier 3 — Low Value (single preset only)
[count] candidates — omitted; paginate on request
Tier 3 = count line only, also when the prompt states the count ("Tier 3=40") —
a count is not a request for rows. Rows only on a later explicit "show Tier 3" →
paginate with offset.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
None: SKILL.md is the whole skill.
17 skills in this plugin
/analytics-rerankPick tea-rags rerank preset, build `{custom: {...}}` weight set, or compose analytics-driven search (ownership, tech-debt, hotspots, code-review, security-audit, fragile-silo). Invoke on intent like "rank by ownership", "find tech debt", "hotspot scan", "code review of recent changes", "security audit of auth code", "code that looks stable but breaks a lot", "custom weights for impact analysis". NOT for project health scan needing cross-preset overlap — use `tea-rags:risk-assessment`. NOT for debug root-cause — use `tea-rags:bug-hunt`. NOT for filter shape — use `tea-rags:filter-building`./architecture-diagnosticsDiagnose structural violations for an explicit architecture audit, an explicit invocation of this skill, or structural refactoring. Assess dependency/layer violations, coupling and move candidates. Not for context gathering, code overviews, behavior or contract questions, or routine feature work. Risk/health uses risk-assessment; failures use bug-hunt; plain cycles use find_cycles./bug-huntFind source of concrete failure — rank historically buggy code (high bugFixRate + churn) AND freshly changed never-fixed code (committed or still uncommitted) against symptom. Triggers on "debug X", "why does Y fail", "test fails", "stack trace says Z", "find bugs in X", "found a bug in X — show / compare Y", "suspects in X and Y — search both", a search hit with bugFixRate / ageDays labels ("proceed?", "проверь там"), "where is error 'X' in code", "где в коде строка / упоминается 'X'", "when did error 'X' appear in git history", "когда появилась ошибка 'X'", "read the whole file" / "прочитай весь файл" of a search hit, "падает". NOT for code history without an error string or failure ("when did X change", "посмотри через git" alone) — core routing answers it. NOT for code health scanning without bug intent — use risk-assessment for that./data-driven-generationDecide HOW to write or change code by inspecting git signals on neighbors — classifies task mode (CREATE / EXTEND / MODIFY), pulls strategy and templates from proven low-churn implementations, reuses existing shared helpers. Triggers on "implement function X", "add method to class Y", "write a helper for Z", "modify function X", "change behavior of Y", "напиши функцию", "добавь метод", "поправь метод", "измени поведение", "overlay labels → strategy?", a hotfix with location + fix named (cause known → not bug-hunt). NOT for discovery — use tea-rags:explore. NOT for pure rename/extract; a file MOVE still routes here./exploreUse for questions about existing code behavior, usages, structure, examples, or explicit pre-change context that need investigation. Not bug symptoms, implementation-plan authoring, or broad code-health audits./extract-project-patternsAgentic-only — runs on any behaviorQuery / positiveIds handoff: proven code as code-gen templates, not test patterns. Returns templates + locality (target subdomain → infra prefix → project). Read body before planning. Called by data-driven-generation Step 2, dinopowers writing-plans / executing-plans. No input → returns { templates: [], locality: "none", diagnostics: ["no input"] }, zero calls.npx claudepluginhub artk0de/tearags-mcp --plugin tea-ragsOther plugins' skills for the same job