MCPInstall

dx-delivery-sdk

Help agents write correct, production-ready TypeScript using @contentstack/delivery-sdk for Contentstack entries, assets, references, filtering, sorting, pagination, locale, Live Preview, and Visual Builder support. Verify SDK behavior against the Delivery SDK Spec when method names, options, or chain order matter. Use when a user asks for Contentstack Delivery SDK code, query examples, helper functions, SDK setup, stack initialization, reference inclusion, filtering, sorting, pagination, typed entry fetching, asset fetching, Live Preview setup, Visual Builder support, SSR preview handling, or debugging SDK query chains.

Installs
91
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/contentstack/contentstack-agent-skills --skill dx-delivery-sdk
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads dx-delivery-sdk automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

dx-delivery-sdk

Description

Help agents write correct, production-ready TypeScript using @contentstack/delivery-sdk for Contentstack entries, assets, references, filtering, sorting, pagination, locale, Live Preview, and Visual Builder support. Verify SDK behavior against the Delivery SDK Spec when method names, options, or chain order matter.

When to Use

Use when a user asks for Contentstack Delivery SDK code, query examples, helper functions, SDK setup, stack initialization, reference inclusion, filtering, sorting, pagination, typed entry fetching, asset fetching, Live Preview setup, Visual Builder support, SSR preview handling, or debugging SDK query chains.

User Problem

Users need current, correct Contentstack Delivery SDK code with the right method names, chain order, and query patterns. The skill should prevent subtle SDK mistakes and default to production-ready TypeScript.

Success Criteria

  • Uses current @contentstack/delivery-sdk method names and correct chain order.
  • Verifies API details against the Delivery SDK Spec when behavior is uncertain.
  • Produces TypeScript-first examples with safe environment-based credentials.
  • Handles references, filters, sorting, pagination, field selection, assets, locale, and Live Preview correctly.
  • Flags or avoids common mistakes such as wrong query methods, missing pagination, or shared SSR Live Preview stacks.

Expected Inputs

  • Content type UID
  • Entry UID or asset UID when applicable
  • Field UIDs for filters, sorting, selection, or references
  • Locale when localized content is needed
  • Desired return shape or helper function behavior
  • SSR or Visual Builder context when Live Preview is involved

Expected Outputs

  • TypeScript code snippets
  • Reusable helper functions
  • Correct SDK query chains
  • Live Preview or SSR-safe stack setup
  • Debugging guidance for incorrect Contentstack SDK usage

Example User Requests

  • Write a Contentstack Delivery SDK query for blog posts with author references included.
  • Show me the correct TypeScript setup for Contentstack Live Preview in Next.js SSR.
  • Fix this Contentstack query chain; it is not returning the right entries.
  • Create a helper to fetch entries by URL with pagination and typing.
  • How do I fetch assets and filter by content type in @contentstack/delivery-sdk?

Workflow Summary

  1. Identify the target object: entry, asset, content type, taxonomy, or helper.
  2. Check the Delivery SDK Spec when method names, options, or chain order matter.
  3. Ask only for missing inputs needed to build the query correctly.
  4. Choose the correct SDK chain and method order.
  5. Add pagination, locale, field selection, and references as needed.
  6. Use safe TypeScript types and reusable helpers.
  7. Include error handling and common-mistake warnings when relevant.

Instructions

Identify the target

Determine whether the request is for entries, assets, taxonomy, references, Live Preview, or a reusable helper. Ask only for missing UIDs, locale, references, or return shape when needed.

Verify SDK behavior

Use the Delivery SDK Spec as the source of truth for method names, supported options, and chain order. If the request depends on SDK behavior, confirm the exact API before answering.

Use current SDK patterns

Prefer TypeScript and the current @contentstack/delivery-sdk API. Use safe environment-based credentials and avoid hardcoded tokens or host values unless they are documented defaults.

Build correct queries

Apply references before .query(), use QueryOperation for filters, use orderByAscending() / orderByDescending() for sorting, and add pagination for collection queries.

Handle Live Preview safely

For SSR or Visual Builder, create a new stack per request and apply live preview configuration before fetching. Do not reuse a Live Preview stack across requests.

Output Format

Prefer TypeScript. Use concise, production-ready code blocks. Verify method-order constraints against the Delivery SDK Spec when they matter. Do not hardcode credentials. Call out pagination limits when returning multiple entries. Include brief notes for Live Preview or SSR safety when relevant.

Tooling Notes

Prefer @contentstack/delivery-sdk as the primary SDK. Use @timbenniks/contentstack-endpoints for region-specific preview hosts when needed. Use getContentstackEndpoints(region, true) so SDK host values omit https://. For SSR Live Preview or Visual Builder, create a new stack per request.

Security

Defaults

Never expose deployment tokens or environment secrets. Validate deployment targets before triggering. Require confirmation for production deployments. Never auto-deploy to production without review. Never hardcode Contentstack credentials in examples. Avoid sharing preview tokens or other secrets in responses. For SSR Live Preview, do not reuse a stack instance across requests.

