agentleFS
sebyx07sebyx07/ruby2html/.claude/skills/add-html-tag/SKILL.md

add-html-tag

Skill23 starsChanged 12 days agoMITView on GitHub

Add a new HTML element (standard, void, or hyphenated custom element like turbo-frame) to the ruby2html DSL, with specs and docs. Use when a tag method is missing (NoMethodError for e.g. search, slot, svg) or the user asks to support a new element.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add the tag as written in HTML (lowercase, hyphens allowed, e.g.

    line 12

≈ “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

Add an HTML tag to ruby2html

Tags are data: Ruby2html::Render::HTML5_TAGS / VOID_ELEMENTS in lib/gem/ruby2html/render.rb. At load, define_tag(method_name, tag, void) is called on both Ruby2html::Native (C) and Ruby2html::PureRuby. No C change is needed unless a limit is hit.

Steps

  1. Add the tag as written in HTML (lowercase, hyphens allowed, e.g. turbo-frame) to HTML5_TAGS, keeping the list's ordering style. Method name = tag.tr('-', '_').
  2. Void element per the HTML spec (no closing tag)? Also add it to VOID_ELEMENTS (renders <tag attrs />, ignores content and block).
  3. Limits (C, ext/ruby2html/tag_render.c): name must match [a-z0-9-] and be ≤ 32 bytes (R2H_MAX_TAG_NAME); at most 200 tags (R2H_MAX_TAGS, trampoline pool). Raising a limit is a C change: update the macros/trampoline list and recompile.
  4. Name clashes: the new method shadows any same-named method for code running on a Render or Ruby2html::Component (and wins over component methods/slots inside ViewComponent html blocks). Check Render/Component methods (render, plain, component, content, helpers, output, current_output, link_to, image_tag, form_with, button_to) and common Rails helpers. TemplateCompiler picks the tag up automatically (it reads HTML5_TAGS), so in .html.rb templates a receiverless call of that name will now be rewritten to the tag; search the demo app and specs for existing uses.
  5. Specs in spec/gem/ inside a RenderSpecHelper.describe_each group (runs Native and PureRuby): content, attributes, block, escaping; void form if void.
  6. bundle exec rake compile, CI=1 bundle exec rspec spec/gem, bundle exec rubocop lib/gem/ruby2html/render.rb.
  7. Docs: mention notable new tags in llms.txt (DSL rule 1); ### Added under ## [Unreleased] in CHANGELOG.md.

Notes

  • SVG/MathML children (path, circle, foreignObject) are case-sensitive and come as a family; propose that as a separate design (the 200-slot pool and [a-z0-9-] rule matter) rather than adding one tag.

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.