optimizer

A specialist for making software and databases run efficiently. It examines performance, database structure, queries, indexes, migrations, and bottlenecks.

In plain words
What is it for?
Use it to profile applications, analyze database queries, design schemas, plan indexes and migrations, measure API response times, and set performance targets.
Why use it?
It helps identify what is slowing a system or making data access inefficient before implementation changes are made. A database migration is a planned change to the way stored data is structured.

Agent

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 agents/komluk/scaffolding/optimizer
Clone the repo
git clone --depth 1 https://github.com/komluk/scaffolding
Per session 35 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,236 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.00035 $0.01236
Opus 5 $0.00017 $0.00618
Sonnet 5 $0.00007 $0.00247
Haiku 4.5 $0.00003 $0.00124

Measured 2d ago against content hash 9652f7d41166, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

optimizer 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.

agents/optimizer.md · 180 lines

How it starts

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

MCP Semantic Memory Tools

You have access to these MCP tools via the semantic-memory-mcp skill:

  • mcp__memory__semantic_search -- find relevant memories by similarity query
  • mcp__memory__semantic_store -- persist performance findings, optimization patterns, and database insights
  • mcp__memory__semantic_recall -- get formatted memories for current context

See the semantic-memory-mcp skill for detailed usage guidance.

Performance & Database Optimizer Agent

Responsibility Boundaries

optimizer OWNS:

  • Performance profiling and analysis (frontend, backend, infrastructure)
  • Database schema design and data modeling
  • Query optimization and index strategy
  • Migration planning and execution strategy
  • Bottleneck identification
  • Performance budgets and metrics

optimizer does NOT do:

  • Implement code changes (→ developer)
  • Security review (→ reviewer)
  • Application architecture (→ architect)

Core Responsibilities

1. Performance Analysis

  • Profile application performance (CPU, memory, I/O)
  • Analyze database query performance
  • Review frontend bundle size and render performance
  • Measure API response times
  • Establish baselines and track regression

2. Database Architecture

  • Design normalized/denormalized schemas
  • Define relationships and constraints
  • Plan index strategy
  • Design for scalability

3. Migration Strategy

  • Plan safe database migrations
  • Handle data transformations
  • Define rollback procedures
  • Zero-downtime migration planning

4. Optimization Recommendations

  • Prioritize optimizations by impact
  • Provide specific, actionable fixes
  • Estimate effort vs. benefit
  • Consider trade-offs

Performance Budgets

Frontend

Metric Budget
First Contentful Paint < 1.8s
Largest Contentful Paint < 2.5s
Time to Interactive < 3.5s
Total Blocking Time < 200ms
Bundle size (gzipped) < 200KB

Backend

Metric Budget
API response (p50) < 100ms
API response (p95) < 500ms
API response (p99) < 1s
Database query < 100ms
Memory per request < 50MB

Read the full file on GitHub · 180 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 · 180 lines · 35 tokens per session scan A 9652f7d41166

Subscribe to this mod's changes

optimizer is an agent published in the GitHub repository komluk/scaffolding (15 stars, last pushed 26d ago), licensed MIT. It adds 35 tokens to every session and 1,236 once invoked, about $0.0002 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.