readable-code

A language-independent guide to making existing code easier to read by improving control flow, names, order, and locality.

In plain words
What is it for?
Use it to spot confusing identifier groups, poor reading order, and scattered logic after the code's main units and interfaces have already been defined.
Why use it?
It helps readers follow a function from top to bottom without holding unnecessary details in their heads, while keeping structure and language-specific mechanics separate.

Skill for Claude CodeCodex

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 skills/jartan-llc/grimoire/readable-code
Any agent
npx skills add Jartan-LLC/grimoire --skill readable-code
Clone the repo
git clone --depth 1 https://github.com/Jartan-LLC/grimoire

Made for: Claude Code, Codex.

Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,188 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.00057 $0.03188
Opus 5 $0.00028 $0.01594
Sonnet 5 $0.00011 $0.00638
Haiku 4.5 $0.00006 $0.00319

Measured 2d ago against content hash 0035f2a1cb43, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

plugins/praxis/skills/readable-code/SKILL.md · 60 lines

How it starts

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

Readable Code

The local-clarity sibling of code-structure. code-structure carves the units and their contracts; this skill shapes how a single body reads to a human once those units exist. Four owners, one test:

  • hygiene = DELETE what git or a library already owns -- a restating comment, dead code, a name that lies or says nothing. A rule that says delete X is hygiene's.
  • readable-code = READ -- shape control flow, the naming of a set of identifiers, and the order and locality of a body so a reader follows it straight down holding as little in mind as possible.
  • code-structure = SHAPE THE UNITS -- decomposition and depth, cohesion, coupling, interfaces, contracts, data invariants. Anything about where a seam falls or how big a unit should be is code-structure's (it owns the size-vs-depth resolution); this skill assumes the units are already carved and asks only whether each reads clearly.
  • pythonica = Python mechanics -- a rule naming a Python construct (a comprehension, match, a context manager) is pythonica's; keep this skill language-agnostic.

Every rule below is a recognizable smell (something a reader or author can actually spot) -> the principle it violates -> a fix direction. No line or nesting-depth count gates any rule; that false precision is what these qualitative smells replace.

Control-flow shape

The physical shape should mirror the logical shape.

  • Buried happy path -- SMELL: you cannot find the main story; it sits at the deepest indent behind a stack of preconditions, tangled at the same level as the error handling, its matching else far below. PRINCIPLE: the main path should run straight down the trunk at one indentation level while edge and error cases are detected, handled, and dismissed in the margin. FIX: invert each precondition into an early return or continue at the top so the primary path falls through unindented. Judge success by whether the main path became unconditional and reads straight down, not by how many levels you removed.
  • Predicate you must invert in your head -- SMELL: if (!isNotReady), or a two-armed branch whose if handles the rare case while the else quietly holds the norm -- you unwind a double negative or reverse the arms just to learn which case is normal. PRINCIPLE: a positively-named predicate reads as a plain assertion, and leading with the common case tells the normal story first. This is shape, not honesty: a truthful negative flag neither lies nor is empty, so hygiene's tests pass it -- reshaping it for readable phrasing is this skill's job. FIX: name the boolean for its affirmative state (is_ready) and phrase the test positively; where a genuine two-way branch remains, order it so the common case leads.
  • Cleverness the next reader must decode -- SMELL: the next reader has to hand-execute the line to know what it yields -- a nested ternary, several operations folded into one dense one-liner, arithmetic on booleans; the author-side tell is a flicker of pride in the compactness, unreliable precisely for the author who prizes it. The cleverness is the point, not a constraint the plain form was measured to fail. PRINCIPLE: code is read far more often than written, so the author's one-time cleverness is repaid as a recurring decoding cost by every later reader. FIX: write the obvious form by default; reach for the dense one only when the plain form is measured to fail a real constraint (a hot path, a memory ceiling) -- and that necessity is exactly the unrecoverable WHY that earns a comment (see hygiene, Comments/KEEP).
  • A loop that hides a named operation -- SMELL: a manual accumulation loop reimplements one well-known operation -- a sum, an any/all, a max-by, a group-by -- so a reader must execute the loop mentally to recover an operation that already has a plain name. PRINCIPLE: name the operation, so the code reads as what it computes ("these are the eligible ones") instead of how it accumulates. FIX: replace the loop with the named operation (a map/filter/reduce, a library call) or an intention-named helper. Discriminator (this is the positive complement to the cleverness rule, not its contradiction): this applies only when the loop is one nameable operation; several operations folded into one dense expression stay in the plain form.

