dynamic-og-images
Skill0 starsChanged 7 months agoApache-2.0View on GitHub
Planning guardrail for Next.js App Router social preview images: route choice, runtime, fonts, assets, CSS subset, and proof.
In this repository57 other files it gives its agents.
- ai-app-integrationSkill
- anti-llm-frontend-designSkill
- aspnet-core-web-developmentSkill
- async-python-patternsSkill
- browser-game-foundationsSkill
- browser-local-qaSkill
- build-mcp-server-sdk-v2Skill
- canva-design-opsSkill
- check-completionSkill
- cli-tool-creatorSkill
- cloudflare-agents-mcpSkill
- cloudflare-durable-objectsSkill
- cloudflare-workers-platformSkill
- deployment-preview-workflowsSkill
- docx-document-artifactsSkill
- durable-workflow-orchestrationSkill
- eval-auditSkill
- evaluate-ragSkill
- figma-design-to-code-rulesSkill
- fine-tuningSkill
- frontend-product-builderSkill
- game-asset-pipeline-expansionSkill
- game-ui-playtestSkill
- generate-synthetic-dataSkill
- github-pr-ci-opsSkill
- gmail-inbox-opsSkill
- golden-datasetSkill
- huggingface-llm-trainerSkill
- javascript-monorepo-buildsSkill
- linear-issue-managementSkill
- media-generation-transcriptionSkill
- millrace-rs-contract-paritySkill
- minecraft-mod-qa-automationSkill
- notion-workspace-flowsSkill
- openai-docsSkill
- optimize-agentic-cliSkill
- pdf-artifact-workflowSkill
- phaser-2d-game-developmentSkill
- postgres-query-performanceSkill
- product-ui-polish-reviewSkill
- pydantic-v2-patternsSkill
- python-repo-refactoring-hygieneSkill
- rag-corpus-hygieneSkill
- react-next-performance-reviewSkill
- rust-best-practicesSkill
- shadcn-ui-compositionSkill
- skill-evaluation-harnessSkill
- tauri-desktopSkill
- tauri-mcp-cliSkill
- tauri-ptySkill
- tile-pixel-art-transitionsSkill
- train-sentence-transformersSkill
- typer-cli-patternsSkill
- using-dbt-for-analytics-engineeringSkill
- validate-evaluatorSkill
- visual-asset-pipelineSkill
- watchdog-file-watcher-patternsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 7 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 66
Default to app/blog/[slug]/opengraph-image.tsx plus ImageResponse for a Next.js App Router blog.
- Very specific: line 67
If the image is segment-based, say params is a Promise and must be awaited before reading slug data.
- Distinctive: line 69
Keep the card poster-like: one hierarchy, one accent, no webpage layout.
- Very specific: line 73
Default to runtime = 'edge'.
- Very specific: line 75
Use ttf, otf, or woff; prefer ttf or otf.
- Very specific: line 78
If local assets are needed in Next.js, say that Node.js runtime is the exception and the asset should be read relative to the project root.
- Distinctive: line 79
Keep CSS variables secondary: Satori supports them, but the layout should still be explicit and local.
- Distinctive: line 90
Start with the classification.
- Distinctive: line 92
Call out any missing font, asset, runtime, or verification boundary.
- Very specific: line 100
Check current official Next.js and Satori docs before making API-specific claims.
- Distinctive: line 102
Keep the render tree compact, flex-first, and auditable.
- Distinctive: line 103
Verify by rendering the image locally or capturing a screenshot of the generated output.
- Distinctive: line 116
Start with the smallest useful read of the request, then widen only enough to name the seam and proof surface.
≈ “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.
Files
Dynamic OG Images
Purpose
Help agents pick the smallest honest render seam for dynamic social preview images. This is a guardrail, not an OG-image cookbook or a generic design manual.
Use When
- the repo has
opengraph-image,twitter-image, or a dedicated OG route - the task is about a share card, metadata image, font loading, asset loading, or preview proof
- the answer depends on current Next.js or Satori behavior
Do Not Use When
- the task is only generic frontend design or raster art
- browser QA is the only problem
- another more specific skill already owns the seam
Quick Start
- Default to
app/blog/[slug]/opengraph-image.tsxplusImageResponsefor a Next.js App Router blog. Use a route handler only when you need a custom URL, custom headers, or a shared endpoint. Use standalone Satori only outside Next.js or when SVG-first output is the point. - If the image is segment-based, say
paramsis a Promise and must be awaited before reading slug data. - State the runtime, font source, asset source, CSS subset, and preview proof in the answer.
- Keep the card poster-like: one hierarchy, one accent, no webpage layout.
Operating Constraints
- Default to
runtime = 'edge'; switch to Node.js only when local files must be read. - Load fonts explicitly. Do not rely on system fonts or
next/fontto populate the image route. - Use
ttf,otf, orwoff; preferttforotf. Do not usewoff2. - Make every non-text asset source explicit: absolute URL, bundled bytes, or data URL. Do not use relative paths.
- Stay inside the documented render subset: inline flex layout, absolute positioning, borders, radii, backgrounds, text wrapping, and simple transforms. Avoid grid, external CSS,
<style>,<link>, pseudo-elements, sticky/fixed positioning, or browser-only tricks. - If local assets are needed in Next.js, say that Node.js runtime is the exception and the asset should be read relative to the project root.
- Keep CSS variables secondary: Satori supports them, but the layout should still be explicit and local.
Inputs This Skill Expects
- The route surface or diff.
- The target route or helper.
- Runtime, font source, asset source, and preview step.
- Visual goal, dimensions, and any brand or content constraints.
Output Contract
- Start with the classification.
- Then name the route/helper, runtime, font source, asset source, CSS subset, and preview step.
- Call out any missing font, asset, runtime, or verification boundary.
- Include one rejected trope and the narrower alternative.
- End with the next verifier and the evidence it should capture.
Procedure
- Identify the smallest honest seam.
- Choose the surface that matches the repo and the output type.
- Check current official Next.js and Satori docs before making API-specific claims.
- Specify explicit font and asset loading.
- Keep the render tree compact, flex-first, and auditable.
- Verify by rendering the image locally or capturing a screenshot of the generated output.
Pitfalls And Gotchas
- Rejected trope: copy a full marketing page into the OG route.
- Better alternative: render one compact poster with one hierarchy and one clearly loaded font.
- Rejected trope: hide assets behind relative paths or implicit defaults.
- Better alternative: use absolute URLs or bundled bytes and prove the preview render.
- Rejected trope: turn this into a generic frontend course.
- Better alternative: stay on the route boundary and keep the answer planning-level.
Progressive Disclosure
Start with the smallest useful read of the request, then widen only enough to name the seam and proof surface. Keep the skill compact so it steers route choice and verification instead of becoming a cookbook.
Verification Pattern
- Confirm the chosen surface matches the task.
- Confirm route, runtime, fonts, assets, and preview evidence are explicit.
- Confirm the answer stays within the documented render subset and does not rely on browser-only behavior.
- Confirm one generic trope was rejected in favor of a narrower OG-image alternative.
- Next verifier: implementation reviewer or browser QA; capture the generated PNG or screenshot plus any head-tag evidence needed to justify the route choice.
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
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.

