fiber-element
Installation
SKILL.md
FiberElement Lynx Apps
Use this skill to build Lynx apps directly from Element PAPI calls exposed through @lynx-js/type-element-api. Treat Element PAPI as the rendering layer: main thread renders, background thread handles async work and events.
Core Rules
- Do not use ReactLynx, JSX, virtual DOM, or browser DOM APIs unless the user explicitly asks for them.
- Split app code into
src/main-thread.ts,src/background.ts, andsrc/style.css. - Use
@lynx-js/type-element-apifor globals/types; Element PAPI functions are runtime globals and are not imported as values. - Keep async work, timers, native data updates, storage, and event handling in
src/background.ts. - Keep Element PAPI tree creation and mutation in
src/main-thread.ts. - If first-screen data exists, keep that data in the main-thread environment first and synchronize it to background through
processData.
Reading Order
- For project scaffold and template-webpack build setup, read
references/template-webpack-build.md. - For shared main-thread helpers, lifecycle shape, Element PAPI selection, and restrictions, read
references/main-thread-rendering.md. - For first-screen data, background updates, and double-thread communication, read
references/double-thread-data-sync.md.