Token导航 LogoToken导航

Agent Skill · 前端设计

developing-preact(开发预 React)

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

developing-preact 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描有未通过项,按安装量在前端设计类的 10,216 个 Skill 里排第 2,360。

总安装 2,352周安装 98GitHub Stars 119下载 784核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:developing-preact(开发预 React)
来源仓库:https://github.com/oaustegard/claude-skills
仓库路径:skills/developing-preact
安装命令:
npx skills add https://github.com/oaustegard/claude-skills --skill developing-preact
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/oaustegard/claude-skills --skill developing-preact

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

该技能将 Claude 转化为 Preact 专家,强调原生 Web API 优先原则。适用于构建高性能、低依赖的前端应用,推荐使用 HTM 和 ES 模块。需避免外部库堆砌,优先采用表单验证、Fetch API 等内置能力。涉及 DOM 操作时应通过浏览器实时预览检查渲染结果与事件绑定。

developing-preact 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/developing-preact

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/oaustegard/claude-skills --skill developing-pr…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

developing-preact 怎么安装?

在终端执行 npx skills add https://github.com/oaustegard/claude-skills --skill developing-preact。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

developing-preact 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

developing-preact 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

developing-preact 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

developing-preact 用的人多吗?

公开数据是累计安装 2,352 次,近一周安装 98 次,下载 784 次,GitHub 119 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

developing-preact 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
developing-preact

开发预 React · 本页

2,352119需要联网MIT未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

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
PatternJSXHTM
Component tag<Button /><${Button} />
Component with children<Modal>...</Modal><${Modal}>...</${Modal}>
Closing tag</Modal></${Modal}>
Expression{value}${value}
Propsprop={val}prop=${val}
Spread props{...obj}...${obj}
Event handleronClick={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\...)}
Key Differences
  1. Component references need ${}: The component name is a JavaScript expression // JSX <Button onClick={handleClick}>Save</Button> // HTM <${Button} onClick=${handleClick}>Save</${Button}>
  2. Nested templates for conditional components: When conditionally rendering components (not HTML elements), wrap in html\` // JSX {isOpen && <Modal title="Hello" />} // HTM ${isOpen && html<${Modal} title="Hello" />} `
  3. No braces for spread: In HTM, spread uses ...${obj} directly // JSX <Input {...inputProps} /> // HTM <${Input}...${inputProps} />
  4. class vs className: Both work in Preact, but prefer class for consistency and smaller output
Common Mistakes
MistakeWrongCorrect
Missing ${} on component<Button><${Button}>
Wrong closing syntax</MyComponent></${MyComponent}>
Braces instead of template{count}${count}
Spread with braces{...props}...${props}
Missing html wrapper in conditional${show && <${X} />}${show && html\<${X} />}

Component Patterns

Use function components with:

  • Hooks for lifecycle and side effects
  • Signals for reactive state (preferred over useState)
  • Suspense for code splitting and async data
  • Context API for cross-component state and dependency injection
  • Error boundaries for graceful error handling

Styling Strategy

Default: Tailwind CSS via CLI — install with npm install tailwindcss@3 --save-dev, then generate purged CSS with npx tailwindcss -o vendor/tailwind.css --content "*.html" --minify. This produces ~6KB of CSS containing only used classes. Avoid: Tailwind CDN (cdn.tailwindcss.com) — not on container egress allowlist, and loads the full 100KB+ JIT compiler. Avoid: Inline styles except for dynamic values impossible to express through utilities. Alternative: CSS modules or styled-components only when project requires scoped styling.

Dependency Evaluation Framework

Before recommending any external package, verify:

  1. Native Web APIs cannot accomplish this - Check MDN documentation
  2. Preact built-ins are insufficient - Signals, hooks, Context API, preact/compat
  3. Bundle size cost is justified - Measure actual benefit gained vs. bytes added

Document the specific performance or capability benefits that justify any dependency inclusion.

Architecture Considerations

For complex decisions involving:

  • Client-side routing (hash-based vs. History API vs. library)
  • SSR requirements
  • State management architecture (signals vs. external library)
  • preact/compat integration for React libraries
  • Performance optimization in constrained environments

Evaluate trade-offs explicitly before committing to an approach. Document reasoning in code comments.

Domain Standards

Progressive Enhancement

