Skip to main content
command CX Codex

suggest-refactor — Claude Code command: use and install

The suggest-refactor command reviews Rust code for clean-architecture violations and returns ranked refactoring steps with code examples.

no license ★ 1,357 updated 2026-03-01

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/suggest-refactor.md
Open on GitHub

What suggest-refactor does

The command inspects a Rust codebase for broken layer boundaries. It looks for outer-layer imports in domain code, concrete adapters inside application use cases, and HTTP or database types leaking into application logic. Findings are grouped from P0 to P3, with suggested changes and code samples.

Its declared tools are Read, Grep, Glob, Bash, and Edit. You can narrow the review with an argument such as src/application/ or request a severity-focused pass with --critical. This is for Rust projects: its checks target Rust source layout under src/, so a non-Rust project is the wrong fit.

What it helps with

  • spot adapter imports in domain code
  • replace concrete use-case dependencies with ports
  • move HTTP types out of application logic
  • find missing abstractions for external services
  • rank architecture fixes by priority

Example prompts for the agent

  • Review this Rust project for clean-architecture issues with /rust:suggest-refactor.
  • Focus the review on src/application/ with /rust:suggest-refactor src/application/.
  • Show only critical findings with /rust:suggest-refactor --critical.

How to install suggest-refactor

Manually: put the files in place

.claude/commands/suggest-refactor.md

Call it with /suggest-refactor. For all projects use ~/.claude/commands/

Questions about suggest-refactor

How do I install suggest-refactor in Claude Code?

Save the command file at .claude/commands/suggest-refactor.md.

What does suggest-refactor do?

It reviews Rust code for clean-architecture violations, ranks the findings from P0 to P3, and suggests concrete refactoring steps with code examples.

Can I limit the review to one part of a project?

Yes. Pass a path such as src/application/, or use --critical to focus the command on critical findings.

Similar slash commands

All slash commands for Code review and refactoring →

From the same set112

The whole set →
release-manager release-manager handles SemVer bumps, drafts changelog records, and verifies checklists before production deployment. CX Codex ★ 1,357repo stars incremental-feature-build The incremental-feature-build command breaks a request into testable features, tracks progress in project files, and works through features one at a time. Use it for multi-stage implementation tasks. CX Codex +1 ★ 1,357repo stars spec-workflow-setup spec-workflow-setup — a slash command that walks you through wiring the spec-workflow MCP server into Claude: dependencies, .mcp.json, .spec-workflow.json, then a connection check. CX Codex +1 ★ 1,357repo stars audit-clean-arch audit-clean-arch audits a Rust codebase against Clean Architecture rules. It locates improper layer dependencies, framework leaks, and concrete adapter couplings. CX Codex +1 ★ 1,357repo stars simulation_examples simulation_examples — a set of ready prompts for the simulation commands in Claude: how to frame a decision, a market response or a timeline before you commit to it. CX Codex +1 ★ 1,357repo stars azure-devops-specialist azure-devops-specialist configures Microsoft Azure services and sets up CI/CD automation using the Azure CLI and MCP tools. Helpful when building pipelines and managing cloud deployments. CX Codex ★ 1,357repo stars skill-validator-agent skill-validator-agent is a Claude Code subagent that checks skill YAML, structure, file links, and scripts. Run it when creating a skill or reviewing changes. CX Codex ★ 1,357repo stars skill-documenter-agent skill-documenter-agent — a subagent that writes complete documentation for Claude Code skills: SKILL.md, examples, API reference, and usage guides. Works directly with code and text. CX Codex ★ 1,357repo stars

Project sponsors

Companies that keep this analytics open