Skip to content

docs: add llms.txt reference for AI coding agents - #161

Merged
treeder merged 3 commits into
mainfrom
create_agents_markdown
Nov 25, 2026
Merged

treeder merged 3 commits into
mainfrom
create_agents_markdown

Conversation

@treeder

@treeder treeder commented Nov 17, 2026

Copy link
Copy Markdown
Member

Summary

Add a root llms.txt reference so AI coding agents and LLMs consuming material-esm/material can fetch the entire component API in a single pass without hallucinating legacy @material/web tag names or import paths.

Changes

  • llms.txt:
    • Side-by-side guardrail table contrasting legacy @material/web tag names/imports with material-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.
    • Setup guide for zero-build CDN <script type=importmap>, npm installation, Google Fonts / Material Symbols, M3 theme CSS custom properties, material/typography/md-typescale.js helpers, and Lit usage.
    • Complete reference for all 25 component families (exact import 'material/...' paths, <md-*> tags, attributes/defaults, slots, methods, and events).
    • Raw markdown documentation index (raw.githubusercontent.com/.../README.md) following the llms.txt specification.
  • README.md: Link llms.txt under Documentation.
  • package.json: Include llms.txt and **/*.md in files so npm package consumers also get llms.txt and per-component READMEs inside node_modules/material/.

Verification

  • Verified all customElements.define(...) tag names, module paths, property defaults, slots, methods, and events directly against component source files and READMEs.
  • Formatted README.md and package.json with Prettier.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 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/web migration table and highlighting key gotchas (such as <md-switch> using selected instead of checked) directly addresses common LLM generation errors.
  • Including llms.txt and **/*.md in package.json's files field ensures local AI coding tools inspecting node_modules/material have offline access to the full reference and component READMEs.
  • Consider keeping code examples in ```html blocks 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.

Comment thread llms.txt Resolved
Comment thread llms.txt Resolved
Comment thread llms.txt Resolved
Comment thread llms.txt Resolved

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 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.

Comment thread llms.txt Resolved
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://create-agents-markdown-material.treeder.workers.dev (commit 25fd1b5)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://74067d9f-material.treeder.workers.dev 25fd1b5 2026-11-25T15:36:07.254Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://e61a0add-material.treeder.workers.dev d38df01 2026-11-17T14:02:59.161Z Visit the dashboard ↗

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 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.

@treeder
treeder merged commit f2e8d4e into main Nov 25, 2026
2 checks passed
@treeder
treeder deleted the create_agents_markdown branch November 25, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant