javascript-pro
Qué hace
Guía al agente de IA para escribir JavaScript limpio y moderno para navegadores y Node.js. Está pensada para desarrolladores que trabajan con JavaScript puro o necesitan mejorar código JS existente.
Cuándo usarla
- ✓Cuando construyes una app de JavaScript puro o un servicio de Node.js.
- ✓Cuando necesitas limpiar o corregir código asíncrono basado en Promises.
- ✓Cuando quieres que un archivo de JavaScript se revise en cuanto a corrección y buenas prácticas.
Link de la skill
https://github.com/Jeffallan/claude-skills/blob/main/skills/javascript-pro/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Refactoriza este archivo de JavaScript para usar async y await, y después compruébalo con el linter.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente revisa la configuración del proyecto, diseña los módulos y los flujos asíncronos, y escribe código moderno. Ejecuta ESLint y comprueba si hay fugas de memoria o rechazos de promesas no gestionados antes de terminar.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
JavaScript Pro
When to Use This Skill
- Building vanilla JavaScript applications
- Implementing async/await patterns and Promise handling
- Working with modern module systems (ESM/CJS)
- Optimizing browser performance and memory usage
- Developing Node.js backend services
- Implementing Web Workers, Service Workers, or browser APIs
Core Workflow
- Analyze requirements — Review
package.json, module system, Node version, browser targets; confirm.js/.mjs/.cjsconventions - Design architecture — Plan modules, async flows, and error handling strategies
- Implement — Write ES2023+ code with proper patterns and optimisations
- Validate — Run linter (
eslint --fix); if linter fails, fix all reported issues and re-run before proceeding. Check for memory leaks with DevTools or--inspect, verify bundle size; if leaks are found, resolve them before continuing - Test — Write comprehensive tests with Jest achieving 85%+ coverage; if coverage falls short, add missing cases and re-run. Confirm no unhandled Promise rejections
Reference Guide
Load detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| Modern Syntax | references/modern-syntax.md |
ES2023+ features, optional chaining, private fields |
| Async Patterns | references/async-patterns.md |
Promises, async/await, error handling, event loop |
| Modules | references/modules.md |
ESM vs CJS, dynamic imports, package.json exports |
| Browser APIs | references/browser-apis.md |
Fetch, Web Workers, Storage, IntersectionObserver |
| Node Essentials | references/node-essentials.md |
fs/promises, streams, EventEmitter, worker threads |
Constraints
MUST DO
- Use ES2023+ features exclusively
- Use
X | nullorX | undefinedpatterns - Use optional chaining (
?.) and nullish coalescing (??) - Use async/await for all asynchronous operations
- Use ESM (
import/export) for new projects - Implement proper error handling with try/catch
- Add JSDoc comments for complex functions
- Follow functional programming principles
MUST NOT DO
- Use
var(always useconstorlet) - Use callback-based patterns (prefer Promises)
- Mix CommonJS and ESM in the same module
- Ignore memory leaks or performance issues
- Skip error handling in async functions
- Use synchronous I/O in Node.js
- Mutate function parameters
- Create blocking operations in the browser
Key Patterns with Examples
Async/Await Error Handling
// ✅ Correct — always handle async errors explicitly
async function fetchUser(id) {
try {
const response = await fetch(`/api/users/${id}`);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
return await response.json();
} catch (err) {
console.error("fetchUser failed:", err);
return null;
}
}
// ❌ Incorrect — unhandled rejection, no null guard
async function fetchUser(id) {
const response = await fetch(`/api/users/${id}`);
return response.json();
}
Optional Chaining & Nullish Coalescing
// ✅ Correct
const city = user?.address?.city ?? "Unknown";
// ❌ Incorrect — throws if address is undefined
const city = user.address.city || "Unknown";
ESM Module Structure
// ✅ Correct — named exports, no default-only exports for libraries
// utils/math.mjs
export const add = (a, b) => a + b;
export const multiply = (a, b) => a * b;
// consumer.mjs
import { add } from "./utils/math.mjs";
// ❌ Incorrect — mixing require() with ESM
const { add } = require("./utils/math.mjs");
Avoid var / Prefer const
// ✅ Correct
const MAX_RETRIES = 3;
let attempts = 0;
// ❌ Incorrect
var MAX_RETRIES = 3;
var attempts = 0;
Output Templates
When implementing JavaScript features, provide:
- Module file with clean exports
- Test file with comprehensive coverage
- JSDoc documentation for public APIs
- Brief explanation of patterns used
Maintained by @jeffallan, Principal Consultant at Synergetic Solutions
Preguntas frecuentes
¿Usa TypeScript?
No. La habilidad se centra en JavaScript moderno en archivos .js, .mjs y .cjs.
¿Cómo prueba el código?
Escribe pruebas con Jest y busca una cobertura del 85 por ciento o más.
¿Comprueba las fugas de memoria?
Sí. Lo comprueba con DevTools o con el inspector de Node y corrige las fugas que encuentra.
Detalles
Descripción original del autor
Writes, debugs, and refactors JavaScript code using modern ES2023+ features, async/await patterns, ESM module systems, and Node.js APIs. Use when building vanilla JavaScript applications, implementing Promise-based async flows, optimising browser or Node.js performance, working with Web Workers or Fetch API, or reviewing .js/.mjs/.cjs files for correctness and best practices.
repo: Jeffallan/claude-skills
Popularidad
- Estrellas en GitHub
- 12 mil
- Posición en el ranking
- #11431
- Licencia
- MIT
- Actualizada
- 30/10/2026
Comentarios
- …
Más skills de este repositorio
angular-architect
12 milAyuda a tu agente a construir apps de Angular 17 y posteriores con componentes independientes, enrutamiento con carga diferida, estado con NgRx, patrones de RxJS y optimización del rendimiento.
api-designer
12 milAyuda a tu agente a diseñar APIs REST o GraphQL y a escribir especificaciones OpenAPI 3.1, con reglas para recursos, paginación, formatos de error y versionado.
architecture-designer
12 milAyuda a tu agente a diseñar la arquitectura de un sistema, comparar patrones y tecnologías, y escribir Registros de Decisiones de Arquitectura que expliquen cada elección.
atlassian-mcp
12 milAyuda a tu agente a buscar y actualizar incidencias de Jira y páginas de Confluence mediante MCP, incluidas las consultas JQL y CQL, los sprints y la sincronización de la documentación.
Skills parecidas
angular-developer
280 milAyuda a tu agente con código de Angular y la estructura del proyecto. Útil para empezar proyectos, crear partes de código o mejorar el rendimiento y la accesibilidad.
frontend-a11y
280 milAyuda a tu agente a hacer que las interfaces web sean accesibles para todos. Asegura que sitios y apps funcionen bien con lectores de pantalla y navegación por teclado.
frontend-patterns
280 milHace que tu agente aplique patrones modernos en desarrollo frontend. Optimiza el rendimiento, gestiona el estado y sigue buenas prácticas en React y Next.js.