Structured Markdown components without framework lock-in.
npx contentbit@latest init, then ask your coding agent to write a post — it
fetches the live authoring guide, writes, and validates until clean.
LLMs are fluent in Markdown, and that fluency is the problem: generated content looks right and breaks in production. Content Blocks is a content protocol that fixes the interface. Authors (humans, CMSes, LLMs) write plain Markdown with directive blocks:
:::comparison{left="Basic" right="Pro"}
- Price | Free | $12/mo
- Support | Community | Priority
:::Every block has a schema. Validation runs before anything renders and produces
file:line:col diagnostics a human or a model can act on. The same registry
that validates content also generates the LLM authoring instructions, so
schema, docs, and prompts can never drift apart.
article.md:12:1 error CB_PROPS_INVALID
:::callout props invalid: type must be one of note|tip|warning|important|tldr.
hint: Did you mean type="warning"?
npx contentbit@latest initOne command: detects your framework and package manager, installs the
packages, scaffolds a starter document, a custom block, and a rendered
/example page, generates LLM authoring instructions, and wires in your
coding agent. In shadcn projects it also installs the styled component pack.
Prefer the pieces? pnpm add @contentbit/core @contentbit/blocks plus the
renderer of your choice. Full walkthrough:
contentbit.dev/docs.
After init, your agent knows how to write content for this project:
"write a blog post about X" · "audit my content"
contentbit agents (included in init) installs Claude Code skills and an
AGENTS.md block, so writing fetches the live guide and validates until clean,
and auditing ranks findings from contentbit stats JSON. The skills hold no
schemas; they read everything from the CLI at runtime, so custom blocks are
picked up automatically. See
contentbit.dev/docs/guides/agents.
What runs under the hood — yourself or via the skills:
- Generate the authoring guide from your registry:
contentbit instructions --audience llm - Let the model write plain Markdown with blocks. Nothing executable.
- Validate:
contentbit validate "content/**/*.md"exits 1 with precise diagnostics. - Feed diagnostics back to the model until clean. Render anywhere: React, Astro, static HTML, or plain Markdown.
| Package | Purpose |
|---|---|
@contentbit/core |
Parser, AST, diagnostics, registry, validation, content models, authoring guide, Markdown fallback |
@contentbit/blocks |
Generic block definitions (callout, steps, comparison, tabs, faq, ...) |
@contentbit/html |
Static HTML renderer, works without JavaScript |
@contentbit/react |
React renderer with headless accessible defaults |
@contentbit/astro |
Astro renderer: .astro components with per-block overrides |
contentbit |
CLI: init / validate / stats / render / instructions / docs / agents |
The styled component pack ships through a shadcn registry:
pnpm dlx shadcn@latest add @contentbit/generic-pack
(registry: https://contentbit.dev/r/{name}.json).
- Docs, with every example rendered live by the library
- All blocks, the generic pack with authoring guidance
- Playground, validates as you type
- Blog, every post is a validated Content Blocks document
- Changelog, what shipped in each release
- llms.txt / authoring guide for agents
pnpm install
pnpm -r build
pnpm -r test
pnpm lint && pnpm fmt:checkSee CONTRIBUTING.md for the repo layout and guidelines.