# Enforce Performance Budgets in CI (performance-budget)

> Sets bundle-size and Lighthouse thresholds in CI and fails builds over budget, so regressions surface at PR time.

- Category: [Performance](https://www.myskills.tools/en/categories/performance/)
- Source: Community · David Dias
- Repository: https://github.com/thedaviddias/Front-End-Checklist/tree/main/skills/performance-budget (commit 4b0ddb9)
- SKILL.md: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/performance-budget/SKILL.md
- Install command: `npx skills add thedaviddias/Front-End-Checklist --skill performance-budget`
- License: MIT
- Compatible with: Any SKILL.md agent
- Permissions: read-repo ✓, write-files ✓, shell ✓, network ✓
- Status: Scan passed
- A rule scan cannot catch every risk. Read this skill's SKILL.md and check its permissions before installing.

## Core rule

Distinguish bundle-size budgets from runtime budgets such as Lighthouse or Core Web Vitals, and enforce both.

## Execution Phases

1. **Check** — Look in package.json and CI config for size or Lighthouse thresholds.
2. **Set thresholds** — Define max bundle size, min Lighthouse score and max LCP; start loose and tighten as you optimize.
3. **Enforce in CI** — Use size-limit and Lighthouse CI assertions on pull requests and fail the build when budgets are exceeded.
4. **Monitor after release** — Wire production RUM and alerting so regressions are caught after deploy, not only in CI.

## Permissions (summarised from SKILL.md)

| Capability | Needed | Details |
|---|---|---|
| File writes | Required | Edits CI workflows, package.json, and size-limit and Lighthouse CI config. |
| Command execution | Limited | Installs and runs budget tools such as size-limit and Lighthouse CI. |
| Network outbound | Limited | Used only to install development dependencies. |

## SKILL.md frontmatter (YAML)

```yaml
---
name: performance-budget
description: "Use when reviewing CI configuration, bundle analysis workflows, or pull requests that add dependencies and assets. Distinguish bundle-size budgets from runtime budgets such as Lighthouse or Core Web Vitals so teams can enforce both."
metadata:
  category: testing
  priority: medium
  difficulty: intermediate
  estimatedTime: "25"
  source: frontendchecklist.io
  url: https://frontendchecklist.io/rules/testing/performance-budget
---
```

Home: https://www.myskills.tools/en/ · URL: https://www.myskills.tools/en/skills/performance-budget/
