roninforge/roninforge-astro/astro-new-content-collection
Claude Code and agent skill by roninforge/roninforge-astro
- community
Checking that the SKILL.md file is still in the repository.
Scaffold 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.
Install
npx vskill@latest install roninforge/roninforge-astro/astro-new-content-collectionSKILL.md
The same SKILL.md was published earlier as roninforge/roninforge-astro/astro-new-content-collection.
Scaffold a New Content Collection
When to use
Use when:
- Adding a new collection (blog posts, authors, products, docs)
- Migrating an Astro 4 collection (drop
type: 'content', replace with aloader) - Wiring a custom data source (CMS, database) via a custom loader
Target: astro ^6.3.3. The companion astro-content-layer and astro-anti-patterns rules cover the surrounding patterns.
Output
For a blog collection backed by src/content/blog/*.md:
src/content.config.ts
src/content/blog/hello.md
src/content/authors.json
Workflow
- Place the config at
src/content.config.ts(NOT insidesrc/content/). Astro 6 removed the old path (anti-pattern #47). - Pick a loader:
glob({ pattern, base })for Markdown / MDX foldersfile(path)for one JSON / YAML file- Custom
loader: { load(ctx) { ... } }for CMS or database
- Write the schema. Use the function form
schema: ({ image }) => z.object(...)if you need theimage()helper for cover images. Usereference('otherCollection')to join collections. - Read with
getCollection('blog'),getEntry('blog', id),getEntries(refs). Render bodies withrender(entry).
Examples
Reading the collection from a page
Common mistakes
- Putting the config at
src/content/config.ts; Astro 6 ignores it. - Using
type: 'content'(removed in 5.0; use a loader). - Using
entry.slug(renamedentry.id). - Using
getEntryBySlug(usegetEntry). - Using
entry.render()(userender(entry)fromastro:content). - Using
Astro.glob(removed; use a glob loader collection).
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/astro-new-content-collection/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/roninforge/roninforge-astro/astro-new-content-collection)