API Cost & Performance Optimizer

VerifiedCaution

Scans APIs and infrastructure to identify expensive operations and opportunities to optimize cost and performance.

Sby Skills Guide Bot
DevelopmentIntermediate
11/18/2026
Claude Code
#performance#cost-optimization#api#database#latency

Recommended for

Automated summary

This skill scans a project’s API and infrastructure for expensive operations and identifies cost and performance optimization opportunities.

Strengths

  • Runs three scanner agents in parallel to cover API costs, database performance, and latency.
  • Produces a structured report with a cost summary, performance hotspots, and opportunities rated by impact, effort, and risk.
  • Supports a focused scan through arguments such as "ai", "caching", "queries", or "latency".

Limitations

  • Requires prior initialization of the `.adlc/` structure and its context files.
  • Cost and latency figures are estimates rather than measured production values.
  • The skill is analysis-only: it does not describe applying fixes or running benchmarks.
When to use it

Use it when you need a quick review of API spend or latency issues and want prioritized optimization opportunities.

When not to use it

Avoid it when `.adlc/` context has not been initialized or when you need optimizations implemented rather than merely identified.

Security analysis

Caution
Quality score76/100

The skill is a read-only cost/performance auditing workflow: it cats local context docs, launches scanner subagents, and produces a report. There is no exfiltration, destructive command, or obfuscation. The only concerns are governance-level — shell and subagent usage without a declared tool list, dynamic path resolution, and dynamic agent-name probing — which place it at 'caution' rather than 'safe' or 'risky'.

Findings
  • •No allowed-tools declared in the manifest, yet the skill instructs the agent to run shell commands (`cat` on `.adlc/` files), execute an embedded backtick command (`!`test -s .adlc/ETHOS.md && cat ...``), and dispatch subagents — a permission-model mismatch that a host should reconcile before trusting it.
  • •The skill directs reading files from a configurable path via `$ADLC_TOOLKIT_ROOT` ("parent of this skill's base directory") for agent checklists; if that variable is attacker-influenced it could cause the agent to read arbitrary files, though only read/report actions follow.
  • •Subagent names are resolved dynamically by probing the Agent tool's listing, with an explicit warning that an unlisted name may silently run a generic agent — a reliability concern that could lead to unvetted behavior executing under this skill's banner.
  • •All observed file operations are read-only (`cat`, `test -s`) with no writes, deletes, network calls, credential access, or encoded payloads.
  • •The skill contains an inline `!`-prefixed command substitution (`test -s .adlc/ETHOS.md && cat .adlc/ETHOS.md || echo ...`) that some harnesses execute automatically at skill load time; the commands themselves are read-only local file reads, but this auto-execution pattern is worth flagging.
  • •Instructs the agent to run a shell block (`cat .adlc/context/*.md`) before proceeding — benign local reads, but it establishes a shell-first workflow.
  • •Dispatches subagents that read files from `$ADLC_TOOLKIT_ROOT/agents/` and `.adlc/agents/`, a path outside the skill directory; content of those checklists is not vetted by this file.
  • •No declared allowed-tools, yet the instructions assume shell and Agent tool availability and adaptively probe which agent names exist.
How this analysis is made

Examples

Full cost and performance scan
/optimize
Focus on AI API spend
/optimize ai
Investigate caching and query latency
/optimize caching and N+1 queries

name: optimize description: API cost & performance scanner — identify expensive operations and optimization opportunities argument-hint: Optional focus area (e.g., "ai", "caching", "queries", "latency")

/optimize — API Cost & Performance Scanner

You are scanning this project's API and infrastructure for cost and performance optimization opportunities.

Ethos

!test -s .adlc/ETHOS.md && cat .adlc/ETHOS.md || echo No ethos found — run /init, or /adlc:init on the plugin install, to vendor .adlc/ETHOS.md

Context

Run this block first, with your shell tool, and read its output before you continue. Each read prints a notice instead of failing when its file is absent.

# adlc-context
echo '--- Architecture'
cat .adlc/context/architecture.md 2>/dev/null || echo 'No architecture context found'
echo '--- Project overview'
cat .adlc/context/project-overview.md 2>/dev/null || echo 'No project overview found'

Input

