Skip to content

Next release#581

Open
aeppling wants to merge 49 commits intomasterfrom
develop
Open

Next release#581
aeppling wants to merge 49 commits intomasterfrom
develop

Conversation

@aeppling
Copy link
Contributor

No description provided.

gula00 and others added 30 commits March 8, 2026 09:14
Add rewrite rules for all TOML-filtered commands so the Claude Code
hook automatically rewrites them to `rtk proxy <cmd>`. This ensures
TOML filters apply transparently without manual `rtk` prefixing.

Commands added: ansible-playbook, brew, composer, df, dotnet, du,
fail2ban-client, gcloud, hadolint, helm, iptables, make,
markdownlint, mix, mvn, ping, pio, poetry, pre-commit, ps, quarto,
rsync, shellcheck, shopify, sops, swift, systemctl, terraform, tofu,
trunk, uv, yamllint.

Tests updated to use `htop` as unsupported command example since
terraform is now supported via TOML filter.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
…) (#478)

Only inject -10 limit when RTK applies its own compact format.
When user provides --oneline/--pretty/--format, respect git's
default behavior (no limit). Also detect -n and --max-count as
user-provided limit flags.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
Add --job and --attempt to flags_with_value in
extract_identifier_and_extra_args() so their values are not
mistaken for the run identifier when placed before it.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
…#479)

Add Language::Data variant for JSON, YAML, TOML, XML, Markdown, CSV
and other data formats. These files have no comment syntax, so the
MinimalFilter skips comment stripping entirely.

Previously, `packages/*` in package.json was treated as a block
comment start (`/*`), causing everything until the next `*/` to be
stripped — corrupting the JSON structure.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
* fix: npm routing, discover cat redirect, proxy quoted args (#470, #315, #388)

#470: rtk npm now correctly routes npm subcommands (install, list,
audit, etc.) without injecting "run". Previously, `rtk npm install`
was executed as `npm run install`.

#315: discover no longer counts `cat >`, `cat >>`, `cat |` as missed
savings. These are write/pipe operations with no terminal output to
compress.

#388: rtk proxy now auto-splits a single quoted argument containing
spaces. `rtk proxy 'head -50 file.php'` now works like
`rtk proxy head -50 file.php`.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

* fix: proxy quote-aware split, redirect detection scan all tokens, npm test routing

- Proxy: replace split_whitespace with shell_split() that respects quotes (#388)
  e.g. 'git log --format="%H %s"' no longer splits on space inside quotes
- Discover: scan all tokens for redirect operators, not just nth(1) (#315)
  e.g. 'cat file.txt > output.txt' now correctly detected as write
- npm: replace tautological test with actual routing logic verification

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

---------

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
… ty, skopeo, stat, biome, oxlint, jj, ssh, gcc) (#490)

Closes #484, #483, #449, #448, #428, #283, #316, #195, #271, #333, #87, #376

Signed-off-by: Patrick <patrick@rtk.ai>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
* fix: rtk rewrite accepts multiple args without quotes

`rtk rewrite ls -al` now works the same as `rtk rewrite "ls -al"`.
Previously, args after the command were rejected or caused ENOENT.

Also adds rewrite tests to benchmark.sh to prevent regression.

Signed-off-by: Patrick Szymkowiak <patrick.szymkowiak@rtk-ai.app>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

* test: add Clap rewrite tests + fix benchmark false failures

- Add 2 Clap try_parse_from tests for rewrite multi-args (catches the
  KuSh bug at unit test level, not just benchmark)
- Fix git diff benchmark: use HEAD~1 on both sides for fair comparison
- Skip cargo/rustc benchmarks when tools not in PATH instead of false FAIL
- Benchmark: 0 fail, 4 skip (env-dependent), 52 green

Signed-off-by: Patrick Szymkowiak <patrick.szymkowiak@rtk-ai.app>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

---------

Signed-off-by: Patrick Szymkowiak <patrick.szymkowiak@rtk-ai.app>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
)

- Replace all 32 `rtk proxy <cmd>` rules with `rtk <cmd>` so TOML filters
  actually apply (proxy bypasses filters, giving 0% real savings)
- Extract NPM_SUBCOMMANDS to module-level const to prevent test/prod drift

Reported-by: FlorianBruniaux

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
- hook_check: detect missing hook (not just outdated), warn with ⚠️
  Only warns if ~/.claude/ exists (Claude Code user) — once per day
- gain: show hook status warning (missing/outdated) in rtk gain output
- ssh.toml: bump max_lines 50→200, truncate_lines_at 120→200 (Florian review)
- git.rs: mark integration test #[ignore] + assert binary exists (Florian review)
- Add HookStatus enum for reuse across gain/diagnostics

Fixes #508, Fixes #509

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
- status() checks .claude/ existence (no false warning for non-CC users)
- Unreadable hook file returns Outdated not Missing
- Swap marker/warning order (emit warning before touching rate-limit marker)
- Rename misleading test, add end-to-end status() test

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
…uncate

- Refactor check_and_warn to delegate to status() (single source of truth)
- Fix double-warning: skip maybe_warn() for `rtk gain` (has its own inline warning)
- Fix git test: case-insensitive assertion for cross-locale compatibility
- ssh.toml: keep truncate_lines_at=120 (terminal width convention)
- Robust mtime handling: unwrap_or(u64::MAX) instead of nested .ok()?
- Test handles all CI environments (no hook, no .claude, hook present)

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
- discover: count RTK_DISABLED= bypassed commands, report top 5 examples
- gain: lightweight 7-day JSONL scan, warn if >10% commands bypassed
- registry: add has_rtk_disabled_prefix() and strip_disabled_prefix() helpers
- gitignore: add .fastembed_cache/ and .next/

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
- apply_line_window() now preserves trailing newline when input has one
- Add test for tail --lines N (space form) rewrite
- Add test for tail_lines without trailing newline

Signed-off-by: Patrick <patrick@rtk-ai.com>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
fix: handle tail rewrites with read tail-lines
…ting

RTK was silently capping git log output in two ways:
1. `--oneline` without `-N` defaulted to 10 entries (now 50)
2. `filter_log_output()` re-truncated even when user explicitly set `-N`
3. Lines >80 chars were truncated, hiding PR numbers and author names

This matters for LLM workflows: Claude needs full commit history for
rebase, squash, and changelog operations. Silent truncation caused
incomplete context and repeated re-runs.

Changes:
- User-explicit `-N` → no line cap, wider 120-char truncation
- `--oneline`/`--pretty` without `-N` → default 50 (was 10)
- No flags → unchanged (default 10)
- Extract `truncate_line()` helper for clarity

Fixes #461

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Extract parse_user_limit() to handle all 4 forms: -20, -n 20, --max-count=20, --max-count 20
- Add token savings test for filter_log_output (≥60%)
- Add 5 tests for parse_user_limit edge cases

Signed-off-by: Patrick <patrick@rtk-ai.com>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
fix: respect user-specified git log limits (#461)
Integrate PR #172 by @danielmarbach onto develop:
- MSBuild binlog parser (binary format, gzip, 7-bit varint)
- TRX test result parser (quick-xml)
- Format report JSON parser
- Subcommand routing: build, test, restore, format + passthrough
- Sensitive env var scrubbing (GH_TOKEN, AWS_SECRET_ACCESS_KEY, etc.)
- Fallback to text parsing when binlog unavailable
- 86-93% token savings on real .NET projects

Maintainer fixes applied:
- Removed binlog temp path from output (wastes tokens)
- Dropped hook file changes (incompatible with develop architecture)
- Fixed unused variable warnings

888 tests pass.

Signed-off-by: Patrick <patrick@rtk-ai.com>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
Add structured rtk dotnet support (build/test/restore) with binlog/TRX parsing, robust argument forwarding, and locale-stable fallback behavior
* feat(opencode): add OpenCode plugin support

Add `--opencode` flag to `rtk init` for installing a global OpenCode
plugin that rewrites Bash/shell commands through `rtk rewrite`.

- New plugin: hooks/opencode-rtk.ts (thin delegator to rtk rewrite)
- New init modes: --opencode (OpenCode only), combinable with Claude modes
- Plugin install/update/remove lifecycle with idempotent writes
- Uninstall cleans up OpenCode plugin alongside Claude Code artifacts
- `rtk init --show` reports OpenCode plugin status
- Replace unreachable!() with bail!() in match exhaustiveness guard

* docs: add OpenCode plugin documentation

- README: OpenCode plugin section, install flags, troubleshooting
- TROUBLESHOOTING: OpenCode-specific checklist
- Update init mode table to reflect Claude Code default
Signed-off-by: Frank <97429702+tsubasakong@users.noreply.github.com>
- add PATHEXT-aware command resolution via which\n- migrate affected command runners to resolved_command\n- add regression coverage for wrapper/fallback behavior
Release-please bumps Cargo.toml but not docs, causing the version
grep to fail after every release. The check adds no value since docs
don't need to track the exact patch version.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
Call skip_test instead of nonexistent skip function, consistent
with all other conditional sections (Python, Go, tree, etc.).

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
Closes #467

git log now includes %b (body) in the format string and extracts the
first meaningful line (skipping Signed-off-by/Co-authored-by trailers),
displayed indented under the header. This preserves BREAKING CHANGE
notices, Closes references, and design context for LLM agents.

Also fixes resolved_command assertion in test and missing truncate
import in cargo_cmd.rs (both from PR #269 rebase).

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
fix: preserve commit body in git log output
Adds 4 Claude Code slash commands for git worktree management, adapted
from MethodeAristote project (Rust/cargo instead of pnpm/TypeScript).

Commands:
- /worktree <branch>: creates worktree + background cargo check
  - --fast: skip cargo check (instant)
  - --check: blocking cargo check before ready
- /worktree-status <branch>: check background cargo check result
- /clean-worktrees: auto-remove all merged worktrees (--dry-run support)
- /clean-worktree: interactive cleanup with confirmation

Also adds .worktrees/ to .gitignore (required by /worktree command).

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
…491)

* feat: add Claude Code tooling — agents, commands, rules, skills

Port and adapt 15 Claude Code artifacts from MethodeAristote/ccboard
to RTK's Rust/CLI context. All TypeScript/web-specific references
replaced with Rust idioms, cargo toolchain, and RTK constraints.

## Agents (2)

- **code-reviewer** (rewrite): RTK-specific red flags table
  (Regex::new in fn, unwrap in prod, async deps, no fallback, no savings
  test), defensive patterns with before/after examples, adversarial
  questions for RTK (savings ≥60%, fallback, startup, exit code,
  cross-platform, ANSI, fixtures)

- **system-architect** (new): RTK architecture map, filter module
  pattern (Pattern 1-4), TOML DSL vs Rust decision guide, performance
  budget (<10ms startup, <5MB binary), module boundary definitions

## Commands (7, under .claude/commands/tech/)

- **worktree**: Creates git worktrees with background `cargo check
  --all-targets`, `--fast`/`--no-check` flags, branch naming
  `feature/xxx` → `.worktrees/feature-xxx`

- **worktree-status**: Checks background cargo check log
  (`/tmp/worktree-cargo-check-{branch}.log`)

- **remove-worktree**: Removes worktree + git ref + branch, protected
  branches: `master`/`main`

- **clean-worktrees**: Auto-removes worktrees on branches merged into
  master (`git branch --merged master`)

- **clean-worktree**: Interactive cleanup with `y/N` prompt

- **codereview**: Pre-PR review, base `master`, 🔴 checks for
  `unwrap()`, non-lazy regex, missing `.context()`, async deps, missing
  token savings tests; `--auto` mode runs `cargo fmt + clippy + test`

- **audit-codebase**: 7-category health audit scored 0-10 (secrets,
  security, deps via cargo audit, structure, tests, perf <10ms, AI
  patterns), weighted global score

## Rules (2, under .claude/rules/)

- **search-strategy**: Navigation codebase RTK — module map, priority
  order (Grep > Glob > Read > Explore), patterns for finding commands,
  filter functions, lazy_static regexes, test coverage, TOML filters

- **rust-patterns**: RTK non-negotiables (no async, lazy_static
  mandatory, fallback pattern, exit code propagation) + idiomatic Rust
  (iterators, ownership, error handling, module structure template,
  anti-patterns table)

## Skills (4, under .claude/skills/)

- **code-simplifier**: Rust simplification patterns (iterator chains,
  string joining, Option/Result chaining, early returns, clone removal),
  RTK guard-rails (never simplify away lazy_static, .context(), fallback)

- **performance**: Startup benchmark (hyperfine), binary size
  (cargo-bloat), memory profiling (/usr/bin/time), regex compilation
  audit, forbidden deps table, before/after regression template

- **design-patterns**: Rust patterns for RTK — Newtype (type safety),
  Builder (complex config), State Machine (multi-phase output parsing),
  Trait Object (command dispatch), RAII, Extension Trait; selection guide
  + anti-patterns

- **tdd-rust**: Full Red-Green-Refactor workflow — real fixtures capture,
  snapshot tests (insta), count_tokens() savings assertion (≥60%),
  fallback test, ANSI stripping test, Arrange-Act-Assert pattern,
  "done" checklist

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>

* chore: update version references to 0.28.2

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>

---------

Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
…clarify

docs: clarify Bash-only auto-rewrite scope
aeppling and others added 15 commits March 13, 2026 13:24
- Cleaned all files for a more reusable cicd
- Added pre-release on develop
- Added jobs dependencies to gain time (avoid running all if mandatory fail)
- Add CICD.md documentation
Shows last 10 Claude Code sessions with RTK vs raw command ratio,
adoption percentage, and output token count. Reuses ClaudeProvider
from discover module — zero JSONL parsing duplication.

Also fixes missing `truncate` import in cargo_cmd.rs (pre-existing
build error on develop).

Closes #487

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
Replace trivial progress bar tests with meaningful tests:
- Parse JSONL with mixed rtk/raw commands, verify counts
- Verify non-Bash tools (Read/Grep) are ignored
- Verify empty sessions produce no commands
- Test count_rtk_commands with all-rtk, no-rtk, mixed, empty

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
The regex pattern for git commands now accepts -C and -c flags
before the subcommand, using a non-capturing group to preserve
subcommand extraction.

Closes #555

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
The hook rewrites "git status" → "rtk git status" but JSONL logs the
original command. count_rtk_commands now uses classify_command() to
also count commands the hook would rewrite, giving realistic adoption
percentages (68% vs previous 2%).

Also adds rtk session to README.md documentation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
Commands like "cd ./path && rtk ls" are now split via
split_command_chain() before classification, matching the
discover module's behavior. Each part is counted independently.

4 tests added: chain with &&, semicolons, all-supported,
and JSONL integration with chained command.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
…fix/cicd-rework

Signed-off-by: aesoft <43991222+aeppling@users.noreply.github.com>
feat: add rtk session command for adoption overview
@aeppling
Copy link
Contributor Author

30 commits, key areas:

New Features:

  1. dotnet support (build/test/restore/format)
  2. OpenCode plugin support
  3. 11 new TOML built-in filters (xcodebuild, jq, basedpyright, ty, skopeo, stat, biome, oxlint, jj, ssh, gcc)
  4. 32 TOML-filtered commands in hook rewrite rules
  5. Git log body preservation
  6. RTK_DISABLED overuse warning
  7. Hook check edge cases
  8. Claude Code tooling — 2 agents, 7 commands, 2 rules, 4 skills
  9. Worktree slash commands for isolated development
  10. Warn when no hook installed + rtk gain hook status
  11. Rewrite uses rtk instead of rtk proxy for TOML-filtered commands

Bug Fixes:

  1. Git log truncation (-n N, --max-count=N)
  2. Git log --oneline no longer silently truncated to 10 entries
  3. Tail rewrite with read tail-lines
  4. Trailing newline preserved in tail_lines
  5. rtk read JSON corruption with glob patterns
  6. gh run view --job flag value loss
  7. Windows command wrapper execution
  8. npm routing, discover cat redirect, proxy quoted args
  9. rtk rewrite accepts multiple args without quotes
  10. Double-warning prevention, case-sensitive test, ssh truncate
  11. test-all.sh aborts when gt not installed
  12. Remove version check from validate-docs CI

Docs:

  1. Clarify Bash-only auto-rewrite scope

AbdoD97 pushed a commit to AbdoD97/rtk that referenced this pull request Mar 14, 2026
Merges rtk-ai/rtk develop → master changes:
- .NET support (build/test/restore/format, 86-93% token savings)
- OpenCode plugin support (--opencode flag for rtk init)
- 11 new TOML filters (xcodebuild, jq, biome, oxlint, jj, etc.)
- Windows PATHEXT resolution via resolved_command() + which crate
- Git log: preserve commit body, respect user limits, default 50 entries
- RTK_DISABLED overuse warning (>10% bypass detection)
- rtk session command for adoption overview
- Proxy command quote-aware argument splitting
- Fix gh run view --job flag value loss
- Fix npm routing for subcommands

Resolved conflicts: .gitignore, Cargo.toml/lock, TROUBLESHOOTING.md,
src/dotnet_cmd.rs, src/git.rs, src/main.rs, src/npm_cmd.rs

https://claude.ai/code/session_01HHvn5KeSYfXjj9uyRiJbuL
@aeppling
Copy link
Contributor Author

Issue found -> rtk verify : 104/111 tests passed on new filters

@aeppling
Copy link
Contributor Author

Issue found -> rtk verify : 104/111 tests passed on new filters

#594

Signed-off-by: aesoft <43991222+aeppling@users.noreply.github.com>
fix(cicd): Clean cicd, rework depends and add pre-release
fix: align 7 TOML filter tests with on_empty behavior
@aeppling
Copy link
Contributor Author

bug found in pre-release

"rtk git log --oneline -N" shows 2 instead of N (does not bypass rtk limit)
This only happen when using the "--oneline" flag

Copy link
Collaborator

@FlorianBruniaux FlorianBruniaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants