1---2name: writing-web3description: Simple web development with HTML, CSS, JS, and HTMX. Use when working with .html, .css, or .htmx files, web templates, stylesheets, or vanilla JS scripts. NOT for React/Vue/Angular (use writing-typescript) or Node.js backends.4---56# Web Development78## Scope910- Use for HTML, CSS, HTMX, vanilla JS, and server-rendered templates.11- Do not use for React, Vue, Angular, TypeScript, Node.js backends, or app architecture.12- Follow existing template language, asset pipeline, framework, accessibility, and security conventions.13- Do not add a dependency, build step, or framework unless the project already uses it or the user approves.1415## Reference Reads1617- Read `references/patterns.md` before layout, behavior, accessibility, or security changes; skip for copy-only edits.1819## Defaults2021- Prefer semantic HTML and CSS; add HTMX or JS only when native browser behavior is insufficient.22- Use mobile-first, fluid CSS. Put repeated design tokens in custom properties; keep one-off values local.23- Preserve usable links and forms when practical.24- Treat accessibility, responsive behavior, and safe rendering as required behavior.25- Escape untrusted output; avoid `innerHTML` unless project sanitizer marks content trusted.2627## Comments2829- Use HTML comments only for template boundaries, generated blocks, or security assumptions that are not obvious from markup.30- Use CSS comments for non-obvious hacks, browser constraints, or integration boundaries.31- Use JS comments only for non-obvious constraints, invariants, side effects, tradeoffs, or browser quirks.32- Keep comments short. Move longer rationale to docs, issue links, or design notes.33- Do not comment obvious markup, selectors, declarations, or event handlers.34- Keep UI tests readable without comments; add one only for unobvious fixtures, browser setup, timing, or regression context.3536## Verification3738- Run project-configured format, lint, validation, tests, and browser checks for the changed files.39- For UI changes, check mobile and desktop widths plus keyboard navigation.40- For changed interactive behavior, run a browser test or state why it was skipped.41- If a check is unavailable, state the gap and run the closest configured gate.42- For rendered-browser verification (screenshots, live interaction, cross-viewport checks), use `browser-automation`.4344## Failure Handling4546- HTML or accessibility validation fails: fix the markup; do not suppress configured checks.47- HTMX request does not fire: check trigger, target, swap, response status, and CSRF/auth headers before adding JS fallback.48- Project conventions or checks are unclear: inspect config first; if still unclear, state the assumption and smallest safe gate.49- Broad, risky, or destructive change: state the risk and ask before acting. Do not run destructive commands.5051## Final Response5253- Files changed:54- Checks:55- Skipped checks:56- Risks/follow-ups: