Build or update the BlueBubbles external channel plugin for Moltbot (extension package, REST...
npx skills add UsmanGhani-Emumba/claude-skills-poc --skill "publisher"
Install specific skill from multi-skill repository
# Description
Publishing skill for deploying finalized content to Notion. Activates after review is complete or when asked to publish/deploy/post content. Triggers on "publish to Notion", "post this to Notion", "deploy the blog", or as the final step in content creation pipelines.
# SKILL.md
name: publisher
description: Publishing skill for deploying finalized content to Notion. Activates after review is complete or when asked to publish/deploy/post content. Triggers on "publish to Notion", "post this to Notion", "deploy the blog", or as the final step in content creation pipelines.
Publisher Skill
Purpose
Deploy finalized, reviewed content to an existing Notion page with proper formatting.
Prerequisites
Required before publishing:
- β Finalized blog content (from Reviewer skill)
- β Notion MCP connection active
- β User has created an empty page in Notion (see below)
User Setup (REQUIRED)
β οΈ Before publishing, the user must:
- Create an empty page in Notion where the blog will be published
- Share that page with the Notion integration (Add connections β select integration)
- Provide the exact page name to Claude
Connection Check (CRITICAL)
β οΈ STOP if Notion MCP is not connected. Inform the user:
"Notion MCP is not connected. Please ensure:
1. Notion MCP server is configured and running
2. Your integration token is valid
3. Target page is shared with the integrationRun
/mcpcommand in Claude Code CLI to check connection status."
Do not attempt publishing without confirmed connection.
Workflow
- Verify connection β Check Notion MCP is active
- Ask for page name β Request the exact name of the target Notion page
- Search for page β Use
API-post-searchto find the page by name - Confirm page β Verify the correct page was found
- Format content β Convert markdown to Notion blocks
- Append content β Use
API-patch-block-childrento add blocks to the page - Return link β Provide the Notion page URL
Page Name Request
If page name is not specified, ask:
"Please provide the exact name of the Notion page where you want to publish this blog.
Note: The page must already exist in Notion and be shared with the integration."
API Usage
Step 1: Search for Page
Use API-post-search to find the target page:
query: "<page name>"
β οΈ Note: Only use the query parameter. Other parameters like filter and page_size cause serialization errors in the current MCP version.
Step 2: Append Content (with Auto-Retry)
Use API-patch-block-children to add content:
block_id: "<page_id from search results>"
children: [array of block objects as JSON string]
Automated Upload Strategy (CRITICAL)
β οΈ The Notion API is prone to 400 errors. Use this automated approach:
Batch Configuration
- Batch size: 5 blocks maximum (smaller = more reliable)
- Never exceed 5 blocks per API call
- Convert all content to blocks first, then split into batches
Auto-Retry Loop (MANDATORY)
Before starting, create a batch tracking list:
Total blocks: [count]
Batches needed: [total / 5, rounded up]
Current batch: 1
For each batch, follow this loop:
REPEAT until current_batch > total_batches:
1. Attempt API call for batch [current_batch]
2. IF success:
- Log: "β
Batch [current_batch] uploaded successfully"
- Increment current_batch
- Continue to next batch
3. IF 400 error:
- Log: "β οΈ Batch [current_batch] failed - retrying..."
- Wait 2 seconds
- Retry SAME batch (up to 3 attempts)
- If still failing after 3 attempts:
a. Try with even smaller batch (2-3 blocks)
b. If still failing, try blocks one at a time
4. IF rate limited (429):
- Wait 30 seconds
- Retry same batch
5. NEVER skip a batch - keep retrying until success
6. Report progress: "[current_batch]/[total_batches] batches complete"
Progress Tracking Template
Use this format to track and display progress:
π€ Publishing Progress
ββββββββββββββββββββ
Total blocks: XX
Batch size: 5
Total batches: XX
[β β β β β β‘β‘β‘β‘β‘] 50% - Batch 5/10
β
Batch 1: Success
β
Batch 2: Success
β
Batch 3: Success
β
Batch 4: Success
π Batch 5: In progress...
400 Error Recovery Strategies
If a batch keeps failing with 400:
- Reduce batch size β Try 3 blocks, then 2, then 1
- Check block content β Remove special characters, emojis, or unusual formatting
- Simplify rich text β Use plain text without formatting
- Split long paragraphs β Break paragraphs over 2000 characters
Example: Single Block Upload (Fallback)
When batches fail, upload one block at a time:
[{"type": "paragraph", "paragraph": {"rich_text": [{"type": "text", "text": {"content": "Your text"}}]}}]
Completion Confirmation
Only report success when ALL batches are uploaded:
β
Publishing Complete!
ββββββββββββββββββββ
All [XX] batches uploaded successfully.
Total blocks published: [XX]
Notion Block Format
When converting markdown to Notion blocks for children parameter:
| Markdown | Notion Block Type |
|---|---|
## Heading |
{"type": "heading_2", "heading_2": {"rich_text": [...]}} |
### Subheading |
{"type": "heading_3", "heading_3": {"rich_text": [...]}} |
| Paragraphs | {"type": "paragraph", "paragraph": {"rich_text": [...]}} |
- item |
{"type": "bulleted_list_item", "bulleted_list_item": {"rich_text": [...]}} |
Rich text format:
{"type": "text", "text": {"content": "Your text here"}}
Error Handling
| Error | Response |
|---|---|
| MCP not connected | Guide user to set up connection |
| Permission denied | Ask user to share page with integration |
| Page not found | Ask user to verify page name and that it's shared |
| Multiple pages found | Show options and ask user to confirm |
| Rate limited (429) | Wait 30 seconds, then auto-retry same batch |
| 400 Bad Request | Auto-retry with smaller batch (see below) |
| Timeout | Wait 5 seconds, auto-retry same batch |
400 Error Auto-Recovery Protocol
When receiving a 400 error, follow this escalation:
- First attempt failed β Retry same batch immediately
- Second attempt failed β Wait 2 seconds, retry same batch
- Third attempt failed β Reduce batch size by half, retry
- Fourth attempt failed β Try uploading blocks one at a time
- Single block still failing β Simplify that block's content (remove special chars/formatting)
- Still failing β Skip problematic block, log it, continue with remaining blocks
NEVER stop the upload process due to errors. Always continue until all possible content is uploaded.
Success Criteria
- Target page found by name
- All content properly formatted as Notion blocks
- Content successfully appended to page
- User receives working Notion URL
Reference
For expected output format, see references/sample-output.md
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.