refine-code

refine-code is a skill for Claude Code, Codex from vaayne/agent-kit. It costs 35 tokens per session (691 once invoked), scanned A, original, MIT.

A method for improving existing software without changing what it does. It covers cleaning up code, restructuring modules, improving architecture, and proving which parts can be removed safely.

In plain words
What is it for?
Use it to clarify functions, reorganize modules, improve boundaries and testability, consolidate coupled code, or identify dead code and configuration.
Why use it?
It helps make code easier to understand and maintain while reducing unnecessary complexity and unused structure.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to clarify functions, reorganize modules, improve boundaries and testability, consolidate coupled code, or identify dead code and configuration.

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

Made for: Claude Code, 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 refine-code

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/vaayne/agent-kit/refine-code"><img src="https://agentmods.dev/badge/skills/vaayne/agent-kit/refine-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 691 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
  • 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.00035 $0.00691
Opus 5.5 $0.00014 $0.00276
Sonnet 5.5 $0.00007 $0.00138
Haiku 4.5 $0.00003 $0.00069

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

Security

Grade A, and why

refine-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/refine-code/SKILL.md · 45 lines

How it starts

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

Refine Code

Reduce the effort needed to understand and maintain existing code while preserving its observable behavior and supported contracts. Rank improvements by cognitive load removed, not lines deleted.

Scope and authorization

Apply the user's intent to every mode:

  • Assess, audit, find, review, or report: inspect and propose; do not edit code, docs, or configuration.
  • Refactor, simplify, apply, clean up, or delete: implement the requested changes and verify them. Do not stop at suggestions or ask again merely because a change crosses files.
  • Continue within existing authorization. Ask only for an unresolved choice that materially changes scope, safety, supported behavior, or a hard-to-reverse decision. Prepare the concrete alternatives first.

Use the files, revisions, and boundaries the user named. For recent work, inspect Git status and the relevant staged, unstaged, committed, and untracked changes. Preserve unrelated work. Read applicable repository instructions; consult neighboring code and decision records only where they explain the change in question.

Choose the relevant guidance

  • Code: local readability, types, and organization. Use the guidance below.
  • Architecture: coupling, module responsibilities, or testability. Read references/ARCHITECTURE.md.
  • Entropy: dead code, duplicate state, unused configuration, or safe deletions. Read references/ENTROPY.md for consumer and compatibility checks.

Combine only the guidance the task needs; there is no mandatory mode sequence. If local friction has a structural cause, explain it and address it within scope. A broader redesign requires a separate decision only when it exceeds the request.

Code

Use these questions where they expose a concrete improvement:

  • Deletion: if the abstraction vanished, would complexity disappear or move into callers? Keep it when it hides needed knowledge, ownership, or policy.
  • Reading: where must a maintainer keep scattered facts in mind? Bring related logic together or name a meaningful intermediate value.
  • Types: do types accurately represent runtime values? Narrow only with evidence from producers and consumers; static types alone do not prove external input or persisted data safe.

Read the full file on GitHub · 45 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 Changed 82aa806763a2
  2. 2mo ago Changed · -103 lines · -145 tokens per session f0ada69ce9bb
  3. 3mo ago First seen · 148 lines · 180 tokens per session scan A c6f1635b78a7

Subscribe to this mod's changes

refine-code is a skill published in the GitHub repository vaayne/agent-kit (54 stars, last pushed yesterday), licensed MIT. It adds 35 tokens to every session and 691 once invoked, about $0.0001 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-08-30.

Related

refine-code compared with skills from other repositories

refine-code next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
refine-codevaayne/agent-kitSkill54yesterdayMITA35Claude Code, Codex
autoreviewopenclaw/clawhubSkill9.6ktodayMITA17Claude Code, Codex
omh-code-reviewrlaope/oh-my-hermesSkill6.4ktodayMITA18Claude Code
agent-teams-simplify-and-hardenLeoYeAI/openclaw-master-skillsSkill2.2k13d agoMITA115Claude Code, Codex
asplos-writing-stylebrycewang-stanford/Awesome-Journal-SkillsSkill1.5k3d agoMITA65Claude Code
revdiff-planumputun/revdiffSkill9773d agoMITA84Claude Code
re0-mergeLilMGenius/paperthinSkill1.5ktodayMITA51Claude Code, Codex