Agent skill

Use Dom

by mweinbach in mweinbach/agent-coworker

Use Expo DOM components to run web code in a webview on native and as-is on web.

MITAuto-check passedMobile

Install Use Dom

skills CLI
$ npx skills add mweinbach/agent-coworker --skill use-dom -a claude-code

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

GitHub CLI
$ gh skill install mweinbach/agent-coworker use-dom --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/mweinbach/agent-coworker.git skills-src && mkdir -p .claude/skills && cp -r skills-src/apps/mobile/.agents/skills/use-dom .claude/skills/use-dom && 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
use-dom
GitHub stars
156
Used in
5 other repos
Token cost
~2.4k tokens
SKILL.md length
494 words
Files
1
Skills in repo
8
Repo updated
First seen
Licence
MIT

At a glance

Use Expo DOM components to run web code in a webview on native and as-is on web.

  • Works in 5 steps: Must have 'use dom'; directive at the… → Single default export — One React… → Own file — Cannot be defined inline or… → …
  • Tasks that involve Cross-platform mobile apps
  • SKILL.md covers What are DOM Components?, When to Use DOM Components, When NOT to Use DOM Components and Basic DOM Component, plus 11 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Use Dom is an agent skill from mweinbach/agent-coworker. Use Expo DOM components to run web code in a webview on native and as-is on web. Migrate web code to native incrementally.

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

It sits in Mobile, covering Cross-platform mobile apps. It works with Expo and React. The repository describes itself as: Terminal-first coworker agent (Bun + OpenTUI). The licence is MIT.

When your agent uses it

  • Tasks that involve Cross-platform mobile apps

Example prompts

  • “/use-dom”

Workflow steps

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

  1. Must have 'use dom'; directive at the top of the file
  2. Single default export — One React component per file
  3. Own file — Cannot be defined inline or combined with native components
  4. Serializable props only — Strings, numbers, booleans, arrays, plain objects
  5. Include CSS in the component file — DOM components run in isolated context

What it can do on your machine

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

Use Dom loads about 2.4k tokens when it runs. Until then it costs about 33 tokens; SKILL.md has 494 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~33
When it runs · the whole SKILL.md, loaded when a task matches
~2.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 mweinbach/agent-coworker at commit aab9dc6, republished under its MIT licence (© mweinbach). 494 words, ~2,419 tokens.

Download SKILL.mdSave it as .claude/skills/use-dom/SKILL.md (or your agent's skills folder).
name
use-dom
description
Use Expo DOM components to run web code in a webview on native and as-is on web. Migrate web code to native incrementally.
version
1.0.0
license
MIT

What are DOM Components?

DOM components allow web code to run verbatim in a webview on native platforms while rendering as-is on web. This enables using web-only libraries like recharts, react-syntax-highlighter, or any React web library in your Expo app without modification.

When to Use DOM Components

Use DOM components when you need:

  • Web-only libraries — Charts (recharts, chart.js), syntax highlighters, rich text editors, or any library that depends on DOM APIs
  • Migrating web code — Bring existing React web components to native without rewriting
  • Complex HTML/CSS layouts — When CSS features aren't available in React Native
  • iframes or embeds — Embedding external content that requires a browser context
  • Canvas or WebGL — Web graphics APIs not available natively

When NOT to Use DOM Components

Avoid DOM components when:

  • Native performance is critical — Webviews add overhead
  • Simple UI — React Native components are more efficient for basic layouts
  • Deep native integration — Use local modules instead for native APIs
  • Layout routes — _layout files cannot be DOM components

Basic DOM Component

Create a new file with the 'use dom'; directive at the top:

tsx
// components/WebChart.tsx
"use dom";

export default function WebChart({
  data,
}: {
  data: number[];
  dom: import("expo/dom").DOMProps;
}) {
  return (
    <div style={{ padding: 20 }}>
      <h2>Chart Data</h2>
      <ul>
        {data.map((value, i) => (
          <li key={i}>{value}</li>
        ))}
      </ul>
    </div>
  );
}

Rules for DOM Components

  1. Must have 'use dom'; directive at the top of the file
  2. Single default export — One React component per file
  3. Own file — Cannot be defined inline or combined with native components
  4. Serializable props only — Strings, numbers, booleans, arrays, plain objects
  5. Include CSS in the component file — DOM components run in isolated context

The dom Prop

Every DOM component receives a special dom prop for webview configuration. Always type it in your props:

tsx
"use dom";

interface Props {
  content: string;
  dom: import("expo/dom").DOMProps;
}

export default function MyComponent({ content }: Props) {
  return <div>{content}</div>;
}
Common dom Prop Options
tsx
// Disable body scrolling
<DOMComponent dom={{ scrollEnabled: false }} />

// Flow under the notch (disable safe area insets)
<DOMComponent dom={{ contentInsetAdjustmentBehavior: "never" }} />

// Control size manually
<DOMComponent dom={{ style: { width: 300, height: 400 } }} />

// Combine options
<DOMComponent
  dom={{
    scrollEnabled: false,
    contentInsetAdjustmentBehavior: "never",
    style: { width: '100%', height: 500 }
  }}
/>

Exposing Native Actions to the Webview

Pass async functions as props to expose native functionality to the DOM component:

tsx
// app/index.tsx (native)
import { Alert } from "react-native";
import DOMComponent from "@/components/dom-component";

export default function Screen() {
  return (
    <DOMComponent
      showAlert={async (message: string) => {
        Alert.alert("From Web", message);
      }}
      saveData={async (data: { name: string; value: number }) => {
        // Save to native storage, database, etc.
        console.log("Saving:", data);
        return { success: true };
      }}
    />
  );
}
tsx
// components/dom-component.tsx
"use dom";

interface Props {
  showAlert: (message: string) => Promise<void>;
  saveData: (data: {
    name: string;
    value: number;
  }) => Promise<{ success: boolean }>;
  dom?: import("expo/dom").DOMProps;
}

export default function DOMComponent({ showAlert, saveData }: Props) {
  const handleClick = async () => {
    await showAlert("Hello from the webview!");
    const result = await saveData({ name: "test", value: 42 });
    console.log("Save result:", result);
  };

  return <button onClick={handleClick}>Trigger Native Action</button>;
}

Using Web Libraries

DOM components can use any web library:

tsx
// components/syntax-highlight.tsx
"use dom";

import SyntaxHighlighter from "react-syntax-highlighter";
import { docco } from "react-syntax-highlighter/dist/esm/styles/hljs";

interface Props {
  code: string;
  language: string;
  dom?: import("expo/dom").DOMProps;
}

export default function SyntaxHighlight({ code, language }: Props) {
  return (
    <SyntaxHighlighter language={language} style={docco}>
      {code}
    </SyntaxHighlighter>
  );
}
tsx
// components/chart.tsx
"use dom";

import {
  LineChart,
  Line,
  XAxis,
  YAxis,
  CartesianGrid,
  Tooltip,
} from "recharts";

interface Props {
  data: Array<{ name: string; value: number }>;
  dom: import("expo/dom").DOMProps;
}

export default function Chart({ data }: Props) {
  return (
    <LineChart width={400} height={300} data={data}>
      <CartesianGrid strokeDasharray="3 3" />
      <XAxis dataKey="name" />
      <YAxis />
      <Tooltip />
      <Line type="monotone" dataKey="value" stroke="#8884d8" />
    </LineChart>
  );
}
Show full SKILL.md (206 more words)Show less

CSS in DOM Components

CSS imports must be in the DOM component file since they run in isolated context:

tsx
// components/styled-component.tsx
"use dom";

import "@/styles.css"; // CSS file in same directory

export default function StyledComponent({
  dom,
}: {
  dom: import("expo/dom").DOMProps;
}) {
  return (
    <div className="container">
      <h1 className="title">Styled Content</h1>
    </div>
  );
}

Or use inline styles / CSS-in-JS:

tsx
"use dom";

const styles = {
  container: {
    padding: 20,
    backgroundColor: "#f0f0f0",
  },
  title: {
    fontSize: 24,
    color: "#333",
  },
};

export default function StyledComponent({
  dom,
}: {
  dom: import("expo/dom").DOMProps;
}) {
  return (
    <div style={styles.container}>
      <h1 style={styles.title}>Styled Content</h1>
    </div>
  );
}

Expo Router in DOM Components

The expo-router <Link /> component and router API work inside DOM components:

tsx
"use dom";

import { Link, useRouter } from "expo-router";

export default function Navigation({
  dom,
}: {
  dom: import("expo/dom").DOMProps;
}) {
  const router = useRouter();

  return (
    <nav>
      <Link href="/about">About</Link>
      <button onClick={() => router.push("/settings")}>Settings</button>
    </nav>
  );
}
Router APIs That Require Props

These hooks don't work directly in DOM components because they need synchronous access to native routing state:

  • useLocalSearchParams()
  • useGlobalSearchParams()
  • usePathname()
  • useSegments()
  • useRootNavigation()
  • useRootNavigationState()

Solution: Read these values in the native parent and pass as props:

tsx
// app/[id].tsx (native)
import { useLocalSearchParams, usePathname } from "expo-router";
import DOMComponent from "@/components/dom-component";

export default function Screen() {
  const { id } = useLocalSearchParams();
  const pathname = usePathname();

  return <DOMComponent id={id as string} pathname={pathname} />;
}
tsx
// components/dom-component.tsx
"use dom";

interface Props {
  id: string;
  pathname: string;
  dom?: import("expo/dom").DOMProps;
}

export default function DOMComponent({ id, pathname }: Props) {
  return (
    <div>
      <p>Current ID: {id}</p>
      <p>Current Path: {pathname}</p>
    </div>
  );
}

Detecting DOM Environment

Check if code is running in a DOM component:

tsx
"use dom";

import { IS_DOM } from "expo/dom";

export default function Component({
  dom,
}: {
  dom?: import("expo/dom").DOMProps;
}) {
  return <div>{IS_DOM ? "Running in DOM component" : "Running natively"}</div>;
}

Assets

Prefer requiring assets instead of using the public directory:

tsx
"use dom";

// Good - bundled with the component
const logo = require("../assets/logo.png");

export default function Component({
  dom,
}: {
  dom: import("expo/dom").DOMProps;
}) {
  return <img src={logo} alt="Logo" />;
}

Usage from Native Components

Import and use DOM components like regular components:

tsx
// app/index.tsx
import { View, Text } from "react-native";
import WebChart from "@/components/web-chart";
import CodeBlock from "@/components/code-block";

export default function HomeScreen() {
  return (
    <View style={{ flex: 1 }}>
      <Text>Native content above</Text>

      <WebChart data={[10, 20, 30, 40, 50]} dom={{ style: { height: 300 } }} />

      <CodeBlock
        code="const x = 1;"
        language="javascript"
        dom={{ scrollEnabled: true }}
      />

      <Text>Native content below</Text>
    </View>
  );
}

Platform Behavior

PlatformBehavior
iOSRendered in WKWebView
AndroidRendered in WebView
WebRendered as-is (no webview wrapper)

On web, the dom prop is ignored since no webview is needed.

Tips

  • DOM components hot reload during development
  • Keep DOM components focused — don't put entire screens in webviews
  • Use native components for navigation chrome, DOM components for specialized content
  • Test on all platforms — web rendering may differ slightly from native webviews
  • Large DOM components may impact performance — profile if needed
  • The webview has its own JavaScript context — cannot directly share state with native

© mweinbach, 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 apps/mobile/.agents/skills/use-dom of mweinbach/agent-coworker.

Open the folder on GitHubat commit aab9dc6

Used in 5 other repositories

We found 11 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 5 other GitHub owners. This page covers the copy in mweinbach/agent-coworker, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Use Dom 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.

Use Dom compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Use Dom this skillmweinbach/agent-coworker1565 repos~2.4kAutomated safety check: PassMIT
Screenmapaleqsio/screenmap243—~7.2kAutomated safety check: PassMIT
Lovdacnlovdacn/ui107—~3.9kAutomated safety check: PassMIT
ThemingCode-with-Beto/skills140—~2.5kAutomated safety check: PassNone
Stream React Nativeadrianhajdin/react-native-lingua152—~2.8kAutomated safety check: PassNone
Expo Upgradeexpo/skills2.7k9 repos~1.9kAutomated safety check: PassMIT

Similar skills

  • Screenmap

    aleqsio/screenmap

    Generate a visual navigation map of an Expo / React Native or NativeScript app.

    243 GitHub stars~7.2k tokensUpdated 5 days ago
    MobileAuto-check passed
  • Lovdacn

    lovdacn/ui

    Manages lovdacn (lvcn) components and projects for Expo & React Native — adding, initializing, fixing, debugging, styling, theming, and composing UI with NativeWind or Uniwind.

    107 GitHub stars~3.9k tokensUpdated 1 mo ago
    MobileAuto-check passed
  • Theming

    Code-with-Beto/skills

    Scaffold a unified, cross-platform color theme system into an Expo Router app.

    140 GitHub stars~2.5k tokensUpdated 2 mo ago
    MobileAuto-check passed
  • Stream React Native

    adrianhajdin/react-native-lingua

    Create, build, and integrate Stream Chat React Native apps in React Native Community CLI and Expo.

    152 GitHub stars~2.8k tokensUpdated 4 mo ago
    MobileAuto-check passed
  • Expo Upgrade

    expo/skills

    Official

    Guidelines for upgrading Expo SDK versions and fixing dependency issues

    2.7k GitHub starsUsed in 9 repos~1.9k tokens
    MobileAuto-check passed
  • React Native Expert

    tech-leads-club/agent-skills

    Guides React Native and Expo work for cross-platform apps: Expo Router navigation, fast lists, Reanimated animation, platform-specific code and project structure.

    7k GitHub stars~3.2k tokensUpdated yesterday
    MobileAuto-check passed

More from mweinbach/agent-coworker

All 8 skills in this repo
  • AI Elements Chat Components

    mweinbach/agent-coworker

    Adds AI Elements components such as conversations, messages, tool displays and prompt inputs to a Next.js project that uses shadcn/ui.

    156 GitHub starsUsed in 5 repos~1.8k tokens
    Auto-check passed
  • Expo Brownfield Integration

    mweinbach/agent-coworker

    Helps add Expo and React Native to an existing native iOS or Android app, and choose between a prebuilt AAR or XCFramework and a fully integrated build.

    156 GitHub starsUsed in 2 repos~900 tokens
    Auto-check: notes
  • Bun Runtime and Toolkit

    mweinbach/agent-coworker

    Quick reference for using Bun to run TypeScript and JavaScript, install packages, bundle code, run tests and serve HTTP, with the key files and commands.

    156 GitHub stars~2.2k tokensUpdated yesterday
    Auto-check: notes
  • Workflow

    mweinbach/agent-coworker

    Author and run a deterministic multi-agent workflow — a JavaScript script that fans out, pipelines, loops, and judges across many child agents.

    156 GitHub stars~2.6k tokensUpdated yesterday
    Auto-check passed
  • Improve Animations

    mweinbach/agent-coworker

    Audit a codebase's animation and motion, produce prioritized improvement plans, and execute selected plans when requested.

    156 GitHub stars~2.5k tokensUpdated yesterday
    Auto-check passed
  • Memories

    mweinbach/agent-coworker

    A skill your agent uses when the user asks to view, list, inspect, add, create, edit, correct, update, or manage long-term memories for the current chat or workspace.

    156 GitHub stars~547 tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Use Dom

What does Use Dom do?

Use Expo DOM components to run web code in a webview on native and as-is on web. Use Dom is an agent skill from mweinbach/agent-coworker. Use Expo DOM components to run web code in a webview on native and as-is on web.

When should I use Use Dom?

Use Dom fits situations like: tasks that involve Cross-platform mobile apps.

How do I install Use Dom in Claude Code?

Run `npx skills add mweinbach/agent-coworker --skill use-dom -a claude-code`. Or copy the skill folder (apps/mobile/.agents/skills/use-dom in mweinbach/agent-coworker) into .claude/skills/use-dom in your project. Claude Code loads it when a task matches its description.

How do I install Use Dom in Codex?

Run `npx skills add mweinbach/agent-coworker --skill use-dom -a codex`. Or copy the skill folder (apps/mobile/.agents/skills/use-dom in mweinbach/agent-coworker) into .agents/skills/use-dom in your project. Codex loads it when a task matches its description.

Can I use Use Dom 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 mweinbach/agent-coworker --skill use-dom -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/use-dom, .gemini/skills/use-dom, .github/skills/use-dom and .opencode/skills/use-dom in your project.

What does Use Dom need to run?

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

Does Use Dom 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 Use Dom 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 Use Dom use?

Use Dom is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Use Dom use?

About 2.4k tokens (SKILL.md is roughly 9.7k 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 Use Dom?

Skills that share tags, products or a category with Use Dom: Screenmap (aleqsio/screenmap, 243 stars), Lovdacn (lovdacn/ui, 107 stars), Theming (Code-with-Beto/skills, 140 stars) and Stream React Native (adrianhajdin/react-native-lingua, 152 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Use Dom?

mweinbach (a GitHub user) maintains it in mweinbach/agent-coworker, which has 156 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on October 8, 2026.

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