Skip to content
Skill Authoring
Skill

/developing-preact

Specialized Preact development skill for standards-based web applications with native-first architecture and minimal dependency footprint. Use when building Preact projects, particularly those involving data visualization, interactive applications, single-page apps with HTM

BOOST
From plugin
claude-skills
15498 skills1 agent
Install
$ npx -y skills add oaustegard/claude-skills --skill developing-preact --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/developing-preact

Context preview

The summary Claude sees to decide when to auto-load this skill.

Specialized Preact development skill for standards-based web applications with native-first architecture and minimal dependency footprint. Use when building Preact projects, particularly those involving data visualization, interactive applications, single-page apps with HTM

SKILL.md

developing-preact.SKILL.md
name: developing-preact
description: Specialized Preact development skill for standards-based web applications with native-first architecture and minimal dependency footprint. Use when building Preact projects, particularly those involving data visualization, interactive applications, single-page apps with HTM syntax, Web Components integration, CSV/JSON data parsing, WebGL shader visualizations, or zero-build solutions with vendored ESM imports.
metadata:
  version: 1.2.1

Preact Developer

Overview

Transform Claude into a specialized Preact developer with expertise in building standards-based web applications using native-first architecture. This skill prioritizes native JavaScript, HTML, and Web APIs over external dependencies, enabling creation of performant, maintainable applications with minimal tooling overhead.

Core Philosophy

**Native-First Development**: Leverage ES modules, Import Maps, Web Components, native form validation, Fetch API, and built-in DOM methods before reaching for external libraries. Default to zero-build solutions with HTM and vendored ESM imports for rapid prototyping and small-to-medium applications.

**Always Deliver in Artifacts**: All code should be created as artifacts to enable iterative editing across sessions.

When to Use This Skill

Trigger this skill when working on:

  • **Preact projects** of any complexity level
  • **Data visualization applications** requiring CSV/JSON parsing and interactive charts
  • **Single-page applications** using HTM tagged template literals
  • **WebGL/shader-based** mathematical visualizations
  • **Web Components** integration projects
  • **Zero-build prototypes** with CDN-based dependencies
  • **Progressive web applications** emphasizing accessibility and performance

Project Type Decision Tree

Follow this decision tree to determine the optimal architecture:

1. Standalone Prototype or Demo

**Characteristics**: Quick prototype, demo, educational example, or proof of concept

**Architecture**:

  • HTM syntax with import maps
  • Vendored ESM dependencies (fetched from npm registry via `scripts/vendor.sh`)
  • Tailwind CSS via CLI (purged, minified)
  • Single HTML file or minimal file structure
  • No build process

**Start with**: Run `bash scripts/vendor.sh` to fetch dependencies, then use `assets/boilerplate.html` as the foundation

2. Small-to-Medium Application (No Build Tooling)

**Characteristics**: Production application without existing build infrastructure, <10 components, straightforward state management

**Architecture**:

  • HTM syntax with import maps
  • ES modules for code organization
  • Signals for reactive state management
  • Native routing (hash-based or History API)
  • Static hosting (Netlify, Vercel, GitHub Pages)

**State Management**: Use global signals for shared state, useSignal for component-local state

3. Complex Application (Build Tooling Required)

**Characteristics**: Large codebase, TypeScript requirement, multiple entry points, advanced optimizations needed

**Architecture**:

  • JSX with build tooling (Vite, Webpack)
  • TypeScript for type safety
  • Consider preact/compat for React ecosystem libraries
  • Advanced code splitting and lazy loading
  • Professional CI/CD pipeline

**When to Recommend**: Only after confirming team's development environment and build requirements

4. Existing Project

**Approach**: Match existing patterns and tooling. Analyze the codebase to determine current architecture before suggesting changes.

Technical Standards

Import Map Configuration

Always use this exact import map structure for standalone examples. Dependencies are vendored locally via `scripts/vendor.sh` (fetched from `registry.npmjs.org`):

<script type="importmap">
  {
    "imports": {
      "preact": "./vendor/preact.module.js",
      "preact/hooks": "./vendor/hooks.module.js",
      "@preact/signals-core": "./vendor/signals-core.mjs",
      "@preact/signals": "./vendor/signals.mjs",
      "htm": "./vendor/htm.module.js",
      "htm/preact": "./vendor/htm.module.js"
    }
  }
</script>

**Critical — modular files, not standalone bundle**: Do NOT use `htm/preact/standalone.module.js`. The standalone bundle embeds its own Preact copy, which causes `@preact/signals` to get a different Preact instance (it imports `from 'preact'` as a bare specifier). Modular files + import map = one shared Preact instance for everything.

**Why vendored, not CDN**: `esm.sh` is a pass-through to the entire npm registry — allowlisting it opens arbitrary code execution surface. `registry.npmjs.org` is already on the container egress allowlist and provides scoped, versioned tarballs.

Syntax Preference

**Default to HTM** tagged template literals unless:

  • User explicitly requests JSX
  • Project already uses JSX tooling
  • TypeScript strict mode requires JSX

JSX to HTM Translation Reference

When mentally converting from React/JSX patterns to HTM, apply these rules:

Mental Model

HTM uses JavaScript template literals. Everything that was `{expression}` in JSX becomes `${expression}`. Component *names* are also expressions, hence `<${Component}>`.

Translation Rules

| Pattern | JSX | HTM | |---------|-----|-----| | Component tag | `<Button />` | `<${Button} />` | | Component with children | `<Modal>...</Modal>` | `<${Modal}>...</${Modal}>` | | Closing tag | `</Modal>` | `</${Modal}>` | | Expression | `{value}` | `${value}` | | Props | `prop={val}` | `prop=${val}` | | Spread props | `{...obj}` | `...${obj}` | | Event handler | `onClick={fn}` | `onClick=${fn}` | | Conditional | `{show && <X />}` | `${show && html\`<${X} />\`}` | | Ternary | `{a ? <X /> : <Y />}` | `${a ? html\`<${X} />\` : html\`<${Y} />\`}` | | Map | `{items.map(i => <Li />)}` | `${items.map(i => html\`<li>...</li>\`)}` |

Key Differences

1. **Component references need `${}`**: The component name is a JavaScript expression

   // JSX
   <Button onClick={handleClick}>Save</Button>
Read more
Ships withclaude-skills

A collection of Claude skills distributed as a Claude Code plugin marketplace. Skills are primarily designed for the Claude.ai PaaS skill compute environment; mileage will vary if used as Claude Code Agent Skills.

Get the whole plugin

Other skills on claude-skills.