Document capability-driven presentation practice in CLAUDE.md.

This commit is contained in:
russell@unturf.com 2026-02-07 16:40:04 -05:00
parent 4b8d2aa4d3
commit fe237ba350

View file

@ -185,6 +185,37 @@ Disabling or removing tests weakens the codebase and is unacceptable. Tests are
**CRITICAL**: Do not include Claude Code attribution in commit messages. Attributing human work to Claude is inappropriate and misrepresents the actual authorship of the code. All code changes should be attributed to the human developer who reviewed, approved, and committed the work.
## Capability-Driven Presentation
Follow Russell Ballestrini's capability-driven presentation practice
(russell.ballestrini.net/capability-driven-presentation/). A page need not look
identical across all browsers. Accommodate what the user's browser can do:
1. **Single canonical URI** — one URL serves the content.
2. **Consistent content** — regardless of viewer capabilities.
3. **Graceful enhancement/degradation** — use available capabilities to enhance presentation.
### The `js-only` / `<noscript>` pattern
```html
<noscript>
<style>.js-only {display: none;}</style>
</noscript>
```
Apply the `js-only` class to any element that requires JavaScript to function.
When JS is unavailable, these elements hide automatically — the user never sees
a broken control.
### AJAX form submission
Comment forms use progressive enhancement: the form works as a normal POST +
redirect without JS. When JS is available, `comments.js` intercepts the submit,
sends via `fetch()` with `X-Requested-With: XMLHttpRequest`, and inserts the
new comment into the DOM without a page reload (preserving media playback).
The server returns JSON (HTTP 201) for AJAX requests and falls back to the
normal redirect flow on any error.
## Style
- **Never use "AI" — always say "machine learning."** We grow machine learning, not "AI." This term is forbidden in all permacomputer discourse, marketing, & documentation.