Borrowing it
Nothing to install: this file belongs to irahardianto/rugged-gemini. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/irahardianto/rugged-gemini/main/.gemini/commands/refactor.tomlgit clone --depth 1 https://github.com/irahardianto/rugged-geminiWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/irahardianto/rugged-gemini/refactor)<a href="https://agentmods.dev/commands/irahardianto/rugged-gemini/refactor"><img src="https://agentmods.dev/badge/commands/irahardianto/rugged-gemini/refactor.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00795 |
| Opus 5 | $0.00000 | $0.00398 |
| Sonnet 5 | $0.00000 | $0.00159 |
| Haiku 4.5 | $0.00000 | $0.00080 |
Grade A, and why
refactor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 86 lines — stays where its author put it; the contents beside it link to each section on GitHub.
description = "Refactor existing code safely: 3-path requirement elicitation → impact analysis → incremental change → parity verification. Dispatches @refactoring-specialist for execution."
prompt = """
Refactor Workflow
Phase 0: Requirement Elicitation
Determine refactoring source before proceeding:
Path A — Human-Specified
User provides a specific, actionable target:
- ✅
/refactor extract storage interface in task feature - ✅
/refactor split user handler into separate auth handler - ✅
/refactor migrate callbacks to async/await in notification service→ Proceed directly to Phase 1
Path B — Tool-Driven
User references a static analysis tool as the requirement source:
- ✅
/refactor from-deepsource— read DeepSource MCP findings - ✅
/refactor from-clippy— parsecargo clippyoutput - ✅
/refactor from-lint— parse linter output (ESLint, golangci-lint, ruff) → Parse tool findings → present summary → user approves scope → proceed to Phase 1
Supported tools:
| Tool | Integration |
|---|---|
| DeepSource MCP | Read findings via deepsource MCP tools |
| cargo clippy | Parse cargo clippy --message-format json |
| golangci-lint | Parse golangci-lint run --out-format json |
| ESLint | Parse npx eslint . --format json |
| ruff | Parse ruff check . --output-format json |
| SonarQube | Read via API if available |
Path C — Discovery
User doesn't know what to refactor, or provides vague request:
- ✅
/refactor discover— audit first, then refactor - ❌
/refactor apps/backend— too vague - ❌
/refactor improve code quality— what specific issue? → Dispatch SCOUT(@scout + @qa-analyst, code smell audit) → Present findings → user approves scope → proceed to Phase 1
Vague request without path → "Run /refactor discover to find issues, or specify a target like /refactor extract storage interface in task feature."
When to Use / NOT
Use: restructuring, pattern migration, breaking dep upgrades, QA findings, extracting interfaces, tool-driven cleanup.
Don't: new features (orchestrator), small bugs (orchestrator Pattern B), "find improvements" without /refactor discover.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 86 lines · 0 tokens per session scan A e9cc067b63b4
refactor is a command published in the GitHub repository irahardianto/rugged-gemini (5 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 795 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other commands, from other repositories
qa-changes
This skill should be used when the user asks to "QA a pull request", "test PR changes", "verify a PR works", "functionally test changes", or when an automated workflow triggers QA validation of code changes. Provides a structured methodology for setting up the environment, exercising changed behavior, and reporting…
doctor
Diagnosticar y reparar problemas del framework Don Cheli, git y entorno. Usa cuando el usuario dice "doctor", "problemas del framework", "don cheli no funciona", "repair Don Cheli", "debug setup", "setup broken", "framework broken", "reparar entorno". Detecta y repara issues de configuración, git y dependencias…
fix
Universal debugging and fix application with semantic code analysis.
gh-issue-use-cypress
Like /gh-issue-use-browser, but pinned to the Cypress MCP — use when your project runs the Cypress MCP for browser automation. Example — /gh-issue-use-cypress "Composer > Save" saving toasts failure but the record persists.
http-service
Build, review or debug a Bun HTTP service. Loads the http-service skill, then works the task through its workflow.
auditar-cascading
Invoca cascading-failures-auditor — audita serviço para 5 triggers de cascade (sem timeout, retry sem jitter, sem circuit breaker, sem deadline, queue unbounded) e gera CASCADING-AUDIT.md.