Graph-Guided Safe Refactoring
tirth8205/code-review-graph
Plans a refactor from a code dependency graph, previews renames before applying them and checks that the final impact matches the plan.
Full-workspace code quality analysis and refactoring with validation
$ npx skills add termide/termide --skill refactor -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install termide/termide refactor --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/termide/termide.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/refactor .claude/skills/refactor && 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 "refactor" agent skill from https://github.com/termide/termide/tree/main/.agents/skills/refactor into .claude/skills/refactor/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "refactor", 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/termide/termide/tree/main/.agents/skills/refactorType 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 termide/termide --skill refactor -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install termide/termide refactor --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/termide/termide.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/refactor .agents/skills/refactor && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "refactor" agent skill from https://github.com/termide/termide/tree/main/.agents/skills/refactor into .agents/skills/refactor/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "refactor", 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 termide/termide --skill refactor -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install termide/termide refactor --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/termide/termide.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/refactor .cursor/skills/refactor && 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 "refactor" agent skill from https://github.com/termide/termide/tree/main/.agents/skills/refactor into .cursor/skills/refactor/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "refactor", 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/termide/termide.git --path .agents/skills/refactor--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 termide/termide --skill refactor -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install termide/termide refactor --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/termide/termide.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/refactor .gemini/skills/refactor && 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 "refactor" agent skill from https://github.com/termide/termide/tree/main/.agents/skills/refactor into .gemini/skills/refactor/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "refactor", 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 termide/termide refactorInstalls 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 termide/termide --skill refactor -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/termide/termide.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/refactor .github/skills/refactor && 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 "refactor" agent skill from https://github.com/termide/termide/tree/main/.agents/skills/refactor into .github/skills/refactor/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "refactor", 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 termide/termide --skill refactor -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install termide/termide refactor --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/termide/termide.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/refactor .opencode/skills/refactor && 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 "refactor" agent skill from https://github.com/termide/termide/tree/main/.agents/skills/refactor into .opencode/skills/refactor/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "refactor", 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.
refactorFull-workspace code quality analysis and refactoring with validation
Refactor is an agent skill from termide/termide. Full-workspace code quality analysis and refactoring with validation
Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Development, covering Refactoring and Code quality. It works with Git, Model Context Protocol, Rust and SQL. The repository describes itself as: All-in-one terminal workspace for desktops and servers: editor with LSP, file manager with SFTP/FTP, terminal, git, database viewer and a coding agent in one zero-config static… The licence is MIT.
5 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 5c550fc. 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:
ReadGrepGlobBash(cargo check*)Bash(cargo clippy*)Bash(cargo test*)Bash(cargo fmt*)Bash(cargo tree*)Bash(cargo audit*)Bash(cargo outdated*)…and 14 more on the same allowed-tools line.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
cargogitFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.
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.
Refactor loads about 2.8k tokens when it runs. Until then it costs about 19 tokens; SKILL.md has 1,169 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 termide/termide at commit 5c550fc, republished under its MIT licence (© termide). 1,169 words, ~2,819 tokens.
.claude/skills/refactor/SKILL.md (or your agent's skills folder).Full-workspace code quality analysis and incremental refactoring with continuous validation.
This skill is intended for periodic whole-codebase refactoring passes, not per-branch or per-diff cleanup. It does not accept --diff / --staged / --since arguments.
Platform note: agents that support frontmatter permissions may use allowed-tools and user-invocable. Other agents should ignore unsupported fields and follow the workflow below. When platform-specific orchestration or memory features are unavailable, degrade gracefully and continue with the equivalent local workflow.
Arguments (optional):
/refactor crates/app — limit scope to one directoryAGENTS.md, CLAUDE.md, and PRD.md. Also read any project or agent memory/notes files if present for intentional_placeholder_*, feedback_*, or similar notes that inform what to skip.cargo clippy --workspace --all-targets 2>&1 — warning count.cargo test --workspace 2>&1 — green baseline? If tests fail or code doesn't compile, report and stop.wc -l — LOC per crate, files > 400 LOC.cargo tree -d — duplicated dependencies.cargo audit — CVE list. If severity ≥ Medium, flag but continue.cargo outdated --root-deps-only — major-behind deps.cargo machete — unused [dependencies] entries.cargo udeps — unused deps (secondary, if machete absent).git log --numstat --since="6 months ago" → top-10 files by churn (hotspot candidates for splitting).grep -rn "TODO\|FIXME\|HACK\|XXX" --include="*.rs" — from repo root, not from crates/ (see Rules below).grep -c "match\|if\|for\|while" on the ten largest .rs files.Analyze code across the categories below. For large scope, use parallel subagents or parallel analysis passes if the platform supports them, ideally one per category or related group of categories.
Architecture (SOLID)
match on types that are expected to grow.Legitimate exceptions to "1 file = 1 type": Error+ErrorKind pairs, Builder+Target, small private helpers (< 30 LOC), related DTO families (Request/Response), typestate marker types, newtype wrapper collections.
Module coupling / cohesion
pub — types/functions public without need (downgrade to pub(crate) / pub(super)).Duplication (DRY)
match patterns across different files.Dead code
crates/. Binary crate in src/ is a legitimate caller (previous incident with check_git_available / ram_usage_percent was caused by grepping only crates/).use, functions, types, constants.HIGH — unused private / pub(crate) in leaf module, no callers.MEDIUM — pub in inner crate, no callers found via grep.LOW — enum variant, trait impl, or item with #[allow(dead_code)] nearby — likely intentional placeholder.ForceSave, dead enum variants in vfs_state.rs/keyboard.rs, format_bytes x3, ConflictResolution x3 across layers).Performance
.clone() / .to_string() / .to_owned() where a reference suffices.Error boundaries
From / thiserror).unwrap() / expect() in production code — replace with ? or explicit handling..map_err(|_| ...) without information).Security
cargo audit / cargo deny check licenses output here (do not split into a separate step).fs::*(user_input_path) without canonicalize() + starts_with() check — path traversal risk.Command::new(user_input) or shell-expansion of user input — command injection.Style and idioms
#[must_use] on pure / builder methods.Concurrency (Rust-specific)
Arc<Mutex<T>> where locked guard is used mostly for reads (grep the ratio of .lock() read accesses vs mutations) — Arc<RwLock<T>> candidate..await inside a .lock() guard — deadlock risk.tokio::spawn without an abort handle for long-running tasks (leaks on shutdown).Send / Sync markers where the compiler would accept them.API stability
pub enum without #[non_exhaustive] on a cross-crate boundary.pub in a child module re-exported via pub use only for one caller — downgrade candidate to pub(crate).pub API without a version bump.Allocations / hot path (TUI-specific)
.to_string() / format! / Vec::new() / vec![] inside render_*, tick_*, draw_*, update_* functions.Arc<Config> pattern is used.Cow<str> candidates: functions taking &str that sometimes need an owned String.Testing quality
std::env::set_var, global state mutation inside #[test].#[ignore] without a comment explaining why.assert_eq! on a large struct).cargo-tarpaulin is available, highlight files with < 50%).Observability
println! / eprintln! in production code (not #[test] / examples) — should be log::*.let _ = <Result> — errors swallowed without log::warn!.Each finding gets two tags:
Impact: HIGH / MED / LOW
HIGH — > 100 LOC reduction OR removes a bug class OR unblocks a perf fix
MED — 20–100 LOC reduction OR consolidates a recurring pattern
LOW — < 20 LOC OR stylistic
Risk: SAFE / CAREFUL / BREAKING
SAFE — private internals, no API surface change, covered by tests
CAREFUL — pub(crate) API, hot path, thread boundary
BREAKING — pub API, schema/config format, semantic changeDefault execution order: HIGH-SAFE → MED-SAFE → HIGH-CAREFUL → LOW-SAFE → MED-CAREFUL. BREAKING findings are shown but never executed without explicit user approval.
Output format (terminal, do not create report files):
## Findings (ROI-sorted)
### 🟢 HIGH-SAFE (execute automatically)
1. **<short title>** — path/to/file.rs, path/to/other.rs
Why: <one-sentence justification + evidence>.
Effort: ~N min · Risk: SAFE (<reason>).
### 🟡 MED-CAREFUL (propose, require approval)
2. **<short title>** — path/to/file.rs
Why: …
Effort: ~N min · Risk: CAREFUL (<reason>).
### 🔴 BREAKING (report only, do not execute)
3. …
### 📦 Ecosystem
- cargo-audit: N advisories.
- cargo-outdated: N major-behind deps.
- cargo-machete: N unused crates.
- cargo-tarpaulin: workspace coverage X% (only if available).
## Category counts
| Category | Found | HIGH | MED | LOW |
|--------------|------:|-----:|----:|----:|
| Architecture | … | … | … | … |
| … | … | … | … | … |
Baseline: X clippy warnings, Y workspace LOC, Z tests passing.Auto-mode:
HIGH-SAFE and MED-SAFE findings.CAREFUL and BREAKING in the report for the user to review.Non-auto:
SAFE findings preselected when supported.For each fix:
Edit.cargo check — still compiles?cargo test --workspace.On compilation or test failure — revert the change and move on.
Commit boundaries: do not auto-commit. Let the user review the final diff and commit.
cargo fmt --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspaceCompare with baseline: warnings removed, LOC deleted/changed, tests still green.
crates/. Binary crate in src/ is a legitimate caller.intentional_placeholder_* entries and skip those silently.cargo-machete, cargo-mutants, cargo-audit, etc.) is not in PATH, emit an info line and continue — do not fail.BREAKING findings are reported but never executed without explicit user consent.SAFE actions.© termide, MIT. 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 .agents/skills/refactor of termide/termide.
Open the folder on GitHubat commit 5c550fc
Refactor 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 |
|---|---|---|---|---|---|---|
| Refactor this skilltermide/termide | 171 | — | ~2.8k | Automated safety check: Pass | MIT | |
| Graph-Guided Safe Refactoringtirth8205/code-review-graph | 32k | 1 repos | ~332 | Automated safety check: Pass | MIT | |
| Worktrunk CLI Output Rulesmax-sixty/worktrunk | 8.9k | — | ~12k | Automated safety check: Pass | Custom licence | |
| Coding Agentmastra-ai/mastra | 29k | — | ~2.3k | Automated safety check: Pass | Custom licence | |
| Release Datafusion Ducklakedatafusion-contrib/datafusion-ducklake | 182 | — | ~903 | Automated safety check: Pass | Apache-2.0 | |
| Review Changesgemwalletcom/core | 149 | — | ~2.4k | Automated safety check: Notes | MIT |
tirth8205/code-review-graph
Plans a refactor from a code dependency graph, previews renames before applying them and checks that the final impact matches the plan.
max-sixty/worktrunk
CLI output standards for worktrunk: message functions, ANSI color nesting and the shell integration that changes directory after the wt command exits.
mastra-ai/mastra
Authoring playbook for building agents that write, edit, review, or refactor code.
datafusion-contrib/datafusion-ducklake
Prepare and publish a new release of datafusion-ducklake to crates.io
gemwalletcom/core
Review and fix local git changes against Gem Wallet Core coding standards and patterns
r3bl-org/r3bl-open-core
Publish a crate release to crates.io with changelog, standalone release notes, git tag, and GitHub release.
termide/termide
Prepare and publish a project release with version updates, changelog generation, tagging, and validation
termide/termide
Collect uncommitted changes and create a semantic commit with a descriptive message
Works with
Categories
Full-workspace code quality analysis and refactoring with validation. Refactor is an agent skill from termide/termide.
Refactor fits situations like: tasks that involve Refactoring; tasks that involve Code quality.
Run `npx skills add termide/termide --skill refactor -a claude-code`. Or copy the skill folder (.agents/skills/refactor in termide/termide) into .claude/skills/refactor in your project. Claude Code loads it when a task matches its description.
Run `npx skills add termide/termide --skill refactor -a codex`. Or copy the skill folder (.agents/skills/refactor in termide/termide) into .agents/skills/refactor 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 termide/termide --skill refactor -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/refactor, .gemini/skills/refactor, .github/skills/refactor and .opencode/skills/refactor in your project.
Going by SKILL.md and its folder, Refactor needs the command-line tools its instructions call (cargo and git). Its frontmatter pre-approves these tools: Read, Grep, Glob, Bash(cargo check*), Bash(cargo clippy*), Bash(cargo test*), Bash(cargo fmt*), Bash(cargo tree*), Bash(cargo audit*), Bash(cargo outdated*), Bash(cargo machete*), Bash(cargo deny*), Bash(cargo mutants*), Bash(cargo tarpaulin*), Bash(cargo udeps*), Bash(git status*), Bash(git diff*), Bash(git stash*), Bash(git log*), Bash(wc *), Bash(grep*), Edit, Write, Task.
SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. 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.
Refactor is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.8k tokens (SKILL.md is roughly 11k 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 Refactor: Graph-Guided Safe Refactoring (tirth8205/code-review-graph, 32k stars), Worktrunk CLI Output Rules (max-sixty/worktrunk, 8.9k stars), Coding Agent (mastra-ai/mastra, 29k stars) and Release Datafusion Ducklake (datafusion-contrib/datafusion-ducklake, 182 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
termide (a GitHub organization) maintains it in termide/termide, which has 171 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 6, 2026.
Source: termide/termide on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.