Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

component-scaffolding构件脚手架

Agent Skill

component-scaffolding 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

343

周安装

14

GitHub Stars

3

下载量

111
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/schalkneethling/webdev-agent-skills --skill component-scaffolding

简介

为 Drupal 主题生成 Twig 组件骨架,结合 web components 与 Miyagi 验证。

  • 假设项目位于 apps/component-library/ 层级结构下。
  • 需配置 schema.yaml 或 mocks.yaml 文件定义组件元数据。
  • 安装前建议确认项目是否为 Drupal 主题开发环境。
  • 支持通过触发短语“Add component skeleton”激活技能。

SKILL.md

Component Scaffolding

Generate component skeletons for a Drupal theme using Twig, web components, and Miyagi for validation.

Trigger Phrases

  • "Add component skeleton at patterns/..."
  • "Create new component..."
  • "Scaffold component..."
  • Creating/updating schema.yaml or mocks.yaml files

Configuration

Component Library Root

This skill assumes it lives within a component library project, e.g.:

apps/component-library/
├── .claude/
│   └── skills/
│       └── component-scaffolding/   ← this skill
├── src/
│   ├── components/
│   └── css/
└── <theme-name>.libraries.yml

The component library root is three levels up from this skill (i.e., ../../.. relative to this SKILL.md).

Theme Name Discovery

The <theme-name> placeholder must be replaced with the actual Drupal theme name. To determine it:

  1. Navigate to the component library root
  2. Find the *.libraries.yml file — the filename prefix is the theme name
  3. Example: circle_dot.libraries.yml → theme name is circle_dot

If the theme name cannot be determined from existing files, ask the user.

File Templates

1. Twig Template: <component-name>.twig

{{ attach_library("<theme-name>/pattern-<component-name>") }}

<div class="<ComponentName>">
	{# Component implementation #}
</div>
  • Library name: pattern-<component-name> (kebab-case)
  • CSS class: <ComponentName> (PascalCase)
  • Single tab indentation

2. CSS: <component-name>.css

/** @define <ComponentName>; */

.<ComponentName > {
  /* Component styles */
}
  • PascalCase in @define comment
  • Tab indentation

3. JavaScript: <component-name>.js

Only create if explicitly needed. Skip if user says "no JavaScript", "CSS only", etc.

// @ts-check

class <ComponentName> extends HTMLElement {
	constructor() {
		super();
	}

	connectedCallback() {
		this.#addEventListeners();
	}

	/**
	 * Add event listeners
	 */
	#addEventListeners() {
		// Add event listeners here
	}
}

customElements.define("<component-name>", <ComponentName>);
  • PascalCase class name
  • NO prefix on custom element name (use kebab-case directly)
  • Only #addEventListeners() method in skeleton
  • NO #elements field or #getElements() method

4. Schema: schema.yaml

$schema: http://json-schema.org/draft-07/schema#
$id: /<tier>/<component-name>

type: object

required:
  - property1

additionalProperties: false
properties:
  • $id matches component tier path
  • Include required array with placeholder names
  • Leave properties: empty in skeleton
  • 2-space indentation (YAML standard)

For detailed schema patterns, see references/schema-and-mocks.md.

5. Mocks: mocks.yaml

  • Single blank line only in skeleton
  • User adds their own mock data later

For mock data patterns, see references/schema-and-mocks.md.

6. CSS Entry Point: src/css/<component-name>.css

@import url("../components/<tier>/<component-name>/<component-name>.css")
layer(components);
Note: If the component is an element, you can use the elements.css entry point instead.

7. Library Definition: <theme-name>.libraries.yml

Add entry alphabetically within the appropriate tier section:

pattern-<component-name>:
  header: true
  css:
    component:
      build/assets/css/<component-name>.css: {}
  js:
    build/assets/components/<tier>/<component-name>/<component-name>.js:
      attributes:
        type: module
  • Omit the js: block entirely if no JavaScript file is created
  • Maintain blank line between library definitions
  • Omit the css: block entirely if the component is an element

Naming Conventions

ItemFormatExample
Directory/fileskebab-caseshare-button
CSS classPascalCaseShareButton
JS classPascalCaseclass ShareButton
Custom elementkebab-case, NO prefixshare-button
Library name<prefix>-<kebab>pattern-share-button
Schema $id/<tier>/<kebab>/patterns/share-button

Component Tiers

TierLocationLibrary Prefix
Elementssrc/components/elements/element-
Patternssrc/components/patterns/pattern-
Template Componentssrc/components/template-components/template-component-
Templatessrc/components/templates/template-

Workflow

  1. Create component directory: src/components/<tier>/<component-name>/
  2. Create component files (twig, css, schema.yaml, mocks.yaml, and js only if needed)
  3. Create CSS entry point: src/css/<component-name>.css
  4. Add library definition to <theme-name>.libraries.yml (alphabetically in tier section)
  5. Run linters to verify

Optional Files

Pay attention to user requests indicating which files to skip:

User saysAction
"no JavaScript" / "CSS only"Skip.js file, omit js: from library
"no CSS" / "JavaScript only"Skip.css files, omit css: from library
"schema only" / "just the schema"Create only schema.yaml

Notes

  • Skeletons provide structure, not functionality
  • All files use tabs except YAML (2 spaces)
  • Run linters after creation to verify

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.98%
按下载量换算40

Claude

29.08%
按下载量换算32

Cursor

18.55%
按下载量换算21

Gemini CLI

8.3%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills