media-publish
Skill7 starsChanged 8 months agoMITView on GitHub
Publish content to all configured platforms. Reads the content manifest, validates files, and invokes each platform's publish.sh with credential isolation. Supports --dry-run. Handles partial failures gracefully. Works independently — you can write markdown by hand and just use this skill.
- Reads credentials
- Commits and pushes
In this repository6 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- media-ideaSkill
- media-imageSkill
- media-setupSkill
- mediaSkill
- media-writeSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 8 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Before starting, read these shared library files:
- Very specific: line 25
Read lib/adapter-discovery.md for adapter invocation patterns
- Very specific: line 26
Read lib/manifest-ops.md for manifest format and validation
- Distinctive: line 30
If the user specifies a post path, use it.
- Distinctive: line 36
Verify the post directory contains:
- Distinctive: line 41
If any are missing, report what's missing and stop.
- Very specific: line 45
Read manifest.yaml and validate:
- Very specific: line 64
Only attempt platforms with status: draft, pending, or failed.
- Distinctive: line 67
If no platforms are publishable, tell the user: "All platforms are already published or skipped.
- Distinctive: line 92
Use AskUserQuestion to confirm.
- Very specific: line 102
Read the adapter's auth_env_var from adapter.yaml, then invoke:
- Distinctive: line 121
After each platform publish attempt, update the manifest atomically:
- Very specific: line 139
Use the atomic write pattern from lib/manifest-ops.md:
- Distinctive: line 146
After all platforms are attempted, report:
- Very specific: line 163
If --dry-run was used:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/media-publish — Multi-Platform Publishing
Publish your content to all configured platforms in one go.
Prerequisites
Before starting, read these shared library files:
- Read
lib/adapter-discovery.mdfor adapter invocation patterns - Read
lib/manifest-ops.mdfor manifest format and validation
Step 1: Locate the Post
If the user specifies a post path, use it. Otherwise, find the most recent post:
ls -dt content/posts/*/ 2>/dev/null | head -1Verify the post directory contains:
source.md(canonical content)manifest.yaml(content manifest)variants/directory with at least one variant file
If any are missing, report what's missing and stop.
Step 2: Pre-Publish Validation
Read manifest.yaml and validate:
- Source exists and is non-empty:
[ -s "<post_dir>/source.md" ] || echo "ERROR: source.md is empty or missing" - Each variant file exists and is non-empty:
For each variant in the manifest, check the file exists:
[ -s "<post_dir>/<variant_file>" ] || echo "ERROR: <variant_file> missing" - Asset files exist (if referenced in manifest):
[ -f "<post_dir>/<asset>" ] || echo "WARN: asset <asset> missing" - Filter publishable variants:
Only attempt platforms with status:
draft,pending, orfailed. Skip:published,skipped.
If no platforms are publishable, tell the user: "All platforms are already published or skipped. Nothing to do."
Step 3: Check Platform Configuration
For each publishable platform, verify:
- The adapter directory exists:
adapters/<name>/ - The adapter's
publish.shis executable - The required env var is set in
.env(for API-based adapters) - For git-push adapters, the configured repo path exists
Report any missing configuration and offer to run /media-setup.
Step 4: Confirm with User
Show what will be published:
Ready to publish "<title>":
[PUBLISH] Dev.to — variants/devto.md (draft)
[PUBLISH] Hashnode — variants/hashnode.md (draft)
[SKIP] GitHub Pages — already publishedUse AskUserQuestion to confirm. Options:
- A) Publish all
- B) Dry run first (preview without publishing)
- C) Select specific platforms
- D) Cancel
Step 5: Publish
For each platform, invoke the adapter's publish.sh with credential isolation.
Read the adapter's auth_env_var from adapter.yaml, then invoke:
AUTH_VAR=$(python3 -c "import yaml; print(yaml.safe_load(open('adapters/<name>/adapter.yaml')).get('auth_env_var', ''))")
AUTH_VAL=$(grep "^${AUTH_VAR}=" .env | cut -d= -f2-)
env -i PATH="$PATH" HOME="$HOME" \
"${AUTH_VAR}=${AUTH_VAL}" \
./adapters/<name>/publish.sh "<post_dir>/variants/<name>.md" "<post_dir>/assets" [--dry-run]For git-push adapters (no auth_env_var):
env -i PATH="$PATH" HOME="$HOME" GIT_DIR="$(git rev-parse --git-dir)" \
./adapters/<name>/publish.sh "<post_dir>/variants/<name>.md" "<post_dir>/assets" [--dry-run]Step 6: Update Manifest
After each platform publish attempt, update the manifest atomically:
On success (exit 0):
Parse the JSON stdout to get url and id. Update the variant:
status: published
published_at: <current ISO timestamp>
url: <url from stdout>
id: <id from stdout>
error: nullOn failure (exit 1-4):
status: failed
error: "<stderr output>"Use the atomic write pattern from lib/manifest-ops.md:
- Write to
.manifest.yaml.tmp - Validate YAML
- Backup original, then
mvtemp tomanifest.yaml
Step 7: Report Results
After all platforms are attempted, report:
Published "<title>":
[OK] Dev.to → https://dev.to/user/post-slug
[OK] Hashnode → https://hashnode.com/post/xyz
[FAIL] GitHub Pages — git push failed (exit 1)
2/3 platforms succeeded. Run /media-publish again to retry failed platforms.If all succeeded:
All platforms published successfully!If --dry-run was used:
Dry run complete. No content was actually published.
Run /media-publish again without --dry-run to publish for real.Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

