api-design-rest
FreeWhen creating or extending an HTTP API for client consumption.
The English summary is being prepared. Showing the original description.
When designing and implementing web interfaces to ensure they are usable by everyone.
The English summary is being prepared. Showing the original description.
See how to installReview the instructions the agent will receive before you install.
Accessible interfaces are NOT optional extras—they're legal requirements (ADA, WCAG). This skill ensures web interfaces work for everyone: keyboard users, screen reader users, color-blind users, and users with cognitive disabilities. Accessible design is better design for all users.
<button>, <nav>, <dialog>, <form>) instead of building from <div>aria-* attributes ONLY when native HTML is insufficientalt attributes to images; provide captions for videos<label> elements with form inputsalt="" for decorative images)<label> elements<div onClick={...}> instead of <button><label> elementsoutline: none; without providing custom focus statesplaceholder attribute instead of <label> elementrole="button" on divs instead of <button>outline: none)alt="" if decorative)<label> elementsrole="button" on divs, use placeholder for labels, trap keyboard❌ Anti-pattern (Non-semantic, no labels, color-only error, no focus):
// BAD: DIV button, no accessibility
<div onClick={() => submit()} style={{ outline: 'none', cursor: 'pointer' }}>
Submit
</div>
// BAD: Input without label
<input type="email" placeholder="Email address" />
// BAD: Error shown only in red
<div style={{ color: 'red' }}>Password too short</div>
// BAD: Modal with focus trap
<div role="dialog">
<input />
{/* User can Tab outside modal */}
</div>
✅ Correct pattern (Semantic, labeled, accessible errors, focus managed):
// GOOD: Semantic button
<button onClick={() => submit()} type="button">
Submit
</button>
// GOOD: Label explicitly associated
<label htmlFor="email-input">Email address</label>
<input id="email-input" type="email" required />
// GOOD: Error shown with icon and text (not just color)
<div className="error" role="alert" aria-live="polite">
<Icon name="error" />
Password too short (minimum 8 characters)
</div>
// GOOD: Modal with focus trap and keyboard handling
const Modal = ({ isOpen, onClose, children }) => {
const modalRef = useRef(null);
useEffect(() => {
if (!isOpen) return;
const handleKeyDown = (e) => {
if (e.key === 'Escape') onClose();
};
// Focus first interactive element in modal
const firstFocusable = modalRef.current?.querySelector('button, [href], input');
firstFocusable?.focus();
window.addEventListener('keydown', handleKeyDown);
return () => window.removeEventListener('keydown', handleKeyDown);
}, [isOpen]);
return (
<dialog
ref={modalRef}
open={isOpen}
role="dialog"
aria-modal="true"
aria-labelledby="modal-title"
>
<h1 id="modal-title">Modal Title</h1>
{children}
<button onClick={onClose}>Close</button>
</dialog>
);
};
No reviews yet. Tell others what you thought.
No login needed. Share how it worked for you, ask a question, or note where it did not run.
No comments yet. Be the first to write one.
When creating or extending an HTTP API for client consumption.
The English summary is being prepared. Showing the original description.
When improving read performance and reducing database load.
The English summary is being prepared. Showing the original description.
When configuring automated build, test, and deployment workflows for a repository.
The English summary is being prepared. Showing the original description.
When asynchronously reviewing peer code before merging into the main branch.
The English summary is being prepared. Showing the original description.
When addressing slow application endpoints, high database CPU usage, or standardizing data access patterns.
The English summary is being prepared. Showing the original description.
When isolating and fixing unpredictable or complex software bugs.
The English summary is being prepared. Showing the original description.