Astro implementation checklist
This checklist provides a technical verification path for Astro projects transitioning from development to a production environment, focusing on content integrity, performance optimization, and deployment stability.
Content Collections and Type Safety
0/5Zod Schema Validation
criticalVerify that all collections in src/content/config.ts have a defined schema and that 'npm run build' passes without validation errors.
Slug Uniqueness Check
criticalEnsure no duplicate slugs exist across content collections to prevent build-time routing conflicts.
Frontmatter Type Alignment
recommendedAudit all .md and .mdx files to ensure frontmatter fields match the required Zod schema types exactly, specifically for dates and booleans.
Content Relationship Mapping
recommendedUse the reference() function in Zod schemas for related content (e.g., authors or categories) to ensure referential integrity.
Draft Content Filtering
criticalConfirm that build scripts or collection queries explicitly filter out items where 'draft: true' is present in the frontmatter.
Island Architecture and Hydration
0/5Client Directive Audit
criticalReview all components for 'client:load', 'client:idle', or 'client:visible' and remove directives from components that do not require interactivity.
Component Tree Analysis
criticalEnsure no server-side only data (like Node.js FS modules) is passed to hydrated client components to avoid bundling errors.
Framework Bundle Minimization
recommendedVerify that only one framework (e.g., React or Svelte) is used per page unless strictly necessary to minimize JS payload.
Client:Only Verification
recommendedConfirm that 'client:only' is only used for components that rely on browser-specific APIs and that a fallback loading state is provided.
Shared State Management
recommendedValidate that shared state between islands is handled via Nano Stores or custom events rather than a heavy global provider if possible.
Asset and Image Optimization
0/5Astro Image Component Usage
criticalReplace all standard <img> tags with the <Image /> component from 'astro:assets' for automatic WebP conversion and resizing.
Remote Image Patterns
criticalConfigure 'image.remotePatterns' in astro.config.mjs to authorize external domains used for dynamic images or pSEO content.
LCP Optimization
recommendedApply 'loading="eager"' and 'fetchpriority="high"' to images appearing in the initial viewport to improve Largest Contentful Paint.
Explicit Dimensions
criticalDefine width and height attributes for all images to prevent Layout Shift (CLS) during page load.
SVG Optimization
optionalPass SVGs through an optimizer like SVGO or use a dedicated Astro icon integration to remove unnecessary metadata.
SEO and Meta Configuration
0/5Site Configuration
criticalDefine the 'site' property in astro.config.mjs with the final production URL to enable correct absolute URL generation for sitemaps.
Sitemap Integration
criticalInstall and configure '@astrojs/sitemap' and verify that the sitemap.xml is generated in the /dist folder after build.
Canonical URL Implementation
criticalEnsure every page includes a <link rel="canonical"> tag generated using Astro.url to prevent duplicate content issues.
OpenGraph and Meta Tags
recommendedVerify that dynamic meta tags (title, description, og:image) are correctly populated from content collection frontmatter.
Robots.txt Setup
recommendedAdd a robots.txt file to the public/ directory that correctly points to the sitemap and defines crawl rules.
Deployment and Infrastructure
0/5Adapter Configuration
criticalInstall the correct SSR adapter (e.g., @astrojs/cloudflare, @astrojs/vercel) if using Hybrid or SSR mode.
Environment Variable Validation
criticalDefine all production secrets in the hosting provider's dashboard and verify they are accessed via import.meta.env.
404 Page Customization
recommendedCreate a src/pages/404.astro file to ensure custom branding for broken links and verify it renders correctly in the build output.
Build Cache Verification
optionalConfirm that the CI/CD pipeline is configured to cache the .astro directory to speed up subsequent builds.
Header and Redirect Rules
recommendedConfigure _headers or _redirects files in the public/ folder if required by your specific hosting provider (e.g., Cloudflare Pages).