ECC is a toolkit that organizes and improves how coding agents work through skills, memory, security checks, research practices, and related extensions. It is for developers using agents such as Claude Code, Codex, OpenCode, and Cursor.
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.
git clone --depth 1 https://github.com/affaan-m/ECCWrote 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/affaan-m/ecc/refactor)<a href="https://agentmods.dev/commands/affaan-m/ecc/refactor"><img src="https://agentmods.dev/badge/commands/affaan-m/ecc/refactor/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/commands/affaan-m/ecc/refactor"><img src="https://agentmods.dev/badge/commands/affaan-m/ecc/refactor.svg" alt="Reviewed on agentmods" width="80" 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.00014 | $0.00413 |
| Opus 5.5 | $0.00006 | $0.00165 |
| Sonnet 5.5 | $0.00003 | $0.00083 |
| Haiku 4.5 | $0.00001 | $0.00041 |
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 1mo 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.
What it actually says
Refactor & Cleanup
Improve the internal structure of the selected code without changing its observable behavior. All tests must pass before and after.
Before Starting
- Confirm the test suite is passing.
- Note the current coverage baseline.
- Identify the scope: single function, file, or module?
Refactoring Targets
Dead Code Removal
- Unused variables, imports, functions, and exports
- Commented-out code blocks (delete, don't leave as comments)
- Feature flags that are permanently enabled/disabled
- Unreachable branches
Duplication Reduction
- Repeated logic that can be extracted into a shared utility
- Copy-pasted blocks differing only in a parameter (extract with that parameter)
- Inline constants that appear in multiple places (extract to named constants)
Structure Improvements
- Functions over 50 lines → break into smaller, named steps
- Files over 800 lines → extract cohesive sub-modules
- Nesting deeper than 4 levels → extract early-return guards or helper functions
- Mixed concerns in one function → split into focused single-responsibility functions
Naming
- Rename variables/functions whose names don't match their behavior
- Replace magic numbers and strings with named constants
- Align naming with the domain language used elsewhere in the codebase
Constraints
- No behavior changes — refactoring is purely structural.
- One concern at a time — do not mix refactoring with feature work or bug fixes.
- Keep tests green — run the suite after each meaningful change.
- Don't add abstractions preemptively — extract only what has already proven to be duplicated (rule of three).
Output
After refactoring, summarize:
- What was removed (dead code, duplication)
- What was extracted (new utilities, constants)
- What was renamed and why
- Coverage before / after (should not decrease)
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.
- 1mo ago First seen · 51 lines · 14 tokens per session scan A 1fe05960dc20
refactor is a command published in the GitHub repository affaan-m/ECC (290,905 stars, last pushed 2d ago), licensed MIT. It adds 14 tokens to every session and 413 once invoked, about $0.0001 per session on Opus 5.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-07.
Other commands, from other repositories
caveman-review
Caveman-style code review — one-line findings with severity.
double-check
Comprehensive verification with automated quality gates, confession gathering, and confidence-based issue filtering. Default: self-review with gates. --deep: multi-agent review via code-reviewer agent. Use before committing, after fixing bugs, or to validate feature completeness.
review-skills
Review changed skills: automated bash checks + 9 structural dimensions (D1-D9) + 5 intent checks (M1-M5). PASS/FAIL verdict. Fix in-place.
qa
Invoke QA Engineer for test case design, bug investigation, and quality assurance.
code-review
Code review a pull request.
tester
Alias for /qa (/rob) - Senior QA Engineer for black-box feature testing.