astro-optimizer
/astro-optimizer
Audytuje i optymalizuje strony Astro pod kątem JavaScriptu po stronie klienta, Core Web Vitals, obrazów, kolekcji treści i czasu budowania, z pomiarami.
- Autor
- RuneStone-Tech ↗
- Repozytorium
- optimize-anything ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 04.11.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 12
- Skrypty
- 1
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 04.11.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
- 1 skrypt w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.
Skrypty: scripts/audit.py
Co robi i kiedy
Audytuje i optymalizuje strony Astro pod kątem JavaScriptu po stronie klienta, Core Web Vitals, obrazów, kolekcji treści i czasu budowania, z pomiarami.
Oryginalny opis (EN)
Audit and optimize Astro sites (Astro 4, 5, 6 and 7; static or SSR with the node, Netlify, Vercel or Cloudflare adapters) for client JavaScript and island hydration, Core Web Vitals, images and fonts, content collections and build time, route caching, server islands, CSP/env safety, and upgrade fallout, with real before/after measurement. Always produces a written findings report and a fix plan for approval before touching code. Use this whenever the user mentions a slow Astro site, too much JavaScript, client:load/client:visible/client:only, islands or server islands, hydration, Lighthouse LC
Jak działa
- Workflow
- Principles
Podgląd SKILL.md
--- name: astro-optimizer description: Audit and optimize Astro sites (Astro 4, 5, 6 and 7; static or SSR with the node, Netlify, Vercel or Cloudflare adapters) for client JavaScript and island hydration, Core Web Vitals, images and fonts, content collections and build time, route caching, server islands, CSP/env safety, and upgrade fallout, with real before/after measurement. Always produces a written findings report and a fix plan for approval before touching code. Use this whenever the user mentions a slow Astro site, too much JavaScript, client:load/client:visible/client:only, islands or server islands, hydration, Lighthouse LCP/INP/CLS, astro:assets or Image/Picture, font loading, ViewTransitions/ClientRouter, prefetch, content collections taking forever to build, getStaticPaths, SSR TTFB, route caching, CSP, or upgrading Astro 5 to 6/7 -- even if they never say "audit" or "optimize". --- # Astro Optimizer Audit an Astro codebase, report what is slow or fragile and why, agree a plan with the user, then fix it. Order: evidence, approval, edits. Astro's promise is HTML first and JavaScript only where you ask for it, so the first question is always what is being hydrated that does not need to be. Hydration, caching and CSP changes can alter behavior or security, so nothing is edited before approval. ## Workflow ### 1. Scope (quick) - Find the project root (`package.json` with `astro`, plus `astro.config.*`). Record: Astro major, output mode (`static` by default, or `server`), adapter, integrations, UI framework renderers, content collections, `site`, Node version and package manager. If `output: 'hybrid'` is still present, the project predates Astro 5. - Run `python <skill-dir>/scripts/audit.py <project-root>` -- static scan of `package.json`, `astro.config.*` and `.astro`/`.ts`/`.js`/`.mdx` sources for version leftovers, hydration cost, image/font gaps, XSS and cache misuse, with file:line evidence. Use `--json` to post-process. - Classify the pain: slow load (JS/CSS/images/fonts), bad LCP or CLS, slow interactions (heavy islands), slow SSR/TTFB (origin/cache), slow build (collections/images), or code health/upgrade. Ask which hurts if unclear. - If the user only gave a URL, say a code audit needs the repo; meanwhile collect field data (CrUX/PageSpeed Insights) and do not guess at causes. Read `references/tooling.md` once to see what can actually be measured here. - Astro sites often contain React/Svelte/Vue islands. Optimize the island boundary here; for component internals inside an island, hand off to the matching framework optimizer. ### 2. Audit The script finds cheap leads; you find the rest by reading. Read `astro.config.*`, the base layout, the home page, the 3-5 most important routes, and every component with a `client:*` directive. Load only what applies: | Area | Reference | | ----------------------------------------------------------------- | --------------------------------- | | Islands, client directives, hydration, framework components | `references/islands-hydration.md` | | Output modes, prerender, server islands, route caching, sessions | `references/rendering-caching.md` | | Content collections, live collections, data fetching, build scale | `references/content-data.md` | | Images, responsive srcset, fonts, CSS delivery | `references/assets-fonts.md` | | Script processing, view transitions, prefetch, bundles, CWV | `references/scripts-bundle.md` | | XSS/CSP/secrets, accessibility, types, tests, upgrades | `references/safety-quality.md` | | Production measurement and honest reporting | `references/tooling.md` | **Measure, never guess.** Build for production, run it (`astro preview` or the adapter's server), and measure that. Count islands by directive, inspect transferred JS per island, and check the LCP image and font requests. Dev-server timings mean nothing, and a single Lighthouse run is weaker evidence than field p75 data. Mark each finding **Confirmed** (build output, network panel, code evidence) or **Suspected** (needs measuring). ### 3. Report Fill `assets/report-template.md`, save it as `ASTRO_OPTIMIZATION_REPORT.md` in the project root, and show the user. Five-line summary, findings table sorted by impact/effort, then per-finding detail (evidence, why it hurts, fix, risk, behavior impact). Group near-duplicates. ### 4. Plan -- then stop for approval Use plan mode: `EnterPlanMode` (load with ToolSearch if deferred), write the plan, present with `ExitPlanMode`; if unavailable show it in chat and wait for an explicit "go". Structure: 1. **Quick wins** -- `client:load` to `client:visible`/`client:idle`, delete client directives from components that render static markup, use `<Image>`/`<Picture>` with `layout` and real dimensions, preload the one real font, enable prefetch, remove unused integrations, add cache headers. Low risk. 2. **Structural** -- replace a framework island with `.astro` + `<script>`/custom element, split a header island into a small cart island, move personalization into a `server:defer` island, prerender routes that do not need request data, move ad-hoc content globs to collections, adopt route caching. Name each behavior change. 3. **Heavy** -- Astro 5 to 6 to 7 upgrade, removing a UI framework or adapter, changing image service, adopting view transitions site-wide. Separately approved. Each step: files touched, expected effect, how to verify, how to roll back. ### 4b. Experimental gate (ask before enabling) Astro's experimental flags (`clientPrerender`, `incrementalBuild`, `parallelPrerender`, `svgOptimization`, `collectionStorage`, `staticRedirectPage`, plus adapter experimental CDN cache providers) can help, but they may change between minors, need host support, or change output. Never enable them as part of a "quick win": list only the ones that fit this project in an **Experimental candidates** section with benefit, risk, rollback and the version that introduced them, then ask which, if any, the user wants. Declined flags stay out of the plan. ### 5. Fix Only approved items, in small groups. After each: `npx astro check` (if installed), the project's lint and tests, then `npx astro build`. A break must trace to one change. Do not mix an upgrade with optimization edits. If an approved change turns out to expose per-user data to a shared cache, or to remove interactivity users had, stop and ask. ### 6. Verify and wrap up Re-measure the same scenario: transferred JS per island, island count by directive, LCP/INP/CLS on a production build, build wall time and page count, and SSR TTFB for server-rendered routes. State plainly what could not be measured. End with deferred items and one suggested next step. ## Principles - **Ship less JavaScript.** An island is a cost, not a feature. Every `client:*` directive must earn its framework runtime. - **Choose the cheapest directive that keeps the interaction.** `client:visible` below the fold, `client:idle` for non-urgent, `client:load` only for above-the-fold interactivity, `client:only` only when SSR is impossible. - **Static by default, dynamic by exception.** `prerender = false` is a decision with a hosting and cache cost; keep it off routes that can be built. - **Server islands beat making the whole page dynamic.** Defer the avatar, cart count or price, cache the shell. - **Content collections beat ad-hoc globs** for structured content, and build-time beats request-time unless freshness is the point. - **Images and fonts decide LCP and CLS.** A hero image in `public/` with no `width`/`height` is a finding, not a style choice. - **Caching is correctness first.** Never let a shared CDN or route rule cache a per-user response; state the staleness trade-off for every cache change. - **Do not break HTML, SEO or accessibility for speed.** Keep semantic markup, real links, alt text, focus handling and error pages. - **Docs move.** Astro 5, 6 and 7 differ (removed `Astro.glob`/`ViewTransitions`, strict Rust compiler, new Markdown pipeline). Check the docs for the version in `package.json`, not memory.
Pliki w paczce (12)
- LICENSE 1 KB
- README.md 1 KB
- SKILL.md 8 KB
- assets/report-template.md 2 KB
- references/assets-fonts.md 5 KB
- references/content-data.md 5 KB
- references/islands-hydration.md 5 KB
- references/rendering-caching.md 5 KB
- references/safety-quality.md 5 KB
- references/scripts-bundle.md 6 KB
- references/tooling.md 4 KB
- scripts/audit.py 20 KB
Wersje
W bazie nie ma innych skilli o nazwie astro-optimizer.
Migawka bazy z 13.11.2026 · wersja paczki da20c52abe59 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 90fe-astro
Pisze i przegląda strony w Astro 7: wyspy, dyrektywy klienta, obrazy, kolekcje treści i zmienne środowiskowe, by strony ładowały mało JavaScriptu. - 100astro
Pomaga budować strony w Astro: komponenty, strony, kolekcje treści, adaptery SSR i wdrożenia statyczne. - 100astro
Wspiera budowę stron treściowych i marketingowych w Astro 6: static-first, wyspy i częściowa hydracja, kolekcje treści, server islands, renderowanie na żądanie, adaptery i migracja z Astro 5. - 100astro
Dostarcza wiedzę o Astro 5+: Content Collections, Islands, SSG i SSR, integracje oraz migracja z Next.js. - 100astro
Wspiera tworzenie stron w Astro: wyspy, kolekcje treści, akcje, renderowanie po stronie serwera i wielkość JavaScriptu. - 100astro-static-islands
Pomaga budować serwisy treściowe w Astro z wyspami statycznymi i minimalnym JavaScriptem po stronie klienta.