publisher-medium — Claude Code command: convert posts for Medium
Turns a blog post from markdown, PDF or a URL into HTML you can paste into Medium, with markers showing where images go.
npx claude-code-templates@latest --command marketing/publisher-mediumWhat publisher-medium does
The publisher-medium command takes your draft and produces an HTML file built for Medium. Feed it a file path, a post URL or a slug from the codebase. A second argument sets the language: en by default, ja for Japanese.
Source detection happens on its own. Markdown, PDF, HTML and plain text get read locally; a link goes through WebFetch; a slug is looked up in the repo. Headers, lists, code blocks and quotes survive the trip. Diagrams get upload markers plus their file paths, so you know what to attach by hand once you are in the editor.
The result is medium-article-[LANG].html, with a copy button for one-click transfer. The command opens that preview and the Medium editor for you. No dependencies to install — Read, Write and Bash cover it. Without filesystem or browser access in your agent environment, you handle the preview step yourself.
What it helps with
- turn a markdown draft into Medium-ready HTML
- pull a post from a URL and strip the extra markup
- mark where diagrams need uploading during publishing
- keep headers, lists and code blocks intact in the export
- prepare a preview file with a one-click copy button
Example prompts for the agent
- Convert
my-postinto Medium format - Build a Medium version of
article.mdin Japanese - Fetch https://blog.com/post and produce the Medium HTML
How to install publisher-medium
1claude-code-templates
npx claude-code-templates@latest --command marketing/publisher-medium2Manually: put the files in place
.claude/commands/publisher-medium.mdCall it with /publisher-medium. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/publisher-medium.mdCall it with /prompts:publisher-medium. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/publisher-medium.prompt.mdManually: put the files in place
.gemini/commands/publisher-medium.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about publisher-medium
How do I install publisher-medium in Claude Code?
Run npx claude-code-templates@latest --command marketing/publisher-medium. The command file then lives at .claude/commands/publisher-medium.md.
What does publisher-medium do?
It reads a post from a file, URL or slug, converts it to HTML suited to Medium, and adds image upload markers with the paths to each file.
Which tools does the command use?
Read, Write, Bash, Glob and WebFetch. Nothing external is required, though WebFetch handles the URL input.
Source text
publisher-medium.md · MIT
--- allowed-tools: Read, Write, Bash, Glob, WebFetch argument-hint: <input> [lang] description: Convert blog posts to Medium-ready HTML format with image upload markers --- # Medium Article Converter Convert blog posts to Medium-ready format with proper HTML structure and image handling. **Usage:** `$ARGUMENTS` **Examples:** ```bash /publisher:medium my-post # Default English /publisher:medium my-post ja # Japanese /publisher:medium article.md # From file path /publisher:medium https://blog.com/post # From URL ``` **Process:** 1. **Parse Input & Detect Source** - File path, URL, or blog post slug - Optional language parameter (en/ja) 2. **Universal Input Detection** - **File**: Read markdown, PDF, HTML, or text - **URL**: WebFetch to retrieve content - **Slug**: Search codebase for blog post 3. **Convert to Medium Format** - Parse markdown and extract frontmatter - Convert to clean HTML suitable for Medium - Preserve headers, lists, code blocks, quotes - Add image upload markers for diagrams - Include image paths for easy upload reference 4. **Create HTML Preview File** - Generate `medium-article-[LANG].html` preview - Include one-click copy button - Add image upload instructions with file paths - Use Medium-style formatting and colors 5. **Open in Browser** - Open HTML preview file - Open Medium editor (https://medium.com/new-story) - User can copy HTML and paste into Medium - Follow image markers to upload diagrams **Output:** - HTML preview file with copy button - Clear image upload markers - File paths shown for each image - Ready to paste into Medium editor **Note**: Works universally - no dependencies required, just Read, Write, and Bash tools.
© davila7 · MIT · davila7/claude-code-templates