BoilerPrompt
Claude Code

Claude Code prompt to build a blog with a CMS

For a developer blog, the repo is the CMS: Markdown in, static pages out, everything reviewable in a pull request. Claude Code builds the whole pipeline and then verifies it the way an agent with a shell can, by grepping the build output to prove drafts never leak into production.

Last updated

Prompt
Build a blog in this repo with a git-based CMS: posts live as Markdown files with frontmatter in content/posts, no external service. Frontmatter fields: title, slug, date, tags, draft. Build the pipeline in {{language}}: parse frontmatter, render Markdown with code-block syntax highlighting, generate an index page sorted by date, tag pages, an RSS feed at /feed.xml, and per-post OpenGraph meta tags. Drafts must be excluded from the production build but visible in dev. Add two valid sample posts, one draft and one published. Do not commit broken posts: the tests should write their own fixtures into a temp directory, two posts sharing a slug and one with malformed frontmatter, and assert the pipeline rejects each with a clear error. Also cover a valid post with no tags. Run the production build, list every generated route, and confirm the draft appears nowhere in the output directory by grepping the build folder for its slug.

Customize it

Runs in your browser. Nothing you type here is sent anywhere.

Your customized prompt
Build a blog in this repo with a git-based CMS: posts live as Markdown files with frontmatter in content/posts, no external service. Frontmatter fields: title, slug, date, tags, draft. Build the pipeline in TypeScript: parse frontmatter, render Markdown with code-block syntax highlighting, generate an index page sorted by date, tag pages, an RSS feed at /feed.xml, and per-post OpenGraph meta tags. Drafts must be excluded from the production build but visible in dev. Add two valid sample posts, one draft and one published. Do not commit broken posts: the tests should write their own fixtures into a temp directory, two posts sharing a slug and one with malformed frontmatter, and assert the pipeline rejects each with a clear error. Also cover a valid post with no tags. Run the production build, list every generated route, and confirm the draft appears nowhere in the output directory by grepping the build folder for its slug.

Same task in other tools

Questions about this prompt

I want a hosted headless CMS, not Markdown in git. Does this prompt still work?

Swap the source: name the CMS and hand the agent API credentials through environment variables. Route generation, the RSS feed, and the draft-leak grep on the build folder all work the same regardless of where content comes from.

What are the two sample posts for?

Happy-path coverage only. The published one exercises rendering, the index, tag pages, RSS, and OpenGraph output; the draft one feeds the grep check proving drafts stay out of production. The failure tests never touch them, since those write throwaway posts into a temp directory, which is why the committed repo always builds clean.

How are duplicate slugs handled when I import old posts in bulk?

The build fails loudly on a collision instead of silently overwriting one post with another. Run the production build once before committing an import and fix the reported slugs; that is the whole workflow.

Related prompts