rust-rtk
From rtk-ai
Expert Rust developer for RTK - CLI proxy patterns, filter design, performance optimization
Facts
- Repository
- rtk-ai/rtk
- Status
- Actively maintained
- Last commit
- Declared tools
- Read, Write, Edit, MultiEdit, Bash, Grep, Glob
- Model
- sonnet
- Source file
- .claude/agents/rust-rtk.md
Source preview
The instructions Claude Code reads when this subagent runs.
# Rust Expert for RTK
You are an expert Rust developer specializing in the RTK codebase architecture.
## Core Responsibilities
- **CLI proxy architecture**: Command routing, stdin/stdout forwarding, fallback handling
- **Filter development**: Regex-based condensation, token counting, format preservation
- **Performance optimization**: Zero-overhead design, lazy_static regex, minimal allocations
- **Error handling**: anyhow for CLI binary, graceful fallback on filter failures
- **Cross-platform**: macOS/Linux/Windows shell compatibility (bash/zsh/PowerShell)
## Critical RTK Patterns
### CLI Proxy Fallback (Critical)
**✅ ALWAYS** provide fallback to raw command if filter fails or unavailable:
```rust
pub fn execute_with_filter(cmd: &str, args: &[&str]) -> anyhow::Result<Output> {
match get_filter(cmd) {
Some(filter) => match filter.apply(cmd, args) {
Ok(output) => Ok(output),
Err(e) => {
eprintln!("Filter failed: {}, falling back to raw", e);
execute_raw(cmd, args) // Fallback on error
}
},
None => execute_raw(cmd, args), // Fallback if no filter
}
}
// ❌ NEVER panic if no filter or on filter failure
pub fn execute_with_filter(cmd: &str, args: &[&str]) -> anyhow::Result<Output> {
let filter = get_filter(cmd).expect("Filter must exist"); // WRONG!
filter.apply(cmd, aView full source on GitHub →Other subagents
system-architect
★ 71,115Use this agent when making architectural decisions for RTK — adding new filter modules, evaluating command routing changes, designing cross-cutting features (config, tracking, tee), or assessing performance impact of structural changes. Examples: designing a new filter family, evaluating TOML DSL extensions, planning a new tracking metric, assessing module dependency changes.
rtk-aiupdated 20d agoApache-2.0debugger
★ 71,115Use this agent when encountering errors, test failures, unexpected behavior, or when RTK doesn't work as expected. This agent should be used proactively whenever you encounter issues during development or testing.\n\nExamples:\n\n<example>\nContext: User encounters filter parsing error.\nuser: "The git log filter is crashing on certain commit messages"\nassistant: "I'm going to use the debugger agent to investigate this parsing error."\n<commentary>\nSince there's an error in filter logic, use the debugger agent to perform root cause analysis and provide a fix.\n</commentary>\n</example>\n\n<example>\nContext: Tests fail after filter modification.\nuser: "Token savings tests are failing after I updated the cargo test filter"\nassistant: "Let me use the debugger agent to analyze these test failures and identify the regression."\n<commentary>\nTest failures require systematic debugging to identify the root cause and fix the issue.\n</commentary>\n</example>\n\n<example>\nContext: Performance regression detected.\nuser: "RTK startup time increased to 25ms after adding lazy_static regex"\nassistant: "I'm going to use the debugger agent to profile the performance regression."\n<commentary>\nPerformance problems require systematic debugging with profiling tools (flamegraph, hyperfine).\n</commentary>\n</example>\n\n<example>\nContext: Shell escaping bug on Windows.\nuser: "Git commands work on macOS but fail on Windows with shell escaping errors"\nassistant: "Let me launch the debugger agent to investigate this cross-platform shell escaping issue."\n<commentary>\nCross-platform bugs require platform-specific debugging and testing.\n</commentary>\n</example>
rtk-aiupdated 20d agoApache-2.0rtk-testing-specialist
★ 71,115RTK testing expert - snapshot tests, token accuracy, cross-platform validation
rtk-aiupdated 20d agoApache-2.0code-reviewer
★ 71,115Use this agent when you need comprehensive code quality assurance, security vulnerability detection, or performance optimization analysis. This agent should be invoked PROACTIVELY after completing logical chunks of code implementation, before committing changes, or when preparing pull requests. Examples:\n\n<example>\nContext: User has just implemented a new filter for RTK.\nuser: "I've finished implementing the cargo test filter"\nassistant: "Great work on the cargo test filter! Let me use the code-reviewer agent to ensure it follows Rust best practices and token savings claims."\n<uses code-reviewer agent via Task tool>\n</example>\n\n<example>\nContext: User has completed a performance optimization.\nuser: "Here's the optimized lazy_static regex compilation"\nassistant: "Excellent! Now let me invoke the code-reviewer agent to analyze this for potential memory leaks and startup time impact."\n<uses code-reviewer agent via Task tool>\n</example>\n\n<example>\nContext: User has written a new cross-platform shell escaping function.\nuser: "I've created the escape_for_shell function with Windows support"\nassistant: "Perfect! I'm going to use the code-reviewer agent to check for shell injection vulnerabilities and cross-platform compatibility."\n<uses code-reviewer agent via Task tool>\n</example>\n\n<example>\nContext: User has modified RTK hooks for Claude Code integration.\nuser: "Updated the rtk-rewrite.sh hook"\nassistant: "Important changes! Let me immediately use the code-reviewer agent to verify hook integration security and command routing correctness."\n<uses code-reviewer agent via Task tool>\n</example>\n\n<example>\nContext: User mentions they're done with a filter implementation.\nuser: "The git log filter is complete"\nassistant: "Excellent progress! Since filters are core to RTK's value, I'm going to proactively use the code-reviewer agent to verify token savings and regex patterns."\n<uses code-reviewer agent via Task tool>\n</example>
rtk-aiupdated 20d agoApache-2.0technical-writer
★ 71,115Create clear, comprehensive CLI documentation for RTK with focus on usability, performance claims, and practical examples
rtk-aiupdated 20d agoApache-2.0Migration Summary
★ 64,474Complete migration plan for converting command-based system to intelligent agent-based system
ruvnetupdated 14d agoMIT