best-practices
Apply modern web development best practices for security, compatibility, and code quality.
Skill by web-quality-skills
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/duart-555-best-practices
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill 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".
- License
- MIT
- Metadata
- author: web-quality-skills · version: 2.0
- Instructions
- 473 lines in SKILL.md · view on GitHub
Before installing
- Instructions call the network
Files (2)
- SKILL.md
- SECURITY.md · references/
SKILL.md (first lines)
# Best practices
Modern web development standards based on Lighthouse best practices audits. Covers security, browser compatibility, and code quality patterns.
## Evidence-led audit workflow
When a rendered page is available:
1. Run a live Lighthouse Best Practices audit when that capability is available; with Chrome DevTools MCP, use `lighthouse_audit`. Use navigation mode for a normal page load or snapshot mode when the current state must be preserved.
2. Inspect the listed console and network failures and fetch individual details only when they support a finding.
3. Supplement runtime evidence with dependency, header, configuration, and source inspection; Lighthouse is not a complete security assessment.
4. Fix the implicated code, re-run the same audit, and keep security findings separate from style preferences.
If live tools are unavailable, use the Lighthouse CLI plus focused dependency and header checks. Never report a high Lighthouse score as proof that the application is secure.
## Security
Read [the security reference](references/SECURITY.md) when security is in scope or a live audit surfaces a related failure. It covers HTTPS/HSTS, CSP and Trusted Types, Subresource Integrity, headers, dependencies, sanitization, and cookies.
At minimum:
* **Use HTTPS without mixed content.** Add HSTS only after confirming every relevant subdomain supports HTTPS.
* **Treat a strict CSP as defense in depth.** Prefer nonces or hashes and test with report-only before enforcement.
* **Sanitize untrusted HTML and protect DOM XSS sinks.** Prefer text APIs when markup is not required.
* **Pin and review third-party code.** Use SRI where the delivery model supports it and keep dependencies patched.
* **Verify response headers at runtime.** Source configuration alone does not prove what the deployed page sends.
## Browser compatibility
### Doctype declaration
```html
<!-- ❌ Missing or invalid doctype -->
<HTML>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!-- ✅ HTML5 doctype -->
<!DOCTYPE html>
<html lang="en">
```
### Character encoding
```html
<!-- ❌ Missing or late charset -->
<html>
<head>
<title>Page</title>
<meta charset="UTF-8">
</head>
<!-- ✅ Charset as first element in head -->
<html>
<head>
<meta charset="UTF-8">
<title>Page</title>
</head>
```
### Viewport meta tag
```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>
```
### Feature detection
```javascript
// ❌ 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;
}
}
```
### Polyfills (when needed)
Prefer **bundling polyfills at build time** (Babel/SWC + `core-js`, or `@vitejs/plugin-legacy`) targeted by your supported-browsers list. This eliminates the runtime check entirely and avoids shipping polyfill bytes to modern browsers.
If you must load a polyfill at runtime, append a script element — never use `document.write` (it blocks the parser and is broken in async/deferred contexts):
```html
<script>
if (!('fetch' in window)) {
const s = document.createElement('script');
s.src = '/polyfills/fetch.js';
s.defer = true;
document.head.appendChild(s);
}
</script>From duart-555/claude-code-setup, MIT.
More from duart-555/claude-code-setup
- 0.570score
apple-design-hig
duart-555
Cross-platform UI/UX design reviewer grounded in Apple's Human Interface Guidelines (123 pages pulled from developer.apple.com, including 57 component pages)…
SkillAFreshness: AClaude Code +9 - 0.561score
context-budget
duart-555
Audits Claude Code context window consumption across agents, skills, MCP servers, and rules.
SkillAFreshness: AClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Oct 15, 2026 (13 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 2.0
- License
- MIT
- Repository
- github.com/duart-555/claude-code-setup
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.798score
best-practices
web-quality-skills
Apply modern web development best practices for security, compatibility, and code quality.
SkillAFreshness: A★ 325Claude Code +9 - 0.344score
best-practices
bg-szy
Apply modern web development best practices for security, compatibility, and code quality.
SkillBFreshness: B★ 6Claude Code +9 - 0.333score
best-practices
web-quality-skills
Apply modern web development best practices for security, compatibility, and code quality.
SkillAFreshness: AClaude Code +9 - 0.279score
best-practices
web-quality-skills
Apply modern web development best practices for security, compatibility, and code quality.
SkillCFreshness: CClaude Code +9 - 0.279score
best-practices
web-quality-skills
Apply modern web development best practices for security, compatibility, and code quality.
SkillCFreshness: CClaude Code +9 - 0.264score
best-practices
addyosmani
Apply modern web development best practices for security, compatibility, and code quality.
SkillDFreshness: D★ 3Claude Code +9 - 0.240score
best-practices
web-quality-skills
Apply modern web development best practices for security, compatibility, and code quality.
SkillDFreshness: DClaude Code +9 - 0.240score
best-practices
web-quality-skills
Apply modern web development best practices for security, compatibility, and code quality.
SkillDFreshness: DClaude Code +9
More from web-quality-skills
- 0.798score
best-practices
web-quality-skills
Apply modern web development best practices for security, compatibility, and code quality.
SkillAFreshness: A★ 325Claude Code +9 - 0.582score
accessibility
web-quality-skills
Audit and improve web accessibility following WCAG 2.1 guidelines.
SkillAFreshness: A★ 1Claude Code +9 - 0.582score
accessibility
web-quality-skills
Audit and improve web accessibility following WCAG 2.1 guidelines.
SkillAFreshness: A★ 5Claude Code +9 - 0.529score
core-web-vitals
web-quality-skills
Optimize Core Web Vitals (LCP, INP, CLS) for better page experience using field and lab evidence.
SkillBFreshness: BClaude Code +9 - 0.423score
seo
web-quality-skills
Optimize for search engine visibility and ranking.
SkillDFreshness: D★ 1Claude Code +9 - 0.403score
accessibility
web-quality-skills
Audit and improve web accessibility following WCAG 2.2 guidelines.
SkillDFreshness: DClaude Code +9
Cite this page
best-practices skill. Agent Mart. https://agentmart.dev/skills/duart-555-best-practices (last updated 2026-10-24)