optimization-sdk-sync

A procedure for updating implementation references for Contentful’s Optimization SDK, which helps applications use personalization features, from verified upstream code and documentation.

In plain words
What is it for?
Use it when the Optimization SDK or its documentation changes, or when checking whether Contentful personalization references are outdated across supported JavaScript runtimes.
Why use it?
It keeps agent guidance aligned with current SDK behavior while preserving older guidance unless compatibility evidence requires a change.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/contentful/skills/optimization-sdk-sync
Any agent
npx skills add contentful/skills --skill optimization-sdk-sync
Clone the repo
git clone --depth 1 https://github.com/contentful/skills

Made for: Claude Code, Codex.

Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,967 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00064 $0.01967
Opus 5 $0.00032 $0.00983
Sonnet 5 $0.00013 $0.00393
Haiku 4.5 $0.00006 $0.00197

Measured 2d ago against content hash e38de362a179, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

optimization-sdk-sync scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

local-skills/skills/optimization-sdk-sync/SKILL.md · 227 lines

How it starts

The opening of the file, as written. The whole thing — 227 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Optimization SDK Sync

Update the modern Optimization SDK knowledge in contentful-personalization from a verified upstream revision. Optimize the result for an agent solving implementation tasks: concise, explicit, runtime-specific, and grounded in public API and maintained examples.

Do not copy upstream guides wholesale. Treat this as a knowledge compilation workflow.

Scope

This skill owns modern @contentful/optimization* guidance. Preserve legacy @ninetailed/* guidance unless upstream evidence requires a compatibility correction.

Supported runtime references:

  • shared concepts and behavior
  • React Web
  • Next.js App Router
  • Next.js Pages Router
  • browser Web
  • Node.js
  • React Native

Do not synthesize iOS or Android guidance until upstream provides equivalent knowledge-base facts, public API declarations, and guide blueprints.

Source resolution

Use the public repository by default:

https://github.com/contentful/optimization.git

Resolve sources in this order:

  1. An explicit local path supplied by the user.
  2. An existing reusable clone at .docs/optimization-sdk-sync/repository.
  3. A fresh clone of the official HTTPS repository into that cache.

The cache is repo-local working state for the sync process. It is not committed or distributed. Reusing it avoids cloning the public repository on every run while still allowing the skill to fetch and inspect an exact upstream commit.

For the default remote flow:

  1. Inspect the managed cache's origin and worktree status before checkout.
  2. Verify origin is exactly the official HTTPS repository before fetching.
  3. If the origin differs or the cache has local changes, do not repoint, reset, delete, or clean it. Stop and report the conflict, or use a separately approved clean cache.
  4. Fetch the requested ref, defaulting to main.
  5. Resolve it to a full immutable commit SHA.
  6. Inspect a detached checkout of that SHA. Do not use git pull or merge upstream history.

For an explicit local path:

Read the full file on GitHub · 227 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 227 lines · 64 tokens per session scan A e38de362a179

Subscribe to this mod's changes

optimization-sdk-sync is a skill published in the GitHub repository contentful/skills (39 stars, last pushed 3d ago), licensed MIT. It adds 64 tokens to every session and 1,967 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

newsjack-detector

Monitor current news and reaction signals, then decide which are credible newsjacking opportunities for a client. Uses the local monitoring engine for evidence, but the skill owns PR judgment, brand safety, standing, decay, angle fit, and handoff.

elvisun/newsjack · 54 tokens

find-journalists

Build, refine, dedupe, and enrich small fit-checked journalist lists for newsjack campaigns. Uses the newsjack CLI (preferred) or the medialyst MCP for news search and journalist enrichment, and falls back to a best-effort local mode with no verified contacts; the agent owns how returned data is organized.

elvisun/newsjack · 69 tokens

pr-calendar

Turn the Medialyst PR calendar feed into a brand-specific, lead-time-aware plan. Pull source-backed upcoming moments, keep only the few a brand has real standing to own, schedule backward from the event date, screen out tone-deaf hooks, and hand selected moments to angle and journalist prep ahead of time. The planned…

elvisun/newsjack · 78 tokens

newsjack-triage

Consolidate freshness-gated newsjack signals and route them by client standing before angle generation. Collapses any remaining same-story duplicates, decides strong/partial/none standing with a journalist-shape sanity check, and sorts each story into pitchready, bigstory (always-surfaced suggestion), or watch. Never…

elvisun/newsjack · 82 tokens

story-origin-check

Recover the first public timestamp and canonical major coverage for a newsjacking signal, then decide whether newer coverage is the same story, a different story, or a materially new development.

elvisun/newsjack · 40 tokens

prompt-proximity-architecture

Turn an approved measurement charter, ICPs, and buyer jobs into a budget-aware prompt coverage blueprint across proximity bands, aided status, information acts, journey states, roles, locales, evidence grades, partitions, and measurement lanes. Use before prompt wording to define required, optional, and prohibited…

elvisun/newsjack · 67 tokens