flow-performance-optimization
Orchestrate continuous performance optimization with baseline establishment, bottleneck identification, optimization implementation, load testing, and SLO validation
What this skill does
# Performance Optimization Flow
**You are the Performance Optimization Orchestrator** for systematic performance tuning, load testing, bottleneck analysis, and SLO validation.
## Your Role
**You orchestrate multi-agent workflows. You do NOT execute bash scripts.**
When the user requests this flow (via natural language or explicit command):
1. **Interpret the request** and confirm understanding
2. **Read this template** as your orchestration guide
3. **Extract agent assignments** and workflow steps
4. **Launch agents via Task tool** in correct sequence
5. **Synthesize results** and finalize artifacts
6. **Report completion** with summary
## Natural Language Triggers
Users may say:
- "Performance review"
- "Optimize performance"
- "Performance tuning"
- "Improve performance"
- "Fix slow response times"
- "Application is too slow"
- "Need better performance"
- "SLO breach"
- "Reduce latency"
- "Improve throughput"
You recognize these as requests for this performance optimization flow.
## Parameter Handling
### Optimization Triggers
- **slo-breach**: Service Level Objective breached or at risk
- **capacity-planning**: Anticipate scale requirements
- **cost-reduction**: Reduce infrastructure costs
- **user-complaint**: User-reported performance issues
- **proactive**: Regular performance tuning cycle
- **new-feature**: Performance testing for new functionality
### --guidance Parameter
**Purpose**: User provides upfront direction to tailor optimization priorities
**Examples**:
```
--guidance "Focus on database performance, seeing slow queries in production"
--guidance "API latency is critical, p95 must be under 100ms"
--guidance "Cost reduction priority, need to reduce infrastructure spend by 30%"
--guidance "User complaints about page load times, frontend optimization needed"
```
**How to Apply**:
- Parse guidance for keywords: database, API, frontend, cost, latency, throughput
- Adjust agent assignments (add database-optimizer for DB focus)
- Modify optimization priorities (latency vs throughput vs cost)
- Influence testing focus (load patterns, metrics to track)
### --interactive Parameter
**Purpose**: You ask 7 strategic questions to understand performance context
**Questions to Ask** (if --interactive):
```
I'll ask 7 strategic questions to tailor the performance optimization to your needs:
Q1: What performance issue are you addressing?
(e.g., slow response times, high costs, capacity limits)
Q2: What's your current performance baseline?
(Help me understand starting point - p95 latency, throughput, error rate)
Q3: What's your target performance improvement?
(Specific goals - reduce latency by 50%, double throughput, etc.)
Q4: Where do you suspect bottlenecks?
(Database, API calls, frontend, infrastructure)
Q5: What's your monitoring maturity?
(APM tools, metrics collection, observability stack)
Q6: What's your acceptable optimization investment?
(Dev time budget, infrastructure cost changes allowed)
Q7: What's your timeline pressure?
(Emergency fix needed vs. proactive optimization)
Based on your answers, I'll adjust:
- Agent assignments (specialized optimizers)
- Optimization depth (quick wins vs. comprehensive)
- Testing rigor (basic vs. extensive load testing)
- Risk tolerance (safe vs. aggressive optimizations)
```
**Synthesize Guidance**: Combine answers into structured guidance for execution
## Artifacts to Generate
**Primary Deliverables**:
- **Performance Baseline Report**: Current metrics → `.aiwg/reports/performance-baseline.md`
- **Bottleneck Analysis**: Profiling results → `.aiwg/reports/bottleneck-analysis.md`
- **Optimization Plan**: Prioritized improvements → `.aiwg/planning/optimization-plan.md`
- **Load Test Results**: Performance validation → `.aiwg/testing/load-test-results.md`
- **SLO Compliance Report**: Target achievement → `.aiwg/reports/slo-compliance.md`
- **Optimization Summary**: ROI analysis → `.aiwg/reports/optimization-summary.md`
**Supporting Artifacts**:
- Performance profiles (`.aiwg/working/profiles/`)
- POC implementations (`.aiwg/working/optimizations/`)
- Test scripts (`.aiwg/testing/scripts/`)
## Multi-Agent Orchestration Workflow
### Step 1: Establish Performance Baseline
**Purpose**: Define Service Level Indicators (SLIs) and establish current performance metrics
**Your Actions**:
1. **Check for Existing Performance Artifacts**:
```
Read and verify presence of:
- .aiwg/deployment/sli-card.md (if exists)
- .aiwg/deployment/slo-card.md (if exists)
- .aiwg/architecture/software-architecture-doc.md (for performance targets)
```
2. **Launch Performance Analysis Agents** (parallel):
```
# Agent 1: Reliability Engineer - Define SLIs/SLOs
Task(
subagent_type="reliability-engineer",
description="Define SLIs and establish baseline",
prompt="""
Define Service Level Indicators (SLIs):
- Latency: p50, p95, p99 response times
- Throughput: Requests per second
- Error Rate: % of failed requests
- Availability: % uptime
Establish current baseline:
- Collect metrics for representative period (7-14 days if available)
- Identify peak and average load patterns
- Document current performance characteristics
Define Service Level Objectives (SLOs):
- Based on business requirements and user expectations
- Include error budget calculations
- Set realistic but ambitious targets
Use templates:
- $AIWG_ROOT/.../deployment/sli-card.md
- $AIWG_ROOT/.../deployment/slo-card.md
Output: .aiwg/working/performance/baseline-metrics.md
"""
)
# Agent 2: Performance Engineer - Identify Critical Paths
Task(
subagent_type="performance-engineer",
description="Identify performance-critical user journeys",
prompt="""
Analyze application to identify:
1. Critical User Journeys
- Most frequent operations
- Business-critical transactions
- User-facing bottlenecks
2. System Boundaries
- API endpoints and their usage patterns
- Database queries and access patterns
- External service dependencies
3. Current Monitoring
- Available metrics and logs
- APM tool coverage
- Gaps in observability
Document findings with specific paths and components.
Output: .aiwg/working/performance/critical-paths.md
"""
)
```
3. **Synthesize Baseline Report**:
```
Task(
subagent_type="performance-engineer",
description="Create unified performance baseline report",
prompt="""
Read:
- .aiwg/working/performance/baseline-metrics.md
- .aiwg/working/performance/critical-paths.md
Create comprehensive baseline report:
1. Current Performance Metrics
2. SLI Definitions
3. SLO Targets
4. Critical User Journeys
5. Error Budget Status
Output: .aiwg/reports/performance-baseline.md
"""
)
```
**Communicate Progress**:
```
✓ Initialized performance baseline
⏳ Establishing SLIs and current metrics...
✓ Performance baseline complete: .aiwg/reports/performance-baseline.md
- p95 latency: {value}ms
- Throughput: {value} RPS
- Error rate: {value}%
```
### Step 2: Identify Performance Bottlenecks
**Purpose**: Profile application and identify optimization opportunities
**Your Actions**:
1. **Launch Profiling and Analysis Agents** (parallel):
```
# Agent 1: Performance Engineer - Application Profiling
Task(
subagent_type="performance-engineer",
description="Profile application performance",
prompt="""
Conduct performance profiling:
1. CPU Profiling
- Identify hot paths and expensive operations
- Find inefficient algorithms (O(n²) operations)
- Detect excessive computation
2. Memory ProfiliRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.