Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

content-collections

verified

Astro content collections setup, type-safe schemas, query patterns, and frontmatter validation. Use when building Astro sites, setting up content collections, creating collection schemas, querying content, validating frontmatter, or when user mentions Astro collections, content management, MDX content, type-safe content, or collection queries.

View on GitHub

Marketplace

ai-dev-marketplace

vanman2024/ai-dev-marketplace

Plugin

website-builder

development

Repository

vanman2024/ai-dev-marketplace
2stars

plugins/website-builder/skills/content-collections/SKILL.md

Last Verified

February 1, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/vanman2024/ai-dev-marketplace/blob/main/plugins/website-builder/skills/content-collections/SKILL.md -a claude-code --skill content-collections

Installation paths:

Claude
.claude/skills/content-collections/
Powered by add-skill CLI

Instructions

# Content Collections Management for Astro

Complete content collections setup and management for Astro projects, including type-safe schemas, query patterns, frontmatter validation, and content organization.

## Overview

This skill provides comprehensive support for Astro content collections:
- Schema definition with Zod validation
- Type-safe query patterns
- Frontmatter validation and testing
- Collection setup and configuration
- Content organization best practices

## Instructions

### 1. Initial Setup

Run the setup script to initialize content collections in an Astro project:

```bash
bash scripts/setup-content-collections.sh [project-path]
```

This script:
- Creates `src/content/config.ts` if not exists
- Sets up collection directories
- Adds TypeScript types generation
- Configures content collection imports

### 2. Define Collection Schemas

Use schema templates to define type-safe collection schemas:

**TypeScript Schema (Recommended):**
```bash
# Read template for reference
Read: templates/schemas/blog-collection-schema.ts
Read: templates/schemas/docs-collection-schema.ts
```

**Python Schema (for build scripts):**
```bash
# For Python-based content generation
Read: templates/python/collection-schema.py
```

### 3. Generate TypeScript Types

Generate TypeScript types from your collection schemas:

```bash
bash scripts/generate-types.sh [project-path]
```

This creates:
- `src/content/config.ts` exports
- Type definitions in `.astro/types.d.ts`
- Auto-completion for collection queries

### 4. Query Content Collections

Use query builder patterns for type-safe content retrieval:

**TypeScript Queries:**
```bash
Read: templates/queries/basic-queries.ts
Read: templates/queries/advanced-queries.ts
Read: templates/queries/filtered-queries.ts
```

**Python Queries (for build scripts):**
```bash
Read: templates/python/query-patterns.py
```

### 5. Validate Frontmatter

Validate content frontmatter against schemas:

```bash
bash scripts/validate-frontmatter.sh 

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
7537 chars