Code Refiner
Mathews-Tom/armory
Deep code simplification and refactoring preserving behavior across Python, Go, TypeScript, Rust.
Reviews RTK's Rust code for over-engineering and verbose patterns, applying idioms like iterator chains and early returns while protecting a specific list of constraints from being simplified away.
$ npx skills add rtk-ai/rtk --skill code-simplifier -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install rtk-ai/rtk code-simplifier --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/rtk-ai/rtk.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/code-simplifier .claude/skills/code-simplifier && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "code-simplifier" agent skill from https://github.com/rtk-ai/rtk/tree/develop/.claude/skills/code-simplifier into .claude/skills/code-simplifier/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-simplifier", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/rtk-ai/rtk/tree/develop/.claude/skills/code-simplifierType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add rtk-ai/rtk --skill code-simplifier -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install rtk-ai/rtk code-simplifier --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/rtk-ai/rtk.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/skills/code-simplifier .agents/skills/code-simplifier && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "code-simplifier" agent skill from https://github.com/rtk-ai/rtk/tree/develop/.claude/skills/code-simplifier into .agents/skills/code-simplifier/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-simplifier", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add rtk-ai/rtk --skill code-simplifier -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install rtk-ai/rtk code-simplifier --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/rtk-ai/rtk.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/skills/code-simplifier .cursor/skills/code-simplifier && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "code-simplifier" agent skill from https://github.com/rtk-ai/rtk/tree/develop/.claude/skills/code-simplifier into .cursor/skills/code-simplifier/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-simplifier", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/rtk-ai/rtk.git --path .claude/skills/code-simplifier--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add rtk-ai/rtk --skill code-simplifier -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install rtk-ai/rtk code-simplifier --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/rtk-ai/rtk.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/skills/code-simplifier .gemini/skills/code-simplifier && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "code-simplifier" agent skill from https://github.com/rtk-ai/rtk/tree/develop/.claude/skills/code-simplifier into .gemini/skills/code-simplifier/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-simplifier", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install rtk-ai/rtk code-simplifierInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add rtk-ai/rtk --skill code-simplifier -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/rtk-ai/rtk.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/skills/code-simplifier .github/skills/code-simplifier && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "code-simplifier" agent skill from https://github.com/rtk-ai/rtk/tree/develop/.claude/skills/code-simplifier into .github/skills/code-simplifier/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-simplifier", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add rtk-ai/rtk --skill code-simplifier -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install rtk-ai/rtk code-simplifier --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/rtk-ai/rtk.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/skills/code-simplifier .opencode/skills/code-simplifier && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "code-simplifier" agent skill from https://github.com/rtk-ai/rtk/tree/develop/.claude/skills/code-simplifier into .opencode/skills/code-simplifier/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-simplifier", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
code-simplifierReviews RTK's Rust code for over-engineering and verbose patterns, applying idioms like iterator chains and early returns while protecting a specific list of constraints from being simplified away.
The skill lists patterns to apply: iterator chains instead of manual accumulation loops, cleaner string building, Option and Result chaining instead of nested match expressions, struct destructuring to avoid repeated field access, early returns instead of deep nesting, removing redundant clones, and if let in place of a full match for a single variant.
It also names constraints that must never be simplified away even though they look like candidates: a LazyLock regex that cannot be moved inside a function, mandatory .context() calls on every question-mark operator, a fallback-to-raw-command branch that looks like dead code but is a safety net, exit code propagation that must not collapse into Ok(()), and test modules marked with #[cfg(test)]. After simplifying, the skill runs cargo fmt, cargo clippy and cargo test to check for regressions.
7 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 8533612. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
ReadGrepGlobEditFrom allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
cargoFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
RTK Rust Code Simplifier loads about 1.1k tokens when it runs. Until then it costs about 46 tokens; SKILL.md has 149 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from rtk-ai/rtk at commit 8533612, republished under its Apache-2.0 licence (© rtk-ai). 149 words, ~1,072 tokens.
.claude/skills/code-simplifier/SKILL.md (or your agent's skills folder).Review and simplify Rust code in RTK while respecting the project's constraints.
LazyLock regex — cannot be moved inside functions even if "simpler".context() on every ? — verbose but mandatoryOk(())#[cfg(test)] mod tests — never remove test modules// ❌ Verbose
let mut result = Vec::new();
for line in input.lines() {
let trimmed = line.trim();
if !trimmed.is_empty() && trimmed.starts_with("error") {
result.push(trimmed.to_string());
}
}
// ✅ Idiomatic
let result: Vec<String> = input.lines()
.map(|l| l.trim())
.filter(|l| !l.is_empty() && l.starts_with("error"))
.map(str::to_string)
.collect();// ❌ Verbose push loop
let mut out = String::new();
for (i, line) in lines.iter().enumerate() {
out.push_str(line);
if i < lines.len() - 1 {
out.push('\n');
}
}
// ✅ join
let out = lines.join("\n");// ❌ Nested match
let result = match maybe_value {
Some(v) => match transform(v) {
Ok(r) => r,
Err(_) => default,
},
None => default,
};
// ✅ Chained
let result = maybe_value
.and_then(|v| transform(v).ok())
.unwrap_or(default);// ❌ Repeated field access
fn process(args: &MyArgs) -> String {
format!("{} {}", args.command, args.subcommand)
}
// ✅ Destructure
fn process(&MyArgs { ref command, ref subcommand, .. }: &MyArgs) -> String {
format!("{} {}", command, subcommand)
}// ❌ Deeply nested
fn filter(input: &str) -> Option<String> {
if !input.is_empty() {
if let Some(line) = input.lines().next() {
if line.starts_with("error") {
return Some(line.to_string());
}
}
}
None
}
// ✅ Early return
fn filter(input: &str) -> Option<String> {
if input.is_empty() { return None; }
let line = input.lines().next()?;
if !line.starts_with("error") { return None; }
Some(line.to_string())
}// ❌ Unnecessary clone
fn filter_output(input: &str) -> String {
let s = input.to_string(); // Pointless clone
s.lines().filter(|l| !l.is_empty()).collect::<Vec<_>>().join("\n")
}
// ✅ Work with &str
fn filter_output(input: &str) -> String {
input.lines().filter(|l| !l.is_empty()).collect::<Vec<_>>().join("\n")
}if let for single-variant match// ❌ Full match for one variant
match output {
Ok(s) => process(&s),
Err(_) => {},
}
// ✅ if let (but still handle errors in RTK — don't silently drop)
if let Ok(s) = output {
process(&s);
}
// Note: in RTK filters, always handle Err with eprintln! + fallbackRun these after simplification:
# Verify no regressions
cargo fmt --all && cargo clippy --all-targets && cargo test
# Verify no new regex in functions
grep -n "Regex::new" src/<file>.rs
# Fixed, reused patterns should be in `LazyLock<Regex>` statics
# Verify no new unwrap in production
grep -n "\.unwrap()" src/<file>.rs
# Should only appear inside #[cfg(test)] blocksstatic RE: LazyLock<Regex> = LazyLock::new(|| Regex::new(...).unwrap()); — the .unwrap() here is acceptable, it's init-time.context("description")? chains — verbose but requiredErr(e) => { eprintln!(...); raw_output } — looks redundant but is the safety netstd::process::exit(code) at end of run() — looks like it could be Ok(())but it isn't© rtk-ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .claude/skills/code-simplifier of rtk-ai/rtk.
Open the folder on GitHubat commit 8533612
RTK Rust Code Simplifier next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| RTK Rust Code Simplifier this skillrtk-ai/rtk | 83k | — | ~1.1k | Automated safety check: Pass | Apache-2.0 | |
| Code RefinerMathews-Tom/armory | 328 | — | ~3.1k | Automated safety check: Pass | MIT | |
| Migrate Core Code to Submodulestinyhumansai/openhuman | 42k | — | ~2.6k | Automated safety check: Pass | GPL-3.0 | |
| PonytailDavidObando/gsharp | 565 | 8 repos | ~1.7k | Automated safety check: Pass | MIT | |
| Rust Best Practicesfarm-fe/farm | 5.6k | 3 repos | ~1.1k | Automated safety check: Pass | MIT | |
| Ponytail Lazy Developer ModeDietrichGebert/ponytail | 158k | — | ~871 | Automated safety check: Pass | MIT |
Mathews-Tom/armory
Deep code simplification and refactoring preserving behavior across Python, Go, TypeScript, Rust.
tinyhumansai/openhuman
Plans and carries out moving non-host-specific code and its tests from the OpenHuman core into vendored tiny submodule libraries, then releases the submodule and re-pins the host.
DavidObando/gsharp
Forces the laziest solution that actually works, simplest, shortest, most minimal.
farm-fe/farm
Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook.
DietrichGebert/ponytail
Makes the agent pick the laziest solution that works: skip unneeded work, reuse what exists, prefer the standard library and platform features, and keep diffs small.
citrolabs/ego-lite
Finds and implements evidence-backed simplifications in the ego-lite repository, such as dead code, duplicated state and speculative abstractions, without hiding behavior changes.
rtk-ai/rtk
Enforces red-green-refactor for Rust work, with idiomatic test patterns, a naming convention and a pre-commit gate of cargo fmt, clippy and test.
rtk-ai/rtk
Describes seven Rust design patterns for the RTK CLI filter modules, with when to use each, RTK examples, and notes on when a pattern is overkill.
rtk-ai/rtk
Enforces red-green-refactor for new RTK output filters in Rust, using real captured fixtures, snapshot tests with insta and token-savings assertions.
rtk-ai/rtk
Audits open GitHub issues, categorizes them, flags duplicates and linked PRs in three phases, with optional deep analysis and comments posted only after validation.
rtk-ai/rtk
Audits a repository's open pull requests, deep-reviews chosen ones and drafts review comments that are only posted after you approve them.
rtk-ai/rtk
Runs issue triage and PR triage in parallel, then cross-analyzes the results to flag duplicate coverage, security gaps, P0 issues with no PR, and PR conflicts.
Works with
Categories
Reviews RTK's Rust code for over-engineering and verbose patterns, applying idioms like iterator chains and early returns while protecting a specific list of constraints from being simplified away. The skill lists patterns to apply: iterator chains instead of manual accumulation loops, cleaner string building, Option and Result chaining instead of nested match expressions, struct destructuring to avoid repeated field access, early returns instead of deep nesting, removing redundant clones, and if let in place of a full match for a single variant.
RTK Rust Code Simplifier fits situations like: cleaning up verbose Rust code in the RTK codebase; replacing a nested match or manual loop with an idiomatic Rust pattern; checking whether a piece of RTK code is safe to simplify.
Run `npx skills add rtk-ai/rtk --skill code-simplifier -a claude-code`. Or copy the skill folder (.claude/skills/code-simplifier in rtk-ai/rtk) into .claude/skills/code-simplifier in your project. Claude Code loads it when a task matches its description.
Run `npx skills add rtk-ai/rtk --skill code-simplifier -a codex`. Or copy the skill folder (.claude/skills/code-simplifier in rtk-ai/rtk) into .agents/skills/code-simplifier in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add rtk-ai/rtk --skill code-simplifier -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code-simplifier, .gemini/skills/code-simplifier, .github/skills/code-simplifier and .opencode/skills/code-simplifier in your project.
Going by SKILL.md and its folder, RTK Rust Code Simplifier needs the command-line tools its instructions call (cargo). Our summary lists: Rust with cargo, clippy and rustfmt. Its frontmatter pre-approves these tools: Read, Grep, Glob, Edit.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
RTK Rust Code Simplifier is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.1k tokens (SKILL.md is roughly 4.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with RTK Rust Code Simplifier: Code Refiner (Mathews-Tom/armory, 328 stars), Migrate Core Code to Submodules (tinyhumansai/openhuman, 42k stars), Ponytail (DavidObando/gsharp, 565 stars) and Rust Best Practices (farm-fe/farm, 5.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
rtk-ai (a GitHub organization) maintains it in rtk-ai/rtk, which has 82,651 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on October 7, 2026.
Source: rtk-ai/rtk on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.