authoring-patterns
Skill115 starsChanged 55 days agoApache-2.0View on GitHub
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/.
In this repository46 other files it gives its agents.
- AGENTS.mdAGENTS.md
- projects/starters/angular/AGENTS.mdAGENTS.md
- projects/starters/bundles/AGENTS.mdAGENTS.md
- projects/starters/eleventy/AGENTS.mdAGENTS.md
- projects/starters/eleventy-ssr/AGENTS.mdAGENTS.md
- projects/starters/go/AGENTS.mdAGENTS.md
- projects/starters/go-htmx/AGENTS.mdAGENTS.md
- projects/starters/hugo/AGENTS.mdAGENTS.md
- projects/starters/importmaps/AGENTS.mdAGENTS.md
- projects/starters/lit-library/AGENTS.mdAGENTS.md
- projects/starters/mcp-app/AGENTS.mdAGENTS.md
- projects/starters/mpa/AGENTS.mdAGENTS.md
- projects/starters/nextjs/AGENTS.mdAGENTS.md
- projects/starters/nuxt/AGENTS.mdAGENTS.md
- projects/starters/react/AGENTS.mdAGENTS.md
- projects/starters/solidjs/AGENTS.mdAGENTS.md
- projects/starters/sphinx/AGENTS.mdAGENTS.md
- projects/starters/svelte/AGENTS.mdAGENTS.md
- projects/starters/typescript/AGENTS.mdAGENTS.md
- projects/starters/vue/AGENTS.mdAGENTS.md
- agent-availability-reportSkill
- agent-debug-ciSkill
- agent-dependenciesSkill
- agent-startersSkill
- agent-upkeepSkill
- agent-web-modernizationSkill
- audit-accessibilitySkill
- audit-ciSkill
- audit-codeSkill
- audit-consolidationSkill
- audit-simplificationSkill
- authoring-benchmarksSkill
- authoring-componentsSkill
- authoring-documentationSkill
- authoring-examplesSkill
- authoring-projectsSkill
- authoring-testsSkill
- authoring-typescriptSkill
- elementsSkill
- github-dependabotSkill
- guidance-api-designSkill
- guidance-buildSkill
- guidance-webgpu-performanceSkill
- summarize-releasesSkill
- summarize-video-releasesSkill
- troubleshootingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
22 rules. About 0 are common, 14 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 31
Check for a recently validated HTML template from a playground workflow
- Distinctive: line 32
Check for HTML the user has pasted or referenced
- Distinctive: line 33
If no template exists, ask the user to provide the HTML they want to save
- Distinctive: line 37
Ensure the template is valid before proceeding.
- Very specific: line 39
Call api_validate with { template, lang: 'html', format: 'json' }
- Distinctive: line 40
If validation returns errors, report them to the user and fix each issue
- Distinctive: line 42
Do NOT proceed to Phase 3 until validation passes
- Distinctive: line 46
Use the MCP tool to derive correct ESM import statements.
- Very specific: line 48
Call api_imports_get with the template HTML
- Very specific: line 50
Always prepend import { html } from 'lit'.
- Very specific: line 60
Avoid component names in the title (use LoginForm not InputPasswordLoginForm)
- Distinctive: line 65
Should reflect the pattern's theme or category
- Very specific: line 69
Must use format 'Patterns/<Category>'
- Distinctive: line 70
Check existing categories before creating new ones:
- Distinctive: line 88
If an existing file matches the template's theme, add the new export to that file
- Distinctive: line 89
Only create a new file when no existing category fits
- Distinctive: line 103
When appropriate, reference NVIDIA or NVIDIA Autonomous Vehicle program for UX use cases
- Very specific: line 124
If the template contains <script> tags: use the render() method form
- Very specific: line 125
If the template uses only declarative HTML: use the render arrow-function form
- Distinctive: line 175
Read the existing file
- Distinctive: line 178
Do NOT change existing exports or the default export
- Very specific: line 182
Write the file to projects/internals/patterns/src/<file-name>.examples.ts
≈ “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.
Files
Authoring Patterns
Persist a validated HTML template as a reusable pattern file in the Elements pattern library at projects/internals/patterns/src/.
When to Use This Skill
- User wants to save a playground template as a reusable pattern
- User asks to persist, save, or store a composition in the codebase
- User wants to create a new pattern file from HTML
- User says "save as pattern," "create pattern," or "add to pattern library"
- User has a validated playground prototype and wants it cataloged
Must Read Files
You MUST review these files before proceeding:
- Examples Guidelines -- authoritative rules for naming,
@summary, and structure - Scan
projects/internals/patterns/src/*.examples.tsto understand existing patterns and categories
Workflow
Phase 1: Locate Template
Find the validated HTML template to persist. Look for it in the conversation context:
- Check for a recently validated HTML template from a playground workflow
- Check for HTML the user has pasted or referenced
- If no template exists, ask the user to provide the HTML they want to save
Phase 2: Check Validity
Ensure the template is valid before proceeding.
- Call
api_validatewith{ template, lang: 'html', format: 'json' } - If validation returns errors, report them to the user and fix each issue
- Re-validate until
okis true andsummary.errorsis 0 - Do NOT proceed to Phase 3 until validation passes
Phase 3: Generate Imports
Use the MCP tool to derive correct ESM import statements.
- Call
api_imports_getwith the template HTML - The tool returns the required
@nvidia-elements/core/*/define.jsimports - Always prepend
import { html } from 'lit';as the first import -- the tool does not include it
Phase 4: Determine Metadata
Analyze the template and determine where and how to file it.
Export name:
- PascalCase, 1-3 words (per examples.md guidelines)
- Describes WHAT the pattern shows, not HOW it works
- Avoid component names in the title (use
LoginFormnotInputPasswordLoginForm)
Filename:
- kebab-case with
.examples.tssuffix - Should reflect the pattern's theme or category
Category (default export title):
- Must use format
'Patterns/<Category>' - Check existing categories before creating new ones:
| 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:
- If an existing file matches the template's theme, add the new export to that file
- Only create a new file when no existing category fits
- Present the decision to the user for confirmation
Phase 5: Write @summary
Compose a UX-focused JSDoc @summary for the pattern.
Rules:
- Max 400 characters
- One or two concise sentences
- Explain WHAT the pattern demonstrates, WHY the pattern helps, WHEN to use it, and HOW it improves UX
- Always include
@tags pattern - Derive design intent from template analysis: layout type, interaction pattern, use case, domain context
- When appropriate, reference NVIDIA or NVIDIA Autonomous Vehicle program for UX use cases
Good examples:
@summary Login form with email and password fields with credential validation. Use for authentication entry points where real-time feedback guides users through sign-in requirements.
@summary Data grid empty state with retry action. Use when requested data is not found and a retry action is available.
@summary Horizontal list item card with thumbnail, title, description, and icon button actions for browsable content lists.Avoid:
- Restating what is obvious from the code (
@summary A card with a button) - Vague descriptions (
@summary Example pattern)
Phase 6: Assemble
Build the TypeScript file content.
Determine render style:
- If the template contains
<script>tags: use therender()method form - If the template uses only declarative HTML: use the
renderarrow-function form
New file template:
import { 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: () => html`
<!-- template HTML -->
`
};New file template (with <script> tags):
import { 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 -->
`
}
};Adding to an existing file:
- Read the existing file
- Merge imports -- add any new
@nvidia-elements/core/*/define.jsimports that are not already present, maintaining alphabetical order - Append the new named export at the end of the file
- Do NOT change existing exports or the default export
Phase 7: Write and Verify
- Write the file to
projects/internals/patterns/src/<file-name>.examples.ts - Confirm to the user with:
- Path
- Export name
- Category
- Components used (list of
nve-*tags) - The
@summarycontent
References
- Examples Guidelines -- naming, summary, structure rules
- Authoring Guidelines -- HTML authoring rules for
nve-*components - Existing patterns:
projects/internals/patterns/src/*.examples.ts
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
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.

