Skip to content

Commit 3363f8a

Browse files
Release hardening for v1.0.0 (#3)
Make the integration safe and accurate for real agent-harness use, and add release hygiene. - AGENTS.md: "Harness safety" guards (no streaming/-f wrapping; trust raw exit code on pass/fail; prefer native file/search tools); corrected Setup note. - references/commands.md: "Harness notes"; static-only log rows; drop the "near-lossless" overstatement. - SKILL.md + README.md: "Compatibility & limitations" (Command Code hook gap, exit-code fidelity, piped/ANSI per RTK #1282, streaming, PATH, native tools, permission surface); honest savings table. - Add CHANGELOG.md; bump skill to 1.0.0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VvpBXNCbbg4eibmZQZAbb6
1 parent 04de855 commit 3363f8a

5 files changed

Lines changed: 128 additions & 12 deletions

File tree

AGENTS.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ These rules keep it net-positive.
88

99
## Setup
1010

11-
RTK is optional. If `rtk --version` fails, run commands normally — never block
12-
work to install it. Best setup: install RTK's auto-rewrite hook once with
13-
`rtk init -g` (then restart Command Code) so Bash commands are rewritten to `rtk`
14-
automatically and you never prefix by hand. Without a hook, prefix manually per
15-
the tiers in @references/commands.md.
11+
RTK is optional. If `rtk --version` fails or `rtk` isn't on PATH, run commands
12+
normally — never block work to install it. There's no auto-rewrite hook for
13+
Command Code yet (RTK's `rtk init` doesn't target it), so prefix commands
14+
yourself per the tiers in @references/commands.md.
1615

1716
## The one rule: compress noise, preserve signal
1817

@@ -38,6 +37,16 @@ and strips only noise. `-u` / `--ultra-compact`, `rtk read … -l aggressive`, a
3837
(2-line summary) are **lossy** — opt-in only for skimming something huge and
3938
unimportant, never your default.
4039

40+
## Harness safety — don't let it break the tool call
41+
42+
- **Don't wrap streaming/follow output** (`-f`, `tail -f`, a growing log): RTK
43+
buffers output to filter it, so it can hang the command. Run these raw.
44+
- **When a pass/fail verdict matters** (tests, CI gates), trust the command's raw
45+
exit code. If you can't tell whether the `rtk` view preserved it, re-run raw or
46+
use `rtk proxy <cmd>`.
47+
- **Prefer the native file/search tools** over `rtk ls/grep/find/read` — they're
48+
lossless, give line numbers, and don't pass through RTK anyway.
49+
4150
## If a compressed view isn't enough
4251

4352
On failure, RTK's tee fallback already kept the full output. Otherwise don't

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Changelog
2+
3+
All notable changes to this integration are documented here. The format follows
4+
[Keep a Changelog](https://keepachangelog.com/), and this project aims to adhere
5+
to [Semantic Versioning](https://semver.org/).
6+
7+
## [1.0.0] — 2026-06-30
8+
9+
First stable release. The integration is now selective, accurate against the real
10+
RTK command surface, and hardened for agent-harness use.
11+
12+
### Changed
13+
- Reworked from "always prefix every command with `rtk`, use ultra-compact for
14+
maximum savings" to a **selective, signal-preserving** policy: compress noisy,
15+
large, low-stakes output; keep full fidelity for diffs, structured/JSON output,
16+
secrets, small outputs, and files you'll edit.
17+
- Recommend RTK's auto-rewrite hook where supported, and document that `rtk init`
18+
does not target Command Code yet — so manual prefixing is the working default.
19+
- Optimize for **net** savings (gross minus re-runs and the standing prompt cost);
20+
trimmed the always-on instruction footprint.
21+
22+
### Fixed
23+
- Removed commands/flags that don't exist in real RTK: `rtk tree`,
24+
`rtk gain --failures`, `rtk json --keys-only`.
25+
- Corrected `rtk read` vs the native Read tool guidance.
26+
- Softened "lossless" to "signal-preserving" to match RTK's filter-plus-tee
27+
behavior (full output recovered on failure, not guaranteed lossless).
28+
29+
### Added
30+
- **Harness-safety guidance**: don't wrap streaming/`-f` commands (buffer hang);
31+
trust the raw exit code for pass/fail; prefer native file/search tools; treat
32+
`rtk` as optional with a raw fallback when it isn't on PATH.
33+
- **Compatibility & limitations** documentation covering the Command Code hook
34+
gap, exit-code fidelity, piped/ANSI behavior (RTK
35+
[#1282](https://github.com/rtk-ai/rtk/issues/1282)), streaming, and the
36+
permission surface.
37+
38+
[1.0.0]: https://github.com/Coding-Dev-Tools/rtk-command-code/releases/tag/v1.0.0

README.md

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,17 @@ leaves precise output alone:
129129
| Category | Command | Through RTK? | Est. savings |
130130
|---|---|---|---|
131131
| Status / listings | `rtk git status`, `rtk ls`, `rtk git log` | 🟢 yes | ~80% |
132-
| Logs / containers | `rtk docker ps`, `rtk log app.log` | 🟢 yes | ~80% |
132+
| Logs / containers | `rtk docker ps`, `rtk log app.log` *(static, not `-f`)* | 🟢 yes | ~80% |
133133
| Dependencies | `rtk pip list`, `rtk pnpm list` | 🟢 yes | ~70% |
134134
| Tests / build | `rtk cargo test`, `rtk err <cmd>` | 🟡 plain mode (keeps failures) | ~90% |
135135
| Diffs you'll apply | `git diff`, `git show` | 🔴 run raw ||
136136
| JSON / parsed output | `… --format json` | 🔴 run raw ||
137137
| Files you'll edit | native Read tool | 🔴 not RTK ||
138138

139-
_Savings are illustrative; actual numbers vary by command and output size. Run
140-
`rtk gain` to measure your own — and `rtk discover` to spot poor fits._
139+
_Savings are illustrative and apply to **large** output — small outputs can be
140+
net-neutral or negative. Run streaming/`-f` commands, and anything whose pass/fail
141+
exit code matters, **raw** (see [Compatibility & limitations](#compatibility--limitations)).
142+
Run `rtk gain` to measure your own; `rtk discover` to spot poor fits._
141143

142144
See [references/commands.md](references/commands.md) for the full tiered list and
143145
[references/analytics.md](references/analytics.md) for measuring net savings.
@@ -155,6 +157,46 @@ accumulated savings. Track **net** savings, not just the headline number:
155157
tee fallback keeps full output whenever a command fails. See
156158
[references/analytics.md](references/analytics.md).
157159

160+
## Compatibility & limitations
161+
162+
This is a documentation/instruction integration: it tells Command Code *when* to
163+
route output through the real [RTK](https://github.com/rtk-ai/rtk) binary. A few
164+
things to know before relying on it:
165+
166+
- **No native Command Code hook (yet).** RTK's `rtk init` supports Claude Code,
167+
Copilot, Cursor, Gemini, Cline, and others — **not** Command Code. So
168+
`rtk init -g` won't wire up Command Code; the manual-prefix path this repo
169+
installs is the working default. Closing that gap upstream is the goal in
170+
[Upstream](#upstream) below.
171+
- **Exit-code fidelity.** Agent harnesses key success off a command's exit code.
172+
RTK aims to pass it through, but this has been fixed command-by-command and
173+
isn't guaranteed for every command/version. **For a pass/fail that matters
174+
(tests, CI gates), trust the raw exit code** — or run the command raw /
175+
`rtk proxy`. The tiers keep `rtk cargo test` in *plain* mode, never aggressive.
176+
- **Piped (non-TTY) output.** A harness captures stdout as a pipe. RTK can still
177+
emit icons/decoration there (RTK issue
178+
[#1282](https://github.com/rtk-ai/rtk/issues/1282)), which wastes tokens or
179+
corrupts parsed output. Run anything you'll parse **raw**, and set `NO_COLOR=1`
180+
if decoration leaks in.
181+
- **Streaming / follow.** RTK buffers output to filter it, so `-f`, `tail -f`, or
182+
a growing log can hang. Run those raw.
183+
- **PATH.** A non-interactive shell may not find `rtk`; the integration treats it
184+
as optional and falls back to the bare command, so a missing binary is a no-op,
185+
not a failure.
186+
- **Native tools.** Command Code's built-in file/search tools (Read/Grep/Glob)
187+
are lossless, give line numbers, and don't pass through RTK — prefer them over
188+
`rtk read/grep/find`.
189+
- **Permissions.** `rtk` (especially `rtk proxy <cmd>`) can execute arbitrary
190+
wrapped commands, so an `rtk` allow-list entry is broad by nature — grant it
191+
deliberately.
192+
- **Hooks on Windows.** RTK's filters work on Windows, but its auto-rewrite hook
193+
has gaps there (RTK
194+
[discussion #671](https://github.com/rtk-ai/rtk/discussions/671)); `.ps1` stays
195+
CRLF per `.gitattributes`.
196+
197+
None of these corrupt your repository — the worst case is a failed or misread
198+
tool call that's recoverable by re-running raw.
199+
158200
## Files
159201

160202
```
@@ -170,6 +212,7 @@ rtk-command-code/
170212
├── CONTRIBUTING.md # How to contribute
171213
├── CODE_OF_CONDUCT.md # Contributor Covenant
172214
├── SECURITY.md # Vulnerability reporting policy
215+
├── CHANGELOG.md # Release history
173216
├── LICENSE # Apache 2.0
174217
└── README.md # This file
175218
```

SKILL.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ compatibility: >-
1313
normally if it isn't installed.
1414
metadata:
1515
author: Coding-Dev-Tools
16-
version: "0.2.0"
16+
version: "1.0.0"
1717
homepage: https://github.com/rtk-ai/rtk
1818
allowed-tools: Bash(rtk:*) Bash(git:*) Bash(cargo:*) Bash(ls:*) Bash(cat:*) Bash(grep:*) Bash(find:*) Bash(diff:*) Bash(docker:*) Bash(kubectl:*) Bash(gh:*) Bash(glab:*) Bash(pnpm:*) Bash(npm:*) Bash(pip:*) Bash(bundle:*) Bash(ruff:*) Bash(tsc:*) Bash(eslint:*) Bash(pytest:*) Bash(go:*) Bash(jest:*) Bash(vitest:*) Bash(dotnet:*) Bash(aws:*) Bash(psql:*) Bash(prisma:*) Bash(wget:*)
1919
---
@@ -104,6 +104,23 @@ full output. Optimize **net** tokens (savings minus re-runs), not the headline
104104
number. Full reference:
105105
[references/analytics.md](references/analytics.md).
106106

107+
## Compatibility & limitations
108+
109+
- **No native Command Code hook yet.** `rtk init` doesn't list Command Code, so
110+
the manual-prefix path (Method 2) is the working default; an auto-rewrite hook
111+
needs hand-wiring until Command Code is supported upstream.
112+
- **Exit codes.** RTK aims to pass the wrapped command's exit code through, but it
113+
isn't guaranteed for every command/version. When a pass/fail verdict matters
114+
(tests, gates), trust the raw exit code or re-run raw / `rtk proxy <cmd>`.
115+
- **Piped output.** The harness captures stdout as a non-TTY pipe; RTK may still
116+
emit icons/decoration ([RTK #1282](https://github.com/rtk-ai/rtk/issues/1282)).
117+
For anything you'll parse, run raw; set `NO_COLOR=1` if decoration leaks in.
118+
- **Streaming.** RTK buffers to filter, so don't wrap `-f`/follow or growing logs.
119+
- **PATH.** In a non-interactive shell `rtk` may not be found; the integration
120+
treats it as optional and falls back to raw commands.
121+
- **Permissions.** `rtk` (and `rtk proxy`) can execute arbitrary wrapped commands
122+
— allow-list it deliberately.
123+
107124
## Prerequisite
108125

109126
RTK on PATH (`rtk --version`). If missing:

references/commands.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ output**. The skill is knowing *when* that helps. Three tiers:
88
failures: use plain `rtk` (which keeps errors/diffs), never `-u`/aggressive.
99
- 🔴 **Keep full fidelity** — run raw; compression risks dropping what you need.
1010

11-
Plain `rtk <cmd>` is near-lossless. `-u` / `--ultra-compact`, `rtk read … -l
11+
Plain `rtk <cmd>` keeps the signal and strips only noise. `-u` / `--ultra-compact`, `rtk read … -l
1212
aggressive`, and `rtk smart` (2-line summary) are lossy — reserve them for
1313
skimming something huge and unimportant.
1414

@@ -18,10 +18,10 @@ skimming something huge and unimportant.
1818
| `ls -la` | `rtk ls` | listings dedup/group cleanly |
1919
| `git status`, `git log -n 20` | `rtk git status`, `rtk git log -n 20` | already summaries |
2020
| `docker ps`, `docker images` | `rtk docker ps`, `rtk docker images` | tabular, repetitive |
21-
| `docker logs <c>`, `kubectl logs <p>` | `rtk docker logs <c>`, `rtk kubectl logs <p>` | dedups repeated lines |
21+
| `docker logs <c>`, `kubectl logs <p>` (finite) | `rtk docker logs <c>`, `rtk kubectl logs <p>` | dedups repeated lines**never** with `-f`/follow |
2222
| `kubectl get pods/services` | `rtk kubectl pods`, `rtk kubectl services` | tabular |
2323
| `pip list`, `pnpm list`, `bundle install` | `rtk pip list`, `rtk pnpm list`, `rtk bundle install` | long dependency dumps |
24-
| `cat app.log` (triage) | `rtk log app.log` | collapses repeated log lines with counts |
24+
| `cat app.log` (static triage) | `rtk log app.log` | collapses repeated lines — not for `-f`/follow |
2525
| `env` (scan, non-secret) | `rtk env -f AWS` | filters to a prefix |
2626

2727
## 🟡 Default mode only — keep the failures, drop the green
@@ -44,6 +44,15 @@ the `file:line` you need, which forces a re-run that costs more than it saved.
4444
| A file you'll **edit** | native Read tool | lossless + line numbers; bypasses RTK anyway |
4545
| You need everything, just this once | `rtk proxy <cmd>` | passthrough + still tracks savings |
4646

47+
## Harness notes
48+
49+
- **Streaming/follow** (`-f`, `tail -f`, a growing log) → run raw; RTK buffers and can hang.
50+
- **Exit status** → for a pass/fail verdict that matters (tests, gates), trust the
51+
command's raw exit code; if unsure RTK preserved it, re-run raw or `rtk proxy`.
52+
- **Piped output** → RTK may emit icons/decoration over a non-TTY pipe; for anything
53+
you'll parse, run raw (set `NO_COLOR=1` if decoration leaks in).
54+
- **Native tools** → prefer the built-in file/search tools over `rtk read/grep/find`.
55+
4756
## Analytics
4857

4958
Measuring real savings — and spotting bad fits before they cost you — lives in

0 commit comments

Comments
 (0)