RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Copilot instructions/rtk-ai/rtk

Copilot instructions

.github/copilot-instructions.md
Copilot instructions

Quality

97/100

Scores the file, not the repository.

Length

464 words

7 headings · 4 code blocks

Repository

74k

— · pushed 0 days ago

Last changed

3 days ago

First indexed 3 days ago.
rtk-ai/rtk/.github/copilot-instructions.mdRawGitHub
1# Copilot Instructions for rtk
2 
3**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`).
4 
5## Using rtk in this session
6 
7**Always prefix commands with `rtk` when running shell commands** — this reduces token consumption for every operation you perform.
8 
9```bash
10# Instead of: Use:
11git status rtk git status
12git log -10 rtk git log -10
13cargo test rtk cargo test
14cargo clippy --all-targets rtk cargo clippy --all-targets
15grep -r "pattern" src/ rtk grep -r "pattern" src/
16```
17 
18**rtk meta-commands** (always use these directly, no prefix needed):
19```bash
20rtk gain # Show token savings analytics
21rtk gain --history # Full command history with per-command savings
22rtk discover # Scan session history for missed rtk opportunities
23rtk proxy <cmd> # Run a command raw (no filtering) but still track it
24```
25 
26**Verify rtk is installed before starting:**
27```bash
28rtk --version # Should print: rtk X.Y.Z
29rtk gain # Should show a dashboard (not "command not found")
30```
31 
32> Name collision: `rtk gain` failing means you have `reachingforthejack/rtk` (Rust Type Kit) installed instead. Run `which rtk` to check.
33 
34## Build, Test & Lint
35 
36```bash
37cargo build # Development build
38cargo test # All tests
39cargo test test_name # Single test
40cargo test module::tests:: # Module tests
41cargo test -- --nocapture # With stdout
42 
43# Pre-commit gate (must all pass before any PR)
44cargo fmt --all --check && cargo clippy --all-targets && cargo test
45
46bash scripts/test-all.sh # Smoke tests (requires installed binary)
47```
48 
49PRs target the **`develop`** branch, not `main`. All commits require a DCO sign-off (`git commit -s`).
50 
51## Architecture
52 
53rtk 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`.
54 
55For 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.
56 
57## Key Conventions
58 
59- **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.
65 
66For the full contribution workflow, design philosophy, and new-filter checklist, see [CONTRIBUTING.md](../CONTRIBUTING.md).
67 

Commands it names

  • git status rtk git status
  • git log -10 rtk git log -10
  • cargo test rtk cargo test
  • cargo clippy --all-targets rtk cargo clippy --all-targets
  • cargo build
  • cargo test
  • cargo test test_name
  • cargo test module::tests::
  • cargo test -- --nocapture
  • cargo fmt --all --check && cargo clippy --all-targets && cargo test
  • git
  • cargo
  • pnpm
  • git commit -s

Sections

  • Copilot Instructions for rtk
  • Using rtk in this session
  • Instead of: Use:
  • Build, Test & Lint
  • Pre-commit gate (must all pass before any PR)
  • Architecture
  • Key Conventions

What it covers

buildtestlint-formatcode-stylegit-pragent-behaviour

Stack — with the evidence

rust

(1.00)

github-actions

(0.60)

Format

Copilot instructions

Two layers: one always-on repo file, plus optional glob-scoped instruction files. Lives under .github/ rather than the repo root, which is the tell that it is aimed at the GitHub platform surface as much as the editor.

What the corpus says about it

Repository

Owner
rtk-ai
Language
—
License
—
Archived
no

All configs in this repo

Also in rtk-ai/rtk

Diff this repo’s formats

One 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?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
rtk-ai/rtkCLAUDE.md · 74kCLAUDE.mdrustgithub-actionssetupbuildtestlint-format+596/1003 days ago
Diff against CLAUDE.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 63Copilot instructionstypescriptreact+7buildlint-formatstylearch+4100/1003 days ago
louislam/uptime-kuma.github/copilot-instructions.md · 90kCopilot instructionstypescriptjavascript+10setupbuildtestlint-format+9100/1003 days ago
pytorch/pytorch.github/copilot-instructions.md · 102kCopilot instructionspythonpytorch+4setupbuildteststyle+5100/1003 days ago
dotnet/roslyn.github/instructions/Compiler.instructions.md · 21kCopilot instructionscsharpdotnet+1buildteststylearch+399/1003 days ago
hiyouga/LlamaFactory.github/copilot-instructions.md · 74kCopilot instructionspythontransformers+4setupbuildtestlint-format+597/1002 days ago
JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 31kCopilot instructionstypescriptnode+7buildlint-formatstylearch+397/1002 days ago
dotnet/roslyn.github/copilot-instructions.md · 21kCopilot instructionscsharpdotnet+1buildteststylearch+397/1003 days ago
bagisto/bagisto.github/copilot-instructions.md · 28kCopilot instructionsphplaravel+8setupbuildteststyle+597/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack