medium

medium is a command for coding agents from kanaerulabs/growth-kit. It costs 8 tokens per session (3,640 once invoked), scanned A, original, MIT.

A command that reformats content from files, URLs, or blog entries for publishing on Medium, a blogging platform.

In plain words
What is it for?
Use it with a post slug, file path, or URL to prepare markdown, HTML, text, JSON, or other content for Medium.
Why use it?
It removes the manual work of finding the main text, title, and description and adapting different source formats.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/kanaerulabs/growth-kit/medium
Clone the repo
git clone --depth 1 https://github.com/kanaerulabs/growth-kit

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for medium

README.md
[![agentmods](https://agentmods.dev/badge/commands/kanaerulabs/growth-kit/medium.svg)](https://agentmods.dev/commands/kanaerulabs/growth-kit/medium)
Your own site
<a href="https://agentmods.dev/commands/kanaerulabs/growth-kit/medium"><img src="https://agentmods.dev/badge/commands/kanaerulabs/growth-kit/medium.svg" alt="Measured on agentmods" height="20"></a>
Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,640 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00008 $0.03640
Opus 5 $0.00004 $0.01820
Sonnet 5 $0.00002 $0.00728
Haiku 4.5 $0.00001 $0.00364

Measured 4d ago against content hash 7dd162500024, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

medium scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

publisher-plugin/commands/medium.md · 467 lines

How it starts

The opening of the file, as written. The whole thing — 467 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Convert any content source to Medium-ready format. This command is adaptive - it works with any input format and blog structure.

Usage: $ARGUMENTS

Phase 1: Universal Input Detection

Parse Input:

  • Extract content input from $ARGUMENTS
  • Examples:
    • 2025-10-06-my-post (slug)
    • path/to/article.md (file path)
    • https://myblog.com/post (URL)

Detect and Load Content:

If input looks like a file path (contains / or file extension):

  • Use Read tool to load the file
  • Detect format by extension:
    • .md / .mdx → Parse markdown with frontmatter
    • .pdf → Inform user PDF parsing is limited, suggest markdown
    • .html → Extract main content, strip HTML tags
    • .txt → Read as plain text
    • .json → Parse and extract relevant fields

If input looks like a URL (starts with http:// or https://):

  • Use WebFetch tool to retrieve the page
  • Extract main article content, title, and description
  • Parse and clean the text

If input is a slug (no / and no protocol):

  • Search codebase using Glob: **/*${input}*.md
  • Common blog locations:
    • src/content/blog/posts/**/*${input}*.md
    • content/blog/*${input}*.md
    • posts/*${input}*.md
    • blog/*${input}*.md
  • Use Read tool to parse found markdown file

Discover Blog Structure (if slug or file path): Explore the codebase to understand:

  • 📁 Where are markdown files stored?
  • 📋 What frontmatter format is used?
  • 🖼️ Where are images/diagrams stored?
  • 🎨 How are images referenced? (relative paths, absolute URLs, picture elements?)
  • 🔗 What's the blog post URL structure?

For URLs: Extract and use the content as-is, skip blog structure discovery.

Phase 2: Create Conversion Script

Write a custom TypeScript conversion script that handles their specific structure.

Required Outputs (Universal Medium Best Practices):

1. Image Handling - Upload Markers (CRITICAL)

// Medium strips base64 and external URLs fail
// Solution: Add clear upload marker for FIRST image only
// IMPORTANT: Only include the FIRST image from the blog post
return `\n\n---\n\n**📊 [UPLOAD IMAGE HERE: ${altText}]**\n\n*File: \`${relPath}\`*\n\n---\n\n`;

Read the full file on GitHub · 467 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 467 lines · 8 tokens per session scan A 7dd162500024

Subscribe to this mod's changes

medium is a command published in the GitHub repository kanaerulabs/growth-kit (15 stars, last pushed 7mo ago), licensed MIT. It adds 8 tokens to every session and 3,640 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.