api-response-optimization · aj-geddes — Claude Code skill: faster API responses
A coding-agent skill that trims payloads, adds caching and compression, and gives you a checklist for slow API endpoints.
npx skills add aj-geddes/useful-ai-prompts --skill api-response-optimization -a claude-codeWhat api-response-optimization does
The skill walks an agent through what makes an API response slow and proposes concrete edits. Three areas get the attention: payload size, caching, and query efficiency. There is a worked example where an endpoint returns fields nobody asked for — a password hash, an SSN, unused metadata — and the optimized version keeps only what the client needs.
Four guides live in references/: response payload optimization, caching strategies, compression and performance, and an optimization checklist. The SKILL.md itself is short, so the agent will open those files as the task moves along.
Reach for it when endpoints drag or server CPU and memory climb. The skill does not install libraries or touch your infrastructure — it hands the agent a plan and a checklist, and the stack choices stay with you.
What it helps with
- shrink an API response by dropping fields the client never uses
- add caching to a hot endpoint
- turn on compression and cut network traffic
- find out why server CPU and memory keep climbing
- run an optimization checklist before a deploy
Example prompts for the agent
- look at the response from /api/users/123 and strip the fields we don't need
- add caching to this endpoint and check that the response doesn't go stale
- go through the optimization checklist and tell me what else can be compressed
How to install api-response-optimization
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill api-response-optimization -a claude-code2Manually: put the files in place
~/.claude/skills/api-response-optimization/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/api-response-optimization/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill api-response-optimization -a codex2Manually: put the files in place
.agents/skills/api-response-optimization/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill api-response-optimization -a cursor2Manually: put the files in place
.cursor/skills/api-response-optimization/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install aj-geddes/useful-ai-prompts api-response-optimization2Manually: put the files in place
.github/skills/api-response-optimization/SKILL.md1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill api-response-optimization -a gemini-cli2Platform CLI
gemini skills install https://github.com/aj-geddes/useful-ai-prompts --path skills/api-response-optimizationManually: put the files in place
.devin/skills/api-response-optimization/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill api-response-optimization -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about api-response-optimization
How do I install api-response-optimization in Claude?
Run npx skills add aj-geddes/useful-ai-prompts --skill api-response-optimization -a claude-code. The skill file then lands at ~/.claude/skills/api-response-optimization/SKILL.md.
What does api-response-optimization do?
It gives the agent a method for speeding up API responses: smaller payloads, caching, compression. Four reference guides in references/ carry the detail.
What do I need to run it?
Just the agent. This is a set of instructions and guides, not a library, so you pick the caching and compression stack yourself.
Source text
SKILL.md · MIT
---
name: api-response-optimization
description: >
Optimize API response times through caching, compression, and efficient
payloads. Improve backend performance and reduce network traffic.
---
# API Response Optimization
## Table of Contents
- [Overview](#overview)
- [When to Use](#when-to-use)
- [Quick Start](#quick-start)
- [Reference Guides](#reference-guides)
- [Best Practices](#best-practices)
## Overview
Fast API responses improve overall application performance and user experience. Optimization focuses on payload size, caching, and query efficiency.
## When to Use
- Slow API response times
- High server CPU/memory usage
- Large response payloads
- Performance degradation
- Scaling bottlenecks
## Quick Start
Minimal working example:
```javascript
// Inefficient response (unnecessary data)
GET /api/users/123
{
"id": 123,
"name": "John",
"email": "[email protected]",
"password_hash": "...", // ❌ Should never send
"ssn": "123-45-6789", // ❌ Sensitive data
"internal_id": "xyz",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-02T00:00:00Z",
"meta_data": {...}, // ❌ Unused fields
"address": {
"street": "123 Main",
"city": "City",
"state": "ST",
"zip": "12345",
"geo": {...} // ❌ Not needed
}
}
// Optimized response (only needed fields)
GET /api/users/123
{
"id": 123,
// ... (see reference guides for full implementation)
```
## Reference Guides
Detailed implementations in the `references/` directory:
| Guide | Contents |
|---|---|
| [Response Payload Optimization](references/response-payload-optimization.md) | Response Payload Optimization |
| [Caching Strategies](references/caching-strategies.md) | Caching Strategies |
| [Compression & Performance](references/compression-performance.md) | Compression & Performance |
| [Optimization Checklist](references/optimization-checklist.md) | Optimization Checklist |
## Best Practices
### ✅ DO
- Follow established patterns and conventions
- Write clean, maintainable code
- Add appropriate documentation
- Test thoroughly before deploying
### ❌ DON'T
- Skip testing or validation
- Ignore error handling
- Hard-code configuration values
© aj-geddes · MIT · aj-geddes/useful-ai-prompts
Similar skills
Everything for Backend and APIs →api-response-optimization by other authors comes first.