AgentSkillsCN

Performance Budgeting

性能预算

SKILL.md

Performance Budgeting

Skill Purpose: Define and enforce performance budgets for load time, Core Web Vitals, and bundle size.


Core Skill Pattern

Objective: Prevent regressions by enforcing measurable performance limits.

Universal Pattern:

  1. Define budgets per page and asset type
  2. Measure against budgets in CI
  3. Fail builds on budget regressions
  4. Track budget history over time
  5. Review and adjust budgets periodically

Key Decisions (Project-Specific):

  • Thresholds for Core Web Vitals
  • Budget scope (global vs per route)
  • Budget enforcement location (CI vs pre-merge)

Project-Specific Implementation Notes

Customize per project:

  • Align budgets with business goals
  • Set stricter budgets for critical flows

Example Budget Config

json
{
  "lcpMs": 2500,
  "cls": 0.1,
  "fcpMs": 1800,
  "jsBundleKb": 300
}

Best Practices

  1. Start with realistic budgets
  2. Tighten budgets over time
  3. Fail on regressions, not noise
  4. Track budgets in version control
  5. Pair budgets with monitoring

Stop Conditions

STOP and escalate if:

  • Budgets are undefined or unrealistic
  • Measurement tooling is missing
  • Budgets conflict with product goals

Skill Version: 1.0.0