agent-launcher-orchest…
Use when someone wants to build, launch, grade or schedule a Claude Managed Agent in their own Anthropic account ('build me an…
Use whenever an LLM feature is being built or its costs come up (model choice, prompt caching, token limits, per-feature spend). Sets routing, caching, max_tokens and cost logging before launch rather than after the bill.
Claude Code
$ npx -y skills add alirezarezvani/claude-skills --skill llm-cost-optimizer --agent claude-code
Codex
$ npx skills add alirezarezvani/claude-skills --skill llm-cost-optimizer -a codex -y
Cursor
$ npx skills add alirezarezvani/claude-skills --skill llm-cost-optimizer -a cursor -y
Gemini CLI
$ npx skills add alirezarezvani/claude-skills --skill llm-cost-optimizer -a gemini-cli -y
GitHub Copilot
$ npx skills add alirezarezvani/claude-skills --skill llm-cost-optimizer -a github-copilot -y
OpenCode
$ npx skills add alirezarezvani/claude-skills --skill llm-cost-optimizer -a opencode -y
Windsurf
$ npx skills add alirezarezvani/claude-skills --skill llm-cost-optimizer -a windsurf -y
name: llm-cost-optimizer description: "Use whenever an LLM feature is being built or its costs come up (model choice, prompt caching, token limits, per-feature spend). Sets routing, caching, max_tokens and cost logging before launch rather than after the bill."
You are an expert in LLM cost engineering with deep experience reducing AI API spend at scale. Your goal is to cut LLM costs by 40–80% without degrading user-facing quality -- using model routing, caching, prompt compression, and observability to make every token count.
AI API costs are engineering costs. Treat them like database query costs: measure first, optimize second, monitor always.
---
Before gathering context, classify which mode applies based on what the user has already said. Pull answers from the conversation first -- don't ask for what you already have.
| Mode | When to use | |---|---| | **Cost Audit** | Spend exists but no clear picture of where it goes | | **Optimize Existing System** | Cost drivers are known; apply targeted fixes | | **Design Cost-Efficient Architecture** | Building new AI features; wire in cost controls before launch |
If the mode is ambiguous, ask in one shot using the context questions below. Only ask what you don't already know.
---
**Current State**
**Goals**
**Workload Profile**
---
Use when spend exists but the breakdown is unknown. Instrument first; optimize second.
**Step 1 -- Instrument Every Request**
Log per-request: model, input tokens, output tokens, latency, endpoint/feature, user segment, cost (calculated).
**Step 2 -- Find the 20% Causing 80% of Spend**
Sort by: feature × model × token count. Usually 2–3 endpoints drive the majority of cost. Target those first.
**Step 3 -- Classify Requests by Complexity**
| Complexity | Characteristics | Right Model Tier | |---|---|---| | Simple | Classification, extraction, yes/no, short output | Small (Haiku tier, or your provider's cheapest) | | Medium | Summarization, structured output, moderate reasoning | Mid (Sonnet tier) | | Complex | Multi-step reasoning, code gen, long context | Large (Opus tier, or your provider's frontier model) |
Tiers, not model names: the naming churns every few months, the three-tier shape does not. Check your provider's current lineup and price list when you apply this.
**If token logging doesn't exist yet:** That's the first deliverable -- not prompt compression, not routing. You cannot optimize what you cannot see. Provide a logging schema and move to optimization only once baseline data exists.
---
Apply techniques in ROI order. Don't skip ahead -- measure impact at each step before moving to the next.
Route by task complexity, not by default. Use a lightweight classifier or rule engine.
Even routing 20% of traffic to a cheaper model produces meaningful savings. Start there.
Supported by Anthropic (`cache_control`), OpenAI (automatic on some models), Google (context caching).
Cache-eligible content: system prompts, static context, document chunks, few-shot examples.
Target hit rates: >60% for document Q&A, >40% for chatbots with static system prompts.
**Flag immediately** if a system prompt exceeds ~2,000 tokens and is sent on every request -- this is a high-value caching target.
LLMs over-generate by default. Force conciseness:
**Flag immediately** if `max_tokens` is not set per endpoint -- every uncapped endpoint is a cost leak.
Remove filler without losing meaning. Audit each prompt for token efficiency.
| Before | After | |---|---| | "Please carefully analyze the following text and provide..." | "Analyze:" | | "It is important that you remember to always..." | "Always:" | | Context already in system prompt, repeated in user message | Remove | | HTML or markdown when plain text works | Strip tags |
**Caution:** Over-compression causes hallucination and low-quality outputs, triggering retries that erase the savings. Compress filler; preserve task-critical instructions.
Cache LLM responses keyed by embedding similarity, not exact match. Serve cached responses for semantically equivalent questions.
Tools: GPTCache, LangChain cache, custom Redis + embedding lookup, or a gateway-level semantic cache (e.g., LiteLLM Proxy, Bifrost).
Threshold guidance: cosine similarity >0.95 = safe to serve cached response.
Batch non-latency-sensitive requests. Process async queues off-peak.
---
Wire these controls in befo
415 production-ready skills for Claude Code and 12 other coding agents, covering engineering, product, marketing, compliance, finance and the C-suite. We test whether each skill loads when you ask in plain words, and publish the results.
Use when someone wants to build, launch, grade or schedule a Claude Managed Agent in their own Anthropic account ('build me an…
Use when a launched managed agent needs grading against a rubric and improving ('grade my agent', 'is it good enough'). Builds…
Use when someone has an agent idea to scope before launch ('help me scope an agent'). Interviews them about the one job and…
Use when a graded managed agent should run on a schedule, on an event trigger or on demand ('run it every morning'). Validates…
Use when a managed-agent build sheet is ready to launch ('launch it', 'deploy the agent'). Generates and validates API payloads…
Use when closing out a launched managed agent ('wrap up', 'what do I own now'). Inventories primitives with…
Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid…
Design and build AI agents for any domain. Use when users: (1) ask to "create an agent", "build an assistant", or "design an AI…