agentsclimarketplace

Medium publish

Skill emaarco/hogwarts/plugins/felix-felicis/skills/medium-publish

A magical place where my skills, rules, and plugins for AI agents are defined, which magically boost productivity 🏰πŸͺ„

Install
npx -y skills add emaarco/hogwarts --skill medium-publish

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Publish a markdown blog post to Medium via GitHub Gist import (macOS). Transforms headings to bold, creates a Gist, copies its URL to the clipboard, and opens Medium's import page for you to finish manually.

SKILL.md

4.1 KB, as published. Nobody here has run it

Skill: medium-publish

Prepares a markdown blog post for Medium by creating a temporary public GitHub Gist, copying its URL to the clipboard, and opening Medium's import page so you can paste the link and finish the import manually.

Why Gist? Medium's import feature requires a publicly accessible URL. GitHub Gists are public and immediately accessible, making them ideal as a transport layer. The Gist is deleted after import.

Why heading transformation? Medium's importer drops markdown heading syntax (#, ##, etc.). Converting headings to bold (**...**) preserves visual hierarchy.

Why not build an import link? Medium's import deep-links are brittle. Instead we open Medium's import page and hand you the Gist URL on the clipboard β€” you paste it and import manually, which is reliable and keeps you in control.

Step 1 β€” Collect input

If a file path was provided as an argument, use it directly.

Otherwise ask via AskUserQuestion:

Which markdown file should I publish to Medium?

Please provide the full path to your .md file.

Step 2 β€” Transform headings

Read the file at <input-path>. For every line that starts with one or more # characters followed by a space, replace it with the heading text wrapped in **...**. Leave all other lines exactly unchanged. Hold the full transformed content in memory β€” do NOT write it to disk.

Example:

  • # My Title β†’ **My Title**
  • ## Section β†’ **Section**
  • ### Sub β†’ **Sub**
  • Normal paragraph β†’ Normal paragraph (unchanged)

Step 3 β€” Create public Gist

Pipe the transformed content directly into gh gist create β€” no temp file:

printf '%s' "<transformed-content>" | gh gist create --public --filename "post.md" -

The command prints the Gist URL (last line of output). Note the URL and its 32-hex-char ID from the output β€” shell variables do not survive between Bash calls, so substitute these literal values into every later command (written as <gist-url> / <gist-id> below).

Step 4 β€” Copy the Gist URL and open Medium's import page

Copy the Gist URL to the clipboard and open Medium's import page:

echo "<gist-url>" | pbcopy
open "https://medium.com/p/import"

(pbcopy and open are macOS commands β€” on Linux, fall back to xclip -selection clipboard / wl-copy and xdg-open, which are not pre-granted.)

Then tell the user:

Gist URL copied to clipboard: <gist-url>

Medium's import page is now open in your browser.

To finish (manually):
1. Make sure you're logged in to Medium.
2. Paste the Gist URL (already on your clipboard) into the import field.
3. Click "Import" and review the preview.

Tip: from your profile you can also reach this via your picture β†’ Stories β†’ "Import a story".

Step 5 β€” Wait for import completion

Ask via AskUserQuestion:

Have you finished importing in Medium?

Options:

  • "Yes, import done β€” delete the Gist"
  • "Not yet (wait)"
  • "Something went wrong β€” delete the Gist anyway"
  • "Copy the Gist URL to clipboard again"

If "Not yet": keep asking the same question β€” NEVER delete the Gist without an explicit "import done" or "delete anyway" answer, since deleting before Medium has fetched it breaks the import. If the user stops responding, end the turn and tell them the Gist URL so they can ask for deletion later.

If "Copy the Gist URL to clipboard again":

echo "<gist-url>" | pbcopy

Then loop back to the same Step 5 question so the user can signal completion or delete.

Step 6 β€” Delete Gist and report

gh gist delete "<gist-id>"

Report:

Done! The Gist has been deleted.

Your post is now in Medium's editor as a draft. You can find it at:
https://medium.com/me/stories/drafts

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.