12-principles-of-anima…
Audit animation code against Disney's 12 principles adapted for web. Use when reviewing motion, implementing animations, or…
Audit UI code for audio feedback best practices. Use when reviewing sound implementation, checking audio UX decisions, or auditing accessibility. Outputs file:line findings.
$ npx -y skills add raphaelsalaja/skill --skill sounds-on-the-web --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/sounds-on-the-webContext preview
The summary Claude sees to decide when to auto-load this skill.
Audit UI code for audio feedback best practices. Use when reviewing sound implementation, checking audio UX decisions, or auditing accessibility. Outputs file:line findings.
name: sounds-on-the-web description: Audit UI code for audio feedback best practices. Use when reviewing sound implementation, checking audio UX decisions, or auditing accessibility. Outputs file:line findings. license: MIT metadata: author: raphael-salaja version: "2.0.0" source: /content/sounds-on-the-web/index.mdx
Review UI code for audio feedback best practices and accessibility.
1. Read the specified files (or prompt user for files/pattern) 2. Check against all rules below 3. Output findings in `file:line` format
| Priority | Category | Prefix | |----------|----------|--------| | 1 | Accessibility | `a11y-` | | 2 | Appropriateness | `appropriate-` | | 3 | Implementation | `impl-` | | 4 | Weight Matching | `weight-` |
Every audio cue must have a visual equivalent; sound never replaces visual feedback.
**Fail:**
function SubmitButton({ onClick }) {
const handleClick = () => {
playSound("success");
onClick(); // No visual confirmation
};
}**Pass:**
function SubmitButton({ onClick }) {
const [status, setStatus] = useState("idle");
const handleClick = () => {
playSound("success");
setStatus("success"); // Visual feedback too
onClick();
};
return <button data-status={status}>Submit</button>;
}Provide explicit toggle to disable sounds in settings.
**Fail:**
// No way to disable sounds
function App() {
return <SoundProvider>{children}</SoundProvider>;
}**Pass:**
function App() {
const { soundEnabled } = usePreferences();
return (
<SoundProvider enabled={soundEnabled}>
{children}
</SoundProvider>
);
}Respect prefers-reduced-motion as proxy for sound sensitivity.
**Fail:**
function playSound(name: string) {
audio.play(); // Plays regardless of preferences
}**Pass:**
function playSound(name: string) {
const prefersReducedMotion = window.matchMedia(
"(prefers-reduced-motion: reduce)"
).matches;
if (prefersReducedMotion) return;
audio.play();
}Allow volume adjustment independent of system volume.
**Fail:**
function playSound() {
audio.volume = 1; // Always full volume
audio.play();
}**Pass:**
function playSound() {
const { volume } = usePreferences();
audio.volume = volume; // User-controlled
audio.play();
}Do not add sound to high-frequency interactions (typing, keyboard navigation).
**Fail:**
function Input({ onChange }) {
const handleChange = (e) => {
playSound("keystroke"); // Annoying on every keystroke
onChange(e);
};
}**Pass:**
function Input({ onChange }) {
// No sound on typing - visual feedback only
return <input onChange={onChange} />;
}Sound is appropriate for confirmations: payments, uploads, form submissions.
**Pass:**
async function handlePayment() {
await processPayment();
playSound("success"); // Appropriate - significant action
showConfirmation();
}Sound is appropriate for errors and warnings that can't be overlooked.
**Pass:**
function handleError(error: Error) {
playSound("error"); // Appropriate - needs attention
showErrorToast(error.message);
}Do not add sound to decorative moments with no informational value.
**Fail:**
function Card({ onHover }) {
return (
<div onMouseEnter={() => playSound("hover")}> {/* Decorative, no value */}
{children}
</div>
);
}Sound should inform, not punish; avoid harsh sounds for user mistakes.
**Fail:**
function ValidationError() {
playSound("loud-buzzer"); // Punishing
return <span>Invalid input</span>;
}**Pass:**
function ValidationError() {
playSound("gentle-alert"); // Informative but not harsh
return <span>Invalid input</span>;
}Preload audio files to avoid playback delay.
**Fail:**
function playSound(name: string) {
const audio = new Audio(`/sounds/${name}.mp3`); // Loads on demand
audio.play();
}**Pass:**
const sounds = {
success: new Audio("/sounds/success.mp3"),
error: new Audio("/sounds/error.mp3"),
};
// Preload on app init
Object.values(sounds).forEach(audio => audio.load());
function playSound(name: keyof typeof sounds) {
sounds[name].currentTime = 0;
sounds[name].play();
}Default volume should be subtle, not loud.
**Fail:**
const DEFAULT_VOLUME = 1.0; // Too loud
**Pass:**
const DEFAULT_VOLUME = 0.3; // Subtle default
Reset audio currentTime before replay to allow rapid triggering.
**Fail:**
function playSound() {
audio.play(); // Won't replay if already playing
}**Pass:**
function playSound() {
audio.currentTime = 0;
audio.play();
}Sound weight should match action importance.
**Fail:**
// Loud fanfare for minor action
function handleToggle() {
playSound("triumphant-fanfare");
setEnabled(!enabled);
}**Pass:**
// Subtle click for minor action
function handleToggle() {
playSound("soft-click");
setEnabled(!enabled);
}
// Richer sound for significant action
function handlePurchase() {
playSound("success-chime");
completePurchase();
}Sound duration should match action duration.
**Fail:**
// 2-second sound for instant action
function handleClick() {
playSound("long-whoosh"); // 2000ms
// Action completes immediately
}**Pass:**
A skill file based on the articles written on userinterface.wiki. Designed for designers and engineers to help them build better user interfaces.
Audit animation code against Disney's 12 principles adapted for web. Use when reviewing motion, implementing animations, or…
Audit Web Audio API code for sound synthesis best practices. Use when reviewing procedural audio, implementing UI sounds, or…
Audit Motion/Framer Motion code for AnimatePresence best practices. Use when reviewing exit animations, modals, or presence…
Build icon components where any icon morphs into any other through SVG line transformation. Use when asked to "create morphing…
Audit CSS for pseudo-element best practices and View Transitions API usage. Use when reviewing hover effects, decorative layers,…
Audit animation code for correct timing function selection. Use when reviewing motion implementations, debugging animations that…