agentleFS
SnoozleStudioSnoozleStudio/opencode-wp-settings/skills/wp-html-standards/SKILL.md

wp-html-standards

Skill4 starsChanged 3 days agoMITView on GitHub

WordPress HTML Coding Standards reference — W3C validation, self-closing elements, attribute quoting, lowercase tags, tabs indentation, PHP and HTML mixing. Use when writing or reviewing theme templates, markup in PHP files, or when asked about WordPress HTML conventions. Pairs with wp-css-standards and wp-js-standards.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write and review HTML that follows the WordPress HTML Coding Standards — valid, escaped, tab-indented markup that plays well with PHP …

    line 12
  2. Distinctive:

    All pages verified against the W3C validator — well-formed markup catches automation-testable problems.

    line 25
  3. Distinctive:

    All tags and attributes lowercase

    line 34
  4. Very specific:

    Every attribute has a value, single or double quoted: <input type="text" name="email" disabled="disabled" />

    line 41
  5. Very specific:

    Never write unescaped output in markup — every dynamic value passes through the escaping matrix (esc_html/esc_attr/esc_url/wp_kses_post)

    line 73
  6. Very specific:

    Keep markup valid even without JS (content usable <noscript>)

    line 76

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

WordPress HTML Coding Standards

Distilled from the official WordPress HTML Coding Standards (developer.wordpress.org).

Goal

Write and review HTML that follows the WordPress HTML Coding Standards — valid, escaped, tab-indented markup that plays well with PHP templates.

When to use

  • Writing or reviewing template markup in theme/plugin PHP files
  • Reviewing rendered HTML for standard compliance
  • Answering "what does the WordPress HTML standard say about X"

The standard

Validation

  • All pages verified against the W3C validator — well-formed markup catches automation-testable problems; not a substitute for manual review

Self-closing elements

  • Forward slash with exactly one space before it: <br /> — never <br/>

Attributes and tags

  • All tags and attributes lowercase
  • Attribute values lowercase when machine-interpreted (content-type); proper title capitalization for human-readable data (link titles)
  • Attributes always quoted (unquoted attributes are a security vulnerability)

Quotes

  • Every attribute has a value, single or double quoted: <input type="text" name="email" disabled="disabled" />
  • Boolean attributes: value omitted — disabled, never disabled="true" (true/false are invalid on boolean attributes)

Indentation

  • Tabs, not spaces; indentation reflects logical structure
  • Mixing PHP and HTML: indent PHP blocks to match surrounding HTML; closing PHP blocks at the same indentation as opening
<?php if ( ! have_posts() ) : ?>
<div id="post-1" class="post">
    <h1 class="entry-title">Not Found</h1>
    <?php get_search_form(); ?>
</div>
<?php endif; ?>

Enforcement mapping

RuleEnforced by
Tabs, quoting, trailing whitespacePrettier HTML (useTabs: true)
Mixed PHP/HTML indentation, embedded PHP tag layoutWPCS Squiz.PHP.EmbeddedPhp (via phpcs)
Lowercase tags/attributesPrettier HTML (normalizes)
W3C validationReview + validator (no automated gate)
Escaping of dynamic outputWPCS WordPress.Security.EscapeOutput (esc_html/esc_attr/esc_url at output)

Rules

  • Never write unescaped output in markup — every dynamic value passes through the escaping matrix (esc_html/esc_attr/esc_url/wp_kses_post)
  • Boolean attributes without values; self-closing with the space
  • Keep markup valid even without JS (content usable <noscript>)

Output contract

  • Templates written: valid HTML5, tabs, all output escaped at echo time
  • Review findings: file:line + violated rule + fix

References

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.