# Performance Optimization

> Optimize application performance with evidence. Use when latency, throughput, memory, bundle size, rendering speed, Core Web Vitals, query time, startup time, or resource usage matters.

- **Type:** Skill
- **Install:** `agentstack add skill-hsienw-ai-agent-engineering-playbook-performance-optimization`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [HsienW](https://agentstack.voostack.com/s/hsienw)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [HsienW](https://github.com/HsienW)
- **Source:** https://github.com/HsienW/ai-agent-engineering-playbook/tree/master/skills-operational-hardening/performance-optimization

## Install

```sh
agentstack add skill-hsienw-ai-agent-engineering-playbook-performance-optimization
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Performance Optimization

## Skill Interface

- Name: performance-optimization.
- Description: Optimize application performance with evidence when latency, throughput, memory, bundle size, rendering speed, Core Web Vitals, query time, startup time, or resource usage matters.
- Parameters: Target metric, acceptable threshold, slow path reproduction, realistic input, baseline measurement, profiling or tracing data, constraints, and correctness or regression tests.
- Instructions: Use this skill before performance changes. Measure first, locate the real bottleneck, make the smallest targeted change, compare before and after with the same method, and report residual validation risk.

Measure before optimizing. Optimize the bottleneck that affects users or system
capacity, then measure again.

## Workflow

1. Define the target metric and acceptable threshold.
2. Reproduce the slow path with realistic input.
3. Capture a baseline measurement.
4. Locate the bottleneck with profiling, tracing, logs, database explain output,
   bundle analysis, or runtime metrics.
5. Make the smallest change that addresses the bottleneck.
6. Compare before and after using the same measurement method.
7. Check correctness and regression risk.

## Common Areas

- Network waterfalls and unnecessary sequential awaits.
- Large bundles and eager imports.
- Expensive rendering, avoidable re-renders, and unstable props.
- Repeated parsing, sorting, filtering, or serialization.
- Inefficient queries, missing indexes, and excessive round trips.
- Unbounded concurrency or memory growth.
- Cache misses, cache stampedes, and stale invalidation rules.

## Rules

- Do not trade correctness or security for speed.
- Do not add caching without ownership, invalidation, and memory bounds.
- Do not optimize rare paths while the primary bottleneck is unknown.
- Do not rely on microbenchmarks for user-visible flows without validation.
- Keep performance changes local and reversible.

## Verification

Report:

- Baseline.
- Change made.
- New measurement.
- Test commands actually executed.
- Residual risk, such as missing production traffic validation.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [HsienW](https://github.com/HsienW)
- **Source:** [HsienW/ai-agent-engineering-playbook](https://github.com/HsienW/ai-agent-engineering-playbook)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-hsienw-ai-agent-engineering-playbook-performance-optimization
- Seller: https://agentstack.voostack.com/s/hsienw
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
