Back to Agent Skills
Content & Documentation
Astro Content Collections
Manage type-safe content collections in Astro with schema validation and query APIs.
Claude Code Cursor Copilot Windsurf
Overview
Astro Content Collections provide a type-safe way to manage content within Astro projects. AI coding agents can define collection schemas using Zod, create and validate content entries, and build dynamic pages from collections.
Agents can set up content collections for blogs, documentation, products, and other content types with proper schema validation. They can generate content entries with valid frontmatter, create dynamic routes from collections, and query content using Astro's built-in APIs.
Content Collections support Markdown, MDX, JSON, and YAML formats with automatic type inference. Teams can use AI agents to maintain strict content standards, generate content from templates, and ensure all entries conform to the defined schema.
Agents can set up content collections for blogs, documentation, products, and other content types with proper schema validation. They can generate content entries with valid frontmatter, create dynamic routes from collections, and query content using Astro's built-in APIs.
Content Collections support Markdown, MDX, JSON, and YAML formats with automatic type inference. Teams can use AI agents to maintain strict content standards, generate content from templates, and ensure all entries conform to the defined schema.
Who Is This For?
- Define Zod schemas for content collections
- Generate content entries with valid frontmatter
- Create dynamic routes from content collections
- Migrate existing content to Astro Content Collections
Installation
Setup for Claude Code
npx astro add mdx Configuration
// src/content/config.ts
import { defineCollection, z } from 'astro:content';
const blog = defineCollection({
type: 'content',
schema: z.object({
title: z.string(),
description: z.string(),
pubDate: z.coerce.date(),
tags: z.array(z.string()).default([]),
draft: z.boolean().default(false),
}),
});
export const collections = { blog }; Explore AI Tools
Discover the best AI tools that complement your skills
Read AI & Design Articles
Tips and trends in the world of design and AI
Related Skills
Content & Documentation
Markdown Documentation Generator
Auto-generate structured project documentation from your codebase. AI agents can produce API references, guides, and architecture docs.
Claude Code Codex Copilot
Content & Documentation OpenAPI Documentation
Generate interactive API documentation from OpenAPI and Swagger specifications. Keep your API docs always up to date with your endpoints.
Claude Code Codex Copilot
Content & Documentation README Generator
Create comprehensive, well-structured project READMEs that cover installation, usage, configuration, and contribution guidelines.
Claude Code Codex Copilot