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.
curl -O https://raw.githubusercontent.com/tomdwipo/claude-soul/main/.claude/agents/code-quality-guardian.mdgit clone --depth 1 https://github.com/tomdwipo/claude-soulWrote 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/agents/tomdwipo/claude-soul/code-quality-guardian)<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>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.00000 | $0.02314 |
| Opus 5 | $0.00000 | $0.01157 |
| Sonnet 5 | $0.00000 | $0.00463 |
| Haiku 4.5 | $0.00000 | $0.00231 |
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 --> 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"
}
}
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.
- 8d ago First seen · 348 lines · 0 tokens per session scan C 8e4ecc93b6dd
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.
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…
predictive-analyst
Precognition agent. Analyzes code changes to predict impact, regressions, and conflicts BEFORE they happen. Uses dependency graphs and historical data.
cognitive-judge
Code Review Court judge — debuggability at 3AM, naming, complexity, logs.
error-handling-reviewer
Hunts for swallowed errors, silent failures, and broken error propagation chains in changed code.
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…
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…