writing-web · git:20260602.a416b78 · 2026-06-02 · sha256 a6bcf1edd1ade71e

writing-web git:20260602.a416b78B

Immutable. This exact content is served forever at /api/v1/blob/a6bcf1edd1ade71e.

---
description:
  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.
name: writing-web
---

# Web Development

## Scope

- Use for HTML, CSS, HTMX, vanilla JS, and server-rendered templates.
- Do not use for React, Vue, Angular, TypeScript, Node.js backends, or app architecture.
- Follow existing template language, asset pipeline, framework, accessibility, and security conventions.
- Do not add a dependency, build step, or framework unless the project already uses it or the user approves.

## Reference Reads

- Read `references/patterns.md` before layout, behavior, accessibility, or security changes; skip for copy-only edits.

## Defaults

- Prefer semantic HTML and CSS; add HTMX or JS only when native browser behavior is insufficient.
- Use mobile-first, fluid CSS. Put repeated design tokens in custom properties; keep one-off values local.
- Preserve usable links and forms when practical.
- Treat accessibility, responsive behavior, and safe rendering as required behavior.
- Escape untrusted output; avoid `innerHTML` unless project sanitizer marks content trusted.

## Verification

- Run project-configured format, lint, validation, tests, and browser checks for the changed files.
- For UI changes, check mobile and desktop widths plus keyboard navigation.
- For changed interactive behavior, run a browser test or state why it was skipped.
- If a check is unavailable, state the gap and run the closest configured gate.

## Failure Handling

- HTML or accessibility validation fails: fix the markup; do not suppress configured checks.
- HTMX request does not fire: check trigger, target, swap, response status, and CSRF/auth headers before adding JS fallback.
- Project conventions or checks are unclear: inspect config first; if still unclear, state the assumption and smallest safe gate.
- Broad, risky, or destructive change: state the risk and ask before acting. Do not run destructive commands.

## Final Response

- Files changed:
- Checks:
- Skipped checks:
- Risks/follow-ups: