Directory
‹ Back to apps

Astro 6

Astro 6 (Server Islands, Content Layer, Actions, Sessions, astro:env) Cursor plugin: 48 anti-patterns, 10 rules, 5 skills, reviewer agent, correct + anti-pattern fixtures, validator. Catches Astro 4/5 leftovers that current LLMs still produce.

What’s inside

5 skills
  • Skillastro-migrate-to-content-layerStage-by-stage migration of an Astro 4 collection to the Astro 5+ Content Layer: move src/content/config.ts to src/content.config.ts (Astro 6 removed the old path), replace type:'content' / type:'data' with loader:glob() or loader:file() from astro/loaders, replace getEntryBySlug with getEntry, replace post.render() with render(post) imported from astro:content, replace entry.slug with entry.id, drop Astro.glob in favour of getCollection on a glob loader. Includes before/after diffs and a checklist for each numbered anti-pattern. Pairs with astro-content-layer and astro-anti-patterns rules.
  • Skillastro-new-actionScaffold a new Astro 6 server action in src/actions/index.ts using defineAction with a zod input schema imported from astro:schema (NOT raw zod), optional accept:'form' for HTML form posts (with multipart enctype example for file uploads), and example call sites: server-side via Astro.callAction(actions.x, input) and client-side via actions.x(input). Refuses defineAction without input schema, refuses import from 'zod' inside src/actions/, refuses action named 'apply' outside index.ts. Pairs with astro-actions-and-forms and astro-anti-patterns rules.
  • Skillastro-new-content-collectionScaffold a new Astro 6 Content Layer collection in src/content.config.ts (NOT the legacy src/content/config.ts) using glob() loader from astro/loaders for Markdown bodies or file() for JSON / YAML data, a zod schema with image() helper for cover images and reference() for cross-collection joins. Refuses type:'content' / type:'data' (removed in Astro 5), refuses entry.slug (renamed entry.id), refuses getEntryBySlug (renamed getEntry), refuses entry.render() (use module-level render(entry)). Pairs with the astro-content-layer and astro-anti-patterns rules.
  • Skillastro-new-pageScaffold a new Astro 6 page in src/pages with optional dynamic [param] segment, optional export const prerender flag (true for SSG, false for SSR opt-in), and optional getStaticPaths skeleton when the route is dynamic + prerendered. Refuses lowercase HTTP method exports for endpoints, refuses output:'hybrid' references, refuses raw <img> tags, refuses <ViewTransitions> (use ClientRouter), and requires alt on all <Image> components. Pairs with the astro-routing-and-endpoints, astro-output-and-prerender, and astro-anti-patterns rules.
  • Skillastro-validateRun the plugin validator (tests/validation/validate-plugin.sh), then astro check, then vitest, then a grep audit for tracked Astro 5+ regressions that the type checker does not catch (getEntryBySlug, Astro.glob, ViewTransitions, output:'hybrid', @astrojs/tailwind, import.meta.env.SECRET_*, entry.render(, entry.slug, lowercase get/post endpoint exports, raw <img> for src/ paths, 'from \\'zod\\'' inside src/actions/). Reports each finding with file:line and the canonical replacement. Pairs with astro-anti-patterns rule.