Ensure core functionality works without JavaScript where feasible:

  • Use semantic HTML
  • Leverage native form validation
  • Implement keyboard navigation
  • Add ARIA attributes for accessibility
  • Manage focus states properly

Code Quality

  • Generate simplest working solution first
  • Document non-obvious Preact patterns in code comments
  • Explain hook dependencies
  • Note architectural decisions
  • Infer TypeScript usage from project context

Development Workflow

1. Understand Requirements

Clarify:

  • Target environment (standalone vs. build tools)
  • State complexity
  • Data sources (CSV, JSON, APIs)
  • Accessibility requirements
  • Browser support needs

2. Choose Architecture Pattern

Refer to the Project Type Decision Tree above to select the appropriate architecture.

3. Implement Iteratively

Start with:

  • Basic HTML structure (use assets/boilerplate.html)
  • Core component hierarchy
  • State management setup
  • Data fetching/parsing logic
  • Styling and polish

4. Reference Documentation

Consult bundled references as needed:

  • references/preact-v10-guide.md - Comprehensive Preact API reference
  • references/architecture-patterns.md - Advanced patterns and best practices

5. Use Component Patterns

Leverage assets/component-patterns.md for common UI patterns:

  • Data grids with sorting
  • File upload with drag & drop
  • Search with debouncing
  • Modal dialogs
  • Tabs
  • Toast notifications
  • CSV parsing

Common Patterns

Data Parsing (CSV/JSON)

For data-heavy applications:

import { useSignal } from '@preact/signals';

function parseCSV(text) {
  const lines = text.trim().split('\n');
  const headers = lines[0].split(',').map(h => h.trim());
  return lines.slice(1).map(line => {
    const values = line.split(',').map(v => v.trim());
    return Object.fromEntries(headers.map((h, i) => [h, values[i]]));
  });
}

function DataAnalyzer() {
  const data = useSignal([]);

  const handleFile = async (e) => {
    const text = await e.target.files[0].text();
    data.value = parseCSV(text);
  };

  return html`
    <input type="file" accept=".csv" onChange=${handleFile} />
    <div>Loaded ${data.value.length} rows</div>
  `;
}

WebGL Integration

For shader-based visualizations:

import { useEffect, useRef } from 'preact/hooks';

function ShaderCanvas({ fragmentShader }) {
  const canvasRef = useRef(null);

  useEffect(() => {
    const canvas = canvasRef.current;
    const gl = canvas.getContext('webgl2');

    // Setup WebGL context, shaders, buffers
    // Render loop

    return () => {
      // Cleanup
    };
  }, [fragmentShader]);

  return html`<canvas ref=${canvasRef} class="w-full h-full" />`;
}

Global State with Signals

// state.js
import { signal, computed } from '@preact/signals';

export const users = signal([]);
export const currentUser = signal(null);
export const isAuthenticated = computed(() => currentUser.value !== null);

// Any component can import and use
import { users, isAuthenticated } from './state.js';

Constraints

DO NOT:

  • Recommend npm tooling without confirming user's development environment
  • Suggest dependencies when native solutions exist
  • Optimize prematurely - start with simplest working implementation
  • Ask questions inferable from context

DO:

  • Execute with reasonable defaults when requirements are clear
  • Use HTM syntax by default
  • Create artifacts for all code
  • Prioritize accessibility and progressive enhancement
  • Document architectural decisions in comments

Resources

References (Load as Needed)

  • references/preact-v10-guide.md: Complete Preact v10 API reference covering import maps, HTM syntax, React differences, Signals API, Web Components, SSR, performance patterns, Context, error boundaries, and common gotchas
  • references/architecture-patterns.md: Advanced patterns including zero-build architecture, state management strategies, data fetching, routing, forms, progressive enhancement, accessibility, performance optimization, testing, and security best practices

Assets (Copy into Projects)

  • assets/boilerplate.html: Complete HTML template with import maps, Tailwind CSS, and basic Preact app structure - use as starting point for all standalone examples
  • assets/component-patterns.md: Reusable component implementations for data grids, file uploads, search, modals, tabs, toast notifications, and CSV parsing

Examples

Minimal Counter (Standalone)

<!DOCTYPE html>
<html>
<head>
  <!-- Run: bash scripts/vendor.sh -->
  <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>
