.claude/skills/modern-web-dev/SKILL.md
Use this skill when implementing web features to ensure modern APIs and techniques are used. Triggers: Building UI components, adding browser APIs, implementing features that could use legacy patterns. Examples: - "Add a copy to clipboard button" → ensures Clipboard API is used, not document.execCommand - "Implement drag and drop" → ensures HTML Drag and Drop API, not legacy jQuery UI - "Add form validation" → ensures Constraint Validation API, not manual validation - "Fetch data from API" → ensures fetch() with modern patterns, not XMLHttpRequest Additionally, always check for documented browser support requirements before recommending APIs. If you are asked about web development best practices or modern APIs, use this skill to provide up-to-date guidance.
npx skillsauth add paulkinlan/notebooklm-chrome moder-web-devInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are a modern web development expert. Your role is to ensure all code uses current web platform APIs and avoids legacy patterns when modern equivalents exist.
Before recommending any APIs, you MUST determine the project's browser support requirements.
Look for browser support requirements in these locations (in order):
browserslist fieldYou MUST ask the user before proceeding. Use AskUserQuestion with options like:
Question: "What browsers does this project need to support?"
Options:
- "Latest Chrome only (Chrome extension or modern app)"
- "Baseline Widely Available (all major browsers, stable features)"
- "Baseline Newly Available (cross-browser, includes recent features)"
- "Specific browsers/versions (I'll specify)"
After the user specifies browser support, you MUST document it for future sessions:
## Browser Support
**Target: [Browser description]**
This project targets [detailed description]. This means:
- [What Baseline features are supported]
- [Whether polyfills are needed]
- [Any browser-specific considerations]
package.json exists, suggest adding a browserslist field:{
"browserslist": ["last 2 Chrome versions"]
}
| Preset | Description | Baseline Support | | ---------------- | --------------------------------- | ------------------------------ | | Latest Chrome | Chrome 140+ only | All features + Chrome-specific | | Latest Browsers | Last 2 versions of major browsers | Baseline Newly Available | | Widely Available | 30+ months cross-browser support | Baseline Widely Available only | | Legacy Support | IE11 or older browsers | Requires polyfills |
Based on the project's documented browser support, select APIs accordingly:
Always prefer the most modern API that meets the project's browser support requirements. Avoid legacy APIs when modern equivalents exist within the support constraints.
When asked about implementing a feature or when you encounter code using potentially outdated APIs:
Use WebSearch and WebFetch to research across these authoritative sources:
| Source | Domain | Best For | | ----------------- | --------------------- | ------------------------------------------------------ | | MDN Web Docs | developer.mozilla.org | Comprehensive API documentation, browser compatibility | | web.dev | web.dev | Modern best practices, performance patterns | | Chrome Developers | developer.chrome.com | Chrome-specific APIs, extension APIs | | Google Developers | developers.google.com | Web platform features, tools |
For any API you recommend:
When suggesting APIs, include:
| Feature | Modern API | Instead Of |
| ------------ | ------------------------------------------------------ | ------------------------------ |
| Clipboard | navigator.clipboard.writeText() | document.execCommand('copy') |
| Fetch data | fetch() with async/await | XMLHttpRequest |
| DOM queries | querySelector(), querySelectorAll() | getElementById() alone |
| Iteration | for...of, array methods | for loops with index |
| Async | async/await, Promises | Callbacks, callback hell |
| Modules | ES Modules (import/export) | CommonJS, AMD, global scripts |
| Classes | ES6 class syntax | Constructor functions |
| Storage | IndexedDB, localStorage | Cookies for storage |
| Observers | IntersectionObserver, MutationObserver, ResizeObserver | Scroll/resize event polling |
| Animations | CSS animations, Web Animations API | jQuery animations |
| Forms | Constraint Validation API | Manual validation |
| Dates | Intl.DateTimeFormat, Temporal (when available) | Manual date formatting |
| Numbers | Intl.NumberFormat | Manual number formatting |
| Strings | Template literals, String methods | String concatenation |
| Arrays | Array.from(), spread operator, .at() | Array.prototype.slice.call() |
| Objects | Object spread, Object.entries() | Object.assign() alone |
| URL handling | URL, URLSearchParams | Manual string parsing |
| Events | AbortController for cancellation | Manual cleanup |
| Positioning | CSS Grid, Flexbox | Float layouts |
| Dialog/Modal | <dialog> element | Custom modal divs |
| Popover | Popover API (popover attribute) | Custom popover JS |
| Scroll | scrollIntoView() with options | Manual scroll calculations |
| Deep clone | structuredClone() | JSON.parse(JSON.stringify()) |
| UUID | crypto.randomUUID() | Libraries or manual generation |
If the project is a Chrome extension (check for manifest.json), also prefer:
chrome.scripting over chrome.tabs.executeScriptchrome.storage over localStorage in background scriptschrome.action over chrome.browserActionWhen you need to look up modern APIs, use these search patterns:
# For general web APIs
WebSearch: "[feature] MDN web API 2025"
WebSearch: "[feature] web.dev modern approach"
# For browser support
WebSearch: "[API name] browser support baseline"
WebSearch: "[API name] caniuse"
# For Chrome extension APIs
WebSearch: "[feature] chrome extension manifest v3"
WebSearch: "chrome.scripting API"
# Then fetch documentation
WebFetch: developer.mozilla.org/en-US/docs/Web/API/[APIName]
WebFetch: web.dev/articles/[topic]
WebFetch: developer.chrome.com/docs/extensions/[topic]
When reviewing code or suggesting implementations, format your response as:
API: [API Name] Status: Baseline Widely Available | Baseline Newly Available | [Browser]-specific Browser Support: [Meets/Does not meet] project requirements ([documented target]) Documentation: [Link to MDN or relevant docs]
// Modern implementation
[code example]
Replaces: [Legacy pattern if applicable] Polyfill needed: Yes/No (if applicable for the project's browser support)
Automatically apply these guidelines when:
document.execCommand, XMLHttpRequest, callbacks for async, etc.Every time this skill runs:
CRITICAL: Never assume browser support. Always verify documentation or ask the user first.
Always verify your recommendations against current documentation using the search tools available.
development
Analyzes type design quality focusing on encapsulation, invariant expression, usefulness, and enforcement. Provides quantitative ratings (1-10) for each dimension. Triggers: When adding new types, reviewing type design in PRs, refactoring types. Examples: - "Review the UserAccount type design" -> analyzes type encapsulation and invariants - "Analyze type design in this PR" -> reviews all newly added types - "Check if this type has strong invariants" -> evaluates invariant enforcement - "How can I improve this type?" -> provides actionable type design suggestions
development
Identifies silent failures, inadequate error handling, and inappropriate fallback behavior in code. Zero tolerance for errors that occur without proper logging and user feedback. Triggers: When reviewing error handling, checking for silent failures, analyzing catch blocks. Examples: - "Review the error handling" -> audits all error handling in recent changes - "Check for silent failures" -> hunts for swallowed errors and empty catch blocks - "Analyze catch blocks in this PR" -> reviews every try-catch for adequacy - "Are there any hidden failures?" -> finds errors that get silently ignored
development
Analyzes pull request test coverage quality and completeness. Focuses on behavioral coverage rather than line coverage, identifying critical gaps, test quality issues, and missing edge cases. Triggers: After writing tests, before creating a PR, when reviewing test coverage. Examples: - "Check if the tests are thorough" -> analyzes test coverage quality - "Review test coverage for this PR" -> maps tests to changed code - "Are there any critical test gaps?" -> identifies missing test scenarios - "Review my test quality" -> evaluates test resilience and patterns
documentation
Fix all comments from the GitHub pull request for the current branch. Fetches PR review comments and addresses each issue raised by reviewers. Triggers: When you want to address PR feedback, fix review comments, or resolve PR issues. Examples: - "Fix the PR comments" → fetches and fixes all outstanding review comments - "Address the review feedback" → same behavior - "Fix PR issues" → same behavior