expand-coverage
Agent-only. Raise test coverage above a failed pre-commit threshold: locate the
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Agent-only. Raise test coverage above a failed pre-commit threshold: locate the
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
Decide HOW to write new code by inspecting git signals on neighbors — pulls strategy and templates from proven, low-churn nearby implementations rather than guessing from training data. Triggers on "implement function X", "add method to class Y", "write a helper for Z", "напиши функцию", "добавь метод". NOT for discovery or exploration — use tea-rags:explore for that. This skill activates ONCE the agent is about to write code.
Agentic-only enrichment skill — surface battle-tested reference code from project as templates for generation / modification. Three-level locality cascade (target subdomain → domain → project), quality gate by overlay labels + project-wide proven rerank preset. Returns ranked list of reference chunks + locality annotation (L1 / L2 / L3 / none). Invoked by `tea-rags:data-driven-generation` Step 2 (TEMPLATE), `dinopowers:writing-plans` (per code-gen Task), `dinopowers:executing-plans` (per Task during execute). Skipped when no `positiveIds` / `positiveCode` and no `behaviorQuery` available.
Run automated TeaRAGs install wizard from scratch — detects environment, installs deps (Node.js, tea-rags, Ollama/ONNX, Qdrant), tunes performance, configures MCP server. Progress saves to ~/.tea-rags/setup-progress.json for resumable install. Triggers on "install tea-rags", "set up TeaRAGs MCP", "configure tea-rags from scratch", "поставить tea-rags в проект". NOT for tuning an existing install — use tune for that.
Brainstorm code change seeing risk, ownership, tech-debt signals from tea-rags first — creative exploration grounded in actual state of affected area. Triggers on "brainstorm X", "design feature", "refactor Y", "let's discuss", "давай обсудим", "как перестроить", "что может сломаться". NOT for trivial edits or stylistic questions with no code area to enrich. Wraps superpowers:brainstorming with tea-rags risk-signal enrichment step.
Execute written implementation plan whose Tasks edit code, per-Task SAFE/CAUTION/UNSAFE git-signal verdict before edit AND code-style cascade for code-generation Tasks (style from silo authors, strategy+template from proven neighbors). Triggers on "execute the plan", "start Task N", "выполни план", "начни задачу", "run the plan", "implement the plan steps". NOT for one-off edits without a written plan. Wraps superpowers:executing-plans with tea-rags git-signal verdicts and tea-rags:data-driven-generation cascade.
Finalize dev branch (merge/PR/cleanup) with tea-rags:risk-assessment over full branch diff — completion options weighed against risk zones across entire branch scope. Triggers on "finish the branch", "ready to merge", "wrap up the feature", "ветка готова", "доводим до merge", "branch ready", "PR time", "shipping the branch", "merge ready". NOT for mid-branch interim commits. Wraps superpowers:finishing-a-development-branch with tea-rags:risk-assessment over the branch diff.
coverage-expander sub-agent on pre-commit
"Coverage for (X%) does not meet global threshold (Y%)".
Reindex-if-stale local main before search so corner-case discovery sees current
source. NOT for general test authoring — only closing a measured coverage gap.Raise coverage above threshold via high-level behavioral tests hitting the exact uncovered branches. Never chase lines. tea-rags finds WHAT is untested; you write scenarios.
Runs in a background agent — fully autonomous, no interactive questions; the final report (below) is the handoff.
Coverage above ALL thresholds → report, stop.
grep/awk/sed coverage stdout. Parse the coverage JSON.Read src/. Use find_symbol (full body) + hybrid_search. Read
ONLY: coverage/coverage-summary.json, coverage/coverage-final.json,
vitest.config.ts, package.json, test files you extend.tests/ ONLY. Never touch prod code, configs,
thresholds.src/→tests/ EXACT.
src/core/foo/bar.ts→tests/core/foo/bar.test.ts. No bucket dirs
(tests/coverage-fill/, tests/gaps/, tests/uncovered/). Existing test
file → Edit append.v8 ignore/eslint-disable/c8 ignore to prod.Commit under test just changed src/ → local-main index lags → search misses
new code, corner-case discovery fails silently.
list_projects/prime). Never a stale worktree clone.index_codebase incremental, project: <main-alias> — silent, no consent
(see .claude-plugin/tea-rags/rules/index-freshness.md).src/ written this session.Config emits json/lcov/html only — request summary + final maps:
npm run test:coverage -- --run \
--coverage.reporter=json-summary --coverage.reporter=json 2>&1 | tail -25
json-summary → coverage/coverage-summary.json (per-file %).json → coverage/coverage-final.json (hit maps = exact uncovered lines).Read summary → total.*.pct. Read vitest.config.ts coverage.thresholds
(they drift — statements overridden below 96.9).
One jq over summary (NEVER a grep pipeline):
jq '[to_entries[] | select(.key != "total")
| select(.value.statements.pct < 100)
| {file: .key,
impact: (.value.statements.total - .value.statements.covered),
pct: .value.statements.pct}]
| sort_by(-.impact) | .[0:4]' coverage/coverage-summary.json
Top 2–4 below-threshold files by impact (uncovered statements).
Find the EXACT untested behavior — never guess from the whole file.
Read coverage/coverage-final.json, find target by
path. statementMap+s, branchMap+b, fnMap+f with hit 0 → exact
uncovered ranges = the corner cases.find_symbol enclosing fn/class → full body. Map each range
to the behavior it guards: error path, null/empty guard, boundary, catch,
early return.hybrid_search pathPattern: "tests/**/*.test.ts", query =
module → existing test, mocks, assertion style.find_similar target symbolId → how nearby modules test the
same branch shape; lift proven scenarios.get_callers target → real inputs reaching the branch (a
corner case often reachable through one caller only).Each uncovered branch → one behavioral scenario. Dead/unreachable branch → report it, do NOT fabricate a test.
src/→tests/ EXACT (rule 5). Existing file → Edit append.import { describe, expect, it, vi, beforeEach } from "vitest".Good: "should propagate ConnectionRefused through the ingest pipeline"
Bad: "should execute line 142"
Re-run the Step 1 command once. Read summary, compare total.*.pct to
thresholds.
Coverage before: statements=X.XX% functions=Y.YY% lines=Z.ZZ% branches=W.WW%
Coverage after: statements=X.XX% functions=Y.YY% lines=Z.ZZ% branches=W.WW%
Thresholds: statements=A.AA% functions=B.BB% lines=C.CC% branches=D.DD%
Status: PASS | FAIL
Files added/modified:
- tests/path/to/file.test.ts — N new tests (scenarios: X, Y, Z)
- ...
Reindex: <incremental | skipped-fresh>
Coverage runs: 2 (or 3 if retry used)