18-dx-migrate-js-to-ts-sdk

18-dx-migrate-js-to-ts-sdk is a cursor rule for coding agents from contentstack/contentstack-agent-skills. It costs 50 tokens per session (1,977 once invoked), scanned A, original, MIT.

A migration guide for changing Contentstack Delivery SDK code from JavaScript to TypeScript while keeping its behavior.

In plain words
What is it for?
Use it to rewrite or compare code for stacks, entries, assets, queries, pagination, caching, utilities, taxonomies, and image transformations.
Why use it?
It helps translate SDK setup and operations without missing package requirements, API differences, or TypeScript-specific limitations.

Cursor rule

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 rules/contentstack/contentstack-agent-skills/18-dx-migrate-js-to-ts-sdk
Clone the repo
git clone --depth 1 https://github.com/contentstack/contentstack-agent-skills

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for 18-dx-migrate-js-to-ts-sdk

README.md
[![agentmods](https://agentmods.dev/badge/rules/contentstack/contentstack-agent-skills/18-dx-migrate-js-to-ts-sdk.svg)](https://agentmods.dev/rules/contentstack/contentstack-agent-skills/18-dx-migrate-js-to-ts-sdk)
Your own site
<a href="https://agentmods.dev/rules/contentstack/contentstack-agent-skills/18-dx-migrate-js-to-ts-sdk"><img src="https://agentmods.dev/badge/rules/contentstack/contentstack-agent-skills/18-dx-migrate-js-to-ts-sdk.svg" alt="Measured on agentmods" height="20"></a>
Per session 50 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,977 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.00050 $0.01977
Opus 5 $0.00025 $0.00988
Sonnet 5 $0.00010 $0.00395
Haiku 4.5 $0.00005 $0.00198

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

Security

Grade A, and why

18-dx-migrate-js-to-ts-sdk 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 4d 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.

cursor/rules/18-dx-migrate-js-to-ts-sdk.mdc · 200 lines

How it starts

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

dx-migrate-js-to-ts-sdk

Description

Migrate Contentstack Delivery SDK code from JavaScript to TypeScript. Rewrite setup, initialization, Stack, Entries, Assets, Query, pagination, cache, utils, taxonomy, and image transform usage while preserving behavior and calling out TypeScript-specific differences.

When to Use

Use when a user wants to migrate Contentstack Delivery SDK code from JavaScript to TypeScript. Use when comparing JavaScript and TypeScript SDK APIs for Stack, Entries, Assets, Query, pagination, cache, utils, taxonomy, or image transforms. Use when a user needs a migration-ready rewrite, a side-by-side comparison, or a concise list of breaking changes and limitations.

User Problem

The user needs to move existing Contentstack Delivery SDK code from JavaScript to TypeScript without losing functionality. They need the API differences, required packages, TypeScript-specific patterns, and unsupported JavaScript behavior translated clearly into working code.

Success Criteria

Identifies the correct JavaScript-to-TypeScript SDK equivalents. Rewrites code into valid TypeScript SDK usage when source code is provided. Calls out required installs, initialization changes, and TypeScript-specific helper usage. Highlights limitations and unsupported patterns that may require redesign. Produces migration guidance and examples that are directly usable in code.

Expected Inputs

  • Existing JavaScript SDK code or snippets
  • Target runtime context, such as Node.js or React Native
  • Specific SDK areas involved, such as Stack, Entries, Assets, Query, caching, utils, taxonomy, or image transforms
  • Whether the user wants explanation, migration steps, or rewritten TypeScript code

Expected Outputs

  • Migration summary
  • API mapping notes
  • Rewritten TypeScript code examples
  • Warnings about limitations or unsupported features
  • Optional side-by-side JavaScript and TypeScript comparisons

Example User Requests

  • Migrate this Contentstack JavaScript SDK code to TypeScript.
  • Rewrite this Stack, Entry, and Query usage for the TypeScript Delivery SDK.
  • Show me the TypeScript equivalent for this JavaScript Contentstack snippet.
  • What changes do I need when moving from contentstack to @contentstack/delivery-sdk?
  • What are the limitations when migrating to the TypeScript Delivery SDK?
  • How do I rewrite cache policy usage for the TypeScript Delivery SDK?
  • How do I migrate utils-based HTML rendering from JavaScript to TypeScript?
  • Convert this taxonomy query from the JavaScript SDK to TypeScript.

Read the full file on GitHub · 200 lines

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. 4d ago First seen · 200 lines · 50 tokens per session scan A e94bb6d10b76

Subscribe to this mod's changes

18-dx-migrate-js-to-ts-sdk is a cursor rule published in the GitHub repository contentstack/contentstack-agent-skills (5 stars, last pushed 18d ago), licensed MIT. It adds 50 tokens to every session and 1,977 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-31.