Copilot instructions
.github/copilot-instructions.mdCopilot instructions
Quality
97/100
Scores the file, not the repository.Length
464 words
7 headings · 4 code blocksRepository
74k
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.1# Copilot Instructions for rtk23**rtk (Rust Token Killer)** is a CLI proxy that filters and compresses command outputs before they reach an LLM context, cutting 60-90% of bash output. It wraps common tools (`git`, `cargo`, `grep`, `pnpm`, `go`, etc.) and outputs condensed summaries instead of raw output. Percentages measure bash output, not billed tokens; RTK ships no tokenizer (`src/core/tracking.rs` estimates `bytes / 4`).45## Using rtk in this session67**Always prefix commands with `rtk` when running shell commands** — this reduces token consumption for every operation you perform.89```bash10# Instead of: Use:11git status rtk git status12git log -10 rtk git log -1013cargo test rtk cargo test14cargo clippy --all-targets rtk cargo clippy --all-targets15grep -r "pattern" src/ rtk grep -r "pattern" src/16```1718**rtk meta-commands** (always use these directly, no prefix needed):19```bash20rtk gain # Show token savings analytics21rtk gain --history # Full command history with per-command savings22rtk discover # Scan session history for missed rtk opportunities23rtk proxy <cmd> # Run a command raw (no filtering) but still track it24```2526**Verify rtk is installed before starting:**27```bash28rtk --version # Should print: rtk X.Y.Z29rtk gain # Should show a dashboard (not "command not found")30```3132> Name collision: `rtk gain` failing means you have `reachingforthejack/rtk` (Rust Type Kit) installed instead. Run `which rtk` to check.3334## Build, Test & Lint3536```bash37cargo build # Development build38cargo test # All tests39cargo test test_name # Single test40cargo test module::tests:: # Module tests41cargo test -- --nocapture # With stdout4243# Pre-commit gate (must all pass before any PR)44cargo fmt --all --check && cargo clippy --all-targets && cargo test4546bash scripts/test-all.sh # Smoke tests (requires installed binary)47```4849PRs target the **`develop`** branch, not `main`. All commits require a DCO sign-off (`git commit -s`).5051## Architecture5253rtk routes CLI commands via a Clap `Commands` enum in `main.rs` to specialized filter modules in `src/cmds/*/`, each executing the underlying command and compressing output. Token savings are tracked in SQLite via `src/core/tracking.rs`.5455For full details see [ARCHITECTURE.md](../docs/contributing/ARCHITECTURE.md) and [docs/contributing/TECHNICAL.md](../docs/contributing/TECHNICAL.md). Module responsibilities are documented in each folder's `README.md` and each file's `//!` doc header.5657## Key Conventions5859- **Error handling**: `anyhow::Result` with `.context("description")?` — no bare `?`, no `unwrap()` in production. Filters must fall back to raw command on error.60- **Regex**: Use `LazyLock<Regex>` for fixed patterns reused across calls; keep runtime-dependent patterns local.61- **Testing**: Unit tests inside modules (`#[cfg(test)] mod tests`). Fixtures in `tests/fixtures/`. Token savings assertions with `count_tokens()`.62- **Exit codes**: Preserve the underlying command's exit code via `std::process::exit(code)`.63- **Performance**: Startup <10ms (no async runtime), binary <5MB stripped.64- **Branch naming**: `fix(scope):`, `feat(scope):`, `chore(scope):` where scope is the affected component.6566For the full contribution workflow, design philosophy, and new-filter checklist, see [CONTRIBUTING.md](../CONTRIBUTING.md).67
Also in rtk-ai/rtk
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| rtk-ai/rtkCLAUDE.md · 74k | CLAUDE.md | setupbuildtestlint-format+5 | 96/100 | 3 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 63 | Copilot instructions | buildlint-formatstylearch+4 | 100/100 | 3 days ago | |
| louislam/uptime-kuma.github/copilot-instructions.md · 90k | Copilot instructions | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| pytorch/pytorch.github/copilot-instructions.md · 102k | Copilot instructions | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| dotnet/roslyn.github/instructions/Compiler.instructions.md · 21k | Copilot instructions | buildteststylearch+3 | 99/100 | 3 days ago | |
| hiyouga/LlamaFactory.github/copilot-instructions.md · 74k | Copilot instructions | setupbuildtestlint-format+5 | 97/100 | 2 days ago | |
| JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 31k | Copilot instructions | buildlint-formatstylearch+3 | 97/100 | 2 days ago | |
| dotnet/roslyn.github/copilot-instructions.md · 21k | Copilot instructions | buildteststylearch+3 | 97/100 | 3 days ago | |
| bagisto/bagisto.github/copilot-instructions.md · 28k | Copilot instructions | setupbuildteststyle+5 | 97/100 | 3 days ago |
