secondsky/claude-skills / plugins/nuxt-content/skills/nuxt-content
nuxt-content
VerifiedNuxt Content v3 Git-based CMS for Markdown/MDC content sites. Use for blogs, docs, content-driven apps with type-safe queries, schema validation (Zod/Valibot), full-text search, navigation utilities. Supports Nuxt Studio production editing, Cloudflare D1/Pages deployment, Vercel deployment, SQL storage, MDC components, content collections.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 16.7 KB |
| assets/blog-collection.example.ts | script | 3.7 KB |
| assets/content.config.example.ts | script | 1.8 KB |
| assets/docs-collection.example.ts | script | 5.9 KB |
| assets/nuxt.config.example.ts | script | 1.9 KB |
| references/collection-examples.md | markdown | 6.6 KB |
| references/deployment-checklists.md | markdown | 4.8 KB |
| references/error-catalog.md | markdown | 9.9 KB |
| references/mdc-syntax-reference.md | markdown | 2.0 KB |
| references/query-operators.md | markdown | 2.9 KB |
| references/studio-setup-guide.md | markdown | 4.1 KB |
| scripts/deploy-cloudflare.shexecutable | script | 2.7 KB |
| scripts/deploy-vercel.shexecutable | script | 1.9 KB |
| scripts/setup-nuxt-content.shexecutable | script | 5.2 KB |
| scripts/setup-studio.shexecutable | script | 3.8 KB |
| templates/blog-collection-setup.ts | script | 7.1 KB |
scripts/setup-nuxt-content.sh
View on GitHub#!/bin/bash
# Nuxt Content Setup Script
# Initializes a new Nuxt Content v3 project
set -euo pipefail
# Script-global CONFIG_FILE: tracked by the cleanup trap so the sed .tmp
# tempfile never leaks even on early exit / failure. Populated below when
# we edit nuxt.config.ts and reset implicitly by process exit.
CONFIG_FILE=""
cleanup_sed_tmp() {
if [ -n "${CONFIG_FILE:-}" ] && [ -f "${CONFIG_FILE}.tmp" ]; then
rm -f "${CONFIG_FILE}.tmp"
fi
}
trap cleanup_sed_tmp EXIT
echo "π Nuxt Content v3 Setup"
echo "========================"
echo ""
# Check if we're in a Nuxt project
if [ ! -f "nuxt.config.ts" ] && [ ! -f "nuxt.config.js" ]; then
echo "β Error: No nuxt.config file found. Are you in a Nuxt project?"
echo " Run 'npx nuxi init my-project' first."
exit 1
fi
# Detect package manager
if [ -f "bun.lockb" ]; then
PKG_MGR="bun"
INSTALL_CMD="bun add"
elif [ -f "pnpm-lock.yaml" ]; then
PKG_MGR="pnpm"
INSTALL_CMD="pnpm add"
elif [ -f "yarn.lock" ]; then
PKG_MGR="yarn"
INSTALL_CMD="yarn add"
else
PKG_MGR="npm"
INSTALL_CMD="npm install"
fi
echo "π¦ Detected package manager: $PKG_MGR"
echo ""
# Install dependencies
echo "π₯ Installing @nuxt/content and better-sqlite3..."
$INSTALL_CMD @nuxt/content better-sqlite3
# Install Zod v4 for schema validation
echo "π₯ Installing zod v4 for schema validation..."
$INSTALL_CMD -D zod@^4.3.6
echo ""
echo "β
Dependencies installed!"
echo ""
# Add module to nuxt.config.ts if not already present
if ! grep -q "@nuxt/content" nuxt.config.ts 2>/dev/null; then
echo "π Adding @nuxt/content to nuxt.config.ts..."
# Track CONFIG_FILE for the cleanup trap (installed above). The trap
# guarantees nuxt.config.ts.tmp is removed even if sed fails or the
# script exits early, instead of relying on chained `&& rm` which would
# leak the tempfile on a non-zero sed exit.
CONFIG_FILE="nuxt.config.ts"
# Create backup
cp "$CONFIG_FILE" "${CONFIG_FILE}.backup"
# Add module (simple approach - user may need to adjust)
if grep -q "modules: \[" "$CONFIG_FILE"; then
sed -i.tmp "s|modules: \[|modules: ['@nuxt/content', |" "$CONFIG_FILE"
rm -f "${CONFIG_FILE}.tmp"
else
echo "β οΈ Please manually add '@nuxt/content' to your modules array"
fi
fi
# Create content.config.ts
if [ ! -f "content.config.ts" ]; then
echo "π Creating content.config.ts..."
cat > content.config.ts << 'EOF'
import { defineContentConfig, defineCollection } from '@nuxt/content'
import { z } from 'zod'
export default defineContentConfig({
collections: {
content: defineCollection({
type: 'page',
source: '**/*.md',
schema: z.object({
title: z.string().optional(),
description: z.string().optional(),
date: z.date().optional(),
tags: z.array(z.string()).default([])
})
})
}
})
EOF
echo "β
Created content.config.ts"
else
echo "β οΈ content.config.ts already exists, skipping..."
fi
# Create content directory
if [ ! -d "content" ]; then
echo "π Creating content/ directory..."
mkdir -p content
# Create example content file
cat > content/index.md << 'EOF'
---
title: Welcome to Nuxt Content
description: Your content-driven site powered by Nuxt Content v3
date: 2024-01-01
tags: ['nuxt', 'content']
---
# Welcome to Nuxt Content v3
This is your first content page! Edit this file in `content/index.md`.
## Features
- π **Markdown Support** - Write content in Markdown
- π¨ **MDC Syntax** - Use Vue components in Markdown
- π **Type-Safe Queries** - Query content with TypeScript
- π **Git-Based** - Content stored in your repository
## Next Steps
1. Add more content files to `content/`
2. Create collections in `content.config.ts`
3. Query content with `queryCollection()`
4. Render with `<ContentRenderer>`
Happy writing! π
EOF
echo "β
Created content/ directory with example file"
else
echo "β οΈ content/ directory already exists, skipping..."
fi
# Create example page to render content
if [ ! -d "pages" ]; then
mkdir -p pages
fi
if [ ! -f "pages/[...slug].vue" ]; then
echo "π Creating pages/[...slug].vue..."
cat > 'pages/[...slug].vue' << 'EOF'
<script setup>
const route = useRoute()
const { data: page } = await useAsyncData(route.path, () =>
queryCollection('content').path(route.path).first()
)
if (!page.value) {
throw createError({ statusCode: 404, message: 'Page not found' })
}
useHead({
title: page.value.title,
meta: [
{ name: 'description', content: page.value.description }
]
})
</script>
<template>
<div class="container mx-auto px-4 py-8">
<article class="prose dark:prose-invert max-w-none">
<h1>{{ page.title }}</h1>
<ContentRenderer :value="page" />
</article>
</div>
</template>
EOF
echo "β
Created pages/[...slug].vue"
else
echo "β οΈ pages/[...slug].vue already exists, skipping..."
fi
echo ""
echo "π Nuxt Content v3 setup complete!"
echo ""
echo "Next steps:"
echo " 1. Run your dev server: $PKG_MGR run dev"
echo " 2. Visit http://localhost:3000"
echo " 3. Edit content/index.md"
echo " 4. Check SKILL.md for complete documentation"
echo ""
echo "π Resources:"
echo " - Docs: https://content.nuxt.com/"
echo " - Skill: skills/nuxt-content/SKILL.md"
echo ""
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path β even casually (like "the xlsx in my downloads") β and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |