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
To take stock of an existing API's cost and latency profile before deciding which optimizations to pursue.
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
CautionNothing 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'.
- •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.
Examples
/optimize/optimize caching/optimize queriesname: 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
- If given a focus area, prioritize that dimension
- If no argument, scan all dimensions
- Read
.adlc/context/architecture.mdfor 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).
- api-cost-scanner agent — provide the focus scope and architecture.md for caching context
- db-perf-scanner agent — provide the focus scope
- 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
- Rank optimizations by impact/effort ratio
- Group into quick wins (small effort, high impact) and strategic improvements
- 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 filesThis 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.mdFrom 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 installationopenskills 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 syncManual 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.
Configure a Chat Channel with SecretRefs
DevOps
Set up chat channels using non-interactive commands, with secrets only as SecretRefs. Covers gather, mutate, repair, and prove steps for reliable delivery.
Investigate ClickHouse CI Failures
DevOps
Investigate a ClickHouse CI failure end-to-end from a PR or S3 report URL. Fetches failed tests, classifies flaky vs real regression, and checks for existing issues/fixes.
Ansible PR Review
DevOps
Reviews an Ansible PR following the project's standardized process, including changelog checks, test coverage validation, and feedback tracking.