Saltar al contenido
Skillpedia
Redes sociales48 mil · #5821

social-metadata-hardening

Qué hace

Esta herramienta ayuda a que los enlaces que compartes en redes sociales y apps de mensajería se vean con una vista previa bonita y completa, en lugar de un simple enlace. Soluciona problemas como imágenes que faltan, textos incorrectos o vistas previas desactualizadas.

Cuándo usarla

  • ✓Cuando un enlace compartido no muestra imagen o muestra una que no es la correcta.
  • ✓Cuando quieres que la vista previa del enlace se vea exactamente como la imaginaste.
  • ✓Antes de publicar tu web, para asegurarte de que todos los enlaces se vean bien en todas partes.

Link de la skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/social-metadata-hardening/SKILL.md

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/social-metadata-hardening/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Haz que los enlaces de mi web se vean con vistas previas bonitas en Facebook y WhatsApp.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

La herramienta añade información importante (como el título, la descripción y la imagen) al código de tu web. Además, se asegura de que las imágenes tengan el tamaño correcto y un formato que entiendan las redes sociales.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de GitHub.

Social Metadata Hardening Skill

Fix social sharing so every important URL unfurls as a rich card across all platforms.


When to Use

  • Use when shared links show missing, stale, cropped, or incorrect previews on social and chat platforms.
  • Use when auditing Open Graph, Twitter/X card, image URL, alt text, or metadataBase coverage in a web app.
  • Use before launch when every public page needs predictable rich previews across LinkedIn, X, Facebook, WhatsApp, Slack, Discord, and Telegram.

Why Previews Break

Problem Root Cause
No preview at all Missing og:title, og:description, or og:image
Broken image Relative URL (must be absolute)
Wrong image size Image not 1200×630px (OG standard)
Plain text card Twitter card type missing or set to summary
Stale preview Platform caching old metadata
Metadata missing on crawl Tags added by client-side JS (crawlers don't run JS)

The Gold Standard Metadata Block

Every shareable page needs ALL of these in static HTML:

// Next.js App Router — lib/socialMetadata.js
export function buildSocialMetadata({
  title,
  description,
  path,          // '/blog/my-post'
  image,         // '/images/og/my-post.jpg' or full URL
  imageAlt,
  imageWidth = 1200,
  imageHeight = 630,
}) {
  const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || 'https://www.yourdomain.com';
  
  // Always produce an absolute URL
  const imageUrl = image?.startsWith('http') ? image : `${baseUrl}${image}`;
  const pageUrl  = `${baseUrl}${path}`;
  
  // Detect MIME type from extension
  const ext = imageUrl.split('.').pop().toLowerCase();
  const mimeMap = { jpg: 'image/jpeg', jpeg: 'image/jpeg', png: 'image/png', webp: 'image/webp' };
  const imageType = mimeMap[ext] || 'image/jpeg';

  return {
    title,
    description,
    alternates: { canonical: pageUrl },
    openGraph: {
      title,
      description,
      url: pageUrl,
      type: 'website',  // use 'article' for blog posts
      images: [{
        url: imageUrl,
        secureUrl: imageUrl,   // explicit HTTPS version
        width: imageWidth,
        height: imageHeight,
        alt: imageAlt || title,
        type: imageType,
      }],
    },
    twitter: {
      card: 'summary_large_image',  // NOT 'summary' — that shows a tiny image
      title,
      description,
      images: [imageUrl],
    },
  };
}

Applying the Helper

Static page

// app/about/page.js
import { buildSocialMetadata } from '@/lib/socialMetadata';

export const metadata = buildSocialMetadata({
  title: 'About Us | My Site',
  description: 'Learn about our team and mission.',
  path: '/about',
  image: '/images/og/about.jpg',
  imageAlt: 'The My Site team',
});

Dynamic page (blog post, tool page)

// app/blog/[slug]/page.js
import { buildSocialMetadata } from '@/lib/socialMetadata';

export async function generateMetadata({ params }) {
  const post = await getPost(params.slug);
  return buildSocialMetadata({
    title: `${post.title} | My Blog`,
    description: post.excerpt,
    path: `/blog/${params.slug}`,
    image: post.ogImage || '/images/og/default.jpg',
    imageAlt: post.title,
  });
}

Homepage (app/layout.js or app/page.js)

export const metadata = {
  metadataBase: new URL('https://www.yourdomain.com'), // REQUIRED for absolute URLs
  ...buildSocialMetadata({
    title: 'My Site — Tagline Here',
    description: 'Site-wide description.',
    path: '/',
    image: '/images/og/home.jpg',
  }),
};

⚠️ Set metadataBase when using relative metadata URLs. If your helper already outputs absolute canonical/OG URLs, previews can still work without it.


OG Image Checklist

Good OG images:

  • 1200 × 630px (2:1 ratio — works on all platforms)
  • Under 8MB (Facebook limit)
  • Served over HTTPS
  • File name has no spaces (use hyphens)
  • Format: JPEG or PNG (WebP works on most but not all crawlers)
  • Accessible via GET with no authentication
# Verify your OG image is reachable and correct size
curl -sI https://www.yourdomain.com/images/og/home.jpg | grep -i "content-type\|content-length\|status"

Platform-Specific Notes

Facebook / Meta

  • Caches aggressively — use the Sharing Debugger to force recrawl
  • Minimum image: 200×200px (but use 1200×630 for quality)
  • Needs: og:title, og:description, og:image, og:url

…

Preguntas frecuentes

¿Por qué se ve mal la vista previa de mi enlace?

Puede pasar por varios motivos: falta información esencial (título, descripción, imagen), la imagen es una ruta relativa (necesita ser una URL completa), la imagen tiene un tamaño incorrecto o la red social muestra información antigua que tiene guardada en caché.

¿Cuál es el tamaño ideal para la imagen de la vista previa?

El tamaño recomendado es de 1200 píxeles de ancho por 630 de alto. Así la imagen se ve bien en todas las plataformas.

¿Cómo actualizo la vista previa si ya había compartido el enlace?

Después de corregir el problema en tu web, puedes usar herramientas de cada plataforma (como el Debugger de Facebook o el Card Validator de Twitter/X) para pedirles que vuelvan a leer la información del enlace.

Detalles

Descripción original del autor

Fix social sharing previews so URLs render as rich cards on Facebook, LinkedIn, X/Twitter, WhatsApp, Telegram, and more. Covers OG tags, Twitter cards, absolute image URLs, and debugging.

repo: sickn33/agentic-awesome-skills

Popularidad

Estrellas en GitHub
48 mil
Posición en el ranking
#5821
Licencia
MIT
Actualizada
15/10/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas