readable-code

readable-code is a skill for Codex from denysdovhan/agents. It costs 100 tokens per session (2,301 once invoked), scanned A, original, MIT.

A set of rules for writing, reviewing, and refactoring code so that people can understand it more easily. It applies across languages, with extra guidance for TypeScript, JavaScript, and React code.

In plain words
What is it for?
Use it to keep functions focused, choose clearer names and structure, review changes, and clean up code in TypeScript, JavaScript, JSX, Python, or other languages.
Why use it?
It gives developers consistent ways to simplify confusing code without rewriting unrelated areas. It also explains review findings by rule and respects the project's existing formatter, linter, and conventions.

Skill for Codex

Written for Codex: agents/openai.yaml present.

Good fit Use it to keep functions focused, choose clearer names and structure, review changes, and clean up code in TypeScript, JavaScript, JSX, Python, or other languages.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/denysdovhan/agents/readable-code
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 denysdovhan/agents --skill readable-code
Clone the repo
git clone --depth 1 https://github.com/denysdovhan/agents

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 readable-code

README.md
[![agentmods](https://agentmods.dev/badge/skills/denysdovhan/agents/readable-code/github.svg)](https://agentmods.dev/skills/denysdovhan/agents/readable-code)
Your own site
<a href="https://agentmods.dev/skills/denysdovhan/agents/readable-code"><img src="https://agentmods.dev/badge/skills/denysdovhan/agents/readable-code/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.

agentmods 80×15 button for readable-code

Your own site · 80×15
<a href="https://agentmods.dev/skills/denysdovhan/agents/readable-code"><img src="https://agentmods.dev/badge/skills/denysdovhan/agents/readable-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,301 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.
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.00100 $0.02301
Opus 5.5 $0.00040 $0.00920
Sonnet 5.5 $0.00020 $0.00460
Haiku 4.5 $0.00010 $0.00230

Measured 1mo ago against content hash 0650f4829125, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

readable-code 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.

skills/readable-code/SKILL.md · 240 lines

How it starts

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

Readable Code Rules (/readable-code)

Apply these rules when writing, reviewing, or refactoring code. Inspired by The Art of Readable Code by Dustin Boswell and Trevor Foucher.

Core principle: Code should be easy to understand. The time it takes someone else (or future you) to understand the code is the ultimate metric.

How to Apply

  • The general rules below apply to every language. Examples use TypeScript.
  • Load the language reference for idioms:
  • The project's linter, formatter, and existing conventions win over these rules. Readability is partly familiarity, so a consistent codebase beats a locally "better" style.
  • When editing existing code, apply the rules to the code you touch. Mention other problems instead of rewriting unrelated code.
  • When reviewing, cite the rule number with each finding so the author can look up the reasoning.

1. Keep Functions Short and Focused

  • A function should do one thing. If you can describe what it does with "and", split it.
  • Aim for functions that fit on one screen (~15-25 lines). If it's longer, extract sub-tasks.
  • Each function should operate at a single level of abstraction — don't mix high-level logic with low-level details in the same function.

2. Flatten Control Flow — No Deep Nesting

  • Never nest more than 2 levels deep. If you have a loop inside a loop, or an if inside a loop inside an if, extract the inner block into a helper function with a descriptive name.
  • Use early returns / guard clauses to handle edge cases at the top, keeping the main logic flat.
  • Prefer continue or break to skip iterations rather than wrapping the body in a conditional.
  • Replace complex conditionals with well-named helper functions or variables that explain the intent.

Read the full file on GitHub · 240 lines

Files

What ships with it

5 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. 1mo ago First seen · 240 lines · 100 tokens per session scan A 0650f4829125

Subscribe to this mod's changes

readable-code is a skill published in the GitHub repository denysdovhan/agents (21 stars, last pushed 1mo ago), licensed MIT. It adds 100 tokens to every session and 2,301 once invoked, about $0.0004 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-10-30.

Related

readable-code compared with skills from other repositories

readable-code next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
readable-codedenysdovhan/agentsSkill211mo agoMITA100Codex
security-specialistfabricioctelles/skillsSkill1516d agoApache-2.0A72Claude Code, Codex
agent-plugin-evalfabricioctelles/skillsSkill1516d agoApache-2.0A75Claude Code, Codex
paired-sessionNYTC69/review-loopSkill3yesterdayApache-2.0A108Claude Code, Codex
reorganizeNYTC69/review-loopSkill3yesterdayApache-2.0A98Claude Code
review-loopNYTC69/review-loopSkill3yesterdayApache-2.0A129Claude Code
simplifyvanducng/skillsSkill7todayMITA199Claude Code