skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
dralgorhythm/claude-agentic-framework70 installs

optimizing-code

Improve code performance without changing behavior. Use when code fails latency/throughput requirements. Covers profiling, caching, and algorithmic optimization.

How do I install this agent skill?

npx skills add https://github.com/dralgorhythm/claude-agentic-framework --skill optimizing-code
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    This skill provides a safe and informative guide for optimizing code performance. It contains standard best practices, examples of memoization, and common profiling commands for various programming languages. No security risks were identified.

  • Socketpass

    No alerts

  • Snykpass

    Risk: LOW · No issues

  • Runlayerpass

    1 file scanned · No issues

What does this agent skill do?

Optimizing Code

The Optimization Hat

When optimizing, you improve performance without changing behavior. Always measure before and after.

Golden Rules

  1. Measure First: Never optimize without a benchmark
  2. Profile Before Guessing: Find the actual bottleneck
  3. Optimize the Right Thing: Focus on the critical path
  4. Measure After: Verify the optimization worked

Workflows

  • Benchmark: Establish baseline performance metrics
  • Profile: Identify the actual bottleneck
  • Hypothesize: What optimization will help?
  • Implement: Make the change
  • Measure: Verify improvement
  • Document: Record the optimization and results

Common Optimizations

Algorithm Complexity

  • Replace O(n²) with O(n log n) or O(n)
  • Use appropriate data structures (Set for lookups, Map for key-value)

Caching

// Memoization
const cache = new Map<string, Result>();

function expensiveCalculation(input: string): Result {
  if (cache.has(input)) {
    return cache.get(input)!;
  }
  const result = /* expensive work */;
  cache.set(input, result);
  return result;
}

Database Queries

  • Add indexes for frequently queried columns
  • Avoid N+1 queries (use eager loading)
  • Use pagination for large result sets

Memory

  • Avoid creating unnecessary objects in loops
  • Use streaming for large files
  • Release references when done

Profiling Tools

# Node.js
node --prof app.js
node --prof-process isolate-*.log

# Python
python -m cProfile -s cumtime script.py

# Go
go test -bench=. -cpuprofile=cpu.prof
go tool pprof cpu.prof

Anti-Patterns to Avoid

  • Premature optimization (no benchmark)
  • Micro-optimizations (negligible impact)
  • Optimizing cold paths
  • Sacrificing readability for minor gains

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/dralgorhythm/claude-agentic-framework/optimizing-code">View optimizing-code on skillZs</a>