agentleFS
NVIDIAKnown publisherNVIDIA/elements/.agents/skills/authoring-components/SKILL.md

authoring-components

Skill115 starsChanged 55 days agoApache-2.0View on GitHub

Guide for creating new Elements components with all required files, base classes, metadata patterns, and test boilerplate. Use this skill whenever the user wants to create, scaffold, or set up a new component from scratch, needs to understand the required 10-file structure, asks about base classes and mixins (LitElement vs ButtonFormControlMixin), define.ts vs index.ts patterns, static metadata, component registration, or sub-component parent relationships. Also trigger when the user mentions creating test boilerplate for all 5 test types.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the component creation guide to get critical context for component creation guidance.

    line 21
  2. Distinctive:

    Study a reference: read the closest reference component listed below to understand the pattern in practice.

    line 26
  3. Very specific:

    Add only import '@nvidia-elements/core/<component-name>/define.js' to projects/core/src/bundle.ts in alphabetical order.

    line 39
  4. Very specific:

    Add the definition import to the js-modules list in projects/core/src/index.test.lighthouse.ts so the combined direct-import benchmark …

    line 40
  5. Very specific:

    Measure payloads: run mise exec -- pnpm run test:lighthouse from projects/core.

    line 41

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Authoring Components

You MUST review the component creation guideline before creating or modifying components.

When to Use This Skill

  • Creating a new component from scratch
  • Understanding the required file structure for components
  • Setting up test boilerplate for all 5 test types
  • Choosing the appropriate base class or mixin (ButtonFormControlMixin vs LitElement)
  • Understanding component metadata and registration patterns
  • Setting up JSDoc comments for components

Must Read File

Read the component creation guide to get critical context for component creation guidance.

Workflow

  1. Gather requirements: confirm the component name (kebab-case), purpose, and whether to use LitElement directly or apply ButtonFormControlMixin for button-like interactive components.
  2. Study a reference: read the closest reference component listed below to understand the pattern in practice.
  3. Create the 10 required files in projects/core/src/<component-name>/:
    • component-name.ts:component class with metadata, JSDoc, and render method
    • component-name.css:styles using CSS custom properties
    • component-name.examples.ts:example templates with @summary JSDoc
    • component-name.test.ts:unit tests
    • component-name.test.axe.ts:accessibility tests
    • component-name.test.visual.ts:visual regression tests
    • component-name.test.ssr.ts:SSR tests
    • component-name.test.lighthouse.ts:lighthouse tests
    • define.ts:registration using define() helper with HTMLElementTagNameMap
    • index.ts:side-effect-free export
  4. Update shared entry points:
    • Add only import '@nvidia-elements/core/<component-name>/define.js' to projects/core/src/bundle.ts in alphabetical order. Keep this registration bundle import-only. Export the public API from the component index.ts and expose its entry point through the package exports map.
    • Add the definition import to the js-modules list in projects/core/src/index.test.lighthouse.ts so the combined direct-import benchmark measures the component.
  5. Measure payloads: run mise exec -- pnpm run test:lighthouse from projects/core. Increase a bundle-size limit only when the measured payload exceeds the current limit.
  6. Verify: confirm all files follow the templates in the component creation guide, then run mise exec -- pnpm run lint and mise exec -- pnpm run test from projects/core.

References

  • Component Creation Guide - Complete component creation workflow
  • TypeScript Guidelines - Type safety patterns
  • Examples Guidelines - Example file structure
  • Testing Guidelines - Testing strategy
  • API Design - Properties - Property design patterns
  • API Design - Styles - CSS custom properties

Reference Components

  • /projects/core/src/button/ - ButtonFormControlMixin pattern example
  • /projects/core/src/badge/ - LitElement pattern example
  • /projects/core/src/card/ - Composition with slots example

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.