Skip to content
Back to skills

X Image Cards

ASecurity

Create X/Twitter cards that look like images, not marketing banners. Use when asked to "create OG images", "set up X cards", "make social cards", or "twitter card without text".

  • 207 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added February 7, 2026
toolstypescriptexpress

Works with

  • terminal
  • cli

Security analysis

A100/100

Pro scans all 9 files and shows the line behind each finding

Scanned February 12, 2026

npx -y skills add NeverSight/skills_feed --skill x-image-cards --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of X Image Cards?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for X Image Cards
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/neversight-x-image-cards/badge)](https://www.skillsdirectory.com/skills/neversight-x-image-cards)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: x-image-cards
description: Create X/Twitter cards that look like images, not marketing banners. Use when asked to "create OG images", "set up X cards", "make social cards", or "twitter card without text".
metadata:
  author: 0juano
  version: "1.0.0"
---

# X Image Cards

Create X cards that look like images, not marketing banners. Let the visual be the content — X already shows your title and description in the card UI.

## X-Specific Requirements

| Spec | Value | Why |
|------|-------|-----|
| Dimensions | 2400×1200 physical (1200×600 logical) | 2x for retina, 2:1 aspect ratio |
| Safe margins | 50-56px padding (at 1x) | X clips edges on mobile |
| URL format | `/og/page.png` not `/og/page?format=png` | X prefers explicit extensions |
| Colors | `#FFFFFF` primary, avoid subtle grays | Thumbnails are tiny |

## Zero-Width Space Trick

X overlays `og:title` as white text on the image. Hide it with a zero-width space:

```html
<meta property="og:title" content="&#8203;" />
```

In JSX: `content={"\u200B"}`

Your page `<title>` stays descriptive for SEO — only `og:title` uses the trick.

## Meta Tags

```html
<meta property="og:image" content="https://example.com/og/page.png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="600" />
<meta property="og:title" content="&#8203;" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="https://example.com/og/page.png" />
```

## Dynamic Generation

Use `@vercel/og` with 2x scale and safe margins:

```typescript
import { ImageResponse } from '@vercel/og';

const OG_SCALE = 2;

export async function GET(request: Request) {
  return new ImageResponse(
    (
      <div style={{
        width: '100%',
        height: '100%',
        display: 'flex',
        backgroundColor: '#0a0f1c',
        padding: 100, // 50px * 2 for safe margins
      }}>
        {/* Your visual content here */}
      </div>
    ),
    { width: 1200 * OG_SCALE, height: 600 * OG_SCALE }
  );
}
```

### Express

```typescript
app.get('/og/:slug.png', async (req, res) => {
  const image = new ImageResponse(/* ... */);
  const buffer = await image.arrayBuffer();

  res.setHeader('Content-Type', 'image/png');
  res.setHeader('Cache-Control', 'public, max-age=86400');
  res.send(Buffer.from(buffer));
});
```

## Dynamic Routes (Optional)

For per-page OG images, two approaches:

### On-Demand Generation
Generate when crawler requests the image:
```
/og/[slug].png  →  generates image on request
```

**Risk:** X crawlers timeout after ~5 seconds. Cold starts can exceed this, causing blank previews.

### Pre-Generated (Recommended)
Generate and store image when content is created:
```typescript
// On content creation
const imageBuffer = await generateOgImage(data);
await db.insert({ ogImageData: imageBuffer }); // Store as BYTEA

// On request - instant response
app.get('/og/:id.png', (req, res) => {
  const { ogImageData } = await db.get(req.params.id);
  res.setHeader('Content-Type', 'image/png');
  res.send(ogImageData);
});
```

Pre-generation ensures instant response for crawlers.

## Checklist

- [ ] 2400×1200 (2x retina)
- [ ] 2:1 aspect ratio
- [ ] 50-56px safe margins
- [ ] High contrast colors
- [ ] `.png` extension in URL
- [ ] Zero-width space in `og:title`
- [ ] Test: https://cards-dev.twitter.com/validator

---

*Built for [BondTerminal](https://bondterminal.com). See it in action: [example X post](https://x.com/0juano/status/2016559903578407358).*

Files in this skill

  • SKILL.md3.5 KB
  • description_cn.txt190 B
  • description_de.txt285 B
  • description_en.txt178 B
  • description_es.txt211 B
  • description_fr.txt263 B
  • description_ja.txt360 B
  • description_ko.txt255 B
  • description_tw.txt190 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.