component-common-domai…
Finds duplicate business logic spread across multiple components and suggests consolidation. Use when asking "where is this logic…
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". Do NOT use for accessibility (use web-accessibility),
Claude Code
$ npx -y skills add tech-leads-club/agent-skills --skill web-best-practices --agent claude-code
Codex
$ npx skills add tech-leads-club/agent-skills --skill web-best-practices -a codex -y
Cursor
$ npx skills add tech-leads-club/agent-skills --skill web-best-practices -a cursor -y
Gemini CLI
$ npx skills add tech-leads-club/agent-skills --skill web-best-practices -a gemini-cli -y
GitHub Copilot
$ npx skills add tech-leads-club/agent-skills --skill web-best-practices -a github-copilot -y
OpenCode
$ npx skills add tech-leads-club/agent-skills --skill web-best-practices -a opencode -y
Windsurf
$ npx skills add tech-leads-club/agent-skills --skill web-best-practices -a windsurf -y
name: best-practices description: 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". Do NOT use for accessibility (use web-accessibility), SEO (use seo), performance (use core-web-vitals), or comprehensive multi-area audits (use web-quality-audit). license: MIT metadata: author: web-quality-skills version: '1.0'
Modern web development standards based on Lighthouse best practices audits. Covers security, browser compatibility, and code quality patterns.
**Enforce HTTPS:**
<!-- ❌ Mixed content --> <img src="http://example.com/image.jpg" /> <script src="http://cdn.example.com/script.js"></script> <!-- ✅ HTTPS only --> <img src="https://example.com/image.jpg" /> <script src="https://cdn.example.com/script.js"></script> <!-- ✅ Protocol-relative (will use page's protocol) --> <img src="//example.com/image.jpg" />
**HSTS Header:**
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
<!-- Basic CSP via meta tag -->
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self';
script-src 'self' https://trusted-cdn.com;
style-src 'self' 'unsafe-inline';
img-src 'self' data: https:;
connect-src 'self' https://api.example.com;"
/>
<!-- Better: HTTP header -->**CSP Header (recommended):**
Content-Security-Policy: default-src 'self'; script-src 'self' 'nonce-abc123' https://trusted.com; style-src 'self' 'nonce-abc123'; img-src 'self' data: https:; connect-src 'self' https://api.example.com; frame-ancestors 'self'; base-uri 'self'; form-action 'self';
**Using nonces for inline scripts:**
<script nonce="abc123"> // This inline script is allowed </script>
# Prevent clickjacking X-Frame-Options: DENY # Prevent MIME type sniffing X-Content-Type-Options: nosniff # Enable XSS filter (legacy browsers) X-XSS-Protection: 1; mode=block # Control referrer information Referrer-Policy: strict-origin-when-cross-origin # Permissions policy (formerly Feature-Policy) Permissions-Policy: geolocation=(), microphone=(), camera=()
# Check for vulnerabilities npm audit yarn audit # Auto-fix when possible npm audit fix # Check specific package npm ls lodash
**Keep dependencies updated:**
// package.json
{
"scripts": {
"audit": "npm audit --audit-level=moderate",
"update": "npm update && npm audit fix"
}
}**Known vulnerable patterns to avoid:**
// ❌ Prototype pollution vulnerable patterns Object.assign(target, userInput) _.merge(target, userInput) // ✅ Safer alternatives const safeData = JSON.parse(JSON.stringify(userInput))
// ❌ XSS vulnerable element.innerHTML = userInput document.write(userInput) // ✅ Safe text content element.textContent = userInput // ✅ If HTML needed, sanitize import DOMPurify from 'dompurify' element.innerHTML = DOMPurify.sanitize(userInput)
// ❌ Insecure cookie document.cookie = "session=abc123"; // ✅ Secure cookie (server-side) Set-Cookie: session=abc123; Secure; HttpOnly; SameSite=Strict; Path=/
---
<!-- ❌ Missing or invalid doctype -->
<html lang="en">
<head>
<title>Page</title>
</head>
<body></body>
</html>
<!-- ✅ HTML5 doctype -->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Page</title>
</head>
<body></body>
</html><!-- ❌ Missing or late charset -->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Page</title>
<meta charset="UTF-8" />
</head>
<body></body>
</html>
<!-- ✅ Charset as first element in head -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Page</title>
</head>
<body></body>
</html><!-- ❌ Missing viewport --> <head> <title>Page</title> </head> <!-- ✅ Responsive viewport --> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>Page</title> </head>
// ❌ Browser detection (brittle)
if (navigator.userAgent.includes('Chrome')) {
// Chrome-specific code
}
// ✅ Feature detection
if ('IntersectionObserver' in window) {
// Use IntersectionObserver
} else {
// Fallback
}
// ✅ Using @supports in CSS
@supports (display: grid) {
.container {
display: grid;
}
}
@supports not (display: grid) {
.container {
display: flex;
}
}<!-- Load polyfills conditionally -->
<script>
if (!('fetch' in window)) {
document.write('<script src="/polyfills/fetch.js"><\/script>')
}
</script>
<!-- Or use polyfill.io -->
<script src="https://polyfill.io/v3/polyfill.min.js?features=fetch,IntersectionObserver"></script>---
// ❌ 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');
}// ❌ Non-passive touch/wheel (may block scrolling)
element.addEventListener('touchstart', handThe secure, validated skill registry for professional AI coding agents. Extend Antigravity, Claude Code, Cursor, Copilot and more with absolute confidence.
Finds duplicate business logic spread across multiple components and suggests consolidation. Use when asking "where is this logic…
Detects misplaced classes and fixes component hierarchy problems — finds code that should belong inside a component but sits at…
Maps architectural components in a codebase and measures their size to identify what should be extracted first. Use when asking…
Analyzes coupling between modules using the three-dimensional model (strength, distance, volatility) from "Balancing Coupling in…
Creates step-by-step decomposition plans and migration roadmaps for breaking apart monolithic applications. Use when asking "what…
Maps business domains and suggests service boundaries in any codebase using DDD Strategic Design. Use when asking "what are the…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.