clean-code-reviewer

An automated code-review role that checks files against clean-code principles and returns refactoring suggestions ranked by priority.

In plain words
What is it for?
Use it to review implementation and test files, find concrete issues, and receive suggestions that point to the affected file locations and explain the recommended changes.
Why use it?
It helps identify unclear names, code smells, design violations, and structural problems without relying on vague review comments.

Agent

Install

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.

agentmods
npx agentmods add agents/t1/tdder/clean-code-reviewer
Clone the repo
git clone --depth 1 https://github.com/t1/tdder
Per session 36 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 389 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00036 $0.00389
Opus 5 $0.00018 $0.00195
Sonnet 5 $0.00007 $0.00078
Haiku 4.5 $0.00004 $0.00039

Measured 2d ago against content hash f5a4e2c8b1e4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

clean-code-reviewer 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.

.opencode/agents/clean-code-reviewer.md · 50 lines

What it actually says

Clean Code Reviewer

Perform a thorough clean code review of the provided code files.

Process

  1. Use the skill tool to load the clean-code skill
  2. Read the implementation and test files provided for review
  3. Analyze the code against all clean code principles in priority order:
    • Priority 1: Naming (CRITICAL)
    • Priority 2: Code Smells Detection
    • Priority 3: SOLID Principles
    • Priority 4: Method Design
    • Priority 5: Structure
  4. Return a prioritized list of specific, actionable refactoring suggestions

Output Format

For each finding, report:

  • Priority: Which priority level (1-5)
  • Principle: Which specific principle is violated
  • Location: File and line/method where the issue is found
  • Current: What the code currently does
  • Suggested: What the code should do instead
  • Rationale: Why this change improves the code

Order findings by priority (1 first, 5 last). Within the same priority, order by impact (highest impact first).

Important

  • Be specific and actionable. Do not give vague advice.
  • Every suggestion must reference a concrete location in the code.
  • If the code is already clean at a given priority level, state so and move on.
  • Do not suggest changes that would break existing tests.
  • Consider the 4 Rules of Simple Design: tests pass, reveals intent, no duplication, fewest elements.
Changes

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.

  1. 2d ago First seen · 50 lines · 36 tokens per session scan A f5a4e2c8b1e4

Subscribe to this mod's changes

clean-code-reviewer is an agent published in the GitHub repository t1/tdder (14 stars, last pushed 2d ago), licensed Apache-2.0. It adds 36 tokens to every session and 389 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-08-30.

Related

Other agents, from other repositories

code-reviewer

Reviews code for bugs, logic errors, security vulnerabilities, code quality issues, and adherence to project conventions. Merges security review capabilities including OWASP validation, secrets scanning, and regression detection. Uses confidence-based filtering for quality issues and severity classification for…

zircote-plugins/refactor · 65 tokens

architect

Code architecture analyst, optimization planner, and feature architecture designer. Reviews code from a design perspective, identifies architectural improvements, creates prioritized optimization plans, performs final quality assessments, and designs comprehensive implementation blueprints for new features.

zircote-plugins/refactor · 45 tokens

refactor-code

Code implementation specialist for refactoring workflows. Implements architectural optimizations focusing on clean code principles, fixes test failures, and ensures all changes preserve existing functionality without introducing bugs.

zircote-plugins/refactor · 37 tokens

code-explorer

Deep codebase discovery agent for refactoring and feature development workflows. Traces execution paths, maps architecture layers, catalogs dependencies, and produces structured codebase maps that feed all downstream agents. Runs as Phase 0.5 in refactoring or as parallel explorers in feature development.

zircote-plugins/refactor · 59 tokens

refactor-test

Test coverage analyzer and test case generator for refactoring workflows. Analyzes code coverage, adds missing test cases to meet production requirements, runs tests, and ensures all tests pass before proceeding with refactoring.

zircote-plugins/refactor · 45 tokens

Code Standards

Code style, clean code, refactoring, and coding standards guidelines.

JSK9999/ai-nexus · 16 tokens