</head>
<body>
  <div id="app"></div>
  <script type="module">
    import { render } from 'preact';
    import { useSignal } from '@preact/signals';
    import { html } from 'htm/preact';

    function App() {
      const count = useSignal(0);
      return html`
        <button onClick=${() => count.value++}>
          Count: ${count}
        </button>
      `;
    }

    render(html`<${App} />`, document.getElementById('app'));
  </script>
</body>
</html>

Data Visualization App

For applications processing CSV data and displaying interactive charts, reference the DataGrid pattern in assets/component-patterns.md and combine with a charting library like Chart.js or use native Canvas/SVG for custom visualizations.

WebGL Shader Visualization

For mathematical visualizations using WebGL shaders, create a canvas element, initialize WebGL2 context, compile shaders, and set up a render loop. Reference MDN WebGL documentation for shader setup patterns.

Best Practices Summary

  1. Start Simple: Create working prototype before optimizing
  2. Use Signals: Prefer signals over useState for reactive state
  3. Native First: Check if Web APIs can accomplish the task
  4. Progressive Enhancement: Build with accessibility from the start
  5. Document Decisions: Explain non-obvious patterns in comments
  6. Keys in Lists: Always provide stable keys for mapped elements
  7. Error Boundaries: Wrap async operations in error boundaries
  8. Avoid Inline Functions: Don't create handlers inside map() loops

Validation Checklist

Before delivering code, verify:

  • Import map uses vendored local paths (no CDN URLs)
  • HTM syntax is used (unless JSX explicitly requested)
  • Keys provided for all mapped elements
  • Signals used for reactive state
  • Accessibility attributes included (ARIA, keyboard nav)
  • Error boundaries wrap async operations
  • Loading and error states handled
  • Code is in artifact format for iterative editing
  • Comments explain non-obvious patterns
  • No unnecessary dependencies included

Container Testing

Test Preact apps locally in Claude.ai containers using Playwright. This workflow avoids external CDNs entirely — all dependencies are vendored from registry.npmjs.org.

Setup (one-time per session)

# 1. Vendor JS dependencies
bash scripts/vendor.sh

# 2. Generate Tailwind CSS (if using Tailwind)
npm install tailwindcss@3 --save-dev
npx tailwindcss -o vendor/tailwind.css --content "*.html" --minify

Serve and Test

# 3. Serve locally
python3 -m http.server 8765 &

# 4. Test with Playwright
python3 << 'PYEOF'
from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch(headless=True, args=["--no-sandbox"])
    page = browser.new_page()

    errors = []
    page.on("console", lambda m: errors.append(m.text) if m.type == "error" else None)
    page.on("pageerror", lambda e: errors.append(str(e)))

    page.goto("http://localhost:8765", wait_until="networkidle")

    # Verify no console errors (catches import failures immediately)
    assert not errors, f"Console errors: {errors}"

    # Verify app rendered
    assert page.locator("#app").inner_html() != "", "App did not render"

    # Example: test interaction
    # page.click("button")
    # assert "Count: 1" in page.content()

    browser.close()
    print("All tests passed")
PYEOF

Key guidance

  • Use Playwright directly for local testing — not webctl (webctl is for external sites through the proxy)
  • python3 -m http.server is sufficient — no npm server needed
  • Console error capture via page.on("console") and page.on("pageerror") catches import failures immediately
  • --no-sandbox is required in container environments

Getting Started

For immediate implementation:

  1. Run bash scripts/vendor.sh to fetch vendored dependencies
  2. (Optional) Generate Tailwind CSS: npm install tailwindcss@3 --save-dev && npx tailwindcss -o vendor/tailwind.css --content "*.html" --minify
  3. Copy assets/boilerplate.html as the starting point
  4. Read references/preact-v10-guide.md for API details
  5. Reference assets/component-patterns.md for common UI patterns
  6. Consult references/architecture-patterns.md for advanced scenarios

The skill is designed to enable rapid development of high-quality Preact applications with minimal friction and maximum standards compliance.

平台分布

github-copilot

31.28%
按下载量换算245

Claude Code

25.03%
按下载量换算196

Antigravity

16.6%
按下载量换算130

windsurf

13.96%
按下载量换算109

OpenCode

7.35%
按下载量换算58

Codex

3.18%
按下载量换算25

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills