Repository navigation
docs: add llms.txt reference for AI coding agents - #161
Conversation
There was a problem hiding this comment.
📋 Review Summary
This PR introduces llms.txt as a single-file reference for AI coding agents detailing material-esm/material installation, @material/web syntax differences, and API summaries for all 25 component groups. It also links to llms.txt from README.md and adds llms.txt and **/*.md to the files array in package.json so documentation is bundled with npm releases. Overall, the documentation is accurate and aligns well with the component implementations, with only a few minor issues in inline HTML snippet identifiers and attribute casing conventions.
🔍 General Feedback
- Good structure in
llms.txt: leading with the@material/webmigration table and highlighting key gotchas (such as<md-switch>usingselectedinstead ofchecked) directly addresses common LLM generation errors. - Including
llms.txtand**/*.mdinpackage.json'sfilesfield ensures local AI coding tools inspectingnode_modules/materialhave offline access to the full reference and component READMEs. - Consider keeping code examples in
```htmlblocks as plain HTML (onclick="document.getElementById(...)") rather than mixing in Lit template bindings (@click=${...}), so agents do not copy framework-specific bindings into vanilla HTML pages.
📊 Token Usage & Cost Efficiency
| Metric | Value |
|---|---|
| Input Tokens (uncached) | 3,698 |
| Input Tokens (cached) | 163,823 (⚡ 97.8% cached) |
| Thinking / Reasoning Tokens | 5,708 |
| Output Tokens | 1,136 |
| Dynamic Context Selection Tokens | 3,175 |
| Total Session Tokens | 177,540 |
| Cost (uncached input) | $0.0055 |
| Cost (cached input) | $0.0123 |
| Cost (thinking / reasoning) | $0.0428 |
| Cost (response output) | $0.0085 |
| Cost (context selection) | $0.0075 |
| Estimated Total Cost | $0.0767 |
Gemini 4 Hydrogen: standard tier, global endpoint; regional endpoints are 10% higher.
Cache reads are priced here, but context-cache STORAGE, where the model charges for it separately per token-hour, is not included, so the figure can run slightly low.
There was a problem hiding this comment.
📋 Review Summary
This pull request introduces llms.txt as a comprehensive single-file reference for AI coding agents and LLMs, links to it from README.md, and includes llms.txt and component Markdown documentation in the published npm package via package.json. All four previously raised review comments regarding framework-agnostic HTML event handlers and attribute naming consistency in llms.txt have been addressed. The documentation aligns well with the component implementations and READMEs across the repository, with one remaining discrepancy identified on where supporting-text and error-text are documented as hyphenated HTML attributes despite not having attribute mappings configured in select/select.js.
✅ Resolved Items from Prior Reviews
- Updated the dialog example buttons to use plain HTML onclick handlers referencing confirm-dlg instead of Lit template bindings. (
llms.txt:302) - Updated the menu trigger button example to use a plain HTML onclick handler referencing more-menu instead of a Lit template binding. (
llms.txt:358) - Updated the sheet action button example to use a plain HTML onclick handler referencing filters instead of a Lit template binding. (
llms.txt:448) - Standardised the text field property listing to put lowercase HTML attributes first (readonly, minlength, maxlength, and inputmode) with camelCase JS property names in parentheses. (
llms.txt:503)
🔍 General Feedback
- The llms.txt guide follows the llms.txt specification cleanly and clearly highlights the key differences between material-esm/material and @material/web (such as unified color/type/position attributes and using selected instead of checked).
- Including llms.txt and **/*.md in the files array of package.json ensures consumers installing via npm or CDN have direct access to the documentation.
- All 25 component sections and external raw GitHub documentation links in llms.txt match existing component directories and README files in the repository.
📊 Token Usage & Cost Efficiency
| Metric | Value |
|---|---|
| Input Tokens (uncached) | 2,845 |
| Input Tokens (cached) | 164,686 (⚡ 97.8% cached) |
| PR Comments History Tokens | 838 |
| Thinking / Reasoning Tokens | 6,202 |
| Output Tokens | 648 |
| Dynamic Context Selection Tokens | 3,235 |
| Total Session Tokens | 178,454 |
| Cost (uncached input) | $0.0055 |
| Cost (cached input) | $0.0124 |
| Cost (thinking / reasoning) | $0.0465 |
| Cost (response output) | $0.0049 |
| Cost (context selection) | $0.0080 |
| Estimated Total Cost | $0.0772 |
Gemini 4 Hydrogen: standard tier, global endpoint; regional endpoints are 10% higher.
Cache reads are priced here, but context-cache STORAGE, where the model charges for it separately per token-hour, is not included, so the figure can run slightly low.
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://create-agents-markdown-material.treeder.workers.dev (commit 25fd1b5)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
There was a problem hiding this comment.
📋 Review Summary
This Pull Request introduces llms.txt as a single-file reference tailored for AI coding agents and LLMs, links to it from README.md, and updates package.json to include llms.txt and Markdown documentation in published packages. The guide accurately documents the unified color/type attribute APIs and M3 Expressive components that distinguish material-esm/material from @material/web, and all five prior review comments have been cleanly addressed.
✅ Resolved Items from Prior Reviews
- Updated the example buttons to use plain HTML onclick handlers targeting document.getElementById('confirm-dlg') instead of mismatched Lit @click bindings. (
llms.txt:302) - Updated the trigger button example to use onclick="document.getElementById('more-menu').show()" instead of a mismatched Lit @click handler. (
llms.txt:358) - Updated the documentation to list supportingtext and errortext as the lowercase HTML attributes mapped by Lit in select/select.js. (
llms.txt:419) - Updated the action button example to use onclick="document.getElementById('filters').close('apply')" for consistency with plain HTML examples. (
llms.txt:448) - Standardised the attribute listing to readonly (readOnly), minlength (minLength), maxlength (maxLength), and inputmode (inputMode) to match the rest of the guide and text/text-field.js. (
llms.txt:503)
🔍 General Feedback
- Clear upfront migration table distinguishing material-esm/material's unified elements (e.g. , , , ) from legacy @material/web tag names, alongside important caveats such as using selected rather than checked.
- The import map, package name guidance, and component property/slot/event summaries in llms.txt align accurately with README.md, index.html, and the underlying Lit component implementations.
- Including llms.txt and **/*.md in the package.json files array ensures documentation is distributed with the published npm package.
📊 Token Usage & Cost Efficiency
| Metric | Value |
|---|---|
| Input Tokens (uncached) | 1,866 |
| Input Tokens (cached) | 173,110 (⚡ 98.1% cached) |
| PR Comments History Tokens | 1,487 |
| Thinking / Reasoning Tokens | 6,409 |
| Output Tokens | 641 |
| Dynamic Context Selection Tokens | 3,330 |
| Total Session Tokens | 186,843 |
| Cost (uncached input) | $0.0050 |
| Cost (cached input) | $0.0130 |
| Cost (thinking / reasoning) | $0.0481 |
| Cost (response output) | $0.0048 |
| Cost (context selection) | $0.0087 |
| Estimated Total Cost | $0.0796 |
Gemini 4 Hydrogen: standard tier, global endpoint; regional endpoints are 10% higher.
Cache reads are priced here, but context-cache STORAGE, where the model charges for it separately per token-hour, is not included, so the figure can run slightly low.
Summary
Add a root
llms.txtreference so AI coding agents and LLMs consumingmaterial-esm/materialcan fetch the entire component API in a single pass without hallucinating legacy@material/webtag names or import paths.Changes
llms.txt:@material/webtag names/imports withmaterial-esm/material's unified<md-button>,<md-icon-button>,<md-button-group connected>,<md-text-field>,<md-select>,<md-chip>,<md-tab>,<md-progress>, and<md-sheet>APIs.<script type=importmap>, npm installation, Google Fonts / Material Symbols, M3 theme CSS custom properties,material/typography/md-typescale.jshelpers, and Lit usage.import 'material/...'paths,<md-*>tags, attributes/defaults, slots, methods, and events).raw.githubusercontent.com/.../README.md) following thellms.txtspecification.README.md: Linkllms.txtunder Documentation.package.json: Includellms.txtand**/*.mdinfilesso npm package consumers also getllms.txtand per-component READMEs insidenode_modules/material/.Verification
customElements.define(...)tag names, module paths, property defaults, slots, methods, and events directly against component source files and READMEs.README.mdandpackage.jsonwith Prettier.