clean-code-guard

clean-code-guard is a skill for Codex from amElnagdy/guard-skills. It costs 207 tokens per session (3,921 once invoked), scanned A, original, MIT.

A review workflow for production code in any programming language, using common design and maintainability principles.

In plain words
What is it for?
Use it after writing, refactoring, or fixing code, alongside the project’s own linters, type checkers, formatters, and tests.
Why use it?
It checks generated or changed code for avoidable complexity, duplication, unnecessary work, and common AI coding mistakes before release.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: mentions CLAUDE.md; mentions Claude Code; mentions AGENTS.md.

Good fit Use it after writing, refactoring, or fixing code, alongside the project’s own linters, type checkers, formatters, and tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/amelnagdy/guard-skills/clean-code-guard
About the project

guard-skills is a collection of review skills for coding agents that inspect code, tests, and documentation for common AI-generated problems. Developers run the relevant guard after an agent changes a project, before presenting, committing, or merging the work. The catalogue entries are individual guard skills from this collection.

amElnagdy/guard-skills · 1,231 stars · on GitHub · skills.sh

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.

Any agent
npx skills add amElnagdy/guard-skills --skill clean-code-guard
Clone the repo
git clone --depth 1 https://github.com/amElnagdy/guard-skills

Made for: Codex.

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 clean-code-guard

README.md
[![agentmods](https://agentmods.dev/badge/skills/amelnagdy/guard-skills/clean-code-guard.svg)](https://agentmods.dev/skills/amelnagdy/guard-skills/clean-code-guard)
Your own site
<a href="https://agentmods.dev/skills/amelnagdy/guard-skills/clean-code-guard"><img src="https://agentmods.dev/badge/skills/amelnagdy/guard-skills/clean-code-guard.svg" alt="Measured on agentmods" height="20"></a>
Per session 207 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,921 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 5 Jul 2026
  • Snyk pass 5 Jul 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00207 $0.03921
Opus 5 $0.00103 $0.01961
Sonnet 5 $0.00041 $0.00784
Haiku 4.5 $0.00021 $0.00392

Measured 9d ago against content hash 4694ad1d36cd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

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

skills/clean-code-guard/SKILL.md · 172 lines

How it starts

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

clean-code-guard

You are reviewing generated or changed code before it ships. Apply the rules below as a guard pass after the first implementation pass — and once this skill is active, keep applying it to every later code change in the same session, re-running the self-check before delivery after each edit rather than reverting to unguarded output because the skill loaded earlier. If the user explicitly invokes this skill before writing code, use the same rules while writing and still run the self-check before delivery.

Compatibility

This is a portable instruction skill. It requires no MCP server, network access, API key, shell command, local executable, or bundled script. It can be used in any runtime that supports SKILL.md plus directly linked references/ files; agents/openai.yaml is lightweight display metadata.

This skill does not replace project linters, formatters, type checkers, or test runners. Use the project's own tools for mechanical verification; use this skill for the judgement layer around code quality and review.

How to use this skill

This skill has three modes — pick based on the user's request.

Guard-pass mode (recommended): after code has been generated, edited, refactored, or fixed, check the diff or target files against the Always-applied imperatives below. Fix violations before presenting, committing, or merging the work.

Live mode (explicit): when the user invokes this skill before a risky code edit, apply the same imperatives while writing, then run the Self-check before delivery checklist. If you violate any rule, fix it before showing the user.

Review mode (triggered when the user asks you to review, audit, critique, or rate code): walk references/review-checklist.md against the target file(s) and produce a structured findings report. Do not edit code in review mode unless asked.

Across all three modes, the rule bodies live in references/. Read the relevant reference file when:

  • You hit a rule you don't fully remember the reasoning for.
  • The user pushes back on a rule and you need the source citation.
  • You're in review mode and need the full checklist.
  • The code under review touches a specific principle (e.g., subclassing → references/solid.md; deduplication → references/dry-kiss-yagni.md).

Read the full file on GitHub · 172 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 172 lines · 207 tokens per session scan A 4694ad1d36cd

Subscribe to this mod's changes

clean-code-guard is a skill published in the GitHub repository amElnagdy/guard-skills (1,231 stars, last pushed 2mo ago), licensed MIT. It adds 207 tokens to every session and 3,921 once invoked, about $0.0010 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.