AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Optimizing Performance

skill-cloudai-x-claude-workflow-v2-optimizing-performance · by CloudAI-X

Analyzes and optimizes application performance across frontend, backend, and database layers. Use when diagnosing slowness, improving load times, optimizing queries, reducing bundle size, or when asked about performance issues.

No reviews yet
0 installs
34 views
0.0% view→install

Install

$ agentstack add skill-cloudai-x-claude-workflow-v2-optimizing-performance

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-cloudai-x-claude-workflow-v2-optimizing-performance)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Optimizing Performance? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Optimizing Performance

When to Load

  • Trigger: Diagnosing slowness, profiling, caching strategies, reducing load times, bundle size optimization
  • Skip: Correctness-focused work where performance is not a concern

Performance Optimization Workflow

Copy this checklist and track progress:

Performance Optimization Progress:
- [ ] Step 1: Measure baseline performance
- [ ] Step 2: Identify bottlenecks
- [ ] Step 3: Apply targeted optimizations
- [ ] Step 4: Measure again and compare
- [ ] Step 5: Repeat if targets not met

Critical Rule: Never optimize without data. Always profile before and after changes.

Step 1: Measure Baseline

Profiling Commands

# Node.js profiling
node --prof app.js
node --prof-process isolate*.log > profile.txt

# Python profiling
python -m cProfile -o profile.stats app.py
python -m pstats profile.stats

# Web performance
lighthouse https://example.com --output=json

Step 2: Identify Bottlenecks

Common Bottleneck Categories

| Category | Symptoms | Tools | | -------- | -------------------------------- | ------------------------------- | | CPU | High CPU usage, slow computation | Profiler, flame graphs | | Memory | High RAM, GC pauses, OOM | Heap snapshots, memory profiler | | I/O | Slow disk/network, waiting | strace, network inspector | | Database | Slow queries, lock contention | Query analyzer, EXPLAIN |

Step 3: Apply Optimizations

Frontend Optimizations

Bundle Size:

// ❌ Import entire library
import _ from "lodash";

// ✅ Import only needed functions
import debounce from "lodash/debounce";

// ✅ Use dynamic imports for code splitting
const HeavyComponent = lazy(() => import("./HeavyComponent"));

Rendering:

// ❌ Render on every parent update
function Child({ data }) {
  return ;
}

// ✅ Memoize when props don't change
const Child = memo(function Child({ data }) {
  return ;
});

// ✅ Use useMemo for expensive computations
const processed = useMemo(() => expensiveCalc(data), [data]);

Images:

Backend Optimizations

Database Queries:

-- ❌ N+1 Query Problem
SELECT * FROM users;
-- Then for each user:
SELECT * FROM orders WHERE user_id = ?;

-- ✅ Single query with JOIN
SELECT u.*, o.*
FROM users u
LEFT JOIN orders o ON u.id = o.user_id;

-- ✅ Or use pagination
SELECT * FROM users LIMIT 100 OFFSET 0;

Caching Strategy:

// Multi-layer caching
const getUser = async (id) => {
  // L1: In-memory cache (fastest)
  let user = memoryCache.get(`user:${id}`);
  if (user) return user;

  // L2: Redis cache (fast)
  user = await redis.get(`user:${id}`);
  if (user) {
    memoryCache.set(`user:${id}`, user, 60);
    return JSON.parse(user);
  }

  // L3: Database (slow)
  user = await db.users.findById(id);
  await redis.setex(`user:${id}`, 3600, JSON.stringify(user));
  memoryCache.set(`user:${id}`, user, 60);

  return user;
};

Async Processing:

// ❌ Blocking operation
app.post("/upload", async (req, res) => {
  await processVideo(req.file); // Takes 5 minutes
  res.send("Done");
});

// ✅ Queue for background processing
app.post("/upload", async (req, res) => {
  const jobId = await queue.add("processVideo", { file: req.file });
  res.send({ jobId, status: "processing" });
});

Algorithm Optimizations

// ❌ O(n²) - nested loops
function findDuplicates(arr) {
  const duplicates = [];
  for (let i = 0; i  4s    |
| INP    |  500ms |
| CLS    |  0.25  |
| TTFB   |  1.8s  |

### API Performance

| Metric      | Target  |
| ----------- | ------- |
| P50 Latency | < 100ms |
| P95 Latency | < 500ms |
| P99 Latency | < 1s    |
| Error Rate  | < 0.1%  |

## Validation

After optimization, validate results:

Performance Validation:

  • [ ] Metrics improved from baseline
  • [ ] No functionality regressions
  • [ ] No new errors introduced
  • [ ] Changes are sustainable (not one-time fixes)
  • [ ] Performance gains documented

If targets not met, return to Step 2 and identify remaining bottlenecks.

## Source & license

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

- **Author:** [CloudAI-X](https://github.com/CloudAI-X)
- **Source:** [CloudAI-X/claude-workflow-v2](https://github.com/CloudAI-X/claude-workflow-v2)
- **License:** MIT

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

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.