/tea-rags:mr-review [MR/PR URL — omit for local review]from tea-rags
Signal-driven review of merge requests or local branches using the tea-rags framework. Ranks diff risks across 9 dimensions (blast radius, fragile zones, silo style, missing tests, doc invariants, cycles, naming) and emits plain-language comments each naming a concrete fix. Triggers on phrases like 'review this MR <url>' or 'review my branch'.
Ships in tea-rags. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
9-dimension diff scan → actionable comments. Signals decide WHAT to flag;
comment states fact in plain words + names fix. Local = chat report. External =
inline MR comments behind ONE draft-gate, agent-signed, [minor] on style nits.
find_symbol(project=<alias>, path=<checkout>, symbols=[<touched files>], rerank="hotspots")
— ONE call, all filesgit log / git blame. Diff
acquisition (Phase 1) = sanctioned exception: review INPUT, not signals.tea-rags://guide/tool-choice.git.*,
codegraph.*), preset/label jargon (concerning, deep-silo), UUIDs,
scores, dimension codes. Translation table:
references/delivery-contract.md..claude/rules/** incl. gitignored .local/**,
memory, SessionStart digest, skills) is NEVER evidence in a comment.find_symbol, never Read — symbol=<symbolId> for body,
relativePath for outline; several named ids / files → ONE symbols=[<ids>]
(core Invariants), never one call each.0. RESOLVE → mode (URL? external : local) + checkout path + freshness
1. ACQUIRE → unified diff + MR title/description/author
2. MAP → ONE find_symbol(project=<alias>, path=<checkout>, symbols=[<touched files>],
rerank="hotspots")
→ hunks × outline → {file, changedSymbols[], chunkUUIDs[], overlay}
MAP always precedes the first review_changes / naming call of this
review — never jump from ACQUIRE to a verdict call.
3. SCAN → 9 dimensions — references/dimension-playbook.md
4. CLASSIFY → severity + evidence filter + dedup
5. DELIVER → local: chat report | external: draft-gate → post
(references/delivery-contract.md)
Mode: $ARGUMENTS contains URL → external. Else local.
Checkout: local mode → cwd; external mode → local checkout of MR's repo
(checkout REQUIRED). Every call passes path=<checkout>. Answer reports no
index for that repository → STOP, print register + index instruction. Never scan
unindexed repo.
Freshness (gate — skipped → stale index misses recent base changes, signals
lie): external → git fetch target branch; index behind target → incremental
index_codebase project=<alias>. Local → tea-rags://guide/freshness (lag ≠
unusable, reindex triggers; linked worktree: no reindex — overlay reads tree).
External: unified diff + MR title/description/author via session's MR-platform mechanism (platform CLI / platform MCP server / http-client — whichever configured; skill names no commands). No mechanism → STOP external mode ("no MR-platform mechanism available"), offer local mode on checked-out branch instead.
Local: git diff <merge-base main..HEAD> + uncommitted (git diff HEAD).
On main → uncommitted only. Empty diff → STOP, say so.
MR description = review intent — feeds D6 invariants.
find_symbol project=<alias> path=<checkout> symbols=[<file 1>, <file 2>, …] rerank="hotspots"
→ outline per file (rows keyed by request, misses in missing). Intersect
changed ranges with symbol spans → changed symbols + chunk UUIDs.{file, changedSymbols[], chunkUUIDs[], overlay} — working
set every Phase 3 dimension reads. Overlay = labels from
rankingOverlay.{file,chunk}.* + raw values from payload git.*,
codegraph.symbols.* (payload never carries labels).Non-indexed touched files (new in MR, generated, docs) → overlay: none, still
eligible for D6; never fabricate overlay for them. Local mode: row with
treeState = pre-edit index copy, lines stale → find_symbol for current code.
Nine dimensions over working set, parallel blocks. Full per-dimension parameters + severity mapping: references/dimension-playbook.md — execute its parameter blocks byte-exact (diff-review has no block: its call is the table row).
| Dimension | Catches | Mechanism |
|---|---|---|
| blast-radius | hidden coupling, hub edits | get_callers per symbol + ONE find_symbol(symbols=[<changed ids>], rerank="blastRadius", metaOnly=true) → overlay fanIn/transitiveImpact/isHub |
| shotgun-twins | co-change siblings untouched in MR | find_similar batch on changed chunks + taskIds |
| fragile-zone | edits in panic zones | overlay bugFixRate/churnVolatility/burst — 0 calls |
| silo-style | non-owner edits silo file | blameDominantAuthor* + proven neighbors as reference |
| tests | scenarios at risk, uncovered changes | tests-as-context + stratified per-cluster coverage |
| invariants | diff contradicts docs/specs | semantic_search documentation="only" on concepts |
| cycles | MR introduces import/call cycle | find_cycles scoped to touched dirs |
| naming | new names off the project vocabulary | local: ONE own review_changes(changes:{base:<target branch>}, sections:["naming"], project, path) call (not folded into diff-review's) — named in the plan even when verdicts are already in context (they come from that call), no hand-built names[]; external (MR not checked out — tree lacks its code): get_naming_lexicon names[] from the diff's added-line declarations (kind param/local/field/constant/return/type; called method → return), never changes / review_changes on the local tree. Report = the Phase 5 Local D8 shape, copied (one form, defined there) |
| diff-review | incomplete changes, cohesion, diff-scoped architecture, dependency norms | local: review_changes(changes:{base}, sections:["incompleteChange","cohesion","architecture"]); external (MR not checked out — tree lacks its code): no review_changes, plan line diff-review: judged from the MR diff hunks — review_changes not run (MR code not in local tree). Naming is D8's own call; architecture findings (+ change.nonLocal, change.resolved; never change.persisting) → tea-rags:architecture-diagnostics Phase 3h decides each (classification + its repair/<family>.md), not this skill's evidence/fix gate — never re-judge or hedge them; severity follows tier (critical > active > structural), change.touchedActive = high; norms: list every MISFIT (edge + expectedPath), note exclusionsUnchecked |
Gating: codegraph on (graph tools get_callers / find_cycles in tool list;
unsure → tea-rags://project/<alias>/metrics?section=registry) → D1 + D7 + D8
run on graph. Off → D7, D8 "not assessed" (no substitute; never "no cycles"); D1
degrades to name-matched callers (hybrid_search symbol name + ONE
find_symbol over the hits), every comment on it says callers found by name,
not call graph — lower bound, never "these are all the callers". tests follows
tests-as-context preflight.
Call budget: ≤20 tea-rags calls typical MR, ≤26 at every cap (playbook). Exceeded → narrow scope with user, never silently truncate coverage.
git ls-files --error-unmatch, not git check-ignored). Agent-side path →
restate the point from the code, else drop the finding.Contract shape + conventions + degradation: references/delivery-contract.md.
Local: chat report — findings by severity (major first), observations,
dimensions-skipped notes. No posting. D8 naming overrides the severity
grouping, local too: emit exactly this block, copied, one finding per line —
plan-only answers too, NOW, slots filled from verdicts already in context (else
[planned; not run]); "the block must follow the format" = block not emitted:
### Naming
MISFIT
- <relPath>:<line> — [minor] <plain observation; consequence; fix = suggestion, as in <holder>>
COLLISION
- <relPath>:<line> — [minor] <plain observation; names the existing declaration's file>
NEW_TERM
- <relPath>:<line> — <plain observation; a rename only when alternatives exist>
conforming: <n>; novel: <n>
The verdict word appears only as the group heading, never in a finding line (no
tool names either). <relPath>:<line> comes from review.findings[]; a count
or line number the review answer lacks → n/a. The summary never names the
review mode.
External: draft table (file:line | severity | one-line body) → ONE
whole-batch confirmation → agent posts inline comments + summary via session's
MR-platform mechanism (MCP server preferred, else CLI, else http-client) →
per-comment posted/failed status, failed retried once then surfaced in chat.
Never post without the gate. Never claim posted without per-comment status. No mechanism → print contract in chat, mark "delivered locally".
path — that is the diff.)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
merge-request-review, code-review, diff-analysis, risk-ranking, tea-rags
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.npx claudepluginhub artk0de/tearags-mcp --plugin tea-ragsOther plugins' skills for the same job