# best-practices

Checks web code against Lighthouse standards, patches dependency vulnerabilities, and sets up browser security headers.

- skill · `type=skill` · Claude Code · 392 installs
- Author: web-quality-skills
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/development/best-practices
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/best-practices

## What it does

This skill brings Lighthouse-aligned web quality checks into Claude Code. It scans front-end files for insecure code, missing metadata, and retired browser features. That keeps code current.

The instructions cover Content Security Policy rules, cookie attributes, and running `npm audit`. In HTML markup, the skill checks doctype tags, viewport declarations, and UTF-8 encoding. It also flags `document.write` and replaces synchronous XHR with `fetch`.

HTML sanitization patterns rely on having `dompurify` installed in the project.

## Install

### Claude Code (native platform)

1. **claude-code-templates**
```bash
npx claude-code-templates@latest --skill development/best-practices
```

2. **Skills CLI (Vercel)**
```bash
npx skills add davila7/claude-code-templates --skill best-practices -a claude-code
```

3. **Manually: put the files in place**
- File: `~/.claude/skills/best-practices/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/best-practices/

### Codex

**Manually: put the files in place**
- File: `.agents/skills/best-practices/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

**Manually: put the files in place**
- File: `.cursor/skills/best-practices/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install davila7/claude-code-templates best-practices
```

2. **Manually: put the files in place**
- File: `.github/skills/best-practices/SKILL.md`

### Gemini CLI

**Platform CLI**
```bash
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/development/best-practices
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/best-practices/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/development/best-practices

## When to use it
- configure strict CSP and HSTS HTTP headers
- replace deprecated `document.write` and sync XHR calls
- audit project dependencies with `npm audit`
- enable passive event listeners for touch and wheel handlers

## Example prompts
- Run a security audit and patch vulnerable dependencies
- Set up CSP and security headers for this web app
- Review my code for deprecated browser APIs and unhandled errors

## Similar
- [frontend-design](https://affpapa.org/en/nevibecode/skills/frontend-design.md) — skill · 1025790 installs
- [design-taste-frontend](https://affpapa.org/en/nevibecode/skills/design-taste-frontend.md) — skill · 678700 installs
- [prototype](https://affpapa.org/en/nevibecode/skills/prototype.md) — skill · 986201 installs
- [hyperframes](https://affpapa.org/en/nevibecode/skills/heygen-com-hyperframes.md) — skill · 1200000 installs
- [hyperframes-cli](https://affpapa.org/en/nevibecode/skills/heygen-com-hyperframes-cli.md) — skill · 1300000 installs
- [webapp-testing](https://affpapa.org/en/nevibecode/skills/webapp-testing.md) — skill · 186758 installs

## Other versions with the same name
- [best-practices · moizibnyousaf](https://affpapa.org/en/nevibecode/skills/moizibnyousaf-best-practices.md) — 528 installs

From the same set: [davila7/claude-code-templates](https://affpapa.org/en/nevibecode/by/davila7/claude-code-templates.md) — 804 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
