goccy/tobari/tobari-coverage-improver

Claude Code and agent skill by goccy/tobari

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Analyze test coverage data from tobari.toon and help improve test coverage incrementally. Use when the user has run go test with tobari enabled (e.g., `GOFLAGS="$(tobari flags)" go test ./...`) and wants to improve test coverage or increase code coverage percentage. Triggers on phrases like "improve coverage", "increase coverage", "coverage improvement", or "add more tests".

Install

npx vskill@latest install goccy/tobari/tobari-coverage-improver

SKILL.md

Improve Test Coverage

This skill analyzes test coverage data from tobari and helps improve test coverage incrementally.

Prerequisites

Ensure you have run tests with tobari enabled:

bash
GOFLAGS="$(tobari flags)" go test ./...

How to Read Coverage Data

  1. Check if TOBARI_COVERDIR environment variable is set:

``bash echo $TOBARI_COVERDIR ``

  1. If set, read $TOBARI_COVERDIR/tobari/tobari.toon
  2. If not set or empty, read ./tobari/tobari.toon from current directory

TOON Format Parsing

The tobari.toon file uses Token-Oriented Object Notation format:

TestName[N]{FileName,StartLine,StartCol,EndLine,EndCol,StatementCount,Count}:
/path/to/file.go,7,24,9,2,1,4
/path/to/file.go,11,29,12,22,1,0
  • Top-level key is the test name (e.g., Add corresponds to TestAdd function)
  • [N] indicates the number of entries
  • Each indented line (starting with tab) is a coverage entry with comma-separated values:
  • FileName: source file path
  • StartLine, StartCol: start position
  • EndLine, EndCol: end position
  • StatementCount: number of statements in this block
  • Count: execution count (0 = not covered)
Reports with passedBlocksOnly

If tobari.toon ends with a passedBlocksOnly[N]: section, the tests listed there come from a binary built with --passed-blocks-only: their per-test lists hold only blocks that were actually passed, so none of their entries has Count = 0. Do not conclude that everything is covered. Derive the full set of blocks from the all[N]: list in the metadata: section instead (each line is FileName,StartLine,StartCol,EndLine,EndCol,StatementCount), and treat a block of all that appears in no test as not covered. If the metadata: section also has a sources[N]{Source,Files}: list and the file ends with a source[N]{Name,Source}: section, the report merges several programs: restrict all to the files of the test's own source.

Calculate Current Coverage

  1. Collect all unique coverage entries across all tests:
  • Key = FileName:StartLine:StartCol:EndLine:EndCol
  • Track: StatementCount, MaxCount (highest Count across all tests)
  1. Calculate coverage rate:

`` TotalStatements = sum of all StatementCount values CoveredStatements = sum of StatementCount where MaxCount > 0 CoverageRate = CoveredStatements / TotalStatements * 100 ``

  1. Report to user:

`` Current coverage: XX.X% (Y of Z statements covered) ``

Improve Coverage Incrementally

Set Target and Improve
  1. Set target: CurrentCoverage + 5% (capped at 100%)
  1. Find uncovered code blocks (where Count = 0 for all tests):
  • Read the source file at those locations
  • Understand what code path leads to that block
  • Determine what test input would exercise that code
  1. Implement improvements:
  • Add new test cases or modify existing ones
  • Follow existing test patterns in the codebase
  • Use table-driven tests when appropriate for Go
  1. Run tests with tobari to verify coverage improved:

``bash GOFLAGS="$(tobari flags)" go test ./... ``

  1. Re-read tobari.toon and calculate new coverage
Report and Confirm

After each improvement cycle:

  1. Show the user:
  • Previous coverage rate
  • New coverage rate
  • What was added/changed
  1. Use AskUserQuestion:
  • Question: "Coverage improved from X% to Y%. How would you like to proceed?"
  • Options:
  • "Continue improving (+5% more)"
  • "Skip confirmations and continue to Z%" (where Z is a target like 80%, 90%, 100%)
  • "Stop here"
  1. If user selects "Skip confirmations":
  • Ask for target percentage if not specified
  • Continue improving without confirmation until target is reached or no more improvements possible
  1. If user selects "Continue", repeat from "Set Target and Improve"

Important Guidelines

  • Focus on meaningful coverage that tests actual behavior, not just line hits
  • Consider edge cases: error paths, boundary conditions, nil/empty inputs
  • When adding tests, follow existing patterns in the codebase
  • Prefer table-driven tests for Go code when testing multiple inputs
  • Don't add tests just to hit lines - ensure tests verify correct behavior
  • If a code path is intentionally unreachable (dead code), suggest removing it instead of adding tests

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
48
Repository forks
2
7-day trend score
19

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 24 Mar 2026, 7 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/goccy/tobari/tobari-coverage-improver/badge)](https://verified-skill.com/skills/goccy/tobari/tobari-coverage-improver)

Something wrong with this skill or its page? Tell us.