jj-dom-helpers

Provide minimal TypeScript DOM wrappers for manipulation, Shadow DOM, and templates.

3|Updated Jan 9, 2020
One-click install
npx skills add https://github.com/alexewerlof/jj --skill jj-dom-helpers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jj-dom-helpers
Source: https://github.com/alexewerlof/jj/tree/main
Command: npx skills add https://github.com/alexewerlof/jj --skill jj-dom-helpers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The jj-dom-helpers skill provides a compact, type-safe set of wrappers around DOM APIs to reduce boilerplate and errors when manipulating the document, shadows, templates, and fragments, especially in AI-assisted workflows.

Core Features & Use Cases

  • Type-safe wrappers for common DOM targets (JJHE, JJE, JJSE, JJD, JJDF, JJSR) enabling fluent chaining and safer access to native nodes.
  • Shadow DOM support through ShadowMaster and initShadow for components, templates, and styles.
  • Document fragments and template handling to batch DOM operations and reuse templates without manual boilerplate.
  • Real-world use: building vanilla web components with minimal ceremony while keeping TS type safety.

Quick Start

Create a div with JJHE and chain methods to build and style content (e.g., JJHE.create('div').setText('Hello')) and integrate Shadow DOM templates with ShadowMaster as needed.

Frequently Asked Questions about jj-dom-helpers

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manipulate Shadow DOM safely in TypeScript without a build step?

Type-safe DOM manipulation without a build step is achieved through fluent TypeScript wrappers providing direct access to Shadow DOM, templates, and fragments. It reduces boilerplate by chaining native node operations imperatively for AI-driven apps.

What is the best way to create web components using fluent DOM APIs?

Creating web components with fluent DOM APIs involves using type-safe wrappers to chain element creation and styling. ShadowMaster integration handles Shadow DOM initialization, templates, and styles with minimal ceremony.

Can I use document fragments and templates for batch DOM operations in TypeScript?

Document fragments and templates can be used for batch DOM operations through dedicated fluent wrappers. These handle template reuse and fragment insertion natively, eliminating manual boilerplate while maintaining TypeScript type safety.

Does this DOM helper library require any external dependencies or frameworks?

This DOM helper library requires no external dependencies or frameworks, operating with zero build steps. It provides a minimal, imperative TypeScript interface wrapping native browser APIs to ensure type safety and reusability.

How do fluent DOM wrappers reduce boilerplate in AI-assisted development?

Fluent DOM wrappers reduce boilerplate in AI-assisted development by providing type-safe chaining for common DOM targets. They abstract repetitive API calls into a compact, imperative syntax that AI agents can generate reliably.

When should I use ShadowMaster for Shadow DOM initialization?

ShadowMaster should be used for Shadow DOM initialization when building vanilla web components requiring encapsulated templates and styles. It manages shadow root attachment directly within the fluent wrapper workflow.