Edit existing blog posts - update content, metadata, title, description, slug, categories, tags, and featured images. Use when asked to improve, update, fix, or enhance existing blog posts.
Edit existing blog posts to improve quality, SEO, or fix issues.
| Endpoint | Purpose |
|---|---|
GET /api/blog/posts | List all posts |
GET /api/blog/posts/[slug] | Get single post |
PATCH /api/blog/posts/[slug] | Update post |
DELETE /api/blog/posts/[slug] | Delete post |
POST /api/blog/posts/[slug]/publish | Publish post |
POST /api/blog/posts/[slug]/unpublish | Unpublish to draft |
POST /api/blog/images/upload | Upload new image |
Authentication: Use x-api-key header with BLOG_API_KEY from
.env.apiBefore starting: Read recent entries to understand what has already been done.
tail -60 .claude/skills/blog-changelog.md
After finishing: Append a brief entry.
cat >> .claude/skills/blog-changelog.md << 'EOF'
## YYYY-MM-DD
### [Type]: [Short title]
**Affected:** [slug(s)]
**Why:** [reasoning]
**Changes:**
- `slug` — what was done
EOF
1. CHANGELOG → Read recent entries first
2. FETCH → GET /api/blog/posts/[slug]
3. ANALYZE → Review current content/SEO
4. IMPROVE → Generate new content/image if needed
5. UPDATE → PATCH /api/blog/posts/[slug]
6. VERIFY → Check changes applied
7. CHANGELOG → Append entry with what changed and why
# Load environment
source scripts/load-env.sh
API_KEY=$(grep BLOG_API_KEY .env.api | cut -d'=' -f2)
# Get post with full details
curl -s http://localhost:3000/api/blog/posts/how-to-upscale-images \
-H "x-api-key: $API_KEY" | jq '{
title,
description,
status,
titleLength: (.title | length),
descriptionLength: (.description | length),
category,
tags
}'
All fields are optional. Only include what you want to change.
# Update specific fields
curl -s -X PATCH http://localhost:3000/api/blog/posts/how-to-upscale-images \
-H "x-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "How to Upscale Images 4x: Complete Guide [2026]",
"description": "Upscale images 4x quality instantly with AI. Free tool for photos, graphics, artwork. No quality loss."
}' | jq '{title, updated_at}'
| Field | Type | Notes |
|---|---|---|
title | string | 5-200 chars |
slug | string | Lowercase with hyphens only |
description | string | 20-500 chars |
content | string | Min 100 chars |
author | string | Default: "MyImageUpscaler Team" |
category | string | Guides, Tips, Comparisons, News, Technical |
tags | array | Array of tag strings |
featured_image_url | string | AI-generated uploaded URL |
featured_image_alt | string | Alt text for accessibility |
seo_title | string | Max 70 chars |
seo_description | string | Max 160 chars |
Use the AI image generation skill for unique, contextual images:
# Generate a blog-optimized featured image (1200x630)
yarn tsx .claude/skills/ai-image-generation/scripts/generate-ai-image.ts \
"Modern laptop showing AI image upscaling interface, before and after comparison, professional setup, blue lighting, photorealistic" \
./new-featured.png \
1200 630
# Upload to Supabase Storage
UPLOAD=$(curl -s -X POST http://localhost:3000/api/blog/images/upload \
-H "x-api-key: $API_KEY" \
-F "file=@./new-featured.png" \
-F "alt_text=AI image upscaling before and after comparison")
IMAGE_URL=$(echo "$UPLOAD" | jq -r '.data.url')
# Update post with new URL
curl -s -X PATCH http://localhost:3000/api/blog/posts/[slug] \
-H "x-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d "{\"featured_image_url\": \"$IMAGE_URL\", \"featured_image_alt\": \"AI image upscaling before and after comparison\"}"
See /ai-image-generation skill for prompt templates and best practices.
Images are automatically compressed to WebP format (max 1920x1080, 80% quality) before storage.
# Upload (auto-converts to WebP)
UPLOAD=$(curl -s -X POST http://localhost:3000/api/blog/images/upload \
-H "x-api-key: $API_KEY" \
-F "file=@./new-featured.jpg" \
-F "alt_text=New featured image")
IMAGE_URL=$(echo "$UPLOAD" | jq -r '.data.url')
# Update post with new URL
curl -s -X PATCH http://localhost:3000/api/blog/posts/[slug] \
-H "x-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d "{\"featured_image_url\": \"$IMAGE_URL\"}"
Storage details:
Posts should have 2-3 inline images in the markdown content. To add or update them:
# Generate new inline images
yarn tsx .claude/skills/ai-image-generation/scripts/generate-ai-image.ts \
"Split screen: pixelated photo left, sharp enhanced photo right, dramatic comparison" \
./new-inline.png 800 600
# Upload to storage
INLINE_URL=$(curl -s -X POST http://localhost:3000/api/blog/images/upload \
-H "x-api-key: $API_KEY" \
-F "file=@./new-inline.png" \
-F "alt_text=Before and after comparison" | jq -r '.data.url')
echo "Use this in content: "
Then update the content with the new image markdown (see Step 5).
For large content updates, write to file first. Include inline images in markdown:
cat > /tmp/content-update.json << 'EOF'
{
"content": "# Updated H1 Title\n\nNew intro with primary keyword...\n\n## Section 1\n\nImproved content with more details...\n\n\n\n## Section 2\n\nMore comprehensive content...\n\n\n\n## Conclusion\n\nSummary and [CTA](https://myimageupscaler.com)."
}
EOF
curl -s -X PATCH http://localhost:3000/api/blog/posts/[slug] \
-H "x-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d @/tmp/content-update.json | jq '{title, updated_at}'
Inline Image Rules:
5 Ways, 7 Methods[2026], [Guide], [Free]CRITICAL: Every blog post MUST have hyperlinked CTAs.
Required CTA Placements:
CTA Templates:
<!-- Primary Conclusion CTA -->
[Start upscaling your images now](https://myimageupscaler.com) - free, no signup.
<!-- Contextual CTA -->
[Try our AI upscaler](https://myimageupscaler.com) and see the difference.
<!-- Benefit-focused -->
[Upload your photo](https://myimageupscaler.com) - 4x enhancement in seconds.
<!-- Quality CTA -->
Professional results with our [free image upscaler](https://myimageupscaler.com).
Best Practices:
[text](https://myimageupscaler.com)curl -s -X POST http://localhost:3000/api/blog/posts/[slug]/publish \
-H "x-api-key: $API_KEY" | jq '{status, published_at}'
curl -s -X POST http://localhost:3000/api/blog/posts/[slug]/unpublish \
-H "x-api-key: $API_KEY" | jq '{status, published_at}'
curl -s -X DELETE http://localhost:3000/api/blog/posts/[slug] \
-H "x-api-key: $API_KEY"
Categories: Guides, Tips, Comparisons, News, Technical
Tags: upscale, AI, tutorial, photo, image, enhancement, resolution, prints, social-media, graphics, artwork, logo, product-photos, ecommerce, restoration, batch, free, online
| Category | Words to Avoid |
|---|---|
| Overused | delve, tapestry, nuanced, landscape, testament |
| Corporate | leverage, facilitate, streamline, utilize |
| Filler | "It's important to note", "worth noting" |
| Hype | groundbreaking, revolutionary, game-changing |
| Throat-clearing | "In today's world", "Here's the thing" |
❌ AI: "Image upscaling represents a significant advancement in AI technology."
✅ Human: "I've tested dozens of upscalers. Most make your photos look like plastic."
❌ AI: "This solution offers numerous benefits."
✅ Human: "Here's what makes this different: it actually preserves details."
❌ AI: "The process facilitates enhanced quality."
✅ Human: "Your photos get sharper. Period."
Writing Rules:
# API check
curl -s http://localhost:3000/api/blog/posts/[slug] \
-H "x-api-key: $API_KEY" | jq '{title, updated_at, status}'
# Frontend check
curl -s -o /dev/null -w "%{http_code}" http://localhost:3000/blog/[slug]
curl -s "http://localhost:3000/api/blog/posts?status=published&limit=50" \
-H "x-api-key: $API_KEY" | jq '.data[] | {slug, title, status}'
# Get all posts with old category
curl -s "http://localhost:3000/api/blog/posts?category=OldCategory" \
-H "x-api-key: $API_KEY" | jq '.data[].slug' | while read slug; do
# Update each post
curl -s -X PATCH "http://localhost:3000/api/blog/posts/$slug" \
-H "x-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"category": "NewCategory"}'
done
# Unpublish first
curl -s -X POST http://localhost:3000/api/blog/posts/[slug]/unpublish \
-H "x-api-key: $API_KEY"
# Then publish
curl -s -X POST http://localhost:3000/api/blog/posts/[slug]/publish \
-H "x-api-key: $API_KEY"
# Load environment
source scripts/load-env.sh
API_KEY=$(grep BLOG_API_KEY .env.api | cut -d'=' -f2)
updated_at timestamp changedx-api-key header is correctpublished_at is set/unset accordingly/ai-image-generation - Generate featured and inline images with AI/blog-publish - Create new blog posts from scratch