**Welcome!** We appreciate your interest in contributing to rtk.
## Quick Links
- [Report an Issue](../../issues/new)
- [Open Pull Requests](../../pulls)
- [Start a Discussion](../../discussions)
---
## What is rtk?
**rtk (Rust Token Killer)** is a coding agent proxy that cuts noise from command outputs. It filters and compresses CLI output before it reaches your LLM context, saving 60-90% of tokens on common operations. The vision is to make AI-assisted development faster and cheaper by eliminating unnecessary token consumption.
---
## Ways to Contribute
| Type | Examples |
|------|----------|
| **Report** | File a clear issue with steps to reproduce, expected vs actual behavior |
| **Fix** | Bug fixes, broken filter repairs |
| **Build** | New filters, new command support, performance improvements |
| **Review** | Review open PRs, test changes locally, leave constructive feedback |
**Respect the existing folder structure.** Place new files where similar files already live. Do not reorganize without prior discussion.
**Keep functions short and focused.** Each function should do one thing. If it needs a comment to explain what it does, it's probably too long -- split it.
**No obvious comments.** Don't comment what the code already says. Comments should explain *why*, never *what* to avoid noise.
**Large command files are expected.** Command modules (`*_cmd.rs`) contain the implementation, tests, and fixture in the same file. A big file is fine when it's self-contained for one command.
### 3. Add Tests
Every change **must** include tests. See [Testing](#testing) below.
### 4. Add Documentation
Every change **must** include documentation updates. See [Documentation](#documentation) below.
Once your work is ready, open a Pull Request targeting the **`develop`** branch.
### 6. Review Process
1.**Maintainer review** -- A maintainer reviews your code for quality and alignment with the project
2.**CI/CD checks** -- Automated tests and linting must pass
3.**Resolution** -- Address any feedback from review or CI failures
### 7. Integration & Release
Once merged, your changes are tested on the `develop` branch alongside other features. When the maintainer is satisfied with the state of `develop`, they release to `master` under a specific version.
```
your branch --> develop (review + CI + integration testing) --> version branch --> master (versioned release)
```
---
## Testing
Every change **must** include tests. We follow **TDD (Red-Green-Refactor)**: write a failing test first, implement the minimum to pass, then refactor.
### Test Types
| Type | Where | Run With |
|------|-------|----------|
| **Unit tests** | `#[cfg(test)] mod tests` in each module | `cargo test` |
Tests for new commands live **in the module file itself** inside a `#[cfg(test)] mod tests` block (e.g. tests for `src/kubectl_cmd.rs` go at the bottom of that same file).
**1. Create a fixture from real command output** (not synthetic data):
```bash
kubectl get pods > tests/fixtures/kubectl_pods_raw.txt
```
**2. Write your test in the same module file** (`#[cfg(test)] mod tests`):