rtk-ai/rtk

dotnet test/format/restore not matched by rtk rewrite (discover rules missing)

Open

#1,207 建立於 2026年4月11日

在 GitHub 查看
 (2 留言) (0 反應) (0 負責人)Rust (48,085 star) (2,914 fork)batch import
bugeffort-smallgood first issue

描述

Description

rtk dotnet test, rtk dotnet format, and rtk dotnet restore all work correctly and produce excellent filtered output. However, rtk rewrite does not match these commands, so the PreToolUse hook never rewrites them — they pass through unfiltered.

dotnet build is correctly matched by the rewrite registry, but the other three subcommands are not.

Reproduction

$ rtk rewrite "dotnet build"
rtk dotnet build          # exit 3 ✓

$ rtk rewrite "dotnet test"
                          # exit 1 — no match

$ rtk rewrite "dotnet format"
                          # exit 1 — no match

$ rtk rewrite "dotnet restore"
                          # exit 1 — no match

Meanwhile, the proxied commands work perfectly:

$ rtk dotnet test Project.Tests.csproj --no-build --filter "Category!=Integration" --verbosity minimal
ok dotnet test: 20 tests passed, 0 warnings in 1 projects (936 ms)

Impact

In a large .NET monorepo, dotnet test without --no-build produces 101 lines / 20 KB of output (restore, build warnings, project compilation lines). The actual test result is 3 lines. rtk dotnet test compresses this to 1 line / ~70 bytes — a 97% reduction.

From rtk discover in our environment:

  • dotnet test: 309 missed commands → estimated ~1.5M tokens saveable
  • dotnet format: 40 missed commands
  • dotnet restore: not tracked separately but included in dotnet test runs without --no-build

Environment

  • rtk 0.35.0 (Homebrew, macOS arm64)
  • Claude Code with PreToolUse hook (rtk-hook-version: 3)
  • .NET 10.0

Note

PR #1111 by @Dmitrii-Sokolov appears to address this. This issue is filed for tracking/discoverability.

貢獻者指南

dotnet test/format/restore not matched by rtk rewrite (discover rules missing) · rtk-ai/rtk#1207 | Good First Issue