Blog Post Claude Code Skill
Creating my first Claude Code skill and using it to create a blog post
The Problem
Adding a blog post to this site is a multi-step process. You need to create a new page.tsx file under app/blog/[slug]/, then manually register the post in lib/posts.ts so it shows up on the blog index. If I (or Claude) miss either step, then things may break in confusing ways — a post that renders but doesn't appear in the list, or a link in the index that 404s.
I already documented it in CLAUDE.md so Claude Code could follow along, but I wanted something even more automatic.
Claude Code Skills
Claude Code supports custom slash commands called skills. A skill lives under .claude/skills/ at the root of your project — a directory per skill, with a SKILL.md file inside. When you type /skill-name in the Claude Code prompt, it loads that file as an instruction set and executes it.
Skills can accept arguments (via $ARGUMENTS), ask follow-up questions, read and write files, and do anything else Claude Code can normally do — they just package a repeatable workflow into a single command. They follow the Agent Skills open standard, so the format is portable across AI tools that support it.
Building /new-blog-post
I created .claude/skills/new-blog-post/SKILL.md with instructions that mirror what I'd tell Claude manually. The skill:
- Asks for a title, slug, excerpt, and date (or accepts the title as a direct argument to skip the first prompt)
- Creates
app/blog/[slug]/page.tsxfrom a standard template with the correct Tailwind classes and formatting - Reads
lib/posts.tsand prepends the new entry to thepostsarray so the blog index stays up to date
A CMS Without the CMS
I've played around with the idea of using a proper CMS for this website — a database, a web UI for writing posts, maybe a draft/publish workflow. But I keep coming back to the fact that code and git already give me most of what I'd want from a CMS: version history, a clear publish moment (merging to main), the ability to write and preview locally (or with Cloud Run revision URLs) before anything goes live.
The Claude Code skill bridges that gap between a CMS and my git workflow — it handles the file management so I can focus on writing. It's not a CMS, but it gives me a similar publishing experience while keeping everything in the repo where I want it.
The Meta Part
This post was created using the skill. I typed /new-blog-post, provided the title and excerpt, and Claude Code scaffolded the file and updated lib/posts.ts automatically. I wrote the content, made revisions, and published.
The goal isn't to automate writing — it's to stop letting file management be the reason I don't.