Agent skill

Compose Atoms

by lobehub in lobehub/lobehub

Splits a heavy front-end domain into capability atoms that each host imports separately, sinking state into each atom instead of adding mode or readOnly flags.

Custom licenceAuto-check passedFrontend & Design

Install Compose Atoms

skills CLI
$ npx skills add lobehub/lobehub --skill compose-atoms -a claude-code

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

GitHub CLI
$ gh skill install lobehub/lobehub compose-atoms --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/lobehub/lobehub.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/compose-atoms .claude/skills/compose-atoms && 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
compose-atoms
GitHub stars
83k
Token cost
~2.6k tokens
SKILL.md length
1,242 words
Files
1
Skills in repo
50
Repo updated
First seen
Licence
Custom licence

At a glance

Splits a heavy front-end domain into capability atoms that each host imports separately, sinking state into each atom instead of adding mode or readOnly flags.

  • Works in 10 steps: List hosts (page, portal, share, mobile,… → List capabilities as verbs (view… → Set grain: each verb a host can skip is… → …
  • Adding a second host, such as a share page, to a feature built for one
  • SKILL.md covers When, Grain, Sink State and Kit, plus 5 more sections
  • Calls bun

What it does

The skill applies to a product surface such as Conversation, Document or Task where one entry owns reading, writing, workflow and host integration, or where a second host such as a portal, share view or micro-app is the next change. The idea is that a heavy domain is a kit, not a viewer with modes. Each host is an import list, an atom owns the data, actions and dependencies of one capability, and the assembler only chooses what to mount. It is a module-graph split, because hiding UI does not drop a module; only a host that never imports a file avoids shipping it.

Grain is set by one test: would any host ship the rest and skip this piece? If so, it is an atom. A workflow can be one atom and is split further only if a host would mount part of it alone. State has to sink into the atom, since imports follow the hook, and a store hook left on the page keeps its module on every host that mounts the page. Slicing one large component into smaller files is out of scope and belongs to the react skill.

When your agent uses it

  • Adding a second host, such as a share page, to a feature built for one
  • Replacing a growing set of mode or readOnly props on one big viewer
  • Moving domain state out of a page and into the capability that uses it

Example prompts

  • “Our Document viewer needs a read-only share page. Split it into atoms instead of adding another flag.”
  • “Refactor the Task page so the portal host can mount only the list and decision parts.”
  • “Check whether the store hooks on this page keep unused modules in the share build.”

Workflow steps

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

  1. List hosts (page, portal, share, mobile, popup, micro-app — include the next one).
  2. List capabilities as verbs (view identity, edit field, decide, open host thing). Map host → verbs.
  3. Set grain: each verb a host can skip is an atom. Group the rest under a parent.
  4. Extract primitives and the isolated read hook first.
  5. Extract read atoms. Optional same-domain capabilities become ReactNode slots, not callbacks that close over write modules.
  6. Extract each write / workflow atom into its own file. Heavy deps stay in that file.
  7. Sink state. Move fetch, view-model, transient UI, and handlers out of the assembler. If the page still calls a domain hook to feed props…
  8. Rewrite every host as an import list plus layout. Delete readOnly / isPublic / mode / variant on the fat tree.
  9. Point light hosts at atoms by deep path.
  10. Prove the cut. Grep the light entry's import tree, or trace a module the light host must not ship. A missing button is not proof.

What it can do on your machine

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

    Shell commands in SKILL.md call:

    • bun

    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

Compose Atoms loads about 2.6k tokens when it runs. Until then it costs about 51 tokens; SKILL.md has 1,242 words of instructions outside code blocks.

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

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

Its licence (Custom licence) doesn't allow us to republish the file, so here is its outline and opening line. It has 1,242 words (~2,632 tokens).

“A heavy domain is a kit, not a viewer with modes. Each host is an import list. An atom owns the data, actions, and dependencies of one capability. The assembler only chooses what to mount.”

— opening of SKILL.md by lobehub, Custom licence
name
compose-atoms
user-invocable
false

Read the full SKILL.md on GitHub

Files

Just SKILL.md in .agents/skills/compose-atoms of lobehub/lobehub.

Open the folder on GitHubat commit 35d442e

Compare with similar skills

Compose Atoms 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.

Compose Atoms compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Compose Atoms this skilllobehub/lobehub83k—~2.6kAutomated safety check: PassCustom licence
Dify Component Writing Guidelanggenius/dify158k—~626Automated safety check: PassCustom licence
Bulletproof Reactyamcodes/arkenv145—~1.8kAutomated safety check: PassMIT
Opik Frontend Patternscomet-ml/opik22k—~1.1kAutomated safety check: PassApache-2.0
Frontendredis/RedisInsight8.9k—~3.2kAutomated safety check: PassCustom licence
Frontend Typescript Rulesshinpr/ai-coding-project-boilerplate233—~1.7kAutomated safety check: PassMIT

Similar skills

  • Use when implementing or refactoring React/TypeScript components and the task requires decisions about component ownership, feature boundaries, state, data…

    158k GitHub stars~626 tokensUpdated today
    Frontend & DesignAuto-check passed
  • Bulletproof React

    yamcodes/arkenv

    Bulletproof React architecture patterns for scalable, maintainable applications.

    145 GitHub stars~1.8k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Sets the conventions for the Opik React frontend: TanStack Query for data, Zustand for shared state, one-way layer imports and a fix for Google Translate crashes.

    22k GitHub stars~1.1k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Frontend

    redis/RedisInsight

    Official

    React/Redux frontend development patterns for RedisInsight UI: component folder structure, styled-components, hooks, named exports, barrel files, layout components, and theme usage.

    8.9k GitHub stars~3.2k tokensUpdated 4 days ago
    Frontend & DesignAuto-check passed
  • Frontend Typescript Rules

    shinpr/ai-coding-project-boilerplate

    Applies React/TypeScript type safety, component design, and state management rules.

    233 GitHub stars~1.7k tokensUpdated 5 days ago
    Frontend & DesignAuto-check passed
  • Dokan Frontend Dev

    getdokan/dokan

    Add or modify Dokan frontend code (React, TypeScript, Vue, Tailwind).

    288 GitHub stars~1.9k tokensUpdated today
    Frontend & DesignAuto-check passed

More from lobehub/lobehub

All 50 skills in this repo
  • Builds single-file interactive HTML prototypes rendered with the real LobeHub UI components and written as production-style React, so they can later be split into files.

    83k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Verifies a delivery end to end by driving the real product on a CLI, web, desktop or iOS Simulator surface, capturing evidence and publishing a round with the lh CLI.

    83k GitHub stars~9.7k tokensUpdated today
    Auto-check passed
  • Git Worktree Cleanup

    lobehub/lobehub

    Audits stale Git worktrees and branches with a bundled script, classifies each one, and deletes only after you approve the exact candidates.

    83k GitHub stars~2.8k tokensUpdated today
    Auto-check passed
  • Maintains LobeHub's model-backed alint rule set: writing rules, removing false positives against real code, deciding warn versus error and tracking token cost.

    83k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Guides building LobeHub builtin agent tools, from the manifest and execution runtime to executors, chat UI renders and registry wiring.

    83k GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Explains how LobeHub client code fetches data through services, SWR store hooks and cache keys, and when to avoid useEffect fetching or duplicated state.

    83k GitHub stars~1.7k tokensUpdated today
    Auto-check passed

Works with

Questions about Compose Atoms

What does Compose Atoms do?

Splits a heavy front-end domain into capability atoms that each host imports separately, sinking state into each atom instead of adding mode or readOnly flags. The skill applies to a product surface such as Conversation, Document or Task where one entry owns reading, writing, workflow and host integration, or where a second host such as a portal, share view or micro-app is the next change. The idea is that a heavy domain is a kit, not a viewer with modes.

When should I use Compose Atoms?

Compose Atoms fits situations like: adding a second host, such as a share page, to a feature built for one; replacing a growing set of mode or readOnly props on one big viewer; moving domain state out of a page and into the capability that uses it.

How do I install Compose Atoms in Claude Code?

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

How do I install Compose Atoms in Codex?

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

Can I use Compose Atoms 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 lobehub/lobehub --skill compose-atoms -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/compose-atoms, .gemini/skills/compose-atoms, .github/skills/compose-atoms and .opencode/skills/compose-atoms in your project.

What does Compose Atoms need to run?

Going by SKILL.md and its folder, Compose Atoms needs the command-line tools its instructions call (bun).

Does Compose Atoms 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 Compose Atoms 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 Compose Atoms use?

Compose Atoms has a licence file (the repository's licence) that doesn't match a standard licence. Read it on GitHub before reusing the skill.

How many tokens does Compose Atoms use?

About 2.6k tokens (SKILL.md is roughly 11k 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 Compose Atoms?

Skills that share tags, products or a category with Compose Atoms: Dify Component Writing Guide (langgenius/dify, 158k stars), Bulletproof React (yamcodes/arkenv, 145 stars), Opik Frontend Patterns (comet-ml/opik, 22k stars) and Frontend (redis/RedisInsight, 8.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Compose Atoms?

lobehub (a GitHub organization) maintains it in lobehub/lobehub, which has 83,074 GitHub stars. The repository holds 50 skills in this directory. The repository was last updated on October 9, 2026.

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