claude-soul: Agent for Claude Code

.claude/agents/code-quality-guardian.md

code-quality-guardian is an agent for Claude Code from tomdwipo/claude-soul. It costs 0 tokens per session (2,314 once invoked), scanned C, original, MIT.

An Android code-quality review agent focused on coding standards, maintainable design, documentation, and linting. It uses principles such as avoiding duplication and unnecessary complexity.

In plain words
What is it for?
Use it to review Kotlin or Android projects for naming, structure, method and class size, complexity, nesting, parameters, and test coverage. The supplied description lists target thresholds for these checks.
Why use it?
It helps identify inconsistent or difficult-to-maintain Android code and checks it against stated quality rules and limits.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

This is tomdwipo/claude-soul's own configuration. It tells Claude Code how to work on claude-soul itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-soul configures →

Reuse

Borrowing it

Nothing to install: this file belongs to tomdwipo/claude-soul. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/tomdwipo/claude-soul/main/.claude/agents/code-quality-guardian.md
Clone the repo
git clone --depth 1 https://github.com/tomdwipo/claude-soul

Made for: Claude Code.

Wrote 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.

agentmods badge for code-quality-guardian

README.md
[![agentmods](https://agentmods.dev/badge/agents/tomdwipo/claude-soul/code-quality-guardian.svg)](https://agentmods.dev/agents/tomdwipo/claude-soul/code-quality-guardian)
Your own site
<a href="https://agentmods.dev/agents/tomdwipo/claude-soul/code-quality-guardian"><img src="https://agentmods.dev/badge/agents/tomdwipo/claude-soul/code-quality-guardian.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,314 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.02314
Opus 5 $0.00000 $0.01157
Sonnet 5 $0.00000 $0.00463
Haiku 4.5 $0.00000 $0.00231

Measured 8d ago against content hash 8e4ecc93b6dd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade C, and why

code-quality-guardian scanned grade C with 1 finding 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 8d 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.

Hidden instructionshighPrompt injection

Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.

<!-- Ignore in test files -->
.claude/agents/code-quality-guardian.md · 348 lines

How it starts

The opening of the file, as written. The whole thing — 348 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a Principal Software Quality Engineer specializing in Android code quality, clean code principles, and development best practices. Your mission is to ensure consistently high code quality, maintainability, and adherence to established coding standards.

Core Quality Principles

Clean Code Principles

  • SOLID: Single Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, Dependency Inversion
  • DRY: Don't Repeat Yourself - eliminate duplication
  • KISS: Keep It Simple, Stupid - avoid unnecessary complexity
  • YAGNI: You Aren't Gonna Need It - don't over-engineer
  • Boy Scout Rule: Leave code better than you found it

Code Quality Metrics

// Maintain these quality thresholds:
object QualityMetrics {
    const val MAX_METHOD_LENGTH = 20 // lines
    const val MAX_CLASS_LENGTH = 300 // lines
    const val MAX_CYCLOMATIC_COMPLEXITY = 10
    const val MIN_TEST_COVERAGE = 80 // percent
    const val MAX_METHOD_PARAMETERS = 5
    const val MAX_NESTING_DEPTH = 3
}

Kotlin Code Standards

Naming Conventions

// Classes: PascalCase
class UserRepository

// Functions: camelCase, verb phrases
fun getUserById(id: String): User

// Properties: camelCase
val userName: String

// Constants: UPPER_SNAKE_CASE
const val MAX_RETRY_COUNT = 3

// Packages: lowercase
package com.example.app.feature.lending

// Test functions: backticks for readability
@Test
fun `getUserById returns null when user not found`() { }

Code Organization

// Standard file structure
class UserViewModel(
    // 1. Properties (dependencies first)
    private val userRepository: UserRepository,
    private val analyticsTracker: AnalyticsTracker
) : ViewModel() {
    
    // 2. Public properties
    val userState = MutableStateFlow<UserState>(UserState.Loading)
    
    // 3. Initialization block
    init {
        loadUser()
    }
    
    // 4. Public functions
    fun refreshUser() { }
    
    // 5. Private functions
    private fun loadUser() { }
    
    // 6. Companion object
    companion object {
        const val USER_ID_KEY = "user_id"
    }
}

Read the full file on GitHub · 348 lines

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. 8d ago First seen · 348 lines · 0 tokens per session scan C 8e4ecc93b6dd

Subscribe to this mod's changes

code-quality-guardian is an agent published in the GitHub repository tomdwipo/claude-soul (24 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,314 tokens. A static security scan graded it C with 1 finding (hidden instructions). 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

swiftui-performance-analyzer

Use this agent when the user mentions SwiftUI performance, janky scrolling, slow animations, or view update issues. Automatically scans SwiftUI code for performance anti-patterns - detects expensive operations in view bodies, unnecessary updates, missing lazy loading, and SwiftUI-specific issues that cause frame…

CharlesWiltgen/Axiom · 155 tokens

predictive-analyst

Precognition agent. Analyzes code changes to predict impact, regressions, and conflicts BEFORE they happen. Uses dependency graphs and historical data.

softspark/ai-toolkit · 35 tokens

cognitive-judge

Code Review Court judge — debuggability at 3AM, naming, complexity, logs.

gonzalezpazmonica/savia · 23 tokens

error-handling-reviewer

Hunts for swallowed errors, silent failures, and broken error propagation chains in changed code.

OutSystems/outsystems-mcp · 24 tokens

silent-failure-hunter

Use this agent when reviewing code changes in a pull request to identify silent failures, inadequate error handling, and inappropriate fallback behavior. Invoke it after work involving error handling, catch blocks, fallback logic, or any code that could suppress errors. See "When to invoke" in the agent body for…

nota-america/forgecat-agent-profiles · 67 tokens

fec-ui-checker

Use this subagent to troubleshoot visual defects, layout confusion, CSS issues, responsive exceptions, and inconsistencies between interaction and design in the front-end UI, and save the report as a Markdown file. Supports obtaining design data from Figma, Sketch, MasterGo, Pixso, Moko, and Mock, compares the design…

bovinphang/frontend-craft · 0 tokens