* docs: bump version refs to 0.27.1, fix module count to 59
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor(filters): split monolithic builtin_filters.toml into 28 individual files
Replace the 848-line src/builtin_filters.toml monolith with individual
files under src/filters/<name>.toml (1 filter + tests per file).
Files are concatenated alphabetically by build.rs at compile time into
OUT_DIR/builtin_filters.toml, then embedded via a BUILTIN_TOML constant
in toml_filter.rs. The build step validates TOML syntax and detects
duplicate filter names across files.
Benefits:
- Zero merge conflicts when multiple PRs add filters (different files)
- Clear PR diffs: "+1 file of 30 lines" vs "+30 lines in 850-line file"
- Easy onboarding: copy any .toml, rename, edit 3 fields — done
- Build-time TOML validation catches syntax errors before tests run
Changes:
- build.rs (new): concat + validate src/filters/*.toml
- Cargo.toml: add [build-dependencies] toml = "0.8"
- src/filters/*.toml (28 files): split from monolith
- src/filters/README.md (new): contributor guide
- src/toml_filter.rs: BUILTIN_TOML const + 5 include_str replacements
- src/builtin_filters.toml: deleted
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(filters): add 15 TOML filters (ping, rsync, dotnet, swift, shellcheck, hadolint, poetry, composer, brew, df, ps, systemctl, yamllint, markdownlint, uv)
Tier 1 (high value):
- ping: strip per-packet lines, tail_lines=4 keeps summary only (70%+)
- rsync: match_output on "total size is" → "ok (synced)" (80%+)
- dotnet-build: match_output on "Build succeeded" → "ok (build succeeded)" (70%+)
- swift-build: match_output on "Build complete!" → "ok (build complete)" (70%+)
- shellcheck: strip blank lines + caret indicator lines, max_lines=50 (60%+)
- hadolint: strip blank lines, truncate_lines_at=120, max_lines=40 (60%+)
- poetry-install: strip downloads, match_output on "No dependencies to install" (75%+)
- composer-install: strip downloads, match_output on "Nothing to install" (75%+)
- brew-install: strip Downloading/Pouring, match_output on "already installed" (70%+)
Tier 2 (medium value):
- df: truncate_lines_at=80, max_lines=20 (60%+)
- ps-aux: truncate_lines_at=120, max_lines=30 (60%+)
- systemctl-status: strip blank lines, max_lines=20 (65%+)
- yamllint: strip blank lines, max_lines=50, truncate_lines_at=120 (60%+)
- markdownlint: strip blank lines, max_lines=50, truncate_lines_at=120 (60%+)
- uv-sync: strip downloads, match_output on "Audited"/"Resolved" (70%+)
Updates test guards: count 29→44, expected list +15 names, concat test 30→45.
All 90 inline TOML tests pass. 720 unit tests pass.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(filters): address PR #386 code review (P1 + P2 items)
P1-2: rsync.toml — remove dead strip rule "^total size is \d"
match_output fires at stage 3, strip at stage 4 — the rule was
unreachable on success and removed a useful line on error paths.
P2-1: ps-aux.toml renamed to ps.toml, match_command ^ps\b → ^ps(\s|$)
Prevents false matches on pstree, psql, pstack. Filter name and
test sections updated from ps-aux to ps. Guard list updated.
P2-2: df.toml match_command ^df\b → ^df(\s|$)
Prevents false matches on dfs, dfx.
P2-4: shellcheck.toml — keep caret indicator lines (^-- SC...)
Stripping them lost the exact character position of the error.
Only blank lines are now stripped.
P2-7: swift-build.toml — remove dead strip rule "^Build complete!"
match_output short-circuits before strip runs on success paths.
The rule was unreachable and confusing.
All 90 inline tests pass. 720 unit tests pass.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: address PR #386 code review — 4 filter fixes
- uv-sync: remove Resolved short-circuit (fires before package list)
- dotnet-build: short-circuit only on 0 warnings + 0 errors (not on
any "Build succeeded" — catches builds with warnings too)
- poetry-install: support Poetry 2.x bullet syntax (• vs -) and
"No changes." message; add Poetry 2.x test
- ping: add Windows format support (Pinging + Reply from patterns);
add Windows test
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs(changelog): document round 2 fixes (PR #351 + #386)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: rebase on updated PR #351 — remove 7 dead filters re-added by rebase
Rebase on feat/toml-dsl-pr2 (post-PR-#349 fixes) caused the refactor
commit to re-add dead filters that PR #351 had already removed:
cargo-run, docker-compose-ps, docker-inspect, git-checkout,
git-merge, git-remote, pnpm-build.
These 7 files are removed to maintain the expected 36 filter count.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(dsl): add 'unless' to match_output — prevent short-circuit when errors present
Fixes two match_output bugs where success short-circuit fires before
strip_lines_matching can surface errors in the full output blob.
Changes:
- Add optional `unless` field to MatchOutputRule (serde default = None)
- Compile `unless` into Option<Regex> in CompiledMatchOutputRule
- In apply_filter stage 3: if `unless` matches the blob, skip the rule
and continue to the next match_output rule (or fall through to the pipeline)
- rsync.toml: add `unless = "error|failed|No such file"` to the
"total size is" rule; add test verifying errors are not swallowed
- swift-build.toml: add `unless = "warning:|error:"` to the
"Build complete!" rule; add test verifying warnings are not swallowed
- CONTRIBUTING.md: document match_output[].unless in the field reference table
- Unit tests: 5 new tests covering unless blocks/allows/falls-through/
no-regression/invalid-regex
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs: fix README version string 0.27.1 → 0.27.2 after rebase
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs: fix version 0.27.1→0.27.2 and module count 59→60 in ARCHITECTURE.md + CLAUDE.md
Version strings and module count were stale after rebase onto
updated feat/toml-dsl-pr2. validate-docs.sh now passes clean.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: TOML filter DSL + 14 built-in filters (#299)
Add a declarative TOML-based filter engine for zero-Rust command
filtering, plus 14 built-in filters targeting open issues.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs: update module count to 58 (toml_filter + verify_cmd)
* docs(changelog): add TOML DSL + 14 built-in filters entry
* chore: ignore worktrees directory
* fix: address PR #349 code review (P1 + P2)
P1-1: println! — add trailing newline to TOML-filtered output
print!("{}", filtered) → println!("{}", filtered). Fixes broken
pipe compatibility (rtk make all | wc -l returned 0 for 1 line).
P1-2: remove dead filters — git-checkout, git-remote, git-merge, cargo-run
Clap routes these commands to git.rs/cargo_cmd.rs before run_fallback
is reached, so these TOML filters never activate. Tests passed but
gave false confidence. Removed filter definitions and test sections.
P1-3: map_or instead of is_none_or (MSRV compatibility)
is_none_or requires Rust 1.82+. Replaced with map_or(true, ...) which
compiles on all supported toolchain versions.
P1-4: print tee hint for TOML-filtered commands on failure
let _ = tee::tee_and_hint(...) silently discarded the hint path.
Now follows the same pattern as runner.rs: if let Some(hint) = ... {
println!("{}", hint); }. LLMs can now find the full output file.
P1-5: --require-all now runs integrity check
Previously, `rtk verify --require-all` branched away from
integrity::run_verify(). Now: filter-specific mode (--filter foo)
skips integrity, but default and --require-all always run it first.
P2-1: RTK_NO_TOML checks value not presence
.is_ok() matched any value including RTK_NO_TOML=0.
Replaced with .ok().as_deref() == Some("1").
P2-5: terraform-plan regex — add word boundary after "plan"
^terraform\s+plan → ^terraform\s+plan(\s|$) to prevent matching
"terraform planning" or other plan-prefixed subcommands.
P2-6: iptables regex — \b → (\s|$)
^iptables\b matched iptables-save and iptables-restore (\b fires at
hyphen). Fixed to ^iptables(\s|$).
All 715 tests pass.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: add word-boundary anchors to 6 tofu/mix match_command regexes
Prevents overmatch on subcommands (e.g. `tofu planet` or `mix formats`).
Mirrors the same `(\s|$)` pattern already used by terraform-plan.
Fixes: tofu-plan, tofu-init, tofu-validate, tofu-fmt, mix-format, mix-compile
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs(changelog): add round 2 fix for tofu/mix regex overmatch (PR #349)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: address PR #349 round 3 review (BUG-1 + BUG-2 + P2 items)
- println! trailing newline on TOML-filtered output (BUG-1)
- RTK_NO_TOML check presence→value (as_deref==Ok("1")) (BUG-2)
- make filter: add on_empty="make: ok" + test (P2-3)
- TOML lookup: use basename of args[0] for absolute path support (P2-8)
- utils.rs: translate French docstrings to English (P2-9)
- main.rs: single error message on command-not-found, exit(127) (NEW)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs: bump version refs to 0.27.2 and module count to 60
Fixes pre-push validation: README, CLAUDE.md, ARCHITECTURE.md were
still referencing 0.27.1 (Cargo.toml is 0.27.2). Also updates module
count from 59 to 60 to match main.rs (toml_filter + verify_cmd).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
When running `rtk lint npx eslint ...`, args[0] was "npx" instead of
"eslint", causing no JSON format flag injection and duplicated output.
Extract strip_pm_prefix() and detect_linter() helpers, skip package
manager prefixes before identifying the actual linter name.
gh view/checks commands (pr view, issue view, pr checks, run view)
were ignoring extra flags like -R/--repo, causing failures outside
git repositories where gh needs -R to know which repo to query.
The root cause: these functions took args[0] as the identifier and
discarded everything else, while constructing hardcoded gh commands.
Changes:
- Add extract_identifier_and_extra_args() to separate the positional
identifier from flags, handling both `view 123 -R owner/repo` and
`view -R owner/repo 123` argument orders
- Pass extra args through to gh in view_pr, view_issue, pr_checks,
and view_run
- Add has_json_flag() check at top of run() to passthrough when user
explicitly requests --json output (related fix from #313)
Fixes#223
* fix: gh pr edit/comment pass correct subcommand to gh
pr_action was receiving the past-tense display label ("edited",
"commented") and using it as both the gh subcommand and the
ok_confirmation message. This caused `gh pr edited` to be invoked
instead of `gh pr edit`, which fails with "unknown flag" errors.
Split the parameter into subcmd (for the gh invocation) and
display_label (for ok_confirmation output).
* smaller diff
Clap was rejecting -a, --amend, --allow-empty etc. because Commit only
declared -m/--message. Switch to trailing_var_arg like other git
subcommands so all flags pass through to git directly.
Fixes#327
* fix: prettier reports "All OK" when not installed (#221)
Empty or failed prettier output was incorrectly treated as "all files
formatted". Now detects empty output and non-zero exit code, shows the
actual error message instead of a false positive.
* test: add smoke tests for rewrite, verify, proxy, discover, diff, wc, smart, docker, json edge cases
Covers bug fixes#196, #344, #345, #346, #347 and previously untested
commands. Adds assert_fails helper. 118 assertions total (was 69).
* chore: update benchmark.sh with missing commands and fix paths
- Add cargo (build/test/clippy/check), diff, smart, wc, curl, wget sections
- Fix Python commands: use dedicated rtk ruff/pytest instead of rtk test
- Fix Go commands: use dedicated rtk go/golangci-lint, add go build/vet
- Make BENCH_DIR absolute so debug files work from temp fixture dirs
- Fallback to installed rtk if target/release/rtk not found
The rewrite pattern matched all `docker` commands but the regex didn't
cover `docker compose`, so compose subcommands were never rewritten.
Meanwhile unsupported compose commands (up, down, config) would fail
if manually prefixed with rtk.
- Extend regex to match `docker compose (ps|logs|build)`
- Unsupported compose subcommands (up, down, config, exec, etc.) are
correctly skipped by the regex and not rewritten
- 6 new tests covering supported and unsupported compose subcommands
Fixes#336
Two fixes for command passthrough issues:
1. Restore `--` separator stripped by clap (#287): When running
`rtk cargo test -- --nocapture`, clap consumes `--` and passes only
`["--nocapture"]` to cargo, which rejects it. Now detect `--` from
the original command line and re-insert it in the correct position.
2. Remove noisy `[rtk: parse failed, running raw]` stderr message (#286):
Unrecognized commands like `rtk make` or `rtk ruby` pass through
silently via the fallback, matching the documented behavior.
Fixes#286Fixes#287
Version mentions (README.md, CLAUDE.md, ARCHITECTURE.md) were still
on 0.25.0. Module count was 56 (missed hook_check module added in #350).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- #345: rewrite_segment() now returns None when env_prefix contains
RTK_DISABLED= — prevents rewriting commands the user explicitly
opted out of
- #346: rewrite_compound() detects redirect operators (2>&1, >&2,
&>/dev/null, &>>) before treating bare & as background operator —
fixes corrupted compound commands containing stderr redirects
- #347: validate_json_extension() helper added to json_cmd.rs — early
rejection with clear error message for TOML/YAML/XML/CSV/etc. files,
with a dedicated tip for Cargo.toml (suggests rtk deps)
Tests: 16 new unit tests (4 + 6 + 6), 7 new hook integration tests.
All 672 tests pass. Quality gate clean.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add Claude Code skills for PR and issue triage
Two skills that power structured audits directly in Claude Code sessions.
They replace ad-hoc manual reviews with a repeatable, documented workflow.
**`/pr-triage`** — Pull request audit
Scans open PRs, runs deep review on selected ones, and posts formatted
review comments to GitHub. Covers code quality, test coverage, security
surface, and alignment with CLAUDE.md conventions. Useful before every
merge and for contributor onboarding.
**`/issue-triage`** — Issue audit
Audits open issues, auto-categorizes (bug/feature/doc/question), detects
duplicates, cross-references related PRs, and estimates risk/priority.
Posts structured comments so maintainers have a clear action queue.
Both skills integrate with the `gh` CLI and can be invoked with args:
/pr-triage 42 57 — deep review of specific PRs
/pr-triage all — full audit of all open PRs
/issue-triage — audit-only mode (no comments posted)
/issue-triage all en — deep analysis, English output
These reduce the overhead of code review and issue management to a single
slash command, keeping context inside the Claude Code session.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs: fix version references 0.24.0 → 0.25.0 and module count (pre-existing)
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: curl size guard (#297) + exclude_commands config (#243)
**#297 — curl JSON inflation guard**
- `rtk curl` no longer replaces small JSON responses with a type schema
that is larger than the original payload
- Size guard in `filter_curl_output()`: only return schema when
`schema.len() <= original.len()`
- Inspired by PR #324 (@rursache)
**#243 — exclude_commands config**
- Add `[hooks] exclude_commands = ["curl"]` in config.toml to prevent
the auto-rewrite hook from rewriting specific commands
- Survives `rtk init -g` re-runs (config.toml is user-owned)
- Implemented in `rewrite_cmd::run()` via `HooksConfig` struct
- Threaded through `rewrite_command()` → `rewrite_compound()` → `rewrite_segment()`
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs: add #297 and #243 to CHANGELOG + exclude_commands in README
* docs: fix version references 0.24.0 → 0.25.0 across all docs
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>