API Cost & Performance Scanner

VerifiedCaution

Scan your project's API and infrastructure for cost and performance optimization opportunities, identifying expensive operations and caching gaps.

Sby Skills Guide Bot
DevOpsIntermediate
7/26/2026
Claude Code
#cost-optimization#performance-analysis#api#caching#latency

Recommended for

Automated summary

Runs three parallel scanner agents (API cost, database performance, latency) to surface expensive operations in a project and produce a prioritized optimization report.

Strengths

  • Parallel analysis across three complementary dimensions: API cost, database queries, and latency
  • Every optimization is qualified by impact, effort, and risk of regression
  • Uses the .adlc architecture and project-overview files to ground findings in project context
  • Separates quick wins from strategic work and flags items worth turning into a spec

Limitations

  • Cannot run unless .adlc/context/architecture.md and project-overview.md were created via /init
  • Requires the api-cost-scanner, db-perf-scanner, and latency-scanner agents to be installed in ~/.claude/agents
  • Cost and latency figures are rough estimates, not measurements from real telemetry
When to use it

To take stock of an existing API's cost and latency profile before deciding which optimizations to pursue.

When not to use it

On a project without an initialized .adlc structure or the scanner agents, or when you need instrumented profiling rather than a static review.

Security analysis

Caution
Quality score78/100

Nothing here is destructive, exfiltrating, or obfuscated: the only commands are `cat` of local context files and an `sh` invocation of a project-local helper script, plus spawning read-only analysis sub-agents. The material risks are indirect — executing a repository-controlled include script with no verification, and depending on unpinned external agent definitions. This is powerful-tool usage for a legitimate purpose, so it warrants 'caution' rather than 'risky'.

Findings
  • •Uses the `!` shell-execution syntax to run a project-local script: `sh .adlc/partials/ethos-include.sh` (falling back to `~/.claude/skills/partials/...`). If an untrusted repository contains a crafted script at that path, invoking this skill executes it with the user's privileges — there is no integrity check or signature verification before execution.
  • •Delegates analysis to agent definitions in `~/.claude/agents/` (api-cost-scanner, db-perf-scanner, latency-scanner) whose prompts and tool permissions are not pinned in this file, so the effective capability surface depends on whatever is installed there.
  • •No allowed-tools are declared, so the skill implicitly relies on the host's default bash/Agent permissions without constraining or documenting them.
  • •Reads arbitrary project files (`cat .adlc/context/*.md`) — benign, but output is injected into the model context, so a hostile repo could attempt prompt injection via those context files.
How this analysis is made

Examples

Full optimization scan
/optimize
Focus on caching
/optimize caching
Focus on database queries
/optimize 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

!sh .adlc/partials/ethos-include.sh 2>/dev/null || sh ~/.claude/skills/partials/ethos-include.sh

Context

  • Architecture: !cat .adlc/context/architecture.md 2>/dev/null || echo "No architecture context found"
  • Project overview: !cat .adlc/context/project-overview.md 2>/dev/null || echo "No project overview found"

Input

Focus: $ARGUMENTS

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 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 ~/.claude/agents/ with its full scanning checklist and model selection (sonnet for deep analysis).

  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-scanner-ms1aw4ov/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-scanner-ms1aw4ov' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/api-cost-performance-scanner-ms1aw4ov/download' --output '.skill-downloads/api-cost-performance-scanner-ms1aw4ov/SKILL.md.part' && mv '.skill-downloads/api-cost-performance-scanner-ms1aw4ov/SKILL.md.part' '.skill-downloads/api-cost-performance-scanner-ms1aw4ov/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 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-scanner-ms1aw4ov/SKILL.md' && test -s '.skill-downloads/api-cost-performance-scanner-ms1aw4ov/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/optimize' && cp -R '.skill-downloads/api-cost-performance-scanner-ms1aw4ov' '.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-scanner-ms1aw4ov'

openskills read 'api-cost-performance-scanner-ms1aw4ov'

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-scanner-ms1aw4ov/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