Destructive Actions

This skill does not perform destructive actions. If a request implies deleting, publishing, or mutating production content, require explicit confirmation and verify the target before proceeding.

Secrets

Use environment variables for all credentials and tokens. Never print, infer, or echo secrets. If a secret is missing, request the variable name or show a placeholder only.

Environment Variables

Use process.env placeholders in examples. Prefer required non-null assertions only when the surrounding code clearly validates configuration. Do not suggest committing secrets to source control.

Product Context

    • Product: Developer Experience
    • Description: Developer experience tooling
    • Product safety rules: - Never expose deployment tokens or environment secrets.
  • Validate deployment targets before triggering.
  • Require confirmation for production deployments.
  • Never auto-deploy to production without review.

References

This skill ships reference material in the references/ folder. Read those files on demand when their content is relevant to the task — do not assume their contents from the summaries below.

Delivery SDK Spec (product doc, required)

Examples

Stack setup (few shot *)

User: Set up the Contentstack Delivery SDK in TypeScript.

Assistant: ```ts import contentstack, { QueryOperation } from "@contentstack/delivery-sdk";

const stack = contentstack.stack({ apiKey: process.env.CONTENTSTACK_API_KEY!, deliveryToken: process.env.CONTENTSTACK_DELIVERY_TOKEN!, environment: process.env.CONTENTSTACK_ENVIRONMENT!, region: process.env.CONTENTSTACK_REGION || "us", });


*Default stack setup with env vars and current import style.*

### Live Preview stack factory (few shot *)

**User:** Show the recommended SSR Live Preview setup.

**Assistant:** ```ts
import contentstack from "@contentstack/delivery-sdk";

export function createStack() {
  return contentstack.stack({
    apiKey: process.env.CONTENTSTACK_API_KEY!,
    deliveryToken: process.env.CONTENTSTACK_DELIVERY_TOKEN!,
    environment: process.env.CONTENTSTACK_ENVIRONMENT!,
    region: process.env.CONTENTSTACK_REGION || "us",
    live_preview: {
      enable: true,
      preview_token: process.env.CONTENTSTACK_PREVIEW_TOKEN,
      host: "rest-preview.contentstack.com",
    },
  });
}

Per-request factory for SSR or Visual Builder.

Single entry fetch (few shot *)

User: Fetch one blog post by UID.

Assistant: ```ts const entry = await stack.contentType("blog_post").entry("entry_uid").fetch();


*Use direct fetch for single entries.*

### Entry query (few shot *)

**User:** Fetch multiple blog posts.

**Assistant:** ```ts
const result = await stack.contentType("blog_post").entry().query().find();
const entries = result.entries;

Use query().find() for collections.

References (few shot *)

User: Include author and category references.

Assistant: ```ts const result = await stack .contentType("blog_post") .entry() .includeReference(["author", "category"]) .query() .find();


*`includeReference()` belongs before `.query()`.*

### Filtering (few shot *)

**User:** Filter by title.

**Assistant:** ```ts
const result = await stack
  .contentType("blog_post")
  .entry()
  .query()
  .where("title", QueryOperation.EQUALS, "My Post")
  .find();

Use QueryOperation names exactly.

Sorting (few shot *)

User: Sort by publish date descending.

Assistant: ```ts const result = await stack .contentType("blog_post") .entry() .query() .orderByDescending("published_date") .find();


*Never use `.descending()`.*

### Pagination (few shot *)

**User:** Return page 1 with 10 items and total count.

**Assistant:** ```ts
const result = await stack
  .contentType("blog_post")
  .entry()
  .query()
  .skip(0)
  .limit(10)
  .includeCount()
  .find();

Mention the 100-item default limit when pagination is omitted.

Field selection (few shot *)

User: Only fetch title and url.

Assistant: ```ts const result = await stack .contentType("blog_post") .entry() .query() .only(["title", "url"]) .find();


*Use `only()` and `except()` for payload control.*

### Asset fetch and query (few shot *)

**User:** Fetch an asset and query JPEG assets.

**Assistant:** ```ts
const asset = await stack.asset("asset_uid").fetch();

const result = await stack
  .asset()
  .query()
  .where("content_type", QueryOperation.EQUALS, "image/jpeg")
  .find();

Support both direct fetch and asset queries.

Helper function pattern (few shot *)

User: Create reusable helpers for fetching entries.

