codebase-optimization

codebase-optimization is a skill for Claude Code, Codex from omer-metin/skills-for-antigravity. It costs 84 tokens per session (436 once invoked), scanned A, original, Apache-2.0.

A guide to keeping a codebase maintainable and efficient through refactoring, performance work, and technical-debt management. Technical debt means shortcuts that make future changes harder.

In plain words
What is it for?
Use it to plan refactors, investigate performance problems, reduce code complexity, remove unused code, and manage technical debt.
Why use it?
It helps address slow software, complicated code, memory leaks, large bundles, and cleanup work in small, measurable steps.

Skill for Claude CodeCodex

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

Good fit Use it to plan refactors, investigate performance problems, reduce code complexity, remove unused code, and manage technical debt.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/omer-metin/skills-for-antigravity/codebase-optimization
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 omer-metin/skills-for-antigravity --skill codebase-optimization
Clone the repo
git clone --depth 1 https://github.com/omer-metin/skills-for-antigravity

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 codebase-optimization

README.md
[![agentmods](https://agentmods.dev/badge/skills/omer-metin/skills-for-antigravity/codebase-optimization/github.svg)](https://agentmods.dev/skills/omer-metin/skills-for-antigravity/codebase-optimization)
Your own site
<a href="https://agentmods.dev/skills/omer-metin/skills-for-antigravity/codebase-optimization"><img src="https://agentmods.dev/badge/skills/omer-metin/skills-for-antigravity/codebase-optimization/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 codebase-optimization

Your own site · 80×15
<a href="https://agentmods.dev/skills/omer-metin/skills-for-antigravity/codebase-optimization"><img src="https://agentmods.dev/badge/skills/omer-metin/skills-for-antigravity/codebase-optimization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 84 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 436 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.00084 $0.00436
Opus 5 $0.00042 $0.00218
Sonnet 5 $0.00017 $0.00087
Haiku 4.5 $0.00008 $0.00044

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

Security

Grade A, and why

codebase-optimization 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/codebase-optimization/SKILL.md · 37 lines

What it actually says

Codebase Optimization

Identity

You're a performance engineer who has optimized systems handling billions of requests. You've turned 5-second page loads into 200ms, reduced bundle sizes by 80%, and fixed memory leaks that took down production. You understand that premature optimization is the root of all evil, but you also know when it's time to act. You've learned that the best refactoring is incremental, the best architecture is simple, and the best optimization is deleting code. You measure everything, optimize strategically, and always have a rollback plan.

Your core principles:

  1. Measure before optimizing
  2. Refactor in small, safe steps
  3. The best code is code you don't have to write
  4. Complexity is the enemy of reliability
  5. Every optimization has a trade-off
  6. Working software beats perfect architecture
  7. Delete code whenever possible

Reference System Usage

You must ground your responses in the provided reference files, treating them as the source of truth for this domain:

  • For Creation: Always consult references/patterns.md. This file dictates how things should be built. Ignore generic approaches if a specific pattern exists here.
  • For Diagnosis: Always consult references/sharp_edges.md. This file lists the critical failures and "why" they happen. Use it to explain risks to the user.
  • For Review: Always consult references/validations.md. This contains the strict rules and constraints. Use it to validate user inputs objectively.

Note: If a user's request conflicts with the guidance in these files, politely correct them using the information provided in the references.

Files

What ships with it

3 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 · 37 lines · 84 tokens per session scan A 5a25304d4663

Subscribe to this mod's changes

codebase-optimization is a skill published in the GitHub repository omer-metin/skills-for-antigravity (145 stars, last pushed 7mo ago), licensed Apache-2.0. It adds 84 tokens to every session and 436 once invoked, about $0.0004 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-09-03.

Related

Other skills, from other repositories

debugging-and-error-recovery

Guides systematic root-cause debugging with hard rules against guess-fixes and symptom suppression. Use when tests fail, builds break, behavior doesn't match expectations, or you encounter any unexpected error. Triggers on "this is broken", "tests are failing", "why doesn't this work", or any error output.

borhen68/SkillEngine · 69 tokens

debugging-and-error-recovery

A systematic debugging procedure for finding the underlying cause of failed tests, broken builds, bugs, and unexpected behavior. It emphasizes reproducing the problem, preserving evidence, fixing the cause, and checking the fix.

vinvcn/addyosmani-agent-skills-zh · 57 tokens

observability-and-instrumentation

Instruments code so production behavior is visible and diagnosable. Use when adding logging, metrics, tracing, or alerting. Use when shipping any feature that runs in production and you need evidence it works. Use when production issues are reported but you can't tell what happened from the available data.

borhen68/SkillEngine · 66 tokens

performance-optimization

Optimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.

addyosmani/agent-skills · 59 tokens

doubt-driven-development

Subjects every non-trivial decision to a fresh-context adversarial review before it stands. Use when you want every assumption cross-examined before proceeding, when stress-testing a plan for hidden failure modes, when correctness matters more than speed, when working in unfamiliar code, when stakes are high…

addyosmani/agent-skills · 96 tokens

debugging-and-error-recovery

Guides systematic root-cause debugging. Use when tests fail, builds break, something that worked yesterday broke, behavior doesn't match expectations, or you encounter any unexpected error. Use when you need to figure out what broke and why — a systematic approach to finding and fixing the root cause rather than…

addyosmani/agent-skills · 67 tokens