The Complete Production SOP: How to Deploy and Run Nuxt Content v2 Git-Based Markdown CMS & MDC Syntax in Autonomous AI Agents
Step-by-step SOP to install and run Nuxt Content v2 & MDC syntax skill in Codex, Claude Code, and Cursor. Includes verified prompts, configs, and fixes.
Technical Overview & Architectural Context
Autonomous coding agents frequently stumble when implementing Nuxt Content v2 because they conflate Nuxt Content v1 runtime APIs (such as `$content`) with v2 composables (`queryContent()`), hallucinate standard markdown parsers like markdown-it or remark plugins instead of native MDC syntax, and mishandle Vue SSR hydration within `useAsyncData`. Without deterministic guardrails, agents often attempt to mount custom AST transformers or inject client-only markdown renderers that break server-side rendering and fail type checking. The `nuxt-content-markdown-cms` skill eliminates this ambiguity. It forces autonomous agents (Codex, Claude Code, Cursor, Windsurf) to adhere strictly to Nuxt Content v2 architecture: structuring documents strictly under `/content`, employing `useAsyncData` wrapper patterns for `queryContent()`, leveraging native `<ContentRenderer />` and `<ContentDoc />` components, and executing MDC syntax blocks (`::component{prop=val}`) without external parser bloat. This ensures 100% deterministic code generation and zero SSR hydration mismatches.
Prerequisites & Environment Requirements
Verified Search Intents & Long-Tail Queries Solved
This operational tutorial is engineered to provide deterministic solutions for these developer search queries:
Step-by-Step Execution Playbook
Local Environment Setup & SKILL.md Mounting
Create the local skill manifest directory and inject verified procedural rules into your agent runtime.
Autonomous runtimes parse directory-mounted instructions prior to prompt compilation. In Cursor and Claude Code, placing SKILL.md under `.agents/skills/nuxt-content-markdown-cms/` or referencing it inside `.cursorrules` / `CLAUDE.md` activates the triggers whenever content-related tasks are detected. This establishes deterministic constraints on Nuxt Content v2 APIs without polluting the global prompt context.
mkdir -p .agents/skills/nuxt-content-markdown-cms && curl -fsSL https://askills.dev/api/skills/nuxt-content-markdown-cms/raw -o .agents/skills/nuxt-content-markdown-cms/SKILL.md---
name: "nuxt-content-markdown-cms"
description: "Transform Markdown and MDC components into a full-featured searchable content site."
metadata:
author: "Nuxt"
version: "1.0.0"
runtime_compatibility:
- "codex"
- "claude-code"
- "cursor"
- "windsurf"
triggers:
- "querycontent nuxt content"
- "mdc vue component markdown"
- "nuxt content documentation"
permissions:
fs_read: true
fs_write: "workspace"
shell_exec: false
net_access: false
---Use .cursor/rules or Claude Code CLAUDE.md references to point directly to SKILL.md so the agent only reads the document when file paths match /content/** or /pages/**.
Ensure fs_write permissions are bounded to the workspace directory. Nuxt Content generates internal caches in .nuxt/content; agents should not attempt to write directly into virtual build artifacts.
Module Installation & Nuxt Configuration
Install @nuxt/content module and register it within nuxt.config.ts with required Shiki syntax highlighting options.
Agents must configure `@nuxt/content` inside `nuxt.config.ts` modules array. Nuxt Content v2 leverages Shiki by default for compile-time syntax highlighting. Specifying pre-configured themes and custom MDC components inside `nuxt.config.ts` prevents agents from installing redundant runtime highlight libraries like highlight.js or prismjs.
pnpm add -D @nuxt/contentexport default defineNuxtConfig({
modules: ['@nuxt/content'],
content: {
highlight: {
theme: {
default: 'github-light',
dark: 'github-dark'
},
preload: ['json', 'js', 'ts', 'html', 'css', 'vue', 'bash']
}
}
})Explicitly declaring preload languages in content.highlight prevents on-demand Shiki language fetch latency and network timeout errors during static generation (nuxi generate).
Do not allow agents to install Nuxt 2 modules (e.g., @nuxt/content v1). Check package.json to verify @nuxt/content is version ^2.x.x.
Content Directory Structure & MDC Component Setup
Structure Markdown files with YAML frontmatter under content/ and implement MDC components in components/content/.
Nuxt Content auto-registers any Vue component located in `components/content/` as an MDC component. Agents must understand this special folder naming convention so that components can be invoked directly inside Markdown files using the `::component-name` syntax without explicit script imports.
mkdir -p content/blog components/content<script setup lang="ts">
defineProps<{
type?: 'info' | 'warning' | 'danger'
}>()
</script>
<template>
<div :class="['callout-box', `callout-${type || 'info'}`]">
<slot />
</div>
</template>
<style scoped>
.callout-box {
padding: 1rem;
border-radius: 0.5rem;
margin: 1.5rem 0;
}
.callout-info { background: #e0f2fe; border-left: 4px solid #0284c7; }
.callout-warning { background: #fef3c7; border-left: 4px solid #d97706; }
.callout-danger { background: #fee2e2; border-left: 4px solid #dc2626; }
</style>Keep components inside components/content/ lightweight. Slot-based content rendering ensures markdown nested inside MDC tags is fully transformed into parsed AST nodes.
If a component is placed in components/ instead of components/content/, Nuxt Content will render it as a raw unparsed custom HTML tag instead of mounting the Vue instance.
Querying with useAsyncData and ContentRenderer
Fetch parsed markdown AST via queryContent() wrapped inside useAsyncData and render it with <ContentRenderer />.
Directly calling `await queryContent().findOne()` in `<script setup>` without `useAsyncData` can lead to duplicated network/filesystem calls during SSR hydration. The SOP mandates wrapping every `queryContent()` invocation inside `useAsyncData('key', () => queryContent(...).findOne())` to achieve zero-hydration mismatch and optimal page rendering speeds.
cat << 'EOF' > pages/blog/[...slug].vue<script setup lang="ts">
const route = useRoute()
const { data: post, error } = await useAsyncData(`blog-${route.path}`, () => {
return queryContent('blog', route.params.slug as string).findOne()
})
if (error.value || !post.value) {
throw createError({ statusCode: 404, statusMessage: 'Post Not Found', fatal: true })
}
</script>
<template>
<main class="prose mx-auto py-10">
<h1>{{ post.title }}</h1>
<ContentRenderer :value="post">
<template #empty>
<p>No content found in this document.</p>
</template>
</ContentRenderer>
</main>
</template>Always provide a unique cache key to useAsyncData matching the route path to guarantee isolated state transfer during server-side pre-rendering.
Avoid using find() when rendering single pages; findOne() produces a single document object, whereas find() returns an array and causes <ContentRenderer> to throw a prop validation warning.
Verification, Linting & Output Quality Gate
Execute automated type validation and static page generation to verify zero missing routes or invalid frontmatter.
Before committing changes, the agent must run `npx nuxi typecheck` and `npx nuxi generate` in dry-run mode. This verifies that all markdown YAML headers are valid, all referenced MDC components resolve cleanly, and no dangling references exist in `queryContent` routes.
npx nuxi typecheck && npx nuxi generateInspect the .output/public directory output to verify that static HTML files contain prerendered text and Shiki CSS classes, confirming SSR executed properly.
Unquoted special characters in YAML frontmatter (like colons or brackets) will cause silent parser failures or build aborts during nuxi generate.
Real-World Scenario: Build a Documentation System with Live Code Previews and Alert Callouts
“Set up a Nuxt Content v2 documentation section under /content/docs. Create an MDC Alert component that supports 'warning' and 'info' types, write an introductory markdown article showcasing the Alert component, and build a catch-all route at pages/docs/[...slug].vue using queryContent with full TypeScript error handling.”
Runtime Troubleshooting & Failure Modes
Root Cause: The Nuxt build context has not generated the dynamic TypeScript declaration files after module installation, or .nuxt/tsconfig.json is out of date.
npx nuxi prepareRoot Cause: The custom Vue component was created in 'components/' rather than 'components/content/', preventing Nuxt Content MDC runtime from auto-registering it for markdown parsing.
mkdir -p components/content && mv components/Alert.vue components/content/Alert.vue && npx nuxi prepareFrequently Asked Questions (Nuxt Content v2 Git-Based Markdown CMS & MDC Syntax SOP)
Q:Can I use Nuxt Content v2 Git-Based Markdown CMS & MDC Syntax across Codex, Claude Code, and Cursor simultaneously?
Yes. The SKILL.md specification is platform-agnostic and fully compatible across Codex, Claude Code, Cursor, and Windsurf runtimes by providing standard procedural triggers and bounded filesystem constraints.
Q:How does Nuxt Content v2 Git-Based Markdown CMS & MDC Syntax prevent context window overflow during long agent sessions?
By isolating execution boundaries to specific triggers (like queryContent and MDC syntax) and relying on workspace file updates rather than pumping entire documentation sets into the LLM chat context.
Q:Does this skill require escalated root or container permissions?
No. The skill is rated with a 98/100 Security Score. It operates purely within user-level workspace read/write boundaries with zero root or network-escalation requirements.
Ready to equip your autonomous agent with Nuxt Content v2 Git-Based Markdown CMS & MDC Syntax?
Copy the complete audited SKILL.md specification or download the 1-click zip bundle directly from our verified registry.