best-practices

Applies web security, compatibility, and code quality standards based on Lighthouse audits.

Updated Aug 13, 2026
One-click install
npx skills add https://github.com/Martino17x/Sentinel-Invest --skill best-practices-martino17x
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: best-practices
Source: https://github.com/Martino17x/Sentinel-Invest/tree/main/.agents/skills/best-practices
Command: npx skills add https://github.com/Martino17x/Sentinel-Invest --skill best-practices-martino17x

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 systematic checklist and concrete code patterns for auditing and fixing security headers, browser compatibility, and code quality problems. ## Core Features & Use Cases - Security Hardening: Enforce HTTPS, configure CSP and security headers, sanitize user input, secure cookies, and detect vulnerable dependencies with npm audit. - Compatibility & Deprecation Fixes: Replace deprecated APIs like document.write and synchronous XHR, add feature detection, passive event listeners, and proper meta tags. - Code Quality Review: Validate semantic HTML, error boundaries, memory cleanup, and source map configuration. - Use Case: Before launching a web app, ask the AI to audit your HTML and JavaScript against this checklist to catch mixed content, missing CSP headers, and memory leaks. ## Quick Start Audit my web application's HTML and JavaScript code for security vulnerabilities and deprecated APIs using the best practices checklist.

Frequently Asked Questions about best-practices

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

FAQPage Schema
How do I fix security vulnerabilities in web application dependencies?▼

Run npm audit or yarn audit to detect vulnerable packages, then use npm audit fix to auto-patch when possible. The skill also flags risky patterns like prototype pollution via Object.assign or _.merge with unsanitized user input.

How to configure Content Security Policy headers correctly?▼

Set CSP via an HTTP header rather than a meta tag, restricting default-src to 'self' and using nonces for inline scripts. Include directives like frame-ancestors, base-uri, and form-action to prevent clickjacking and injection attacks.

What deprecated web APIs should I avoid in modern JavaScript?▼

Avoid document.write, synchronous XHR, and Application Cache, which block rendering or are removed from browsers. Replace them with dynamic script loading, async fetch, and Service Workers respectively.

Does this checklist work with React applications?▼

Yes, it includes React-specific guidance such as Error Boundary components using getDerivedStateFromError and componentDidCatch to capture rendering errors. General patterns like event cleanup and input sanitization also apply to React codebases.

Why do passive event listeners matter for scroll performance?▼

Non-passive touchstart and wheel listeners force the browser to wait for JavaScript before scrolling, causing jank. Adding { passive: true } tells the browser the handler will not call preventDefault, enabling smooth scrolling.