Codymaster cm-auto-publisher
Comprehensive publishing automation skill bridging AI agents (OpenClaw, Manus, Claude) to the Content Factory Router. Uses the Router API to publish markdown articles with rich media to any connected Astro site natively.
git clone https://github.com/tody-agent/codymaster
T=$(mktemp -d) && git clone --depth=1 https://github.com/tody-agent/codymaster "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/cm-auto-publisher" ~/.claude/skills/tody-agent-codymaster-cm-auto-publisher && rm -rf "$T"
skills/cm-auto-publisher/SKILL.mdcm-auto-publisher: The Agentic Publishing Skill
Goal: Take unstructured input (links, ideas, raw text), write a highly engaging article following Content Factory rules, and instantly publish it via the Content Factory Router API.
When to Use
ALWAYS when:
- User provides a link/video and says "Write an article about this and publish it".
- User says "Draft and push this news to the blog".
- You have finished drafting an article and need to deploy it to the live site.
- An automated cron job triggers you to aggregate news and auto-publish.
The Process
Phase 1: Content Extraction & Structuring
- Analyze Input: If given a URL, use
(or your browsing tool) to read the source. If given images or Youtube links, extract them.read_url_content - Draft Content: Write a compelling article in standard Markdown.
- Use headings (
,##
).### - For YouTube videos, use the Astro component:
.<YouTube id="VIDEO_ID" /> - For images, just use standard markdown:
.
- Use headings (
Phase 2: Media Preparation
Identify all external images that need to be published with the article. DO NOT try to download them to the local disk using bash commands. The Content Factory Router will handle this. Instead, build a
media array mapping the original URLs to the desired clean filenames.
"media": [ { "url": "https://source.com/raw-image-123.jpg", "filename": "clean-seo-friendly-name.jpg" } ]
Phase 3: API Payload Construction
Construct the JSON payload matching the target site's schema. Standard Target:
cody-master (mapped to tody-agent/todyle-web).
{ "site_id": "cody-master", "title": "[Engaging Title]", "description": "[1-2 sentence SEO meta description]", "category": "news", // or "guide", "use-case" "readingTime": "5 min read", "tags": ["AI", "Vibe Coding", "Automation"], "content": "The raw markdown content here...", "media": [ ... ] }
Phase 4: Publish via Router API
Send the payload to the Cloudflare Worker via a standard
fetch or curl command.
- Get the Secret: Retrieve the API token from the
file or ask the user for the.env
.PUBLISHER_API_KEY - Send POST Request: Use a local script or curl to send the data to the worker.
# Example curl (assuming the payload is saved to payload.json) curl -X POST https://content-factory-router.<YOUR-CLOUDFLARE-ACCOUNT>.workers.dev/publish \ -H "Content-Type: application/json" \ -H "Authorization: Bearer <API_KEY>" \ -d @payload.json
Phase 5: Verification
- Check the response from the Worker. It should return
.{"success": true, "message": "Published...", "commit_sha": "..."} - Inform the user that the article has been successfully committed to GitHub and Cloudflare Pages is now building it.
Red Flags - STOP!
- ❌ DO NOT manually create
files in.mdx
and runsrc/content/articles/
if using this skill! Let the Router API handle the Git history and image blob creation to ensure data consistency.git push - ❌ DO NOT use
orcat
to build complex JSON payloads in bash. Save the payload to aecho
file using your file writing tool, then pass it to.json
.curl