Read the full file on GitHub · 60 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. 2d ago First seen · 60 lines · 57 tokens per session scan A 0035f2a1cb43

Subscribe to this mod's changes

readable-code is a skill published in the GitHub repository Jartan-LLC/grimoire (2 stars, last pushed 14d ago), licensed MIT. It adds 57 tokens to every session and 3,188 once invoked, about $0.0003 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-31.

Related

Other skills, from other repositories

lanshu-create-ai-presenter-video

Turn a topic or finished script plus an authorized adult presenter image into a complete, publish-ready AI presenter video. Use for new presenter videos and for continuing, revising, captioning, lip-sync repairing, or re-exporting an existing presenter-video job. Keep model and provider selection capability-based and…

cclank/lanshu-create-ai-presenter-video · 75 tokens

codex-autoresearch

Run autonomous, measurable experiments in a Git repository: change one hypothesis, verify a numeric metric, keep improvements, and revert failures. Use when the user wants Codex to keep iterating toward a numeric target in the foreground or as a detached background run. Do not use for ordinary one-shot coding…

leo-lilinxiao/codex-autoresearch · 80 tokens

xiaobei-skill-rebuild-image-in-powerpoint

Use when a user wants Codex to directly operate PowerPoint and reconstruct an entire reference image as editable PowerPoint objects while preserving its full layout, labels, connectors, and visual relationships. Do not use for paper-to-deck generation or VBA-only output.

xiao24bei/xiaobei-skill · 62 tokens

xiaohongshu-magazine

《小红书运营手册 · AI工作台》杂志感选题库技能。用于用户想把小红书账号当成一本杂志来办、确定内容母题(刊魂)、设计固定栏目、用开枝散叶方法批量生成选题、区分账号围绕业务还是围绕个人 IP、让每一篇都在攒信任或攒喜欢、或搭建可长期复用的选题库时触发。输入可以是账号定位、目标用户、产品或服务、个人经历和已有素材。输出母题、栏目结构、按信任和喜欢分类的选题库、每根栏目的角度公式和优先级建议。它负责战略层选题库,日历和系列排期交给 xiaohongshu-topic-planner。.

mengke-wang/xiaohongshu-ai-workbench · 184 tokens

xiaohongshu-conversion-path

《小红书运营手册 · AI工作台》成交路径设计技能。用于用户想把小红书内容、主页承接、置顶笔记、评论区、私信和产品/服务转化串起来时触发,重点处理从刷到内容到私信、预约、购买、体验、反馈或成交的路径。适合服务号、产品号、个人 IP、自由职业者和小程序推广。输入可以是账号定位、产品/服务、客单价、用户顾虑、当前内容和转化目标。输出内容分工、信任路径、私信筛选和成交动作。若用户只想改简介、看主页第一眼或优化置顶表达,应使用 xiaohongshu-profile。.

mengke-wang/xiaohongshu-ai-workbench · 168 tokens

xiaohongshu-profile

《小红书运营手册 · AI工作台》主页体检和简介改写技能。用于用户想优化主页第一眼、账号简介、昵称、头像描述、置顶笔记、信任感和定位表达时触发。输入可以是主页截图描述、昵称、简介、置顶笔记、账号定位、产品/服务和目标用户。输出主页诊断、问题优先级、简介改写和置顶建议。若用户重点询问内容到私信、购买、预约、体验或成交路径,应使用 xiaohongshu-conversion-path。.

mengke-wang/xiaohongshu-ai-workbench · 131 tokens