Agent skill

SDK Methods

by live-codes in live-codes/livecodes

Use SDK methods to interact with playgrounds: run, getCode, setConfig, getConfig, watch, runTests, format, getShareUrl, show, destroy.

MITAuto-check passed

Install SDK Methods

skills CLI
$ npx skills add live-codes/livecodes --skill sdk-methods -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install live-codes/livecodes sdk-methods --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/live-codes/livecodes.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/livecodes/sdk-methods .claude/skills/sdk-methods && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sdk-methods
GitHub stars
1.5k
Token cost
~2k tokens
SKILL.md length
196 words
Files
1
Skills in repo
15
Repo updated
First seen
Licence
MIT

At a glance

Use SDK methods to interact with playgrounds: run, getCode, setConfig, getConfig, watch, runTests, format, getShareUrl, show, destroy.

  • SKILL.md covers Setup, Core Patterns, Common Mistakes and SDK Method Reference
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

SDK Methods is an agent skill from live-codes/livecodes. Use SDK methods to interact with playgrounds: run, getCode, setConfig, getConfig, watch, runTests, format, getShareUrl, show, destroy. Load this skill when programmatically controlling embedded playgrounds, reacting to code changes, or retrieving compiled output.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: A Code Playground That Just Works! The licence is MIT.

Example prompts

  • “/sdk-methods”

What it can do on your machine

Read from SKILL.md and the folder at commit 5754e89. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are javascript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

SDK Methods loads about 2k tokens when it runs. Until then it costs about 69 tokens; SKILL.md has 196 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~69
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from live-codes/livecodes at commit 5754e89, republished under its MIT licence (© live-codes). 196 words, ~2,018 tokens.

Download SKILL.mdSave it as .claude/skills/sdk-methods/SKILL.md (or your agent's skills folder).
name
sdk-methods
description
Use SDK methods to interact with playgrounds: run, getCode, setConfig, getConfig, watch, runTests, format, getShareUrl, show, destroy. Load this skill when programmatically controlling embedded playgrounds, reacting to code changes, or retrieving compiled output.
metadata.type
core
metadata.library
livecodes
metadata.library_version
0.13.0
requires
sdk-embedding
sources
live-codes/livecodes:docs/docs/sdk/js-ts.mdx, live-codes/livecodes:src/sdk/index.ts

This skill builds on sdk-embedding. Read it first for foundational concepts.

LiveCodes — Use SDK Methods

The Playground object returned by createPlayground exposes methods to programmatically control the playground.

Setup

javascript
import { createPlayground } from 'livecodes';

const playground = await createPlayground('#container', {
  template: 'react',
});

// All SDK methods return Promises
await playground.run();
const code = await playground.getCode();
await playground.setConfig({
  /* new config */
});

Core Patterns

Run the playground
javascript
// Run the result page (after any needed compilation)
await playground.run();
Get current code and config
javascript
// Get code from all editors
const code = await playground.getCode();
console.log(code.markup.content); // Source markup
console.log(code.markup.language); // Language name
console.log(code.markup.compiled); // Compiled output (if applicable)
console.log(code.result); // Result page HTML

// Get configuration object
const config = await playground.getConfig();
console.log(config.title);
console.log(config.markup.language);

// Get content-only config (without user preferences)
const contentConfig = await playground.getConfig(true);
Update playground configuration
javascript
// Load new project in place (no full reload)
await playground.setConfig({
  markup: { language: 'markdown', content: '# New Content' },
});

// Get the resulting config
const newConfig = await playground.setConfig({
  script: { language: 'typescript', content: 'const x: number = 1;' },
});
Watch for changes
javascript
// Watch for code changes
const codeWatcher = playground.watch('code', ({ code, config }) => {
  console.log('Code changed:', code.script.content);
});

// Watch for code execution
const runWatcher = playground.watch('run', ({ code, config }) => {
  console.log('Playground ran. Result HTML:', code.result);
});

// Watch for console output
const consoleWatcher = playground.watch('console', ({ method, args }) => {
  console[method](...args);
});

// Watch for test results
const testsWatcher = playground.watch('tests', ({ results, error }) => {
  results.forEach((r) => console.log(r.status, r.testPath));
});

// Remove watchers when done
codeWatcher.remove();
runWatcher.remove();
consoleWatcher.remove();
testsWatcher.remove();
Run tests programmatically
javascript
const { results } = await playground.runTests();
results.forEach((result) => {
  console.log(result.status); // 'pass', 'fail', or 'skip'
  console.log(result.errors); // Array of error strings
  console.log(result.testPath); // ['describe', 'it']
});
Show specific panel
javascript
// Show editors
await playground.show('editor'); // Active editor
await playground.show('markup'); // Markup editor
await playground.show('style'); // Style editor
await playground.show('script'); // Script editor

// Show tools
await playground.show('console'); // Console panel
await playground.show('compiled'); // Compiled code viewer
await playground.show('tests'); // Tests panel

// Show result
await playground.show('result'); // Result page
await playground.show('toggle-result'); // Toggle result visibility

// With options
await playground.show('result', { full: true }); // Full screen
await playground.show('result', { zoom: 0.5 }); // 50% zoom
await playground.show('script', { line: 10, column: 5 }); // Scroll to line
Format code
javascript
// Format all editors
await playground.format();

// Format only active editor
await playground.format(false);
Get share URL
javascript
// Long URL with compressed config
const longUrl = await playground.getShareUrl();

// Short URL (requires share service)
const shortUrl = await playground.getShareUrl(true);
Execute custom commands
javascript
// Set broadcast token
await playground.exec('setBroadcastToken', 'my-token');

// Show version info
await playground.exec('showVersion');
Destroy playground
javascript
await playground.destroy();
// Playground removed from DOM, all event listeners cleaned up

Common Mistakes

HIGH Not awaiting async SDK methods

Wrong:

javascript
const playground = await createPlayground('#container', {});
const code = playground.getCode(); // Returns Promise, not code
console.log(code); // Promise { <pending> }

Correct:

javascript
const playground = await createPlayground('#container', {});
const code = await playground.getCode(); // Await the Promise
console.log(code.markup.content);

All SDK methods return Promises. Use await or .then() to get the result.

Source: docs/docs/sdk/js-ts.mdx — SDK methods section

MEDIUM watch callback receives wrong data structure

Wrong:

javascript
playground.watch('code', (data) => {
  console.log(data.content); // Undefined
});

Correct:

javascript
// 'code' event provides { code, config }
playground.watch('code', ({ code, config }) => {
  console.log(code.markup.content);
  console.log(code.style.content);
  console.log(code.script.content);
  console.log(code.result); // Result page HTML
});

// 'run' event provides { code, config }
playground.watch('run', ({ code, config }) => {
  console.log(code.result); // Result page HTML
});

// 'console' event provides { method, args }
playground.watch('console', ({ method, args }) => {
  console[method](...args);
});

// 'tests' event provides { results, error? }
playground.watch('tests', ({ results, error }) => {
  if (error) console.error(error);
  results.forEach((r) => console.log(r.status));
});

Source: docs/docs/sdk/js-ts.mdx — watch method section

LOW Using deprecated onChange instead of watch

Wrong:

javascript
// Deprecated method
const watcher = playground.onChange(({ code, config }) => {
  console.log('changed');
});

Correct:

javascript
// Use watch instead
const watcher = playground.watch('code', ({ code, config }) => {
  console.log('changed');
});
watcher.remove(); // When done watching

onChange is deprecated. Use watch('code', callback) instead.

Source: src/sdk/index.ts — onChange marked as deprecated

SDK Method Reference

MethodReturnsDescription
load()Promise<void>Load playground (for click-to-load mode)
run()Promise<void>Run the result page
format(allEditors?)Promise<void>Format code
getShareUrl(shortUrl?)Promise<string>Get shareable URL
getConfig(contentOnly?)Promise<Config>Get configuration
setConfig(config)Promise<Config>Update configuration
getCode()Promise<Code>Get code from all editors
show(panel, options?)Promise<void>Show specific panel
runTests()Promise<{results}>Run tests
watch(event, fn){remove()}Subscribe to events
exec(command, ...args)Promise<any>Execute custom command
destroy()Promise<void>Clean up and remove

© live-codes, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/livecodes/sdk-methods of live-codes/livecodes.

Open the folder on GitHubat commit 5754e89

Compare with similar skills

SDK Methods next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

SDK Methods compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
SDK Methods this skilllive-codes/livecodes1.5k—~2kAutomated safety check: PassMIT
Interactive HTML Playground Builderanthropics/claude-plugins-official37k1 repos~949Automated safety check: PassApache-2.0
PlaygroundArize-ai/phoenix12k—~3.9kAutomated safety check: PassCustom licence
Vuetify Playgroundvuetifyjs/vuetify41k—~730Automated safety check: PassCustom licence
Remotion Interactivityremotion-dev/remotion62k5 repos~4.7kAutomated safety check: PassCustom licence
Firecrawl Interact Integrationfirecrawl/firecrawl189k1 repos~731Automated safety check: PassISC

Similar skills

  • Interactive HTML Playground Builder

    anthropics/claude-plugins-official

    Official

    Builds a single-file HTML explorer with visual controls, a live preview and a copyable prompt, using one of six templates chosen to fit the topic.

    37k GitHub starsUsed in 1 repo~949 tokens
    Frontend & DesignAuto-check passed
  • Playground

    Arize-ai/phoenix

    Author, edit, or iterate on prompts in the Phoenix prompt playground, including running experiments over a dataset.

    12k GitHub stars~3.9k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Vuetify Playground

    vuetifyjs/vuetify

    Maintains the Vuetify repo's local Playground.vue so contributors get a realistic reproduction and a short demo they can paste into a pull request description.

    41k GitHub stars~730 tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Remotion Interactivity

    remotion-dev/remotion

    Official

    Structure Remotion markup for interactivity. An agent skill from remotion-dev/remotion.

    62k GitHub starsUsed in 5 repos~4.7k tokens
    Media & CreativeAuto-check passed
  • Guides adding Firecrawl's /interact endpoint to product code for pages that need clicks, forms, pagination or logged-in flows beyond plain scraping.

    189k GitHub starsUsed in 1 repo~731 tokens
    Data & AnalyticsAuto-check passed
  • Santa Method

    affaan-m/ECC

    Multi-agent adversarial verification: two independent reviewers with the same rubric must both pass before output ships, with a fix-and-re-review convergence loop and human escalation cap.

    274k GitHub starsUsed in 3 repos~3.1k tokens
    EducationAuto-check passed

More from live-codes/livecodes

All 15 skills in this repo
  • Language Support

    live-codes/livecodes

    Work with 90+ supported languages, compilers, CSS processors, and WASM-compiled languages for markup, style, and script editors.

    1.5k GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Configuration

    live-codes/livecodes

    Configure playground behavior through Config object, query parameters, EmbedOptions, editor settings, processors, external resources, and custom settings.

    1.5k GitHub stars~4.5k tokensUpdated yesterday
    Auto-check passed
  • Display Modes

    live-codes/livecodes

    Configure how the playground is displayed: full, focus, simple, lite, editor, codeblock, and result modes.

    1.5k GitHub stars~1.7k tokensUpdated yesterday
    Auto-check passed
  • Framework Wrappers

    live-codes/livecodes

    Use SDK with React, Vue, Svelte, Solid, Preact, and Web Components.

    1.5k GitHub stars~2.8k tokensUpdated yesterday
    Auto-check passed
  • Getting Started

    live-codes/livecodes

    Quick start for standalone app at livecodes.io, embedding playgrounds with CDN or npm, and self-hosting basics.

    1.5k GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Gh Action

    live-codes/livecodes

    Use the "Preview in LiveCodes" GitHub Action to generate preview playground links for pull request code changes.

    1.5k GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed

Questions about SDK Methods

What does SDK Methods do?

Use SDK methods to interact with playgrounds: run, getCode, setConfig, getConfig, watch, runTests, format, getShareUrl, show, destroy. SDK Methods is an agent skill from live-codes/livecodes. Use SDK methods to interact with playgrounds: run, getCode, setConfig, getConfig, watch, runTests, format, getShareUrl, show, destroy.

How do I install SDK Methods in Claude Code?

Run `npx skills add live-codes/livecodes --skill sdk-methods -a claude-code`. Or copy the skill folder (.agents/skills/livecodes/sdk-methods in live-codes/livecodes) into .claude/skills/sdk-methods in your project. Claude Code loads it when a task matches its description.

How do I install SDK Methods in Codex?

Run `npx skills add live-codes/livecodes --skill sdk-methods -a codex`. Or copy the skill folder (.agents/skills/livecodes/sdk-methods in live-codes/livecodes) into .agents/skills/sdk-methods in your project. Codex loads it when a task matches its description.

Can I use SDK Methods in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add live-codes/livecodes --skill sdk-methods -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sdk-methods, .gemini/skills/sdk-methods, .github/skills/sdk-methods and .opencode/skills/sdk-methods in your project.

What does SDK Methods need to run?

SKILL.md names no scripts, command-line tools or credentials: SDK Methods is instructions for the agent only.

Does SDK Methods access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is SDK Methods safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does SDK Methods use?

SDK Methods is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does SDK Methods use?

About 2k tokens (SKILL.md is roughly 8.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to SDK Methods?

Skills that share tags, products or a category with SDK Methods: Interactive HTML Playground Builder (anthropics/claude-plugins-official, 37k stars), Playground (Arize-ai/phoenix, 12k stars), Vuetify Playground (vuetifyjs/vuetify, 41k stars) and Remotion Interactivity (remotion-dev/remotion, 62k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains SDK Methods?

live-codes (a GitHub organization) maintains it in live-codes/livecodes, which has 1,512 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on October 6, 2026.

Source: live-codes/livecodes on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.