web-quality-best-practices

Applies security, compatibility, and code quality best practices to web codebases.

Updated May 26, 2026
One-click install
npx skills add https://github.com/avel123111/triplanio --skill web-quality-best-practices-avel123111
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: web-quality-best-practices
Source: https://github.com/avel123111/triplanio/tree/main/.claude/skills/web-quality-best-practices
Command: npx skills add https://github.com/avel123111/triplanio --skill web-quality-best-practices-avel123111

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Web applications often ship with security vulnerabilities, deprecated APIs, and compatibility issues that are hard to catch manually. This Skill provides a structured checklist and concrete code patterns based on Lighthouse best practices audits to review and modernize web code. ## Core Features & Use Cases - Security Hardening: Enforce HTTPS, configure CSP headers, Trusted Types, Subresource Integrity, secure cookies, and audit dependencies with npm audit. - Compatibility & Deprecation Cleanup: Replace deprecated APIs like document.write and synchronous XHR, add proper doctype, charset, viewport meta tags, and passive event listeners. - Code Quality Review: Validate semantic HTML, error boundaries, memory cleanup, source map configuration, and permission request patterns. - Use Case: Before deploying a React + Vite app, ask for a security audit to get a checklist of missing CSP headers, vulnerable dependencies, and exposed source maps with concrete fixes. ## Quick Start Review my web project for security vulnerabilities and modern best practices, then list the fixes I should apply.

Frequently Asked Questions about web-quality-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit my web app for security vulnerabilities?

Run npm audit to find vulnerable dependencies, then check for HTTPS enforcement, CSP headers, Trusted Types enforcement, and SRI hashes on third-party scripts. The Skill provides a complete security checklist covering HSTS, X-Content-Type-Options, and Referrer-Policy headers.

How to set up Content Security Policy headers?

Configure a CSP header with default-src 'self', script-src with nonces, frame-ancestors, base-uri, and form-action directives. Use nonces for inline scripts and roll out with Content-Security-Policy-Report-Only before enforcing.

What is Trusted Types and how does it prevent XSS?

Trusted Types is a browser mechanism that makes DOM sinks like innerHTML reject raw strings and accept only sanitized typed objects from a named policy. Enforce it with the require-trusted-types-for 'script' CSP directive and use DOMPurify as the sanitizer.

Should I load polyfills from a CDN like polyfill.io?

No, never load polyfills from third-party CDNs you do not control; polyfill.io was compromised in a 2024 supply-chain attack. Bundle polyfills at build time with Babel or core-js, or self-host with Subresource Integrity hashes.

Why should I avoid document.write and synchronous XHR?

document.write blocks HTML parsing and breaks in async contexts, while synchronous XHR blocks the main thread and freezes the UI. Replace them with dynamically created script elements and async fetch calls.

How do I hide source maps in production builds?

Use hidden-source-map in webpack or sourcemap: 'hidden' in Vite so the sourceMappingURL comment is not emitted. Strip sourcesContent from maps uploaded to error trackers to avoid exposing original source code.