In today’s age of heavy media consumption, it’s hard to make time to create - whether that means starting on a new watercolor painting, a new crafting or 3D printing project, or maybe a new corner for a mini home garden. For me, it’s easy to start drafting a blog post, and put a good amount of content in it, but it’s hard to actually finish it. Getting the final featured image, image attribution, and links in place takes time. And that’s why I recently added a blog post publish agent skill to my blog repo.
I’m not talking about using an agent to write the post itself. I can handle that part! That’s the part I want to do. I’m just talking about the part of taking my draft content that’s a simple Notion markdown file, and converting it into an actual blog post on my site.
I somehow gravitate towards Notion still for drafting new posts. I like that I can start drafts on my phone and then continue working on them later from my linux machine or laptop, or vice versa.
Anything that reduces the blog post writing friction is worth it in my book!
Features
I wanted a skill that could do the following:
- Pull down the latest changes in my blog’s repo
- Take my giant blob of markdown that I paste into a chat (or attach to a chat) and based on a few prompts that I answer, create a new git branch for a blog post
- Generate a new
.mdfile that has all of my blog post content, including the appropriate frontmatter section at the top, the content, the featured image, properly formatted links, and image attribution - Open a GitHub pull request when prompted, including the post content and any images
The Workflow
I complete my blog post draft in Notion, then choose "Export" and export it as markdown. Then I download and open up the zip file, open the .md file in a text editor, and copy all of the content.
I then paste that into a new Claude chat, tell it to help me publish a new blog post, and my skill gets triggered to help get the post live.
Once the pull request is opened, I can preview it via Netlify which is hooked up to my blog repo, and use an agent to make any tweaks to the post needed, by having it make commits to the same git branch.
Once I’m happy with the post preview, I just merge the pull request, and then Netlify pushes the post live to my site.
Final Skill
Here’s the final skill that I ended up with, which I store in my repo at .claude/skills/create-blog-post/SKILL.md:
---
name: create-blog-post
description: Create a new blog post for this Astro blog on its own git branch, with correct frontmatter, public URL slug, co-located featured image and Unsplash attribution, and a verified build. Use when asked to add, write, or publish a new blog post.
---
# Create a blog post
Posts live in `src/content/posts/<slug>/index.md` with images next to them. The schema is in `src/content.config.ts`. The README's "Content" section is the reference for the format.
## 1. Gather inputs
- **Body text**: the post content (Markdown), either pasted or as a `.md` file (for example a Notion export; see "Importing a Markdown file" below). Keep the author's wording. Only fix clear typos or duplicated words, and say which you fixed.
- **Title**: if not given, propose one.
- **Slug**: short, lowercase, hyphenated (e.g. `llm-upsides`). If the user doesn't give one, propose a short one. Avoid long sentence-style slugs.
- **Featured image** (optional but normal): an uploaded file or direct image link, plus the photographer's name and profile URL.
- **Categories/tags**: reuse existing ones where they fit. Check with `grep -h -A4 "^categories:\|^tags:" src/content/posts/*/index.md`. Most posts use `web development`.
If the image is an `unsplash.com/photos/...` page URL, it can't be fetched from the sandbox. Unsplash blocks scripted requests with a bot challenge, and the photo slug is not the `images.unsplash.com` ID. Ask the user to upload the file or send a direct `images.unsplash.com/photo-...` link. Don't try to bypass the challenge.
### Importing a Markdown file
The user shares the Markdown in the chat. They shouldn't have to put files in the repo or run git themselves. Markdown is the preferred input because links stay real `[text](url)` links, and pasted rich text often loses them. The user may share it in any of these forms:
- **Pasted Markdown**: the contents of a Notion-exported `.md` file, pasted into the chat. Use the pasted text as the source.
- **An attached or uploaded file** (`.md`, or a Notion export `.zip`): read it from wherever it landed.
- **A file path**: a dragged-in file usually shows up as a path on the user's machine. If that path can't be read (for example from inside a sandbox), say so, and ask the user to paste the file's contents instead.
If a working copy is needed, for example to unzip an export, put it in the session's scratchpad or a temp directory outside the repo, never in the working tree. A Notion "Markdown & CSV" export `.zip` usually holds `<Page Title> <32-char id>.md`, plus a folder with the same name that holds the page's images. Nested zips are possible, so unzip those too.
If the Markdown was pasted, its relative image paths (`Page%20Title%20<id>/image.png`) point at files you don't have. List the images it references and ask the user to share them (attach the files or send direct links). Leave a clear `TODO` placeholder for any image that doesn't arrive.
Only the formatting gets converted. The wording stays as the author wrote it. Then:
1. **Title**: if the file starts with `# Title`, use that as the post title and remove the line. The layout renders the title as the page `h1`. Sometimes the first `#` is the Notion page name (e.g. "Test blog post for skill") and the next `#` heading is the real title. In that case use the second one as the title, remove both lines, and say which you chose.
2. **Notion properties**: database pages put `Key: value` lines right after the title (`Created:`, `Tags:`, `Status:`, ...). Remove them. Offer any `Tags`/`Category` values as tags and categories, mapped to existing ones where they fit.
3. **Headings**: the body's top heading level must be `##`, with no skipped levels. If the body uses any `#` headings, demote every heading by one level (`#`→`##`, `##`→`###`, ...) so the hierarchy is kept. If the top level is deeper than `##` (e.g. only `###` remain after the title is removed), promote every heading so the top one is `##`. Notion often wraps headings in bold (`### **The Purchase**`); remove the `**` from headings, because heading styles are already bold.
4. **Links**: keep Markdown links as Markdown. Don't convert them to HTML. Check each one:
- Links to other Notion pages (relative `*.md` paths, or `notion.so` / `notion.site` URLs) won't work for readers. List them and ask the user what to link to instead, or whether to unlink the text.
- When the link text is the URL itself (`[https://x.com](https://x.com)`), leave it. Point it out only if a readable label would clearly be better.
- If a URL contains spaces or parentheses, it breaks Markdown links. URL-encode it, or wrap the URL in `<...>`.
5. **Images**: body images are written as URL-encoded relative paths, e.g. ``. Decode each path and copy the file into the post folder under a descriptive kebab-case name. Rewrite the reference to `./<name>.png` and add real alt text, asking the user if it isn't clear what an image shows. Images Notion hosts remotely (`https://...amazonaws.com/...`, `file.notion.so`) expire, so download them or ask the user for the file. The featured image is handled separately (sections 3 and 4). Don't promote the first body image to the featured image unless the user says so.
6. **Notion-only markup**: convert `<aside>` callouts to a blockquote (or a `[[postUpdate | ...]]` block if it's an update note), dropping the emoji icon unless it's part of the text. Toggle blocks come through as `<details>` or nested lists; ask before flattening them. Remove empty `<aside>` tags, stray ` `, and the trailing double spaces Notion uses for line breaks, unless a line break is clearly intended.
7. **Code blocks**: keep the language on fenced blocks. Notion sometimes writes `plain text`; change it to `text` or drop it.
## 2. Branch
Branch from the current default branch: `git checkout -b blog/<slug>`. If the session mandates a specific development branch, use that instead. Don't open a PR unless asked.
## 3. Create the files
Folder: `src/content/posts/<slug>/`
Rename the image to a descriptive kebab-case name (e.g. `light-bulb-light-trails.jpg`) and put it in that folder.
`index.md` frontmatter, matching existing posts:
```yaml
---
title: "On Agentic Development: Some LLM Upsides" # quote if it contains a colon
author: Sheelah
type: post
date: 2026-11-16T12:00:00+00:00 # today's date, ISO with +00:00
url: /blog/<slug>/ # public URL, trailing slash
featured_image: ./<image-file>.jpg # omit if no image
categories:
- web development
tags:
- some-tag
---
```
Notes:
- `url` is used exactly as written, so it must start with `/blog/` and end with `/`. The folder name and `url` slug should match.
- **Canonical link**: don't add one by hand. `src/components/SEO.astro` generates `<link rel="canonical">`, `og:url` and the JSON-LD URL from `url` plus `SITE_URL`. A correct `url` is all that's needed.
- The meta description is auto-generated from the post body, and the social image comes from `featured_image`. No extra fields are needed.
- Use `##` for section headings (the title is the page `h1`). Use fenced code blocks and inline backticks as in other posts.
## 4. Featured image attribution
If the image is from Unsplash (or otherwise needs credit), end the post with this exact two-line block, separated from the body by a blank line:
```markdown
[[featuredImageAttribution]]
| Featured image by [Photographer Name](https://unsplash.com/@username) via Unsplash
```
`[[featuredImageAttribution]]` is handled by `src/utils/remark-custom-blocks.mjs`. Include the marker line, or the credit renders as a plain paragraph. Use the photographer's profile link, not the photo link.
## 5. Verify
```bash
npm ci # only if node_modules is missing
npm run build # type-checks and builds; fails on bad frontmatter
```
Confirm the build output lists `/blog/<slug>/index.html`, and that the built page contains the canonical link and the attribution line:
```bash
grep -o '<link rel="canonical"[^>]*>' dist/blog/<slug>/index.html
grep -c "Featured image by" dist/blog/<slug>/index.html
```
Optionally run `npm run dev` and look at the post and the `/blog/` index.
## 6. Commit and push
Commit with a message like `Add post: <title>`, then push the branch. Add the attribution lines the session requires. Open a PR only if the user asks, and if the repo has a PR template, follow it.
## Renaming later
If the slug or title changes, `git mv` the folder, update `url` (and the title), rebuild, and grep for the old slug. Renaming the branch means pushing the new name and deleting the old remote branch. Say so if deletion isn't possible from the session.
Cursor also looks for skills in .claude directories so this skill would work fine with Cursor as well.
Featured image by Sixteen Miles Out via Unsplash
