Token-optimized commands
Follow rtk.md: exact output and real exit codes win over
compression. A wrapper is not verification and never expands authority.
- If
rtk is not on PATH, use normal tools; do not install it or block work.
- For human-readable output, let the configured PreToolUse hook rewrite Bash
commands (for example
git status → rtk git status). Without that hook,
prefix each supported command, including each command in an && chain.
- For parsed output, exact paths/content/Git state, structured diagnostics or
output that decides the next action, use
rtk proxy <cmd> (or the plain
command when no hook rewrites it). Never sacrifice the producer's exit status.
- If a wrapped command fails, read the actual error and retry through
rtk proxy before concluding the tool, path or repository is missing.
- Keep native commands in scripts, hooks and CI; do not add rtk to them.
Examples:
rtk git status
rtk proxy git diff --cached
rtk proxy git status --porcelain
For builds, lint and specs use the repository's authorized gate command. Do not
pipe a build or test into grep, sort, head or tail as gate evidence.
A filtered zero-error summary is not a successful check.
Supported output families
- Files:
ls, tree, read, find, grep, diff.
- Git and GitHub:
git status/log/diff/add/commit/push/pull, gh pr/issue/run ….
- Tests:
dotnet test, Jest, Vitest, Playwright, pytest, Go, Cargo, RSpec.
- Build and lint:
dotnet build, tsc, ESLint, Biome, Prettier, Cargo Clippy,
Ruff, golangci-lint, Rubocop.
- Package managers: pnpm/npm/yarn, pip, Bundler, Prisma.
- Cloud and containers: AWS CLI, Docker, Kubernetes, OpenShift.
Built-in tools and audits
Bash hooks do not wrap built-in Read/Grep/Glob tools. For broad exploration use
rtk read, rtk grep or rtk find in the terminal to reduce output. For small,
precise reads and exact replacement text, use the built-in file tools: rtk can
filter away the line needed for an edit. Raw output remains mandatory whenever
it drives an operation.
Use rtk gain to inspect savings and rtk discover to find commands that missed
compression. These are optimization aids, not quality-gate evidence. The rtk
project is at https://github.com/rtk-ai/rtk; setup is a human's responsibility.
1---2name: cratis-rtk3description: Use before choosing command-output wrappers, or when a wrapped command fails and exact diagnostics or parsed output are needed. Not for execution permission, CI-gate selection or rewriting repository scripts around rtk.4license: LICENSE5compatibility: Local shell; rtk is optional and must already be installed.6metadata:7 source: https://skillmd.com/skills/cratis/cratis-rtk8---910<!-- Copyright (c) Cratis. All rights reserved. -->11<!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->1213# Token-optimized commands1415Follow [rtk.md](../../rules/rtk.md): exact output and real exit codes win over16compression. A wrapper is not verification and never expands authority.17181. If `rtk` is not on `PATH`, use normal tools; do not install it or block work.192. For human-readable output, let the configured PreToolUse hook rewrite Bash20 commands (for example `git status` → `rtk git status`). Without that hook,21 prefix each supported command, including each command in an `&&` chain.223. For parsed output, exact paths/content/Git state, structured diagnostics or23 output that decides the next action, use `rtk proxy <cmd>` (or the plain24 command when no hook rewrites it). Never sacrifice the producer's exit status.254. If a wrapped command fails, read the actual error and retry through26 `rtk proxy` before concluding the tool, path or repository is missing.275. Keep native commands in scripts, hooks and CI; do not add rtk to them.2829Examples:3031```sh32rtk git status33rtk proxy git diff --cached34rtk proxy git status --porcelain35```3637For builds, lint and specs use the repository's authorized gate command. Do not38pipe a build or test into `grep`, `sort`, `head` or `tail` as gate evidence.39A filtered zero-error summary is not a successful check.4041## Supported output families4243- Files: `ls`, `tree`, `read`, `find`, `grep`, `diff`.44- Git and GitHub: `git status/log/diff/add/commit/push/pull`, `gh pr/issue/run …`.45- Tests: `dotnet test`, Jest, Vitest, Playwright, pytest, Go, Cargo, RSpec.46- Build and lint: `dotnet build`, `tsc`, ESLint, Biome, Prettier, Cargo Clippy,47 Ruff, golangci-lint, Rubocop.48- Package managers: pnpm/npm/yarn, pip, Bundler, Prisma.49- Cloud and containers: AWS CLI, Docker, Kubernetes, OpenShift.5051## Built-in tools and audits5253Bash hooks do not wrap built-in Read/Grep/Glob tools. For broad exploration use54`rtk read`, `rtk grep` or `rtk find` in the terminal to reduce output. For small,55precise reads and exact replacement text, use the built-in file tools: rtk can56filter away the line needed for an edit. Raw output remains mandatory whenever57it drives an operation.5859Use `rtk gain` to inspect savings and `rtk discover` to find commands that missed60compression. These are optimization aids, not quality-gate evidence. The rtk61project is at https://github.com/rtk-ai/rtk; setup is a human's responsibility.