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 skills add andregusman-raiz/a-gusman-claude --skill ag-refatorar-codigogit clone --depth 1 https://github.com/andregusman-raiz/a-gusman-claudeWrote 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/skills/andregusman-raiz/a-gusman-claude/ag-refatorar-codigo)<a href="https://agentmods.dev/skills/andregusman-raiz/a-gusman-claude/ag-refatorar-codigo"><img src="https://agentmods.dev/badge/skills/andregusman-raiz/a-gusman-claude/ag-refatorar-codigo/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/andregusman-raiz/a-gusman-claude/ag-refatorar-codigo"><img src="https://agentmods.dev/badge/skills/andregusman-raiz/a-gusman-claude/ag-refatorar-codigo.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 1 finding, up to medium
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- medium Excessive Agency · line 4 Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.Fix: Remove the model/provider override or disclose it prominently and require explicit operator approval before invoking an external coding CLI or billed model.
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.00043 | $0.00624 |
| Opus 5 | $0.00022 | $0.00312 |
| Sonnet 5 | $0.00009 | $0.00125 |
| Haiku 4.5 | $0.00004 | $0.00062 |
Grade A, and why
ag-refatorar-codigo 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 9d 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 — 67 lines — stays where its author put it; the contents beside it link to each section on GitHub.
ag-refatorar-codigo — Refatorar Codigo
Spawn the ag-refatorar-codigo agent to restructure code without changing behavior.
Invocation
Use the Agent tool with:
subagent_type:ag-refatorar-codigomode:bypassPermissionsrun_in_background:trueprompt: Compose from template below + $ARGUMENTS
Prompt Template
Projeto: [CWD or user-provided path]
Escopo: [module or pattern to refactor from $ARGUMENTS]
## Output
- refactor-report.md com analise antes/depois
- Commits incrementais (1 por step de refatoracao)
- Testes existentes continuam passando (zero regressao)
Protocolo incremental:
1. Mudar UMA coisa → Rodar testes → Pass → Commit
2. Repetir ate completar escopo
3. Se teste falha → Revert → Investigar
Pre-condicao: RECUSAR se nao existem testes.
Output: refactor-report.md (antes → depois, arquivos, commits, diagrama).
Worktree isolation ativo.
Important
- ALWAYS spawn as Agent subagent — do NOT execute inline
- After spawning, confirm to the user that the refactor agent is running
- REFUSES to refactor without existing passing tests
- Each step is a separate commit for safe rollback
- Uses worktree isolation
Code Smell → Refactoring Map
| Code Smell | Refactoring | Trigger |
|---|---|---|
| Funcao > 40 linhas | Extract Function | Limites Clean Code |
| Classe > 300 linhas | Extract Class | Limites Clean Code |
| Switch/if-else chain (>= 3 branches) | Replace Conditional with Polymorphism | Complexidade |
| Primitivo com regras de dominio | Replace Primitive with Value Object | Email, Money, CPF |
| Parametros demais (>3) | Introduce Parameter Object | Clean Code limit |
| Feature Envy | Move Method | Metodo usa mais dados de outra classe |
| Duplicacao | Extract Method + reuse | DRY |
Regras de Ouro para Refatoracao
- NUNCA refatorar sem testes passando — testes sao a rede de seguranca
- NUNCA misturar refactoring e feature no mesmo commit — impossibilita rollback
- Cada passo deve manter testes verdes — se quebraram, reverter imediatamente
- Preferir refatoracoes pequenas e incrementais — 5 commits pequenos > 1 commit grande
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.
- 9d ago First seen · 67 lines · 43 tokens per session scan A 42c4f2c3cd24
ag-refatorar-codigo is a skill published in the GitHub repository andregusman-raiz/a-gusman-claude (19 stars, last pushed 3d ago), licensed MIT. It adds 43 tokens to every session and 624 once invoked, about $0.0002 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-09-03.
Other skills, from other repositories
go-testing
Trigger: Go tests, go test coverage, Bubbletea teatest, golden files. Apply focused Go testing patterns.
verify-implementation
A workflow that runs a project’s verification skills to produce a report on coding patterns, architecture rules, and project conventions. It is intended for work after implementation, before a pull request, or during code review.
test-fixing
Run tests and systematically fix all failing tests using smart error grouping. Use when user asks to fix failing tests, mentions test failures, runs test suite and failures occur, or requests to make tests pass.
code-qualities-assessment
Assess code maintainability through 5 foundational qualities (cohesion, coupling, encapsulation, testability, non-redundancy) with quantifiable scoring rubrics. Works at method/class/module levels across multiple languages. Produces markdown reports with remediation guidance. Use when you ask to "assess…
improving-tests
Improve test design, speed, and coverage with behavior-focused tests, useful seams, characterization tests, TDD, and test refactoring. Use when improving tests, optimizing slow suites, adding coverage, refactoring brittle tests, removing test waste, or working test-first. NOT for fixing production bugs (use…
react-testing-workflows
Testing strategy and execution for React applications. Covers Vitest configuration, React Testing Library patterns, custom hook testing, Playwright E2E, Storybook stories and play functions, and coverage reporting. Keywords: test, vitest, testing library, playwright, storybook, coverage, unit test, integration test…