Agent skill

UI API Decoupling

by openchamber in openchamber/openchamber

A skill your agent uses when creating or modifying OpenChamber shared UI data access, OpenCode SDK calls, RuntimeAPIs, runtime fetch/auth/URLs, authenticated browser assets, bridges/proxies, runtime…

MITAuto-check passed

Install UI API Decoupling

skills CLI
$ npx skills add openchamber/openchamber --skill ui-api-decoupling -a claude-code

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

GitHub CLI
$ gh skill install openchamber/openchamber ui-api-decoupling --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/openchamber/openchamber.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/ui-api-decoupling .claude/skills/ui-api-decoupling && 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
ui-api-decoupling
GitHub stars
11k
Token cost
~2k tokens
SKILL.md length
981 words
Files
4 (incl. references)
Skills in repo
20
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when creating or modifying OpenChamber shared UI data access, OpenCode SDK calls, RuntimeAPIs, runtime fetch/auth/URLs, authenticated browser assets, bridges/proxies, runtime…

  • Works in 12 steps: Do not bypass the SDK for official… → Keep OpenChamber routes explicit.… → Use runtime APIs for runtime-owned… → …
  • Modifying OpenChamber shared UI data access
  • SKILL.md covers Core Boundary, Classify First, Name The Surfaces Before Editing and Load References By Task, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

UI API Decoupling is an agent skill from openchamber/openchamber. Use when creating or modifying OpenChamber shared UI data access, OpenCode SDK calls, RuntimeAPIs, runtime fetch/auth/URLs, authenticated browser assets, bridges/proxies, runtime switching, or server API routes.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/browser-assets-and-auth.md`, `references/implementation-map.md` and `references/runtime-parity.md`).

The repository describes itself as: Agentic Development Environment based on OpenCode AI agent. The licence is MIT.

When your agent uses it

  • Modifying OpenChamber shared UI data access
  • OpenCode SDK calls
  • Runtime fetch/auth/URLs
  • Authenticated browser assets

Example prompts

  • “/ui-api-decoupling”

Workflow steps

12 steps, taken from the first numbered list in SKILL.md.

  1. Do not bypass the SDK for official OpenCode APIs. Preserve SDK-generated method, body, headers, query, auth, and abort signal.
  2. Keep OpenChamber routes explicit. Register them before the generic OpenCode proxy.
  3. Use runtime APIs for runtime-owned capabilities. Components consume hooks/providers, not runtime globals.
  4. Resolve runtime state at call time. Do not cache runtime base URLs, resolver output, credentials, or SDK clients across endpoint switches.
  5. Let transport own auth. HTTP uses runtime bearer handling; browser/realtime URLs use scoped short-lived URL auth where headers are…
  6. Never put long-lived client credentials in URLs. Do not manually append URL tokens.
  7. Define runtime parity explicitly. Shared UI needs deliberate web, Electron, VS Code, hosted-mobile, and Capacitor behavior or stable…
  8. Authoritative fetches must signal failure. Do not convert failure into a valid empty value that callers use to clear state.
  9. Keep privileges at the native/runtime boundary. UI visibility and prompts are not authorization.
  10. Confirm trust-boundary mutations. Host imports, credential writes, privileged deep links, and runtime switching require explicit user…
  11. Parse at the boundary. Treat external, persisted, bridge, IPC, and network payloads as unknown until a schema, parser, or narrow…
  12. Model the real contract. Prefer precise result/state unions and required dependencies over loose strings, boolean combinations, optional…

What it can do on your machine

Read from SKILL.md and the folder at commit eabe419. 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 typescript).

    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

UI API Decoupling loads about 2k tokens when it runs, and up to ~4k if it reads all its reference files. Until then it costs about 58 tokens; SKILL.md has 981 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~58
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4k

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 openchamber/openchamber at commit eabe419, republished under its MIT licence (© openchamber). 981 words, ~2,001 tokens.

Download SKILL.mdSave it as .claude/skills/ui-api-decoupling/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
ui-api-decoupling
description
Use when creating or modifying OpenChamber shared UI data access, OpenCode SDK calls, `RuntimeAPIs`, runtime fetch/auth/URLs, authenticated browser assets, bridges/proxies, runtime switching, or server API routes.

UI API Decoupling

Core Boundary

  • Official OpenCode API calls use @opencode/client (OpenCode 2.x, /api/* routes) through opencodeClient; only packages/ui/src/lib/opencode/ may see wire types, everything else uses the domain model in lib/opencode/model.ts.
  • OpenChamber-owned HTTP capabilities use RuntimeAPIs where runtime-specific behavior exists, otherwise explicit OpenChamber routes through runtimeFetch.
  • Browser/realtime consumers use shared runtime URL/socket helpers.
  • Shared UI never hardcodes localhost, ports, API origins, credentials, or one runtime's transport assumptions.
  • Treat runtime adapters as the imperative shell: they own transport, auth, serialization, and platform mechanics. Shared feature code receives trusted contracts and owns domain decisions.

Classify First

NeedCorrect path
Official OpenCode endpointopencodeClient or its SDK client
SDK gap for official OpenCodeNarrow documented wrapper in opencodeClient preserving request fidelity
OpenChamber HTTP routeruntimeFetch('/api/...')
Runtime-owned capabilityExtend RuntimeAPIs and implement each applicable runtime
Browser-owned authenticated URLRuntime URL resolver and scoped URL auth
SSE/WebSocketOwning realtime transport; also load relay-transport

Name The Surfaces Before Editing

Before writing code that changes what a user can reach or do, write the surface list: every runtime this behavior exists on, and one line per runtime saying what happens there. Runtimes are web, Electron desktop, VS Code, hosted mobile, and Capacitor mobile.

The step is done when no runtime is missing a line. "Not applicable" is a line; silence is not. A stable unsupported response is a valid outcome, an accidental fallthrough is not.

Carry the list into the pull request description, which asks for the same table. It is the same artifact: written once while deciding, restated once while handing off. A surface you cannot answer for is the finding — say so in the list rather than leaving the row blank.

This applies to any user-reachable behavior, not only shared UI data access. A sequence that spans native shell, server, and renderer has surfaces too; so does a capability that only one runtime implements today.

Load References By Task

TaskRequired reference
Iframes, downloads, raw images, object URLs, URL tokensreferences/browser-assets-and-auth.md
Adding runtime capabilities, VS Code behavior, Electron privilege/security, unsupported runtime behaviorreferences/runtime-parity.md
Locating implementations, route registration, runtime switching, or focused testsreferences/implementation-map.md

Load every matching reference before editing.

Mandatory Rules

  1. Do not bypass the SDK for official OpenCode APIs. Preserve SDK-generated method, body, headers, query, auth, and abort signal.
  2. Keep OpenChamber routes explicit. Register them before the generic OpenCode proxy.
  3. Use runtime APIs for runtime-owned capabilities. Components consume hooks/providers, not runtime globals.
  4. Resolve runtime state at call time. Do not cache runtime base URLs, resolver output, credentials, or SDK clients across endpoint switches.
  5. Let transport own auth. HTTP uses runtime bearer handling; browser/realtime URLs use scoped short-lived URL auth where headers are impossible.
  6. Never put long-lived client credentials in URLs. Do not manually append URL tokens.
  7. Define runtime parity explicitly. Shared UI needs deliberate web, Electron, VS Code, hosted-mobile, and Capacitor behavior or stable unsupported responses.
  8. Authoritative fetches must signal failure. Do not convert failure into a valid empty value that callers use to clear state.
  9. Keep privileges at the native/runtime boundary. UI visibility and prompts are not authorization.
  10. Confirm trust-boundary mutations. Host imports, credential writes, privileged deep links, and runtime switching require explicit user intent.
  11. Parse at the boundary. Treat external, persisted, bridge, IPC, and network payloads as unknown until a schema, parser, or narrow constructor produces the trusted type consumed by shared code. Do not validate fields and then continue passing the raw payload.
  12. Model the real contract. Prefer precise result/state unions and required dependencies over loose strings, boolean combinations, optional callback bags, any, or repeated casts. Make unsupported runtime behavior and failure distinct from valid empty success.
  13. Keep adapters deep and bridges thin. Hide meaningful protocol or platform mechanics behind an intention-revealing runtime operation; do not add pass-through layers that only rename SDK, fetch, or bridge calls.
  14. Scope every OpenCode read to the directory being worked in. A directory-scoped read makes OpenCode start that location with all its MCP servers, so a read names the current directory (UI) or the lifecycle's default directory (server), and one read per known project is a fan-out. Which routes and why: opencode-v2, Every directory-scoped read starts a location.
Show full SKILL.md (284 more words)Show less

HTTP Decision Rules

Pass route paths directly to runtimeFetch:

ts
await runtimeFetch('/health');
await runtimeFetch('/api/config/settings');
await runtimeFetch('/api/fs/raw', { query: { path } });

Do not immediately fetch a URL produced by getRuntimeUrlResolver(). Use the resolver only when the browser/realtime API itself consumes the URL:

ts
const imageSrc = getRuntimeUrlResolver().authenticatedAsset('/api/fs/raw?path=diagram.png');
const eventUrl = getRuntimeUrlResolver().sse('/api/event');

Plain fetch is reserved for intentional external origins that are not the active OpenChamber/OpenCode runtime.

Runtime Switch Safety

Review runtime base URL, auth, SDK clients, terminal/realtime transports, stores, session memory, and caches. Key caches by runtime identity where IDs, paths, or URLs can collide. Reset or reconnect affected state through the established runtime-switch flow.

Re-parse values obtained after a switch at their owning boundary. A type established for one runtime response does not make cached raw data from another runtime trustworthy.

Common Anti-Patterns

AvoidUse
Raw feature fetch to official OpenCodeSDK wrapper/client
Component reads runtime globalsuseRuntimeAPIs() / provider
Hardcoded runtime URLruntimeFetch or runtime URL resolver
Browser URL containing bearer/client tokenScoped URL-auth helper
Web-only shared routeExplicit VS Code/mobile decision
Returning [] after authoritative fetch failureThrow or distinct failure result
Rebuilding SDK Request from URL onlyPreserve original request body/headers/signal
Component validates unknown JSON then passes it onwardAdapter parses once and returns a trusted contract
Boolean/nullable combinations for exclusive outcomesDiscriminated result or state union

Verification

  • Official calls use SDK paths or documented SDK-gap wrappers.
  • OpenChamber routes win before generic proxy fallback.
  • Request fidelity, auth, abort, query, and body behavior are tested.
  • Browser/realtime auth uses narrow allowlists and scoped tokens.
  • Every applicable runtime has implementation or explicit unsupported behavior, and the surface list written before editing has a line for each.
  • Runtime switching cannot reuse stale endpoint/auth/cache state.
  • Privileged Electron/extension behavior is enforced outside the renderer.
  • Focused transport, bridge, proxy, auth, and runtime tests pass; static type/lint checks alone are insufficient.

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

Files

SKILL.md and 3 other files (references) in .agents/skills/ui-api-decoupling of openchamber/openchamber.

  • SKILL.md
  • references/browser-assets-and-auth.md
  • references/implementation-map.md
  • references/runtime-parity.md

Open the folder on GitHubat commit eabe419

Compare with similar skills

UI API Decoupling 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.

UI API Decoupling compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
UI API Decoupling this skillopenchamber/openchamber11k—~2kAutomated safety check: PassMIT
Gameobject ModifyIvanMurzak/Unity-MCP4.4k—~2.3kAutomated safety check: PassApache-2.0
Object ModifyIvanMurzak/Unity-MCP4.4k—~2.3kAutomated safety check: PassApache-2.0
Assets ModifyIvanMurzak/Unity-MCP4.4k1 repos~1.7kAutomated safety check: PassApache-2.0
Modifying Taxonomic FilterPostHog/posthog40k—~2.8kAutomated safety check: PassCustom licence
Migrating To Modifier NoderosuH/EasyWatermark1.9k1 repos~5kAutomated safety check: PassApache-2.0

Similar skills

  • Gameobject Modify

    IvanMurzak/Unity-MCP

    Modify GameObject fields and properties in opened Prefab or in a Scene.

    4.4k GitHub stars~2.3k tokensUpdated 4 days ago
    Game DevelopmentAuto-check passed
  • Object Modify

    IvanMurzak/Unity-MCP

    Modify a Unity UnityEngine.Object's serializable fields/properties.

    4.4k GitHub stars~2.3k tokensUpdated 4 days ago
    Game DevelopmentAuto-check passed
  • Assets Modify

    IvanMurzak/Unity-MCP

    Modify an asset file in the project. An agent skill from IvanMurzak/Unity-MCP.

    4.4k GitHub starsUsed in 1 repo~1.7k tokens
    Game DevelopmentAuto-check passed
  • Official

    Guides safe changes to the TaxonomicFilter, PostHog's picker for events, actions, properties, cohorts, and more.

    40k GitHub stars~2.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Migrating To Modifier Node

    rosuH/EasyWatermark

    A skill your agent uses to author new custom Jetpack Compose modifiers and migrate legacy ones from Modifier.composed { } to Modifier.Node + ModifierNodeElement<T.

    1.9k GitHub starsUsed in 1 repo~5k tokens
    MobileAuto-check passed
  • Gameobject Component Modify

    IvanMurzak/Unity-MCP

    Modify a specific Component on a GameObject in opened Prefab or in a Scene.

    4.4k GitHub stars~2.8k tokensUpdated 4 days ago
    Game DevelopmentAuto-check passed

More from openchamber/openchamber

All 20 skills in this repo
  • Theme System

    openchamber/openchamber

    A skill your agent uses when creating or modifying OpenChamber UI components, styling, colors, buttons, visual states, themes, or icons.

    11k GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Drag To Reorder

    openchamber/openchamber

    A skill your agent uses when implementing or modifying OpenChamber sortable or drag-to-reorder behavior, especially @dnd-kit, touch/mobile interactions, variable-width items, or wrapping layouts.

    11k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Locale UI Patterns

    openchamber/openchamber

    A skill your agent uses when creating or modifying OpenChamber UI text, labels, buttons, placeholders, aria labels, empty states, toasts, dialogs, settings copy, navigation labels, or any…

    11k GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Performance Engineering

    openchamber/openchamber

    A skill your agent uses when implementing or reviewing code on interaction, render, event, polling, synchronization, list-processing, store-selector, cache, indexing, or high-volume data paths; when…

    11k GitHub stars~4.9k tokensUpdated today
    Auto-check passed
  • Serve Sim

    openchamber/openchamber

    A skill your agent uses when working with the OpenChamber iOS Simulator app without opening Xcode - boot/install/launch the Capacitor iOS app, start a browser stream, tap/type/gesture/rotate…

    11k GitHub stars~619 tokensUpdated today
    Auto-check passed
  • Clack CLI Patterns

    openchamber/openchamber

    A skill your agent uses when creating or modifying OpenChamber CLI commands, prompts, terminal output, non-TTY behavior, --quiet, or --json behavior.

    11k GitHub stars~1.5k tokensUpdated today
    Auto-check passed

Questions about UI API Decoupling

What does UI API Decoupling do?

A skill your agent uses when creating or modifying OpenChamber shared UI data access, OpenCode SDK calls, RuntimeAPIs, runtime fetch/auth/URLs, authenticated browser assets, bridges/proxies, runtime…. UI API Decoupling is an agent skill from openchamber/openchamber. Use when creating or modifying OpenChamber shared UI data access, OpenCode SDK calls, RuntimeAPIs, runtime fetch/auth/URLs, authenticated browser assets, bridges/proxies, runtime switching, or server API routes.

When should I use UI API Decoupling?

UI API Decoupling fits situations like: modifying OpenChamber shared UI data access; openCode SDK calls; runtime fetch/auth/URLs; authenticated browser assets.

How do I install UI API Decoupling in Claude Code?

Run `npx skills add openchamber/openchamber --skill ui-api-decoupling -a claude-code`. Or copy the skill folder (.agents/skills/ui-api-decoupling in openchamber/openchamber) into .claude/skills/ui-api-decoupling in your project. Claude Code loads it when a task matches its description.

How do I install UI API Decoupling in Codex?

Run `npx skills add openchamber/openchamber --skill ui-api-decoupling -a codex`. Or copy the skill folder (.agents/skills/ui-api-decoupling in openchamber/openchamber) into .agents/skills/ui-api-decoupling in your project. Codex loads it when a task matches its description.

Can I use UI API Decoupling 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 openchamber/openchamber --skill ui-api-decoupling -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ui-api-decoupling, .gemini/skills/ui-api-decoupling, .github/skills/ui-api-decoupling and .opencode/skills/ui-api-decoupling in your project.

What does UI API Decoupling need to run?

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

Does UI API Decoupling 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 UI API Decoupling 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 UI API Decoupling use?

UI API Decoupling 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 UI API Decoupling use?

About 2k tokens (SKILL.md is roughly 8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2k tokens, read only when the agent opens those files.

What are the alternatives to UI API Decoupling?

Skills that share tags, products or a category with UI API Decoupling: Gameobject Modify (IvanMurzak/Unity-MCP, 4.4k stars), Object Modify (IvanMurzak/Unity-MCP, 4.4k stars), Assets Modify (IvanMurzak/Unity-MCP, 4.4k stars) and Modifying Taxonomic Filter (PostHog/posthog, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains UI API Decoupling?

openchamber (a GitHub organization) maintains it in openchamber/openchamber, which has 11,259 GitHub stars. The repository holds 20 skills in this directory. The repository was last updated on October 8, 2026.

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