best-practices

Audit web pages against Lighthouse best practices for security, compatibility, and code quality.

Updated May 24, 2026
One-click install
npx skills add https://github.com/MWest2020/skill-forge --skill best-practices-mwest2020
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: best-practices
Source: https://github.com/MWest2020/skill-forge/tree/main/skills/best-practices
Command: npx skills add https://github.com/MWest2020/skill-forge --skill best-practices-mwest2020

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Web applications accumulate security gaps, deprecated API usage, and code quality issues that are hard to catch manually. This Skill provides a structured, evidence-led audit workflow based on Lighthouse Best Practices so agents can systematically find and fix problems in security, browser compatibility, and code quality. ## Core Features & Use Cases - Evidence-led audit workflow: Run live Lighthouse audits via Chrome DevTools MCP or fall back to the Lighthouse CLI, then verify findings with dependency, header, and source inspection. - Security hardening guidance: Covers HTTPS/HSTS, Content Security Policy, Trusted Types, Subresource Integrity, secure headers, dependency auditing, input sanitization, and secure cookies via a dedicated security reference. - Compatibility and quality patterns: Doctype, charset, viewport, feature detection, polyfill strategy, deprecated API replacements, passive listeners, error handling, source map hygiene, and semantic HTML with do/don't code examples. - Use Case: Ask an agent to run a security audit on a deployed page; it runs the Lighthouse audit, checks response headers and npm dependencies, consults the security reference, and returns a prioritized checklist of fixes. ## Quick Start Ask the agent to audit your web page for security vulnerabilities and modern best practices using the best-practices skill.

Frequently Asked Questions about best-practices

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

FAQPage Schema
How do I run a Lighthouse best practices audit on a web page?

Run a live audit with the Chrome DevTools MCP lighthouse_audit tool when mcp__chrome-devtools__ tools are available, using navigation mode for normal loads or snapshot mode to preserve page state. Otherwise fall back to the Lighthouse CLI with npx lighthouse <url> --only-categories=best-practices.

How do I check a website's security headers?

Verify response headers at runtime with curl -sI and grep for Strict-Transport-Security, Content-Security-Policy, X-Content-Type-Options, and Referrer-Policy. Source configuration alone does not prove what the deployed page actually sends.

Is a high Lighthouse score proof that a site is secure?

No. Lighthouse is not a complete security assessment, and a high score must never be reported as proof of security. Supplement it with dependency audits, header verification, and source inspection.

What replaces deprecated APIs like document.write and synchronous XHR?

Replace document.write with dynamically appended script elements, synchronous XHR with async fetch, and Application Cache with Service Workers. Add passive: true to touch and wheel listeners to avoid blocking scrolling.

Is it safe to load polyfills from a third-party CDN?

No. The polyfill.io service was compromised in a 2024 supply-chain attack. Prefer bundling polyfills at build time with Babel or core-js, self-host them, or use a vetted mirror pinned with Subresource Integrity hashes.