# API Perf Specialist

> Profiles API request latency with curl timing statistics, response-size analysis, gzip validation, and HTTP/2 checks to identify optimization targets. Use when working with curl profiling, bottleneck identification or when the user mentions curl profiling, bottleneck identification.

- Skill: `opknock/api-perf-specialist` (Agent Skill)
- Install (CLI): `npx get-skill add opknock/api-perf-specialist`
- Raw SKILL.md: https://api.skillmd.com/api/skills/opknock/api-perf-specialist/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- License: MIT
- Author: OpKnock (https://skillmd.com/u/opknock)
- Updated: 2026-11-23
- Page: https://skillmd.com/skills/opknock/api-perf-specialist

---


Profiles API request latency with curl timing statistics, response-size analysis, gzip validation, and HTTP/2 checks to identify optimization targets.

## Agentic Workflow: Read -> Reason -> Act (api-perf-specialist)

You are **api-perf-specialist** (backend) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.

### 1. Read — backend context for `api-perf-specialist`
- Domain: Profiles API request latency with curl timing statistics, response-size analysis, gzip validation, and HTTP/2 checks to identify optimization targets.
- **curl-profiling**: Measure DNS, TCP, TLS, TTFB, and total time per request — `curl -w "dns:%{time_namelookup}s connect:%{time_connect}s tls:%{time_appconnect}`
- **bottleneck-identification**: Compare endpoints and payloads to rank bottlenecks — `curl -s -o /dev/null -w '%{time_total}\n' http://localhost:8080/v1/items/1`
- Check `knowledge` and `prerequisites: node.js, python, redis, k6`

### 2. Reason — think for `api-perf-specialist`
- For `curl-profiling`: Measure DNS, TCP, TLS, TTFB, and total time per request — decide which checks to run
- For `bottleneck-identification`: Compare endpoints and payloads to rank bottlenecks — decide which checks to run
- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs

### 3. Act — execute with `api-perf-specialist` tools
- Tools: `Glob`, `Grep`, `Read`, `Bash` (see frontmatter `tools`/`allowed-tools`)
- Use `safe_path` for any write; record evidence (paths, checksums)
- Fingerprint: `api-perf-specialist:2a2dabd4`

# API Perf Specialist

Profiling API latency with curl.

## What This Skill Does
- Measures every network phase of a request
- Compares endpoints, versions, and payload sizes
- Produces reproducible perf evidence for changes

## When to Use
- Triaging slow-endpoint reports
- Comparing a fix before/after
- Building a baseline latency map of the API

## Real Commands

```bash
curl -w "dns:%{time_namelookup}s connect:%{time_connect}s tls:%{time_appconnect}s ttfb:%{time_starttransfer}s total:%{time_total}s\n" -o /dev/null -s https://api.example.com/v1/items
```

## Reading the Phases
- time_namelookup: DNS resolution
- time_connect: TCP handshake
- time_appconnect: TLS handshake
- time_starttransfer: server time to first byte
- time_total: end-to-end including body download

## Testing
- Run 5-10 samples and take the median
- Test from multiple regions for network variance
- Compare gzip vs raw body sizes for payload wins

## Best Practices
- Always use -o /dev/null to isolate server time
- Vary the query params to catch expensive filters
- Save curl -w outputs to a CSV for trend tracking

## Capabilities

### curl-profiling
Measure DNS, TCP, TLS, TTFB, and total time per request

**Parameters:**
- `write-out-format` (string): curl -w format string with timing variables
- `url` (string): Endpoint under test
- `headers` (array): Extra headers like Accept-Encoding or Authorization

**Commands:**
- `curl -w "dns:%{time_namelookup}s connect:%{time_connect}s tls:%{time_appconnect}s ttfb:%{time_starttransfer}s total:%{time_total}s size:%{size_download}\n" -o /dev/null -s https://api.example.com/v1/items`
- `curl -s -o /dev/null -w '%{http_code} %{time_total} %{speed_download} bytes/s\n' http://localhost:8080/`
- `curl -s -H 'Accept-Encoding: gzip' -o /dev/null -w 'compressed:%{size_download} raw:%{size_download}_of_%{size_upload}\n' https://api.example.com/v1/items`
- `curl -sI --http2 http://localhost:8080/ | head -1`
- `curl -s -o /dev/null -w '%{time_starttransfer}\n' http://localhost:8080/v1/items?limit=1000`

**Examples:**
- curl -w with time_appconnect isolates TLS handshake cost
- TTFB over total shows server processing vs transfer time
- gzip header comparison shows compression savings

### bottleneck-identification
Compare endpoints and payloads to rank bottlenecks

**Commands:**
- `curl -s -o /dev/null -w '%{time_total}\n' http://localhost:8080/v1/items/1`
- `curl -s -o /dev/null -w '%{time_total}\n' http://localhost:8080/v2/items/1`
- `curl -s http://localhost:8080/v1/items | jq '.data | length'`
- `curl -s http://localhost:8080/v1/items | wc -c`

**Examples:**
- -cli --help
- -api --help

## References
- [curl -w Variables](https://curl.se/docs/manpage.html#-w)
- [WebPageTest Docs](https://docs.webpagetest.org/)

