x-article
/x-article
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.
- Author
- posthog ↗
- Repository
- posthog.com ↗
- Licence
- MIT
- Last repository change
- 27.10.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 4
No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
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.
Original author description
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.
How it works
- Step 1: Locate the source
- Step 2: Set up the output
- Step 3: Write x-articles/{slug}/article.md
- Step 4: Download the images
- Step 5: Newsletter CTA
- Step 6: Report
SKILL.md preview
---
name: x-article
description: 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.
---
# 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:
1. **Remove the frontmatter** (everything between the opening and closing `---`).
2. **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.
3. **Title → H1.** Take the `title` from the frontmatter and put it as a single `# Title` at the very top of the file.
4. **Remap headings** (because X collapses everything to two levels):
- `##` → `#`
- `###` → `##`
- `#### Heading` → `**Heading**` (bold paragraph, heading text only)
- Leave `#####`+ as bold too.
5. **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`.
6. **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: ``
- 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:
```bash
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`:
```markdown
> 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
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · posthog/posthog.com | 100 | MIT |
| genfeedai/skills | 100 | MIT |
| muhammadhassan03/x-agent-skill | 100 | MIT |
Database snapshot: 13.11.2026 · package version 3052d2901113 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100post-newsletter
Convert a Substack newsletter post into a native posthog.com newsletter file. Fetches the content from a Substack URL, formats it with correct frontmatter and markdown, applies internal links, and re-hosts its images on Cloudinary. Omits Substack-specific sections (byline,… - 100markdown-to-x-article
Create X (Twitter) Article drafts from Markdown through the local Markdown to X Article Chrome extension and its `xap` bridge (127.0.0.1:17345). Use when the user wants to post, publish, send or sync a Markdown file, blog post or article to X / Twitter as an Article, create or… - 100li-newsletter
Plan and write a LinkedIn newsletter or article - the title that earns the subscribe, the issue structure, the cover, the feed post that launches each issue, and a cadence the user can keep. Use when the user says "LinkedIn newsletter", "write an article", "long-form on… - 95article-page-generator
When the user wants to create, optimize, or audit a single article/post page (not the blog index). Also use when the user mentions "article page," "blog post page," "single post," "post template," "article structure," "post optimization," "competitor article analysis," "optimize… - 100blog-post
This skill should be used when the user asks to "write a blog post", "draft a blog post", "create a blog post", "write an article about", or wants to produce a markdown blog post on any topic. Outputs to ~/claude.nosync/posts/. - 100seo-article
Plan and write a blog article meant to rank in Google for a keyword. Use when the user gives a keyword or topic and asks for a blog post, SEO article, "content that ranks", or to rewrite an existing post for search.