Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Apply modern web development best practices for security, compatibility, and code quality. Use when asked to "apply best practices", "security audit", "modernize code", "code quality review", or "check for vulnerabilities".
.claude/skills/mkurman-best-practices/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-06 | ✗→✓ | ▲ Improved | 134% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 38% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 74% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 93% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 46% | 0% |
javascript// ❌ document.write (blocks parsing) document.write('<script src="..."></script>'); // ✅ Dynamic script loading const script = document.createElement('script'); script.src = '...'; document.head.appendChild(script); // ❌ Synchronous XHR (blocks main thread) const xhr = new XMLHttpRequest(); xhr.open('GET', url, false); // false = synchronous // ✅ Async fetch const response = await fetch(url); // ❌ Application Cache (deprecated) <html manifest="cache.manifest"> // ✅ Service Workers if ('serviceWorker' in navigator) { navigator.serviceWorker.register('/sw.js'); }
javascript// ❌ Non-passive touch/wheel (may block scrolling) element.addEventListener('touchstart', handler); element.addEventListener('wheel', handler); // ✅ Passive listeners (allows smooth scrolling) element.addEventListener('touchstart', handler, { passive: true }); element.addEventListener('wheel', handler, { passive: true }); // ✅ If you need preventDefault, be explicit element.addEventListener('touchstart', handler, { passive: false });
javascript// ❌ Errors in production console.log('Debug info'); // Remove in production throw new Error('Unhandled'); // Catch all errors // ✅ Proper error handling try { riskyOperation(); } catch (error) { // Log to error tracking service errorTracker.captureException(error); // Show user-friendly message showErrorMessage('Something went wrong. Please try again.'); }
jsxclass ErrorBoundary extends React.Component { state = { hasError: false }; static getDerivedStateFromError(error) { return { hasError: true }; } componentDidCatch(error, info) { errorTracker.captureException(error, { extra: info }); } render() { if (this.state.hasError) { return <FallbackUI />; } return this.props.children; } } // Usage <ErrorBoundary> <App /> </ErrorBoundary>
javascript// Catch unhandled errors window.addEventListener('error', (event) => { errorTracker.captureException(event.error); }); // Catch unhandled promise rejections window.addEventListener('unhandledrejection', (event) => { errorTracker.captureException(event.reason); });
javascript// ❌ Source maps exposed in production // webpack.config.js module.exports = { devtool: 'source-map', // Exposes source code }; // ✅ Hidden source maps (uploaded to error tracker) module.exports = { devtool: 'hidden-source-map', }; // ✅ Or no source maps in production module.exports = { devtool: process.env.NODE_ENV === 'production' ? false : 'source-map', };
javascript// ❌ Blocking script <script src="heavy-library.js"></script> // ✅ Deferred script <script defer src="heavy-library.js"></script> // ❌ Blocking CSS import @import url('other-styles.css'); // ✅ Link tags (parallel loading) <link rel="stylesheet" href="styles.css"> <link rel="stylesheet" href="other-styles.css">
javascript// ❌ Handler on every element items.forEach(item => { item.addEventListener('click', handleClick); }); // ✅ Event delegation container.addEventListener('click', (e) => { if (e.target.matches('.item')) { handleClick(e); } });
javascript// ❌ Memory leak (never removed) const handler = () => { /* ... */ }; window.addEventListener('resize', handler); // ✅ Cleanup when done const handler = () => { /* ... */ }; window.addEventListener('resize', handler); // Later, when component unmounts: window.removeEventListener('resize', handler); // ✅ Using AbortController const controller = new AbortController(); window.addEventListener('resize', handler, { signal: controller.signal }); // Cleanup: controller.abort();
html<!-- ❌ Invalid HTML --> <div id="header"> <div id="header"> <!-- Duplicate ID --> <ul> <div>Item</div> <!-- Invalid child --> </ul> <a href="/"><button>Click</button></a> <!-- Invalid nesting --> <!-- ✅ Valid HTML --> <header id="site-header"> </header> <ul> <li>Item</li> </ul> <a href="/" class="button">Click</a>
html<!-- ❌ Non-semantic --> <div class="header"> <div class="nav"> <div class="nav-item">Home</div> </div> </div> <div class="main"> <div class="article"> <div class="title">Headline</div> </div> </div> <!-- ✅ Semantic HTML5 --> <header> <nav> <a href="/">Home</a> </nav> </header> <main> <article> <h1>Headline</h1> </article> </main>
html<!-- ❌ Distorted images --> <img src="photo.jpg" width="300" height="100"> <!-- If actual ratio is 4:3, this squishes the image --> <!-- ✅ Preserve aspect ratio --> <img src="photo.jpg" width="300" height="225"> <!-- Actual 4:3 dimensions --> <!-- ✅ CSS object-fit for flexibility --> <img src="photo.jpg" style="width: 300px; height: 200px; object-fit: cover;">
javascript// ❌ Request on page load (bad UX, often denied) navigator.geolocation.getCurrentPosition(success, error); // ✅ Request in context, after user action findNearbyButton.addEventListener('click', async () => { // Explain why you need it if (await showPermissionExplanation()) { navigator.geolocation.getCurrentPosition(success, error); } });
html<!-- Restrict powerful features --> <meta http-equiv="Permissions-Policy" content="geolocation=(), camera=(), microphone=()"> <!-- Or allow for specific origins --> <meta http-equiv="Permissions-Policy" content="geolocation=(self 'https://maps.example.com')">
npm audit)| Tool | Purpose | |------|---------| | npm audit | Dependency vulnerabilities | | SecurityHeaders.com | Header analysis | | W3C Validator | HTML validation | | Lighthouse | Best practices audit | | Observatory | Security scan |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-05 | pass→pass | 17,943 | 14,736 | -18% | 1 | 1 | 0% | 3,418 | 4,701 | +38% | 0 | 0 | — |
case-01 | pass→pass | 12,367 | 9,765 | -21% | 1 | 1 | 0% | 2,151 | 3,740 | +74% | 0 | 0 | — |
case-02 | pass→pass | 9,977 | 8,542 | -14% | 1 | 1 | 0% | 1,829 | 3,538 | +93% | 0 | 0 | — |
case-03 | pass→pass | 25,974 | 10,409 | -60% | 1 | 1 | 0% | 2,807 | 4,104 | +46% | 0 | 0 | — |
case-04 | pass→pass | 7,348 | 7,238 | -1% | 1 | 1 | 0% | 1,235 | 3,110 | +152% | 0 | 0 | — |
case-06 | fail→pass | 13,565 | 16,566 | +22% | 1 | 1 | 0% | 1,688 | 3,955 | +134% | 0 | 0 | — |
case-07 | pass→pass | 23,751 | 8,292 | -65% | 1 | 1 | 0% | 1,760 | 3,399 | +93% | 0 | 0 | — |
case-08 | pass→pass | 11,322 | 8,662 | -23% | 1 | 1 | 0% | 1,882 | 3,411 | +81% | 0 | 0 | — |
case-09 | pass→pass | 3,977 | 3,492 | -12% | 1 | 1 | 0% | 621 | 2,570 | +314% | 0 | 0 | — |
case-10 | pass→pass | 10,510 | 9,263 | -12% | 1 | 1 | 0% | 1,836 | 3,028 | +65% | 0 | 0 | — |
case-11 | pass→pass | 8,598 | 7,577 | -12% | 1 | 1 | 0% | 1,493 | 3,214 | +115% | 0 | 0 | — |
case-12 | pass→pass | 8,322 | 6,150 | -26% | 1 | 1 | 0% | 1,479 | 2,952 | +100% | 0 | 0 | — |
case-13 | pass→pass | 7,003 | 7,203 | +3% | 1 | 1 | 0% | 1,229 | 3,190 | +160% | 0 | 0 | — |
case-14 | pass→pass | 9,928 | 6,927 | -30% | 1 | 1 | 0% | 1,862 | 3,357 | +80% | 0 | 0 | — |
case-15 | pass→pass | 11,628 | 6,046 | -48% | 1 | 1 | 0% | 2,129 | 3,015 | +42% | 0 | 0 | — |
case-16 | pass→pass | 15,835 | 13,777 | -13% | 1 | 1 | 0% | 2,612 | 4,616 | +77% | 0 | 0 | — |
case-17 | pass→pass | 7,780 | 3,362 | -57% | 1 | 1 | 0% | 1,308 | 2,463 | +88% | 0 | 0 | — |
case-18 | pass→pass | 2,731 | 2,601 | -5% | 1 | 1 | 0% | 398 | 2,314 | +481% | 0 | 0 | — |
case-19 | pass→pass | 5,530 | 4,178 | -24% | 1 | 1 | 0% | 906 | 2,523 | +178% | 0 | 0 | — |
case-20 | pass→pass | 9,981 | 6,989 | -30% | 1 | 1 | 0% | 1,758 | 3,308 | +88% | 0 | 0 | — |
case-21 | pass→pass | 11,756 | 10,321 | -12% | 1 | 1 | 0% | 2,122 | 3,785 | +78% | 0 | 0 | — |
case-22 | pass→pass | 16,181 | 15,844 | -2% | 1 | 1 | 0% | 2,638 | 4,500 | +71% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +5 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.