agentleFS
BrivaHamisiBrivaHamisi/laravel-shipkit/skills/social-share-previews/SKILL.md

social-share-previews

Skill0 starsChanged 49 days agoMITView on GitHub

Make Laravel pages show a proper title, description and image when shared on WhatsApp, Facebook, LinkedIn, X, Slack and iMessage, using one Blade component for Open Graph, Twitter card, canonical and meta description tags. Use when link previews show no image or the wrong text, adding og:image or Open Graph tags, or setting page titles and meta descriptions.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When someone pastes your link into WhatsApp or LinkedIn, the app fetches the page and reads a few <meta> tags.

    line 11
  2. Very specific:

    Create a default share image: 1200 × 630, JPEG, under 300 KB, at public/images/share/default.jpg, or change config('share.image').

    line 16
  3. Distinctive:

    Check real previews with the Facebook Sharing Debugger, LinkedIn Post Inspector, and by sending the link to yourself on WhatsApp.

    line 22

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Social share previews (Open Graph and Twitter cards)

When someone pastes your link into WhatsApp or LinkedIn, the app fetches the page and reads a few <meta> tags. Get them wrong and the preview is a bare URL. <x-share-meta /> prints them all correctly, with site-wide fallbacks.

Install

  1. Copy from stubs/, dropping .stub: resources/views/components/share-meta.blade.php, config/share.php, tests/Feature/ShareMetaTest.php.
  2. Create a default share image: 1200 × 630, JPEG, under 300 KB, at public/images/share/default.jpg, or change config('share.image'). Put the logo and name in the middle. Some apps crop the edges into a square.
  3. In the layout <head>, replace the existing <title> and description tags:
    <x-share-meta :title="$title ?? null" :description="$description ?? null" :image="$shareImage ?? null" :type="$ogType ?? 'website'" :robots="$robots ?? null" />
  4. Pass details from each page: a blog post sets its title, excerpt, a JPEG share-size image URL and type="article".
  5. Check real previews with the Facebook Sharing Debugger, LinkedIn Post Inspector, and by sending the link to yourself on WhatsApp.

Why previews break (and what this component does about it)

  • WebP images. WhatsApp and several other apps often show no image for WebP og:image. Serve a JPEG or PNG share size. The image-uploads skill generates a 1200 × 630 share.jpg for every upload.
  • Relative URLs. og:image must be absolute, with https:// in production. Everything here goes through url()/asset(), so set APP_URL correctly. A test asserts that every URL is absolute.
  • Wrong size. 1200 × 630 (1.91:1) works everywhere. Images under 200 × 200 are ignored. The default image also declares its width and height, so the first share renders immediately.
  • HTML in descriptions. The description is stripped of tags, squished and cut to 160 characters.
  • Caching. WhatsApp and Facebook cache previews for days. After fixing tags, re-scrape in the Facebook Sharing Debugger. For WhatsApp, test with a new URL (for example with ?v=2).
  • Pages behind login or bot protection can't be previewed: the crawler gets the login page. Keep shareable pages public, and don't block facebookexternalhit, WhatsApp, LinkedInBot or Twitterbot.
  • One canonical URL. og:url and <link rel="canonical"> use the same URL, so shares of ?utm= variants count towards one page.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.