Assistant: ```ts export async function getEntryByUrl(contentTypeUid: string, url: string) { try { const result = await stack .contentType(contentTypeUid) .entry() .query() .where("url", QueryOperation.EQUALS, url) .includeCount() .find();

return result.entries[0] || null;

} catch (error) { if (error instanceof Error) { console.error("Failed to fetch entry by url:", error.message); } return null; } }


*Include safe error handling in reusable helpers.*

### Common mistakes checklist (edge case *)

**User:** What mistakes should I avoid with the Delivery SDK?

**Assistant:** - Do not call `includeReference()` after `.query()`.
- Use `orderByAscending()` / `orderByDescending()`, not `ascending()` / `descending()`.
- Use `QueryOperation.NOT_EQUALS`, not `NOT_EQUAL`.
- Do not hardcode credentials.
- Add pagination for collection queries.
- Do not reuse a Live Preview SSR stack across requests.

*Use as a compact guardrail response.*

FAQ

What does the dx-delivery-sdk skill do?

Help agents write correct, production-ready TypeScript using @contentstack/delivery-sdk for Contentstack entries, assets, references, filtering, sorting, pagination, locale, Live Preview, and Visual Builder support. Verify SDK behavior against the Delivery SDK Spec when method names, options, or chain order matter. Use when a user asks for Contentstack Delivery SDK code, query examples, helper functions, SDK setup, stack initialization, reference inclusion, filtering, sorting, pagination, typed entry fetching, asset fetching, Live Preview setup, Visual Builder support, SSR preview handling, or debugging SDK query chains.

How do I install dx-delivery-sdk?

Run npx skills add https://github.com/contentstack/contentstack-agent-skills --skill dx-delivery-sdk in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/dx-delivery-sdk/ (personal) or .claude/skills/dx-delivery-sdk/ (project).

Which AI agents can use dx-delivery-sdk?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is dx-delivery-sdk safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains dx-delivery-sdk?

It is published by contentstack in contentstack/contentstack-agent-skills, and it is an official skill from the maker of the technology it covers. It has 91 recorded installs.

More from contentstack/contentstack-agent-skills

View all →

cms-entries

contentstack/contentstack-agent-skills

Advise developers on querying, localizing, versioning, publishing, and structuring Contentstack entries for efficient delivery. Focus on CDA usage, reference expansion, pagination, bulk operations, and Sync API patterns. Use when developers ask about fetching entries, building CDA queries, handling localization, publishing workflows, versioning behavior, bulk operations, or entry-related performance issues.

OfficialBackend & APIs99 installs

cms-environments-publishing

contentstack/contentstack-agent-skills

Advise developers on configuring environments, publishing content, using delivery and preview tokens, leveraging the Sync API, and understanding CDN and publish queue behavior in Contentstack. Use when developers ask about environment setup, publishing behavior, delivery or preview tokens, the Sync API, scheduling, or CDN and caching configuration in Contentstack.

OfficialBackend & APIs98 installs

cms-assets

contentstack/contentstack-agent-skills

Advise developers on organizing, delivering, and transforming assets in Contentstack. Cover folder structure, Image Delivery API transformations, publishing lifecycle, CDN behavior, and common limits. Use when developers ask about uploading, organizing, delivering, transforming, publishing, or troubleshooting images and other media files in a stack's asset library. For the standalone Assets DAM (spaces, workspaces, duplicate sets, saved views, visual markups), use asset-management instead. Reading or updating user-defined fields is not supported here; use asset-management and the Assets API.

OfficialBackend & APIs98 installs

cms-data-modeling-best-practices

contentstack/contentstack-agent-skills

Guide developers to model content in Contentstack using the simplest reusable structure. The skill explains when to use content types, references, global fields, groups, modular blocks, JSON RTE, taxonomy, and tags, and helps avoid over-modeling, deep reference chains, and channel-specific schema sprawl. Use when designing, reviewing, or refactoring Contentstack content models before creating or changing schemas.

OfficialCode Quality & Workflow98 installs

cms-taxonomy

contentstack/contentstack-agent-skills

Advise developers on using Contentstack Taxonomy for structured, hierarchical content classification and delivery-side filtering. Covers taxonomy vs tags, labels, and references; hierarchy design; CDA query operators; localization; and import/export. Use when developers need help classifying content, designing category hierarchies, choosing between taxonomy and other classification approaches, or querying entries by category on the delivery side.

OfficialAI & Agents94 installs

cms-webhooks

contentstack/contentstack-agent-skills

Advise developers on configuring and consuming Contentstack webhooks for real-time event notifications. Cover event channels, payload structure, signature verification, retry behavior, release-triggered webhook storms, and reliable receiver design. Use when developers need help setting up webhooks, choosing event channels, handling webhook payloads, verifying signatures, debugging delivery issues, or integrating Contentstack with external systems such as site rebuilds, search indexes, Slack, or CI/CD.

OfficialBackend & APIs93 installs

Popular code quality & workflow skills

View category →

grill-me

mattpocock/skills

A relentless interview to sharpen a plan or design.

Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

handoff

mattpocock/skills

Compact the current conversation into a handoff document for another agent to pick up.

domain-modeling

mattpocock/skills

Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.

codebase-design

mattpocock/skills

Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.

diagnosing-bugs

mattpocock/skills

Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.