> workflow / performance

Performance

Meet latency, cost, and throughput budgets for application and AI paths with profile-guided changes — not speculative rewrites.

What should I do next?

Complete the steps and evidence below, clear the human gates, then continue to DevOps.

When to use

  • SLOs or cost budgets exist and RC may violate them
  • Token spend or context size is unbounded in agent paths
  • Load profile for launch is known enough to measure
  • You need budget guards before devops wiring

Step-by-step

  1. Define or confirm SLOs and cost budgets per critical path.
  2. Measure baselines (p95 latency, error rate, $/request, tokens/request).
  3. Run performance-review.prompt on hot paths; prefer evidence over intuition.
  4. Optimize with optimization-pattern: cache, batch, smaller context, cheaper models where quality allows.
  5. Install budget-guard.hook.sh for agent sessions that can runaway.
  6. Re-measure; refuse "feels faster" without numbers.
  7. File an optimization backlog for non-blocking work; waive SLO misses only explicitly.

Decisions to make

  • Fix now vs backlog with SLO waiver
  • Model downgrade vs prompt/context reduction vs infra scale
  • Cache invalidation strategy for AI responses
  • Load-test fidelity required before prod

Evidence to collect

  • Perf report with before/after metrics
  • Budget guard config committed
  • Optimization backlog with owners
  • SLO waiver record if shipping under budget miss

Role-specific next actions

  • PM: Trade feature scope for SLO attainment when budgets are real.
  • Architect: Decide caching and model-placement changes that alter ADRs.
  • Engineer: Profile, patch, and re-measure; avoid speculative rewrites.
  • DevOps: Provide load-test harness and capacity headroom data.

Inputs

  • SLOs and cost budgets
  • Load profile / traffic assumptions
  • Baseline traces and token metrics

Outputs

  • Performance report
  • Optimization backlog
  • Budget guard configuration

Required prompts

Required skills

Required MCP servers

Tooling & handbook

Recommended agents & patterns

Human approval gates

  • SLO regression requires explicit waiver with owner and expiry
  • Unbounded agent loops blocked by budget guards before prod

Automation opportunities

  • budget-guard.hook.sh in agent runners
  • Canary metrics compared to baseline SLOs
  • CI perf smoke on critical paths where feasible

Enterprise best practices

  • Chargeback or showback for model spend
  • Capacity planning for launch peaks
  • Cost anomalies page on-call like latency pages

Common mistakes

  • Optimizing before measuring
  • Unbounded context windows and tool loops
  • Shipping without a cost budget because "AI is strategic"