perf-astro

Optimize Astro projects for Lighthouse performance with critical CSS and asset compression.

5.0k|454|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/tech-leads-club/agent-skills --skill perf-astro
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: perf-astro
Source: https://github.com/tech-leads-club/agent-skills/tree/main/packages/skills-catalog/skills/%28performance%29/perf-astro
Command: npx skills add https://github.com/tech-leads-club/agent-skills --skill perf-astro

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires astro-critters, @playform/compress.

What problem does it solve?

This Skill helps Astro developers achieve faster Lighthouse scores by applying authoritative performance optimizations such as critical CSS inlining, asset compression, font loading patterns, and efficient layout strategies.

Core Features & Use Cases

  • Critical CSS inlining: Automatically inline essential CSS to improve First Contentful Paint.
  • Asset optimization: Compress and optimize HTML/CSS/JS assets during build.
  • Font loading and layout: Non-blocking font loading and preloads to improve LCP.
  • Use Case: Imagine deploying an Astro site with many pages; this skill configures tools to reach Lighthouse thresholds across routes.

Quick Start

Install required packages and apply recommended configuration:

  • npm install astro-critters @playform/compress
  • Update astro.config.mjs to enable integrations
  • Run build and lighthouse audit to verify scores

Frequently Asked Questions about perf-astro

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I improve Lighthouse performance scores for an Astro site?

Improve Astro Lighthouse performance by inlining critical CSS to speed up First Contentful Paint, compressing HTML and JS assets during build, and applying non-blocking font loading patterns to optimize Largest Contentful Paint.

How do I inline critical CSS in an Astro project automatically?

Inline critical CSS in an Astro project by installing the astro-critters integration and updating astro.config.mjs, which automatically extracts and injects essential styles directly into your HTML markup during the build process.

What is the best way to compress HTML and JS assets during an Astro build?

Compress Astro build assets by integrating @playform/compress into your astro.config.mjs file, which automatically optimizes and minifies your HTML, CSS, and JavaScript outputs across all site routes.

Does this Astro performance optimization setup work for sites with many pages?

This setup optimizes Astro sites with many pages by applying consistent asset compression, font preloads, and critical CSS inlining across all routes during the build workflow to ensure uniform Lighthouse score improvements.

Why does my Astro site have a low Lighthouse score despite using static generation?

Low Astro Lighthouse scores often stem from render-blocking CSS and unoptimized font loading, which you can resolve by applying automated critical CSS inlining and non-blocking font preloads during your build.

Do I need astro-critters and @playform/compress to optimize Astro assets?

You need astro-critters for automated critical CSS inlining and @playform/compress for asset compression to achieve the recommended Astro build configuration that targets 95+ Lighthouse performance thresholds.