The focus is the argument: whatever follows /optimize in the invocation (on Claude Code it can also arrive as an ARGUMENTS: line appended to this text), a dimension or an area. With none, Step 1 scans all dimensions.

Prerequisites

Before proceeding, verify that .adlc/context/architecture.md and .adlc/context/project-overview.md exist. If any of these files are missing, stop and tell the user: "The .adlc/ structure hasn't been initialized. Run /init (/adlc:init on the plugin install) first to set up the project context."

Instructions

Step 1: Determine Focus

  1. If given a focus area, prioritize that dimension
  2. If no argument, scan all dimensions
  3. Read .adlc/context/architecture.md for current caching and optimization patterns

Step 2: Launch Scanner Agents

Launch 3 formal scanner agents in parallel using the Agent tool. Each agent is defined in $ADLC_TOOLKIT_ROOT/agents/ with its full scanning checklist and model selection (sonnet for deep analysis).

If this harness can run subagents, dispatch these agents in parallel; if it cannot, or you are a subagent, run each checklist inline from .adlc/agents/<name>.md. Agent names are bare on the symlink install and adlc:-prefixed on the plugin install (adlc:<name>): before dispatching, check which form the Agent tool lists and use that one, and do not wait for an error, because a name it does not list can silently run a generic agent without the checklist; if neither form is listed, say which agent is missing and run its checklist inline. When .adlc/agents/ is absent, say that /init (/adlc:init on the plugin install) vendors it, then read $ADLC_TOOLKIT_ROOT/agents/<name>.md (the toolkit root is the parent of this skill's base directory) where your file tool can reach it; never improvise a checklist. An inline run of a review or audit agent is read-only: report findings, apply no fixes, and run no test runner, build tool, package manager or interpreter.

  1. api-cost-scanner agent — provide the focus scope and architecture.md for caching context
  2. db-perf-scanner agent — provide the focus scope
  3. latency-scanner agent — provide the focus scope

Each agent returns structured findings with estimated impact, effort, and risk.

Step 3: Build Optimization Report

Cost Summary

| Service | Est. Monthly Usage | Est. Monthly Cost | Top Optimization | |---------|-------------------|-------------------|------------------| | Claude Sonnet | X calls | $X | ... | | Claude Haiku | X calls | $X | ... | | Gemini Flash | X calls | $X | ... | | SerpAPI | X calls | $X | ... | | Firestore | X reads/writes | $X | ... | | GCS | X operations | $X | ... |

Performance Hotspots

Rank endpoints by estimated latency, highlighting:

  • Sequential operations that could be parallel
  • Missing caches
  • N+1 query patterns
  • Unnecessary data fetching

Optimization Opportunities

For each opportunity:

  • What: Description of the optimization
  • Impact: Cost savings or latency reduction estimate
  • Effort: Small / Medium / Large
  • Risk: Low / Medium / High (chance of breaking something)

Step 4: Prioritized Recommendations

  1. Rank optimizations by impact/effort ratio
  2. Group into quick wins (small effort, high impact) and strategic improvements
  3. Suggest which items warrant a full ADLC requirement (candidates for /spec)

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/api-cost-performance-optimizer-mwk700cs/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/api-cost-performance-optimizer-mwk700cs' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/api-cost-performance-optimizer-mwk700cs/download' --output '.skill-downloads/api-cost-performance-optimizer-mwk700cs/SKILL.md.part' && mv '.skill-downloads/api-cost-performance-optimizer-mwk700cs/SKILL.md.part' '.skill-downloads/api-cost-performance-optimizer-mwk700cs/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Original excerpt: Prerequisites

Before proceeding, verify that .adlc/context/architecture.md and .adlc/context/project-overview.md exist. If any of these files are missing, stop and tell the user: "The .adlc/ structure hasn't been initialized. Run /init (/adlc:init on the plugin install) first to set up the project context."

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/api-cost-performance-optimizer-mwk700cs/SKILL.md' && test -s '.skill-downloads/api-cost-performance-optimizer-mwk700cs/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/optimize' && cp -R '.skill-downloads/api-cost-performance-optimizer-mwk700cs' '.claude/skills/optimize'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/api-cost-performance-optimizer-mwk700cs'

openskills read 'api-cost-performance-optimizer-mwk700cs'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/api-cost-performance-optimizer-mwk700cs/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills