All skills
segmently-ai avatar

/segmently-cli-custom-screen-guide

@3c9bc34

Segmently CLI guide for reading, updating, applying, and validating V2 WebEmbed custom screens and FlexibleLayout paywall ProductCatalog linking. Use when migrating hardcoded WebEmbed HTML to data sources, routing Button and SingleSelectionList child data-source actions through graph edges, reproducing screenshot references as WebEmbed custom screens, checking variables inside custom screens, updating callback fallback edges, verifying shadow-DOM render correctness, migrating images, converting legacy custom-screen APIs, converting paywalls to ProductCatalog-driven custom screens through the Segmently CLI, or validating native FlexibleLayout Text/PurchaseButton labels linked to selected ProductCatalog products. Also trigger when Segmently Launch Assistant returns executeWith.skill/owningSkill=segmently-cli-custom-screen-guide or names this skill for a custom WebEmbed DO flow.

  • 20 files
  • 137.8 KB
  • Updated last week
  • GitHub

Use this Skill: https://skilld.dev/gh/segmently-ai/segmently-support-plugins/segmently-cli-custom-screen-guide

This session only. Nothing lands on disk.

referencessdk-minimal.md

≈733 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Minimal Segmently SDK Snippets

Use the method meanings and operation/render-mode boundaries in the shared authoring contract. These snippets illustrate that contract; they do not grant capabilities outside the current screen packet.

Use only the SDK calls needed for the current screen. Keep fallback text in the DOM so local preview remains understandable.

Ready

segmentlySDK.ready().then(function (sdk) {
  init(sdk);
});

Text Data Source

function text(sdk, label, fallback) {
  var section = sdk.getChildSectionText(label);
  return section && section.title ? section.title : fallback;
}

Generic Child Section

var section = sdk.getChildSection('Benefits');
var sections = sdk.getChildSections();

Media

var media = sdk.getChildSectionMedia('Hero media');
if (media && media.url) {
  image.src = media.url;
}

Variables

var current = sdk.getVariable('goal');
sdk.setVariable('goal', 'improve_focus');
var definition = sdk.getVariableDefinition('goal');

Child Data-Source Actions

Use child data-source actions for editor-managed branching from custom HTML. These calls bypass the parent WebEmbed callback and route through graph action keys on child sections.

var cta = sdk.getChildSection('Continue CTA');
if (cta && cta.kind === 'Button') {
  document.querySelector('[data-action="continue"]').textContent =
    cta.data.buttonText || 'Continue';
  document.querySelector('[data-action="continue"]').onclick = function () {
    sdk.triggerButtonAction('Continue CTA');
  };
}

var goals = sdk.getChildSection('Goals');
var first = goals && goals.data && goals.data.options && goals.data.options[0];
if (first) {
  sdk.triggerOptionAction('Goals', first.optionId || 0);
}
  • triggerButtonAction(labelOrId) routes through section.{childSectionId}.button.
  • triggerOptionAction(labelOrId, optionIdOrIndex) routes through section.{childSectionId}.item.{index} for OptionsList and SingleSelectionList.
  • MultipleSelectionList does not branch through triggerOptionAction; use setVariable() plus fallback navigation for custom multi-select flows.

Fallback Navigation

sdk.navigateNext();
sdk.navigateBack();

Use navigateNext() only for whole-screen fallback/continue behavior. It maps to the parent WebEmbed embed.callback action key, not to child Button/SingleSelectionList edges.

Products

var products = sdk.getProducts();
var price = sdk.getProductPrice(products[0].productId);
sdk.selectProduct(products[0].productId);
sdk.purchaseProduct(products[0].productId);

Local Preview Guard

If a screen must preview outside Segmently, wrap SDK access in guards but keep the production path simple:

if (!window.segmentlySDK) {
  console.warn('Segmently SDK is unavailable in local preview.');
} else {
  segmentlySDK.ready().then(init);
}

Source: SKILL.md on GitHub

No third-party reports yet.

Signed by skilld at 3c9bc34. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last week

README badge

README badge for segmently-ai/segmently-support-plugins/segmently-cli-custom-screen-guide