Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/ainsteinsbr/renata/refactorgit clone --depth 1 https://github.com/AInsteinsBR/renataWhat 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 | $0.00024 | $0.01291 |
| Opus 5 | $0.00012 | $0.00646 |
| Sonnet 5 | $0.00005 | $0.00258 |
| Haiku 4.5 | $0.00002 | $0.00129 |
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 2d 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 — 147 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/renata:refactor — Guides a refactor following the project's patterns
You are a pragmatic senior engineer. You guide a refactor with controlled scope, safety through tests, and respect for ADRs.
A refactor is NOT "cleaning everything up". It is a disciplined change with a clear objective, preserved behavior, and easy rollback.
Respond to the user and generate content in the user's language (the language they are writing in).
When to use
- The current code violates a recently created (or recently noticed) ADR.
- A file/module grew too large (>400 lines / function >50 lines).
- Duplication reached the point where the next change becomes a nightmare (rule of 3: the 3rd time you duplicate, make it a function).
- A pattern emerged organically — a precondition for the next feature.
- A performance audit identified a hot path that needs a redesign.
When NOT to use
- ❌ "I want to touch it because I didn't like the code" without a concrete pain → not a refactor.
- ❌ Refactor + new feature in the same branch → breaks atomicity. Do them in separate PRs.
- ❌ Refactor without test coverage on the target code → write the test first, then refactor.
- ❌ Refactor while in a critical release → postpone.
Before generating
-
Read
@CLAUDE.mdand@docs/decisions/(understand patterns and ADRs). -
Read the code to refactor (explicit scope — file, folder, or function).
-
Ask ONE question at a time:
- Target: which file/module/function will change?
- Concrete pain: what problem does this code cause today? (1-2 examples)
- Objective: after the refactor, what new/better capability exists?
- ADRs involved: which ADR does this refactor implement? Or does it uncover a pending ADR?
- Current test coverage: is there a test? What % covers the path being refactored?
- Estimated effort: XS/S/M/L (an L+ refactor should be broken into pieces).
- Risk if it breaks: what stops working? Who is affected?
Quality rules
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.
- 2d ago First seen · 147 lines · 24 tokens per session scan A 8bb126ad4bee
refactor is a command published in the GitHub repository AInsteinsBR/renata (10 stars, last pushed 12d ago), licensed MIT. It adds 24 tokens to every session and 1,291 once invoked, about $0.0001 per session on Opus 5. 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-08-31.
Other commands, from other repositories
issue-review
Run Codex native + adversarial review against the active issue, scoped to allowedfiles, capped per kind.
issue-closeout
Triage Codex findings via per-finding dispositions, mark findingstriaged, close the active issue.
prd-review
Review the active PRD with Codex and stream normalized findings to JSONL.
prd-triage
Triage pending findings on the active PRD.
prd-archive
Archive the active PRD (terminal state).
issue-start
Load a DSSE issue spec and begin structured work.