npx skills add ...
npx skills add nvidia/elements --skill authoring-patterns
Convert validated playground templates or HTML compositions into reusable pattern files (*.examples.ts) in the pattern library. Use this skill whenever the user wants to save, persist, store, or catalog a template, prototype, composition, or playground result as a reusable pattern. Trigger on phrases like "save as pattern," "create pattern," "add to pattern library," "persist this template," "convert to examples.ts," or when the user has validated HTML and wants it stored in projects/internals/patterns/src/.
npx skills add nvidia/elements --skill authoring-patterns
Persist a validated HTML template as a reusable pattern file in the Elements pattern library at projects/internals/patterns/src/.
You MUST review these files before proceeding:
@summary, and structureprojects/internals/patterns/src/*.examples.ts to understand existing patterns and categoriesFind the validated HTML template to persist. Look for it in the conversation context:
Ensure the template is valid before proceeding.
api_validate with { template, lang: 'html', format: 'json' }ok is true and summary.errors is 0Use the MCP tool to derive correct ESM import statements.
api_imports_get with the template HTML@nvidia-elements/core/*/define.js importsimport { html } from 'lit'; as the first import -- the tool does not include itAnalyze the template and determine where and how to file it.
Export name:
LoginForm not InputPasswordLoginForm)Filename:
.examples.ts suffixCategory (default export title):
'Patterns/<Category>'| Category | File | Description |
|---|---|---|
| Authentication | authentication.examples.ts | Login forms, access states |
| Dashboard | dashboard.examples.ts | Monitoring dashboards, KPI views |
| Examples | browse.examples.ts, panel.examples.ts, subheader.examples.ts, editor.examples.ts | General compositions and layout patterns |
| Feedback | empty-states.examples.ts | Empty states, error states, offline |
| Heatmap | heatmap.examples.ts | Data visualization grids |
| Keyboard Shortcuts | keyboard-shortcuts.examples.ts | Keyboard shortcut displays |
| Logging | logging.examples.ts | Log viewers and log-related UI |
| Media | media.examples.ts | Media players, image galleries |
| Responsive | responsive.examples.ts | Responsive layout patterns |
| Search | search.examples.ts | Search interfaces |
| Trend | trend.examples.ts | Trend charts and metrics |
Add-to-existing vs. create-new:
Compose a UX-focused JSDoc @summary for the pattern.
Rules:
@tags patternGood examples:
Avoid:
@summary A card with a button)@summary Example pattern)Build the TypeScript file content.
Determine render style:
<script> tags: use the render() method formrender arrow-function formNew file template:
New file template (with <script> tags):
Adding to an existing file:
@nvidia-elements/core/*/define.js imports that are not already present, maintaining alphabetical orderprojects/internals/patterns/src/<file-name>.examples.tsnve-* tags)@summary contentnve-* componentsprojects/internals/patterns/src/*.examples.tsimport { html } from 'lit';
// ... generated imports from Phase 3
export default {
title: 'Patterns/<Category>',
component: 'nve-patterns'
};
/**
* @summary <UX-focused description from Phase 5>
* @tags pattern
*/
export const ExportName = {
render() {
return html`
<!-- template HTML with <script> tags -->
`
}
};