Logo Optimization Sdk Sync

Optimization Sdk Sync

Tổ chức
contentful
optimization-sdk-sync

Synchronize the Contentful Optimization SDK's public API, behavior, and implementation guidance into concise, runtime-specific references for the contentful-personalization skill. Use when the optimization repository or SDK documentation changes, when modern SDK guidance appears stale, or when validating that the skill matches an immutable upstream revision.

Tổng quan

Nhà phát hànhcontentful
Kho mãskills
Tên kỹ năngoptimization-sdk-sync
Sao
41
Bản fork
3
Tệp đi kèm
1
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 1 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được contentful công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Optimization Sdk Sync trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/contentful/skills/tree/main/local-skills/skills/optimization-sdk-sync
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/contentful/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/local-skills/skills/optimization-sdk-sync .claude/skills/optimization-sdk-sync
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Optimization Sdk Sync trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Optimization Sdk Sync ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Optimization Sdk Sync không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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:

text
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:

  1. Resolve and record HEAD.
  2. Record the origin URL when present.
  3. If tracked or untracked files are present, treat the run as preview-only unless the user explicitly asks to use dirty state.
  4. Never edit, clean, stash, reset, or otherwise mutate the source repository.

Read repository policy first

Before interpreting upstream files, read every applicable AGENTS.md from the repository root down to each source directory. Follow upstream-generated-file and validation rules.

Evidence hierarchy

Use all four evidence layers. Knowledge-base facts and types alone are not sufficient for complete agent guidance.

  1. Knowledge base — behavioral contracts, caveats, lifecycle, architecture, platform differences, and source pointers under documentation/internal/sdk-knowledge/.
  2. Public exports and types — exact import paths, names, signatures, option shapes, return values, and deprecations under packages/.
  3. Guide blueprints — task coverage, prerequisite ordering, validation expectations, and troubleshooting branches under documentation/authoring/blueprints/.
  4. Maintained implementations and public docs — canonical composition, file boundaries, realistic usage, edge cases, and completeness checks.

Resolve conflicts using the most authoritative source for the claim:

  • exact API shape: public exports and types
  • behavioral semantics: knowledge-base fact backed by its source pointer
  • implementation topology: maintained first-party implementation
  • task completeness: blueprint
  • public wording: public docs, only after checking the layers above

Never infer an API from prose when an exported type or implementation is available.

Treat repository knowledge and guide validators as structural integrity gates. They verify pointers, templates, links, and planned structure; they do not prove that two valid sources agree semantically. When a knowledge fact conflicts with an exported public type, record the discrepancy and follow the public type for downstream API guidance.

Validate upstream inputs

From the resolved checkout, run the repository's documented dependency setup if required, then:

bash
pnpm knowledge:check
pnpm guides:check

Record each result as passed, failed, or blocked. A sandbox, dependency, or runtime restriction is blocked, not failed, but both are non-passing. Stop authoritative downstream writes unless both checks pass; report the immutable SHA, command, status, and concrete failure or blocking reason.

Determine the delta

Read src/skills/contentful-personalization/optimization-sdk-sync.json when it exists. Compare its previous upstream SHA with the newly resolved SHA.

Use the changed-file set to prioritize inspection, but always revalidate:

  • public entry points and declarations for affected packages
  • fact files that point to changed code
  • affected blueprints
  • maintained examples referenced by those facts or blueprints

A file delta narrows review; it never replaces the evidence hierarchy.

Parallel execution

When sub-agents are available, use isolated ownership:

  1. The coordinator resolves and validates the upstream SHA, computes the delta, and owns the overview, shared reference, provenance manifest, and consumer wiring.
  2. Give each runtime worker only its matching knowledge file, blueprint, public entry points and types, linked maintained implementation, and public guide. Each worker writes one runtime file.
  3. No two workers edit the same file.
  4. After integration, run an independent read-only worker that source-verifies the complete pack and searches consumers for stale or contradictory modern guidance.

Workers must follow the same immutable SHA and evidence hierarchy. A worker's report is review input, not a substitute for coordinator validation.

Compile the reference pack

Write source references under src/skills/contentful-personalization/references/:

text
optimization-overview.md
optimization-shared.md
optimization-react-web.md
optimization-nextjs-app-router.md
optimization-nextjs-pages-router.md
optimization-web.md
optimization-node.md
optimization-react-native.md

Each runtime reference should stand alone after optimization-shared.md is loaded. Include only what materially helps an agent implement, review, or debug that runtime:

  • correct package and public import paths
  • initialization and provider or factory boundaries
  • minimal canonical setup
  • user, consent, page or screen, event, and reset lifecycle where supported
  • content fetching or prefetch behavior where supported
  • server/client boundaries and request handling where relevant
  • runtime-specific validation and common failure modes

The overview should route an agent to the right runtime and summarize package selection. Shared concepts belong in optimization-shared.md; do not repeat them in every runtime file.

Writing rules:

  • Aim for at most 120 lines in the overview, 200 in shared concepts, and 300 per runtime. Exceed a target only when removing material would hide a public API boundary or production failure mode.
  • Prefer short declarative sections and small canonical snippets.
  • Use current exported names exactly.
  • State unsupported behavior explicitly rather than implying parity.
  • Distinguish required setup from optional integration.
  • Remove historical narrative unless it prevents a migration mistake.
  • Do not expose internal source-pointer syntax in distributed references.
  • Do not create a second downstream blueprint system.
  • Do not add repo-specific editorial overrides unless required by the consuming workflow.

Update consumers

After compiling the pack:

  1. Route modern SDK topics to the overview or a runtime-specific reference.
  2. Make onboarding and development workflows load optimization-shared.md plus only the detected runtime reference or references.
  3. Keep legacy SDK paths on legacy references.
  4. Remove or rewrite stale modern claims in shared references so they cannot override the generated pack.
  5. Keep modern product policy owned by downstream workflows; synchronize only SDK facts and implementation guidance.

Record provenance

Update src/skills/contentful-personalization/optimization-sdk-sync.json with:

  • schema version
  • official repository URL
  • resolved ref and full commit SHA
  • generation timestamp in UTC
  • source mode (remote or local)
  • whether the source tree was dirty
  • validation commands and passed / failed / blocked results
  • generated reference paths
  • upstream source paths consulted for each generated reference

Do not put machine-specific local paths in the manifest.

Build and verify

The source tree is authoritative. Generate distribution output only after source references and workflow code are updated:

bash
pnpm run build
pnpm run lint
pnpm run typecheck
pnpm run test
python3 local-skills/skills/skill-authoring/scripts/quick_validate.py local-skills/skills/optimization-sdk-sync
python3 local-skills/skills/skill-authoring/scripts/quick_validate.py skills/contentful-personalization
npx skills add . --list --full-depth

Also search the distributed skill for removed API names and obsolete import paths discovered during the sync. Review the generated diff for accidental duplication and machine-specific provenance.

Do not commit, push, or open a pull request unless the user asks.

Completion report

Report:

  • upstream repository, resolved ref, and immutable SHA
  • upstream validation results
  • runtimes updated or deliberately excluded
  • material API or behavioral corrections
  • downstream validation results
  • any unresolved ambiguity, with the competing evidence named

Tệp đi kèm

Mô hình đọc các tệp này khi cần trong lúc kỹ năng được tải. Các tệp được cung cấp ở dạng có thể đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Optimization Sdk Sync làm được gì?

Synchronize the Contentful Optimization SDK's public API, behavior, and implementation guidance into concise, runtime-specific references for the contentful-personalization skill. Use when the optimization repository or SDK documentation changes, when modern SDK guidance appears stale, or when validating that the skill matches an immutable upstream revision.

Vì sao nên dùng Optimization Sdk Sync trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Optimization Sdk Sync là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Optimization Sdk Sync trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/contentful/skills/tree/main/local-skills/skills/optimization-sdk-sync. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Optimization Sdk Sync?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Optimization Sdk Sync với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Optimization Sdk Sync với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Optimization Sdk Sync có miễn phí không?

Có. Kỹ năng này được contentful phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