rtk-ai / rtk-ai/rtk

feat: add bats/TAP test runner filter

Open
#1,908 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:cli enhancement help wanted priority:medium
Dominant language
Rust
Stars
81k
Forks
5.1k
Avg merge
4d 21h
Merged PRs (30d)
35

Description

Problem

bats (Bash Automated Testing System) outputs TAP (Test Anything Protocol) format. It is the highest-volume unhandled command in real-world Claude Code sessions — 353 calls/month per rtk discover --all across 1,178 sessions and 15,483 Bash commands. Currently passes through unfiltered.

TAP Output Format

1..5
ok 1 - test basic install
ok 2 - test git config
not ok 3 - test brew install
# (from function `assert' in file test_helper.bash, line 12)
#   `assert_success' failed
ok 4 - test skills deploy
ok 5 - test status

Proposed Filter

  • Strip blank lines and bare # comment lines (noise on passing tests)
  • Preserve TAP plan (1..N), passing ok lines, and all failure details (including # context lines)
  • max_lines = 60 to cap runaway output on large suites
  • on_empty = "bats: ok" for empty output

Expected Token Savings

~75% on typical passing runs (blank-line noise removed). Failure output preserved in full — critical for Claude to understand what broke.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests. Start by locating how command filters and their tests are organized, then find the entry point for adding a bats/TAP filter. Done means blank and bare comment lines are removed, plans and passing lines are preserved, failure details remain intact, output is capped at 60 lines, and empty output becomes "bats: ok".

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, rust
Domain
cli, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.