---
name: blog-publish
description: Complete publishing workflow for blog posts: validate images and links, stage files, proofread, commit with appropriate action (publish/edit), and push to remote.
---
# Blog Publish Skill
This skill handles the complete publishing workflow for AI Wow blog posts: validates images, checks for broken links, stages files, proofreads, commits, and pushes to remote.
## How to Use
The user will tag or provide a markdown blog post file path. The skill will:
1. Extract all image references from the post (looks for `<Image src="..." />` components)
2. Validate that all referenced images exist in `public/static/images/blog/`
3. Check for broken links using the check-broken-links skill
4. Determine if this is a new post (publish) or existing post (edit)
5. Stage the blog post and all referenced images
6. Create an initial commit with appropriate action ("publish" or "edit")
7. Invoke the blog-proofread skill to check for spelling, grammar and punctuation errors
8. If proofreading finds errors, apply fixes and commit those changes
9. Push to remote
10. Ask if the user wants to run the blog-edit skill
## Workflow Steps
### 1. Validate the Blog Post
- Confirm the file path exists
- Read the markdown content
- Extract image references using regex: `<Image src="([^"]+)"`
### 2. Validate Images
For each image found:
- Check if the file exists at `public/static/images/blog/{filename}`
- If any image is missing, alert the user and EXIT
- List all images that will be staged
### 3. Check for Broken Links
Invoke the `check-broken-links` skill with the blog post path:
```bash
python3 .claude/skills/check-broken-links/check_links.py {blog_post_path}
```
Review the JSON output:
- If there are broken links, report them to the user
- The user can decide whether to fix them or proceed
- If the user wants to fix them, apply the fixes and continue
- If the user wants to proceed anyway, continue to next step
### 4. Determine Commit Action
Check if the blog post file is already tracked in git:
```bash
git ls-files --error-unmatch {blog_post_path}
```
- If the file is already tracked → use "edit" in commit message
- If the file is not tracked (new file) → use "publish" in commit message
### 5. Stage Files
```bash
git add {blog_post_path}
git add public/static/images/blog/{image1}
git add public/static/images/blog/{image2}
# ... etc
```
### 6. Initial Commit
```bash
git commit -m "content: {action} {post-slug}"
```
Where `{action}` is either "publish" or "edit" based on step 4.
### 7. Run Proofread
Invoke the `blog-proofread` skill with the blog post path. This will check for grammar, spelling, and punctuation errors.
If the skill reports errors, review and apply the suggested fixes to the file.
### 8. Commit Proofread Changes (if any)
Check git status. If the blog post was modified:
```bash
git add {blog_post_path}
git commit -m "content: proofread {post-slug}"
```
### 9. Push to Remote
```bash
git push
```
### 10. Completion
After successfully pushing, ask the user:
"Post published successfully! Would you like me to run this by your editor (run skill: blog-edit)?"
## Error Handling
- **Missing images**: Alert user with list of missing files and EXIT
- **Broken links**: Report broken links to user and ask whether to fix or proceed
- **No git changes**: Alert user that there are no changes to commit
- **Proofread tool errors**: Show the error output but continue with push
- **Push errors**: Show error and let user resolve manually
## Example Usage
User: "Publish data/journal/2025-11-01-chatprd.md"
The skill will:
1. Read the file
2. Find images (e.g., `chatprd-screenshot.png`, `chatprd-demo.gif`)
3. Verify images exist in `public/static/images/blog/`
4. Run check-broken-links skill to validate all URLs
5. If broken links found, report them and ask user whether to fix or proceed
6. Check if file is tracked in git (determines "publish" vs "edit")
7. Stage blog post + images
8. Commit: "content: publish chatprd" (or "content: edit chatprd" if already tracked)
9. Invoke blog-proofread skill
10. If errors found and fixed, commit: "content: proofread chatprd"
11. Push to remote
12. Ask: "Post published successfully! Would you like me to run this by your editor (run skill: blog-edit)?"
## Notes
- The blog-proofread skill checks for essential errors only (grammar, spelling, punctuation)
- Extract just the slug from the filename (remove date prefix and .md extension) for commit messages
- Use `git ls-files --error-unmatch {path}` to check if a file is tracked (exits with 0 if tracked, non-zero if not)
- The blog-edit skill provides style and clarity suggestions beyond basic proofreading