Help us improve
Share bugs, ideas, or general feedback.
From astro-builder
Add a new content type (Astro 6 content collection) to the project. Defines the schema in src/content.config.ts, creates example content files, and wires up utility functions. Arguments: content type name (e.g. "tutorials", "changelogs", "case-studies").
npx claudepluginhub pcamarajr/content-stack --plugin astro-builderHow this skill is triggered — by the user, by Claude, or both
Slash command
/astro-builder:new-content-typeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are adding a new Astro 6 content collection to this project. The argument is the collection name (e.g. `tutorials`, `changelogs`, `case-studies`).
Complete content collections setup and management for Astro projects, including type-safe schemas, query patterns, frontmatter validation, and content organization.
Expert Astro Content Layer API — content.config.ts, glob/file loaders, custom loaders, getCollection, getEntry, render(), Zod schemas, MDX, Remark/Rehype plugins. Use when managing structured content, blog posts, or any typed data collections.
Provides type-safe, schema-validated content management in Astro for Markdown, MDX, YAML, and JSON files—no CMS needed. Validates frontmatter with Zod schemas, generates TS types, enables querying/filtering/sorting, and renders with <Content />.
Share bugs, ideas, or general feedback.
You are adding a new Astro 6 content collection to this project. The argument is the collection name (e.g. tutorials, changelogs, case-studies).
CLAUDE.md and .astro-builder/content-schema.md to understand existing content types.src/content.config.ts to understand the existing collection definitions.src/lib/content.ts to understand the utility function patterns.astro.config.ts to get the i18n configuration (locales, default locale).src/content/articles/) to understand the folder structure.Ask questions one at a time to define the new content type. Use the AskUserQuestion tool.
Ask:
/en/tutorials/[slug])src/content.config.tsAdd the new collection using Astro 6 glob() loader and defineCollection(). If multilingual:
const tutorials = defineCollection({
loader: glob({ pattern: "**/*.{md,mdx}", base: "./src/content/tutorials" }),
schema: z.object({
title: z.string(),
description: z.string(),
date: z.coerce.date(),
tags: z.array(z.string()).default([]),
translationKey: z.string().optional(),
lang: z.enum(["en", "it"]).default("en"), // adjust to configured locales
// add fields from the interview
}),
});
Export the collection in the collections object.
For each configured locale, create the folder:
src/content/{name}/en/src/content/{name}/it/ (if multilingual)Create one example .md file per locale with all required frontmatter fields populated with realistic placeholder content.
src/lib/content.tsAdd utility functions for the new collection following the existing patterns:
export async function getTutorialsByLang(lang: string) {
const all = await getCollection("tutorials");
return all
.filter((entry) => entry.data.lang === lang)
.sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf());
}
Add any other helpers that are appropriate (e.g. getTutorialBySlug(), getAllTutorialTags()).
src/lib/urls.tsAdd a URL builder for this content type:
export function buildTutorialUrl(slug: string, lang: string): string {
return `/${lang}/tutorials/${slug}`;
}
Ask the user: "Do you want me to scaffold the listing page and detail page for this content type?"
If yes, run /astro-builder:new-page for each needed page.
Run pnpm build and tsc --noEmit. Fix any errors before finishing.
Report:
src/content/config.ts — always src/content.config.ts.glob() loader (Astro 6 pattern).tags: string[] — never fixed category enums.translationKey to link content across locales.