claude.symlink/skills/javascript/SKILL.md
Write modern JavaScript with ES6+, async patterns, and Node.js. Use for JS development, async debugging, or optimization.
npx skillsauth add htlin222/dotfiles javascriptInstall 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.
Write modern, clean JavaScript and TypeScript.
// Prefer async/await over promise chains
async function fetchData() {
try {
const response = await fetch(url);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
return await response.json();
} catch (error) {
console.error("Fetch failed:", error);
throw error;
}
}
// Parallel execution
const [users, posts] = await Promise.all([fetchUsers(), fetchPosts()]);
// Error handling for multiple promises
const results = await Promise.allSettled([task1(), task2(), task3()]);
const succeeded = results.filter((r) => r.status === "fulfilled");
// Object destructuring with defaults
const { name, age = 0, ...rest } = user;
// Array methods
const active = users.filter((u) => u.active).map((u) => u.name);
// Object spread for immutable updates
const updated = { ...user, name: "New Name" };
// ES modules
export class UserService {
#privateField; // Private field
constructor(config) {
this.#privateField = config.secret;
}
async getUser(id) {
return await this.#fetch(`/users/${id}`);
}
}
// Named and default exports
export { UserService };
export default UserService;
// Interfaces over types for objects
interface User {
id: string;
name: string;
email?: string;
}
// Generics
function first<T>(arr: T[]): T | undefined {
return arr[0];
}
// Utility types
type CreateUser = Omit<User, "id">;
type ReadonlyUser = Readonly<User>;
// ESM in Node.js
import { readFile } from "fs/promises";
import { fileURLToPath } from "url";
const __dirname = fileURLToPath(new URL(".", import.meta.url));
// Streams for large files
import { createReadStream, createWriteStream } from "fs";
import { pipeline } from "stream/promises";
await pipeline(
createReadStream("input"),
transform,
createWriteStream("output"),
);
this binding (use arrow functions or .bind())Input: "Fix async issue" Action: Check for unhandled promises, race conditions, proper error handling
Input: "Convert to TypeScript" Action: Add types, interfaces, fix type errors, configure tsconfig
testing
Converts narrative medical text into Pocket Medicine bullet-style notes with proper abbreviations, then modularizes sections exceeding 20 lines into linked standalone files.
devops
Use when deploying Docker services on the local VM (hostname: vm, Pop!_OS) with Traefik reverse proxy and Homepage dashboard. Covers crane image workflow, Traefik file-provider registration, Homepage services.yaml entries, and compose templates on the traefik-proxy network.
development
Use when reviewing a data visualization or figure for clarity, checking if a graph communicates its message without additional context, or iterating on R/Python plot scripts until a naive reader can fully understand the figure.
development
Runs Vale prose linter on markdown/text files and auto-fixes issues. Use when the user asks to lint, proofread, or improve writing quality of markdown or text files.