Skip to content

feat: add the Contentstack Studio skill - #20

Closed
sumitjain-cstk wants to merge 6 commits into
contentstack:mainfrom
sumitjain-cstk:feat/add-studio-skill
Closed

sumitjain-cstk wants to merge 6 commits into
contentstack:mainfrom
sumitjain-cstk:feat/add-studio-skill

Conversation

@sumitjain-cstk

@sumitjain-cstk sumitjain-cstk commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What this adds

A new studio skill covering Contentstack Studio end to end: SDK install, project provisioning, component registration, sections and templates, data binding, canvas and preview routes, verification, and troubleshooting.

Studio's skills are a pack: one router plus specialist files it loads per task. They are added here as one skill folder:

  • skills/studio/SKILL.md is the Studio router (name: studio).
  • skills/studio/skills-index.md is the router's trigger table and topic map.
  • skills/studio/<name>.md holds the 109 specialist files the router loads.

Files are copied verbatim from contentstack/studio-docs main at 259bc62e (docs/prompts, identical to skills/src). The specialists sit flat next to SKILL.md so the pack's own ./<name>.md links resolve without rewriting. studio-docs stays the source of truth; re-copying is how this gets updated.

Review fixes: the Copilot comments on the skill text were checked against the Studio SDK and fixed upstream in contentstack/studio-docs#138. skills/studio/ is now synced from that branch. Merge #138 first so studio-docs stays the source of truth; once it lands, skills/studio/ matches studio-docs main.

Other changes

  • skills/CLAUDE.md: router row for Studio.
  • manifest.json: studio entry, skill_count 21 → 22.
  • README.md: count, skills table, and a note for Cursor and Codex users who copy files out: copy skills/studio/ too.
  • scripts/build-cursor-rules.sh and scripts/build-codex-skills.sh: a new IN_PLACE_SKILLS list, currently just studio. For a skill in that list:
    • Its generated rule (cursor/rules/22-studio.mdc) and codex/studio/SKILL.md rewrite relative links to ../../skills/studio/.
    • Both start with a note that relative paths resolve in skills/studio/. The router finds specialists by path as well as by link, so it needs the note.
    • codex/ gets no copy of its bundled files, so the 110 Studio files exist only once, in skills/studio/.
  • Every other skill builds exactly as before; its generated output is unchanged.

Notes for review

  • Generated files are all plain files with forward-slash relative links, with no symlinks, so they behave the same on Windows, macOS and Linux. The build scripts need bash and perl, which ship with macOS, Linux and Git Bash on Windows.
  • Some specialists link to ../../docs/... pages in studio-docs. Those links don't resolve here, and they already don't resolve in the hosted installer's output. Fixing them belongs upstream in studio-docs.
  • I scanned the added files for keys, tokens and internal hostnames and found none.

🤖 Generated with Claude Code

Adds skills/studio: the Studio router (SKILL.md), its routing table
(skills-index.md) and the 109 specialist skill files it loads, copied
verbatim from contentstack/studio-docs main (259bc62e, docs/prompts).
The specialists sit flat next to SKILL.md so the pack's ./<name>.md links
resolve unchanged.

Registers it in skills/CLAUDE.md, manifest.json and README.md, and
regenerates cursor/rules and codex.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sumitjain-cstk
sumitjain-cstk requested a review from a team as a code owner October 13, 2026 12:34
Copilot AI lite review requested due to automatic review settings October 13, 2026 12:34
@snyk-io

snyk-io Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Cursor rules sit in cursor/rules/, away from their skill's bundled files,
so build-cursor-rules.sh now rewrites relative link targets in each rule
body to ../../skills/<slug>/ and, for skills that bundle files, adds a note
naming the folder relative paths resolve in. The Studio router resolves
specialists by path, not only by link, so it needs that note. This also
fixes the references/ links in brand-kit-assistant,
developer-hub-app-architect and dx-delivery-sdk.

build-codex-skills.sh now symlinks each bundled entry to
../../skills/<slug>/ instead of copying it, so skills/ is the only copy
(codex/studio was a second copy of the 110 Studio files). README says to
copy codex/ with cp -RL, and to copy skills/ alongside cursor rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical and moderate issues remain, including Cursor packaging and incorrect authoring recipes.

11 open findings
What changed in this PR

Adds a Contentstack Studio skill pack covering setup, authoring, SDK integration, data binding, routing, verification, and troubleshooting.

Changes:

  • Adds the Studio router, index, and specialist guidance.
  • Registers Studio in repository metadata and routing.
  • Regenerates Codex and Cursor integrations.
File Description
skills/​studio/​use-condition-block.md Condition Block guidance
skills/​studio/​understand-reference-depth.md Reference-depth guidance
skills/​studio/​understand-installation.md Installation guidance
skills/​studio/​understand-canvas-vs-component.md Canvas and component guidance
skills/​studio/​understand-canvas-url.md Canvas URL guidance
skills/​studio/​understand-bring-your-own-data.md App-owned data guidance
skills/​studio/​understand-authoring-headlessly.md Headless authoring guidance
skills/​studio/​troubleshoot.md Troubleshooting guidance
skills/​studio/​resolve-reference-depth-pitfalls.md Reference-depth pitfalls
skills/​studio/​register-component-render-contracts.md Component render contracts
skills/​studio/​register-component-pitfalls.md Component pitfalls
skills/​studio/​register-breakpoints.md Breakpoint registration
skills/​studio/​pin-query-to-freeform.md Freeform query guidance
skills/​studio/​make-visual-editor-editable.md Visual editor guidance
skills/​studio/​gate-third-party-scripts.md Third-party script guidance
skills/​studio/​expose-section-props.md Section props guidance
skills/​studio/​drive-studio-canvas-ui.md Canvas UI guidance
skills/​studio/​build-section-pitfalls.md Section pitfalls
skills/​studio/​build-section-component-choice.md Component choice guidance
skills/​studio/​author-without-code.md No-code authoring guidance
skills/​studio/​author-composition-thumbnails.md Composition thumbnails
skills/​studio/​author-composition-static-values.md Static composition values
skills/​studio/​author-composition-section-slot-fill.md Section-slot composition
skills/​studio/​author-composition-nested-repeaters.md Nested repeater composition
skills/​studio/​author-composition-migration.md Composition migration
skills/​studio/​author-composition-exposed-props.md Exposed composition props
skills/​studio/​author-composition-encoding.md Composition encoding
skills/​CLAUDE.md Studio routing entry
README.md Skill catalog update
manifest.json Studio registration and count
cursor/​rules/​00-router.mdc Cursor routing
codex/​studio/​use-condition-block.md Generated Codex guidance
codex/​studio/​understand-reference-depth.md Generated Codex guidance
codex/​studio/​understand-installation.md Generated Codex guidance
codex/​studio/​understand-bring-your-own-data.md Generated Codex guidance
codex/​studio/​understand-authoring-headlessly.md Generated Codex guidance
codex/​studio/​troubleshoot.md Generated Codex guidance
codex/​studio/​resolve-reference-depth-pitfalls.md Generated Codex guidance
codex/​studio/​register-component-render-contracts.md Generated Codex guidance
codex/​studio/​register-component-pitfalls.md Generated Codex guidance
codex/​studio/​register-breakpoints.md Generated Codex guidance
codex/​studio/​pin-query-to-freeform.md Generated Codex guidance
codex/​studio/​make-visual-editor-editable.md Generated Codex guidance
codex/​studio/​gate-third-party-scripts.md Generated Codex guidance
codex/​studio/​expose-section-props.md Generated Codex guidance
codex/​studio/​drive-studio-canvas-ui.md Generated Codex guidance
codex/​studio/​build-section-pitfalls.md Generated Codex guidance
codex/​studio/​build-section-component-choice.md Generated Codex guidance
codex/​studio/​author-without-code.md Generated Codex guidance
codex/​studio/​author-composition-thumbnails.md Generated Codex guidance
codex/​studio/​author-composition-static-values.md Generated Codex guidance
codex/​studio/​author-composition-section-slot-fill.md Generated Codex guidance
codex/​studio/​author-composition-nested-repeaters.md Generated Codex guidance
codex/​studio/​author-composition-migration.md Generated Codex guidance
codex/​studio/​author-composition-exposed-props.md Generated Codex guidance
codex/​studio/​author-composition-encoding.md Generated Codex guidance
codex/​AGENTS.md Codex routing entry

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cursor/rules/22-studio.mdc
Comment thread skills/studio/author-composition-nested-repeaters.md Outdated
Comment thread skills/studio/author-composition-pitfalls.md
Comment thread skills/studio/author-composition-section-slot-fill.md Outdated
Comment thread skills/studio/author-composition-sections.md Outdated
Comment thread skills/studio/author-composition-nested-repeaters.md
Comment thread skills/studio/author-without-code.md
Comment thread skills/studio/pin-query-to-freeform.md Outdated
Comment thread skills/studio/understand-authoring-headlessly.md Outdated
Comment thread skills/studio/understand-installation.md Outdated
Copilot AI lite review requested due to automatic review settings October 13, 2026 12:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Comment thread skills/studio/register-component-prop-contracts.md Outdated
Comment thread skills/studio/register-component-prop-contracts.md Outdated
Comment thread skills/studio/upgrade-studio-sdk.md Outdated
Comment thread skills/studio/wire-slot-data.md Outdated
Symlinks don't check out as links on Windows unless core.symlinks is on,
so codex/ no longer uses them, and other skills' generated output goes
back to exactly what it was before this PR.

Both build scripts now treat skills listed in IN_PLACE_SKILLS (just
studio) specially: their generated SKILL.md / rule rewrites relative link
targets to ../../skills/<slug>/ and notes that relative paths resolve
there, and codex/ gets no copy of their bundled files. Every other skill
is built as before. Plain files and forward-slash links, so this works
the same on Windows, macOS and Linux.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 13, 2026 13:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Comment thread skills/studio/register-component.md Outdated
Comment thread skills/studio/troubleshoot-canvas.md Outdated
Comment thread skills/studio/upgrade-studio-sdk.md Outdated
Comment thread skills/studio/decompose-site.md Outdated
Comment thread skills/studio/expose-section-props.md Outdated
Comment thread skills/studio/import-content.md Outdated
…file

The note said the files were at the repo root, which is wrong once the
Cursor rules are copied into a project. It now gives the path relative to
the generated rule / codex SKILL.md, names skills-index.md and the
specialists as living there, and says to report a missing folder instead
of improvising.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 14, 2026 08:49
Re-copies skills/studio from contentstack/studio-docs#138
(fix/skills-copilot-review-agent-skills-pr20 @ 3e1a003f), which fixes the
Copilot comments on this PR that checked out against the Studio SDK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Comment thread skills/studio/SKILL.md
Comment thread skills/studio/build-repeating-section.md Outdated
Comment thread skills/studio/setup-section-preview.md Outdated
Comment thread skills/studio/wire-external-data.md Outdated
Copilot AI lite review requested due to automatic review settings October 14, 2026 08:58
timbenniks-contentstack added a commit that referenced this pull request Oct 14, 2026
Adds skills/studio: a router SKILL.md, skills-index.md and 109 specialist
guides copied from contentstack/studio-docs.

On top of the PR: description restructured to include "Use when" for the
validator; generated cursor/codex/manifest/router and build-script changes
dropped (no longer exist on next); README row plus docs/skills/studio.md
and index, selection and skills CLI entries.

Co-authored-by: Sumit Jain <266980249+sumitjain-cstk@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved documentation contradictions and references to scripts or files missing from the shipped pack remain.

17 open findings
11 resolved since last review
Previously missed (6)

In code that hasn't changed since last review

Low severity Missing UI preview generator script

skills/​studio/​author-composition-thumbnails.md:77

Fix D instructs the agent to run scripts/make-ui-preview.ts, but no such script is included in this repository or in the Studio pack. This makes the advertised no-canvas thumbnail backfill path unusable for consumers; ship the script or replace these commands with an actually available procedure.

Low severity Acceptance path references missing preview generator

skills/​studio/​build-repeating-section.md:190

This mandatory acceptance item points API-created sections at scripts/make-ui-preview.ts, which is not present in the pack. A consumer following the documented API path cannot satisfy the checklist; bundle the generator or document a supported alternative.

Low severity Fix unmatched parenthesis in trigger sentence

skills/​studio/​figma-generate-components.md:9

The trigger sentence has an unmatched closing parenthesis in Phrases), which makes the usage guidance read as malformed prose. Replace it with a colon like the other specialist files.

Low severity Verification scripts are missing from the pack

skills/​studio/​import-content.md:23

The verification section says the reproducers are committed under ../../scripts/ and gives two commands, but this pack ships only the two build scripts and contains neither verify-import-preview.ts nor verify-import-e2e.ts. After installing the skill, these promised checks cannot be run; add the scripts to the bundle or remove/update the reproducibility claims.

Low severity Missing migration schema verification reproducer

skills/​studio/​migrate-ct-schema.md:21

The verification status claims a committed scripts/verify-migrate-ct-schema.ts reproducer and gives a command to run it, but the pack contains no such file. This prevents consumers from reproducing the stated verification; add the verifier or remove/update the claim.

Low severity Acceptance requires unavailable preview script

skills/​studio/​migrate-page-to-studio.md:159

The acceptance checklist requires an API-created section thumbnail via tsx scripts/make-ui-preview.ts, but that script is absent from the shipped repository. The skill can therefore reach an acceptance requirement it cannot perform; provide an available UI/API procedure or bundle the script.

🧠 Review effort: Lite

Comment thread skills/studio/pin-query-to-freeform.md Outdated
Comment thread skills/studio/register-component-pitfalls.md Outdated
Comment thread skills/studio/register-component.md Outdated
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 14, 2026 09:09
@sumitjain-cstk

Copy link
Copy Markdown
Contributor Author

Review comments: what was fixed

All 28 review threads are answered and resolved. Each comment was checked against Studio code (SDK origin/alpha, Studio UI, Studio API) before changing anything. Skill-text fixes were made upstream in contentstack/studio-docs#138, which is the source of truth, and then synced here.

Packaging (this repo)

  • Cursor and Codex can't find the Studio specialists (cc2c902). The Studio rule and codex/studio/SKILL.md now say every specialist and skills-index.md lives in ../../skills/studio/ relative to that file. The scoping is in the build scripts' IN_PLACE_SKILLS, so other skills build exactly as before.

Skill text, first pass (b0775aa)

  • Repeater examples (author-composition-nested-repeaters, -section-slot-fill, -sections): added props.children → slot. Without it the SDK renders nothing.
  • Empty-slot rule (author-composition-encoding, understand-authoring-headlessly, troubleshoot-canvas, author-composition-sections): exempts the section-slot node and the page-side entry for an unfilled slot. Never delete a section-slot node.
  • register-component: 14 prop types, adding action and plaintext.
  • register-component-prop-contracts: a safe imageurl coercion. Which URL-pattern variables resolve now depends on url_metadata.url_source.
  • upgrade-studio-sdk: upgrade only the Studio packages the host declares. Rollback restores the real lockfile and uses the project's package manager.
  • understand-installation: a catch-all visitor route is the default, and per-template routes are supported.
  • author-without-code: added Freeform templates and how to edit them.
  • pin-query-to-freeform: Condition Blocks only for multi-CT references.
  • Dead references: skill names in expose-section-props, wire-component-default-data and configure-studio; studio-docs-only scripts in decompose-site and import-content (the retry rule is now written inline).
  • Small fixes: the wire-slot-data trigger sentence, and the 3- vs 6-page contradiction in decompose-site.

Skill text, second pass (7be55ce)

  • register-component / -pitfalls: choice defaults are arrays everywhere, matching wire-component-default-data. The type count is 14 throughout.
  • pin-query-to-freeform: the pitfall row now matches step 9.
  • build-repeating-section: registerComponent takes props, not schema.
  • wire-external-data: the CSR example ignores a stale response when sku changes.
  • setup-section-preview / verify-setup: a deployed app allows framing only from https://*.contentstack.com. * stays for local dev servers.

Not changed, with reasons in the threads

  • root. keys in resolvedReferences (2 comments): the SDK ignores template-scope keys and reads only the values, which are already correct.
  • Router description scope: broad on purpose in the Studio pack. Narrowing it is for the pack owners to decide.
  • Access-Control-Allow-Origin: * in the Next.js example: left as is until someone confirms Studio never reads the app cross-origin.

Merge order

Merge studio-docs#138 first, then this PR.

🤖 Generated with Claude Code

timbenniks-contentstack added a commit that referenced this pull request Oct 14, 2026
- Apply valid Copilot review findings from PR #20 (prop type count,
  choice defaults, Condition Block rule, props: key, canvas-route-only
  frame headers, stale-response race, package-manager-agnostic upgrade)
- Relink 37 and inline 50 links that pointed into private studio-docs
- Remove internal references (PR numbers, internal scripts and tools)
- Simplify install-layout resolution for plugin installs
- Narrow the description to Studio-specific requests
- Ask before reading or refreshing the Contentstack MCP's stored session

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@timbenniks-contentstack

Copy link
Copy Markdown
Contributor

Thanks @sumitjain-cstk! The Studio skill is now in #21, the combined 0.2.0 release PR, with all 109 guides. Changes on top:

  • Applied the remaining valid Copilot findings: prop type count, choice defaults, the Condition Block rule, props: instead of schema:, frame headers on the canvas route only, the stale-response race, and package-manager-agnostic upgrade steps.
  • Fixed 87 links into the private studio-docs repo (relinked to guides in the pack or turned into plain text).
  • Removed internal references.
  • Narrowed the description so it doesn't fire on general Contentstack, Live Preview or Launch questions.
  • Added an ask-first step before reading or refreshing the Contentstack MCP's stored session.

It's worth bringing these back into studio-docs so the next copy doesn't undo them. You're credited as co-author. Closing in favour of #21.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Multiple documented workflow inconsistencies and missing referenced assets remain unresolved.

0 open findings

17 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Medium severity Section-slot validation rejects documented empty-slot pattern

skills/​studio/​author-composition-encoding.md:44

This checklist still requires every Section Slot inside an iteration to have a child Section in place, which rejects the documented Pattern B shape: a section-level section-slot intentionally keeps its own slot empty until the template fills it (author-composition-section-slot-fill.md:45-47,80-83). Scope this assertion to template-side fills or explicitly exempt the section-slot node.

🧠 Review effort: Lite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants