S

Smart Optimize Tool

Streamline your workflow with this comprehensive, performance, optimization, response. Includes structured workflows, validation checks, and reusable patterns for performance.

CommandClipticsperformancev1.0.0MIT
0 views0 copies

Smart Optimize Tool

Intelligently detect and apply performance optimizations across your entire application stack, from frontend rendering to backend queries to infrastructure configuration.

When to Use This Command

Run this command when...

  • You want a holistic performance assessment that identifies optimizations across the full stack rather than a single layer
  • Application performance has degraded and you need intelligent detection of the root causes across multiple systems
  • You are preparing for a load test or launch and want proactive optimization of all critical paths
  • Multiple small performance issues have accumulated and you need a systematic pass to address them all
  • You want smart prioritization of which optimizations deliver the most impact for the least effort

Quick Start

# .claude/commands/smart-optimize-tool.md --- name: Smart Optimize Tool description: Full-stack performance detection and optimization command: true --- Optimize smartly: $ARGUMENTS 1. Scan the full application stack for performance issues 2. Rank findings by impact and implementation effort 3. Apply high-impact, low-effort optimizations first 4. Report results with before/after comparisons
# Invoke the command claude "/smart-optimize-tool the entire API layer" # Expected output # > Scanning API layer for performance issues... # > Found 9 optimization opportunities: # > [HIGH impact, LOW effort] Add database indexes for 3 slow queries # > [HIGH impact, MED effort] Implement response compression (gzip) # > [MED impact, LOW effort] Add connection pooling to DB client # > [MED impact, MED effort] Cache repeated authorization lookups # > [LOW impact, LOW effort] Remove 4 unused middleware from chain # > ... (4 more) # > Applying top 5 optimizations... # > Results: avg response time 380ms -> 120ms (68% improvement)

Core Concepts

ConceptDescription
Full-Stack ScanningAnalyzes frontend, backend, database, and infrastructure layers for issues
Impact-Effort MatrixRanks each optimization by expected performance gain versus implementation complexity
Smart PrioritizationApplies high-impact, low-effort fixes first to maximize return on optimization time
Incremental MeasurementMeasures the effect of each optimization individually before applying the next
Stack-Aware AnalysisUnderstands how frontend, API, database, and caching layers interact and affect each other
Smart Optimize Matrix
======================

               LOW effort    MED effort    HIGH effort
            +-------------+-------------+-------------+
  HIGH      | ** DO       | * PLAN      |   CONSIDER  |
  impact    | FIRST **    |   NEXT      |   LATER     |
            +-------------+-------------+-------------+
  MED       | * DO        |   EVALUATE  |   SKIP      |
  impact    |   SECOND    |             |   USUALLY   |
            +-------------+-------------+-------------+
  LOW       |   QUICK     |   SKIP      |   SKIP      |
  impact    |   WINS      |             |             |
            +-------------+-------------+-------------+

Configuration

ParameterDescriptionDefaultExampleRequired
$ARGUMENTSTarget scope for optimizationentire project"API layer", "frontend bundle"No
max_optimizationsMaximum number of optimizations to apply510No
min_impactMinimum impact threshold to includelow"medium", "high"No
max_effortMaximum effort level to includehigh"low", "medium"No
apply_modeWhether to apply changes or just reportapply"report-only"No

Best Practices

  1. Start with report-only mode -- Use apply_mode: "report-only" on the first run to review all findings before any code changes are made. This lets you exclude optimizations that conflict with your design constraints.

  2. Optimize one layer at a time -- Scope to "database queries" or "frontend rendering" rather than the full stack when you want controlled, reviewable changes.

  3. Measure baseline before starting -- Record current performance metrics (response times, bundle size, memory usage) so the before-after comparisons are accurate and meaningful.

  4. Run tests between optimizations -- Apply one fix, verify tests pass, then move to the next. Batching optimizations makes it hard to identify which change introduced a regression.

  5. Re-run after major changes -- Performance characteristics change as features are added. Schedule periodic smart optimization passes after significant codebase changes.

Common Issues

Conflicting optimizations: Two optimizations may interfere with each other, such as adding an index and changing a query to no longer use that column. The tool checks for conflicts but edge cases exist. Review applied changes holistically.

False positives in impact estimation: Static analysis may overestimate the impact of optimizations that affect rarely-executed code paths. Cross-reference findings with actual production metrics or access logs.

Optimization removed for readability reasons: Some technically valid optimizations (loop unrolling, inlining) reduce code readability. If preserve_readability is important to your team, set max_effort: "low" to stay conservative.

Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates