Agent skill

Lit Element Authoring

by paralleldrive in paralleldrive/aidd

Rules for writing Lit elements in an AIDD project: binding elements on DatabaseElement, observed values, presentation components and action-style callbacks.

MITAuto-check passedFrontend & Design

Install Lit Element Authoring

skills CLI
$ npx skills add paralleldrive/aidd --skill aidd-lit -a claude-code

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

GitHub CLI
$ gh skill install paralleldrive/aidd aidd-lit --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/paralleldrive/aidd.git skills-src && mkdir -p .claude/skills && cp -r skills-src/ai/skills/aidd-lit .claude/skills/aidd-lit && 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
aidd-lit
GitHub stars
384
Token cost
~1.2k tokens
SKILL.md length
132 words
Files
2
Skills in repo
35
Repo updated
First seen
Licence
MIT

At a glance

Rules for writing Lit elements in an AIDD project: binding elements on DatabaseElement, observed values, presentation components and action-style callbacks.

  • Creating a new Lit binding element that observes database values
  • SKILL.md covers Extending DatabaseElement, Binding element vs presentation, Testing and useObservableValues, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Splitting a Lit component into a binding element and a presentation

What it does

Lit elements sit in the components layer and consume Observe values and void actions from plugins. Binding elements extend DatabaseElement with the required plugin named in the generic, which makes sure the plugin's services are added to the main database before the first render so the service exposes the right Observe APIs and actions. Presentation elements are kept separate, and only binding elements connect to data.

Most binding elements make a single useObservableValues call that gathers just the values needed for rendering, using Observe.withDefault for slow values so a skeleton can show at once. Presentation files export only render, plus unlocalized bundles where needed. Callbacks are named as verb-noun action calls, not click or toggle events, and @property is almost never used on binding elements. Presentations are unit tested, while binding elements are not, since they hold no business logic.

When your agent uses it

  • Creating a new Lit binding element that observes database values
  • Splitting a Lit component into a binding element and a presentation
  • Naming and wiring action callbacks in a Lit UI

Example prompts

  • “Create a Lit element for the toolbar that binds to the view plugin and renders visibility state.”
  • “Refactor this component into a binding element and a presentation with action callbacks.”

Requirements

  • An AIDD project with the structure, service and observe skills

What it can do on your machine

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

Lit Element Authoring loads about 1.2k tokens when it runs. Until then it costs about 61 tokens; SKILL.md has 132 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~61
When it runs · the whole SKILL.md, loaded when a task matches
~1.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 paralleldrive/aidd at commit 9a7c8e3, republished under its MIT licence (© paralleldrive). 132 words, ~1,202 tokens.

Download SKILL.mdSave it as .claude/skills/aidd-lit/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
aidd-lit
description
Enforces Lit element authoring best practices. Use when creating Lit elements, binding elements, presentations, DatabaseElement, useObservableValues, or when the user asks about Lit UI patterns, reactive binding, or action callbacks.

Lit element authoring

Lit elements live in the components/ layer per structure. Consume Observe and void actions from plugins per service.


Extending DatabaseElement

Binding elements extend DatabaseElement<typeof myPlugin> — either directly or via an intermediate base class. The required plugin must be specified in the generic.

This ensures the plugin's services are extended onto the main database before the element renders, so this.service exposes the correct Observe APIs and actions.

ts
// Direct
export class HelloWorldElement extends DatabaseElement<typeof helloWorldPlugin> {
  get plugin() { return helloWorldPlugin; }
}

// Indirect — base extends DatabaseElement, leaf specifies plugin
export class LayoutElement<T extends MyApplicationPlugin = MyApplicationPlugin> extends CoreApplicationElement<T> { }
export class ToolbarElement extends LayoutElement<typeof toolbarPlugin> { }

Binding element vs presentation

sudolang
BindingElement {
  injects: "observed values via useObservableValues"
  triggers: "re-render when those values change"
  binds: "action callbacks to the presentation"
}

Presentation {
  type: "pure function (no hooks)"
  receives: "data and action callbacks as props"
  returns: "TemplateResult"
  constraint: "Keep reactive logic in binding element; presentation stays pure"
}

Testing

sudolang
Testing {
  presentation: "add *.test.ts when appropriate; unit test the presentation"
  bindingElement: "not unit tested — no business logic; uses Database service (already unit tested)"
}

useObservableValues

Most binding elements use a single useObservableValues call. Collect all observed values in one object.

Observe only what you need — the minimal values required for rendering. For values that may resolve slowly, wrap with Observe.withDefault so you can render a skeleton (or placeholder) immediately while waiting. See observe.

ts
render() {
  const values = useObservableValues(() => ({
    visible: this.service.actions.isViewVisible(name),
    userProfile: this.service.services.authentication.userProfile,
  }));
  if (!values) return;

  return presentation.render({ ...values, toggleView: () => this.toggleView(name) });
}

Presentation exports

sudolang
Constraints {
  Presentation files ONLY export render (and unlocalized bundles where appropriate)
  Nothing else ever exported from a presentation file
  For render args type externally: use Parameters<typeof render>[0]
}

Action callbacks (not events)

sudolang
PresentationCallbacks {
  are: "action calls, not events"
  semantics: "verbNoun — not onClick/onToggle/onSignOut style"
  bindingElement: "passes action callbacks (e.g. toggleView, signOut) as props"
  presentation: "invokes them when user intent occurs"
  callback: "calls the service/transaction directly"
}
ts
// Binding element: binds the action (verbNoun)
toggleView: () => this.toggleToolbarChild(name)

// Presentation: receives and invokes when user acts
item.toggleView()

Lit properties

sudolang
PropertyRules {
  default: "Almost never use @property on binding elements"
  exception: "Use properties ONLY when needed to bind to the correct entity in the database (e.g. entity for table rows, layer for view hosts)"
  multipleInstances: "need a property to identify which entity they represent"
  singleInstanceElements: "have no properties; observe values directly; re-render only when those values change"
}

Execute

sudolang
fn whenCreatingOrModifyingLitElement() {
  Constraints {
    Extend DatabaseElement<typeof myPlugin> (directly or indirectly) with required plugin specified
    Split into binding element (reactive) and presentation (pure)
    Use single useObservableValues in binding element; Observe only minimal values; use Observe.withDefault for slow-resolving values
    Pass observed values and action callbacks to presentation
    Keep presentation pure — no hooks
    Add @property only when entity binding requires it (multiple instances)
    Presentation exports only render (and localization bundles where appropriate)
    Add *-presentation.test.ts for presentation when appropriate; do not unit test binding elements
    Never include business logic within binding elements — move into computed values or action handlers
    Good binding elements should be extremely small
  }
}

© paralleldrive, 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 1 other file in ai/skills/aidd-lit of paralleldrive/aidd.

  • SKILL.md
  • README.md

Open the folder on GitHubat commit 9a7c8e3

Compare with similar skills

Lit Element Authoring 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.

Lit Element Authoring compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Lit Element Authoring this skillparalleldrive/aidd384—~1.2kAutomated safety check: PassMIT
Svelte Core Best Practicesrilldata/rill2.9k4 repos~1.8kAutomated safety check: PassApache-2.0
Frontend Patternskurealnum/dotfiles29019 repos~3.7kAutomated safety check: PassNone
LobeHub Data Fetching Layerslobehub/lobehub83k—~1.7kAutomated safety check: PassCustom licence
Guide to the ofa.js Frameworkofajs/ofa.js754—~13kAutomated safety check: PassMIT
Cursor BYOK Frontend Guideleookun/cursor-byok3.2k—~1.9kAutomated safety check: PassMIT

Similar skills

  • Rules for writing idiomatic Svelte 5 code: when to reach for runes like state, derived and effect, and how to handle props, attachments and bindings.

    2.9k GitHub starsUsed in 4 repos~1.8k tokens
    Frontend & DesignAuto-check passed
  • Frontend Patterns

    kurealnum/dotfiles

    Frontend development patterns for React, Next.js, state management, performance optimization, and UI best practices.

    290 GitHub starsUsed in 19 repos~3.7k tokens
    Frontend & DesignAuto-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
    Frontend & DesignAuto-check passed
  • Documentation knowledge base for the ofa.js no-build front-end framework, with rules that keep generated code in ofa.js syntax rather than Vue or React habits.

    754 GitHub stars~13k tokensUpdated 2 days ago
    Frontend & DesignAuto-check passed
  • Cursor BYOK Frontend Guide

    leookun/cursor-byok

    Sets the rules for building the Cursor BYOK desktop app's React and Tauri frontend, especially its HTTP boundary and component state architecture.

    3.2k GitHub stars~1.9k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Reference knowledge base for the no-build ofa.js framework, with syntax rules and a table of mistakes to avoid when writing components, pages and routes.

    754 GitHub stars~8.3k tokensUpdated 2 days ago
    Frontend & DesignAuto-check passed

More from paralleldrive/aidd

All 35 skills in this repo
  • AIDD Skill Authoring Guide

    paralleldrive/aidd

    Guides creating, reviewing or refactoring AI-Driven Development skills so each one stays minimal, composable and named around a single clear function.

    384 GitHub stars~1.1k tokensUpdated 3 mo ago
    Auto-check passed
  • AIDD UI Layout Patterns

    paralleldrive/aidd

    Enforces a split of UI components into terminal and layout types, with layout components composing others through standard layout tokens, for cleaner structure and fewer re-renders.

    384 GitHub stars~562 tokensUpdated 3 mo ago
    Auto-check passed
  • Adobe Data ECS Plugin Rules

    paralleldrive/aidd

    Enforces @adobe/data/ecs practices when writing Database.Plugin definitions, including property order, plugin composition, services, components, resources and archetypes.

    384 GitHub stars~1.9k tokensUpdated 3 mo ago
    Auto-check passed
  • Error Causes Handling

    paralleldrive/aidd

    Has your agent throw and catch JavaScript and TypeScript errors with the error-causes library, using named causes, preserved originals and routed handlers.

    384 GitHub stars~1.1k tokensUpdated 3 mo ago
    Auto-check passed
  • Teaches the saga pattern with call and put so network requests and side effects stay out of the logic and sagas can be tested without mocks.

    384 GitHub stars~587 tokensUpdated 3 mo ago
    Auto-check passed
  • Epic Changelog Logger

    paralleldrive/aidd

    Adds completed epics to a changelog in reverse chronological order, one emoji-tagged line each, covering only significant user-facing work.

    384 GitHub stars~461 tokensUpdated 3 mo ago
    Auto-check passed

Questions about Lit Element Authoring

What does Lit Element Authoring do?

Rules for writing Lit elements in an AIDD project: binding elements on DatabaseElement, observed values, presentation components and action-style callbacks. Lit elements sit in the components layer and consume Observe values and void actions from plugins. Binding elements extend DatabaseElement with the required plugin named in the generic, which makes sure the plugin's services are added to the main database before the first render so the service exposes the right Observe APIs and actions.

When should I use Lit Element Authoring?

Lit Element Authoring fits situations like: creating a new Lit binding element that observes database values; splitting a Lit component into a binding element and a presentation; naming and wiring action callbacks in a Lit UI.

How do I install Lit Element Authoring in Claude Code?

Run `npx skills add paralleldrive/aidd --skill aidd-lit -a claude-code`. Or copy the skill folder (ai/skills/aidd-lit in paralleldrive/aidd) into .claude/skills/aidd-lit in your project. Claude Code loads it when a task matches its description.

How do I install Lit Element Authoring in Codex?

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

Can I use Lit Element Authoring 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 paralleldrive/aidd --skill aidd-lit -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/aidd-lit, .gemini/skills/aidd-lit, .github/skills/aidd-lit and .opencode/skills/aidd-lit in your project.

What does Lit Element Authoring need to run?

SKILL.md names no scripts, command-line tools or credentials: Lit Element Authoring is instructions for the agent only. Our summary lists: An AIDD project with the structure, service and observe skills.

Does Lit Element Authoring 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 Lit Element Authoring 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 Lit Element Authoring use?

Lit Element Authoring 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 Lit Element Authoring use?

About 1.2k tokens (SKILL.md is roughly 4.8k 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 Lit Element Authoring?

Skills that share tags, products or a category with Lit Element Authoring: Svelte Core Best Practices (rilldata/rill, 2.9k stars), Frontend Patterns (kurealnum/dotfiles, 290 stars), LobeHub Data Fetching Layers (lobehub/lobehub, 83k stars) and Guide to the ofa.js Framework (ofajs/ofa.js, 754 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Lit Element Authoring?

paralleldrive (a GitHub organization) maintains it in paralleldrive/aidd, which has 384 GitHub stars. The repository holds 35 skills in this directory. The repository was last updated on June 12, 2026.

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