mcpbeat Sign in

X Article Agent Skill

Convert a posthog.com blog or newsletter post into a markdown file formatted for posting as an X (Twitter) Article. Strips frontmatter, promotes the title to an H1, remaps headings to X's two heading levels (subheadings + bold), downloads all post images into a numbered folder, and appends a subscribe CTA for newsletters. Use when the user wants to copy a post from contents/blog/ or contents/newsletter/ into X Article format.

1k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
1114
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/PostHog/posthog.com --skill x-article

The instruction itself

7 sections, as written by the author

Format a post for an X Article

X Articles only support two heading levels ("heading" and "subheading") plus bold text, and images must be uploaded one at a time. This skill produces a clean markdown file and a folder of ordered images so the user can copy/paste text and drag images in order.

The user will provide a post — a slug, a filename, or a path under contents/blog/ or contents/newsletter/: $ARGUMENTS

Step 1: Locate the source

Find the source file under contents/blog/ or contents/newsletter/ (extension may be .md or .mdx). If the argument is ambiguous or matches multiple files, ask which one. Note whether it came from blog or newsletter — the CTA in Step 4 only applies to newsletters.

Read the full file.

Step 2: Set up the output

Derive {slug} from the source filename (without extension). Create the output folder x-articles/{slug}/ (relative to repo root) and an images/ subfolder inside it.

Step 3: Write x-articles/{slug}/article.md

Transform the source body into the article file:

  • Remove the frontmatter (everything between the opening and closing ---).
  • Remove MDX import lines and any other JSX/component noise that won't render as plain text (e.g. <NewsletterForm />, <ProductComparisonTable .../>, wrapping <div>s). If a component can't be represented as text, drop it. Images inside components are still handled in Step 4.
  • Title → H1. Take the title from the frontmatter and put it as a single # Title at the very top of the file.
  • Remap headings (because X collapses everything to two levels):
  • ###
  • #####
  • #### HeadingHeading (bold paragraph, heading text only)
  • Leave #####+ as bold too.
  • Keep all body text, links, lists, blockquotes, code blocks, and footnotes verbatim. X has no relative-link context, so prefix any relative links (e.g. /blog/..., /feature-flags) with https://posthog.com.
  • Replace each image with a numbered marker. Walk the body top to bottom and replace every image (see Step 4 for what counts as an image) with a line like:
   [IMAGE 1: alt text]

Numbered in document order starting at 1. This tells the user which downloaded image goes where.

Step 4: Download the images

Collect every image URL in document order. Images appear as:

  • Markdown: !alt
  • Components: imageLight="https://res.cloudinary.com/..." (and imageDark= — prefer imageLight; skip the dark duplicate)
  • Raw <img src="...">

Cloudinary URLs may contain transformation segments between /upload/ and the filename (e.g. /upload/q_auto,f_auto/file.jpg or /upload/w_1600,c_limit,q_auto,f_auto/file.jpg). Download the URL as-is — the transformations are harmless.

Do not download the featuredImage from frontmatter unless it also appears in the body.

For each image in order, save it to x-articles/{slug}/images/{n}.{ext} where {n} matches the [IMAGE n: ...] marker and {ext} is the original extension from the URL (jpg, png, gif, webp). Download with:

curl -sSL -o "x-articles/{slug}/images/{n}.{ext}" "{url}"

Run the downloads and verify each file is non-empty (a failed Cloudinary fetch returns a tiny error body). Report any that failed.

Step 5: Newsletter CTA

If — and only if — the source was a newsletter, append this to the very bottom of article.md:

> Subscribe to [build mode](https://newsletter.posthog.com/subscribe), our newsletter, to get more writing like this.

Step 6: Report

Tell the user:

  • The output path x-articles/{slug}/article.md
  • How many images were downloaded (and where), and flag any failures
  • A reminder that [IMAGE n: ...] markers in the text show where each numbered image goes

Other skills for the same job

different authors, same section of the catalogue
Canvas Design
by anthropics
vendor ×13

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.

1388k tokens
X Article Publisher
by ZhanlinCui
×2

Publish Markdown articles to X (Twitter) Articles editor with proper formatting. Use when user wants to publish a Markdown file/URL to X Articles, or mentions "publish to X", "post article to Twitter", "X article", or wants help with X Premium article publishing. Handles cover image upload and converts Markdown to rich text automatically.

7k tokens scripts zh
Nanobanana Ppt Skills
by ComeOnOliver
×2

AI-powered PPT generation with document analysis and styled images

2k tokens
Open Notebook
by K-Dense-AI
×1

Self-hosted, open-source alternative to Google NotebookLM for AI-powered research and document analysis. Use when organizing research materials into notebooks, ingesting diverse content sources (PDFs, videos, audio, web pages, Office documents), generating AI-powered notes and summaries, creating multi-speaker podcasts from research, chatting with documents using context-aware AI, searching across materials with full-text and vector search, or running custom content transformations. Supports 16+ AI providers including OpenAI, Anthropic, Google, Ollama, Groq, and Mistral with complete data privacy through self-hosting.

14k tokens scripts
Cell Figure Guide
by BioTender-max
×1

Cell (Cell Press) figure preparation: resolution (300-1000 DPI), formats (TIFF/PDF), RGB color, Avenir/Arial fonts, uppercase panel labels, strict image manipulation policies.

4k tokens
Open Notebook
by christophacham
×1

Self-hosted, open-source alternative to Google NotebookLM for AI-powered research and document analysis. Use when organizing research materials into notebooks, ingesting diverse content sources (PDFs, videos, audio, web pages, Office documents), generating AI-powered notes and summaries, creating multi-speaker podcasts from research, chatting with documents using context-aware AI, searching across materials with full-text and vector search, or running custom content transformations. Supports 16+ AI providers including OpenAI, Anthropic, Google, Ollama, Groq, and Mistral with complete data privacy through self-hosting.

18k tokens scripts
Libreoffice Writer
by ComeOnOliver
×1

Use when creating, editing, formatting, exporting, or extracting LibreOffice Writer (.odt) documents via UNO, including session-based edits, structured text targets, tables, images, lists, patch workflows, and snapshots.

24k tokens scripts
X Article Publisher
by ComeOnOliver
×1

Publish Markdown articles to X (Twitter) Articles editor with proper formatting. Use when user wants to publish a Markdown file/URL to X Articles, or mentions "publish to X", "post article to Twitter", "X article", or wants help with X Premium article publishing. Handles cover image upload and converts Markdown to rich text automatically.

13k tokens scripts zh

How to use it

Copy the folder

Take posthog/x-article from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.