xiaohongshu
xiaohongshu
js-ts-performance-readability
Write JavaScript/TypeScript that is performant, readable, and easy to trust with minimal inspection. Use when generating or reviewing JS/TS code—scripts, utilities, data processing, or performance-sensitive logic—so outputs are correct, fast, and maintainable without heavy manual review.
Full skill instructions
Apply these practices so generated code is correct, performant, and readable with minimal inspection.
Before writing code, understand what you're solving and what can go wrong.
Think through edge cases before implementation—they're easier to handle when designed for, not patched in:
If requirements are ambiguous, clarify before implementing. Questions like:
Getting alignment on edge cases early prevents rework.
type Config = { name: string; timeout: number; retries: number }).as const for tuple return types so callers get narrow types: return [success, count] as const.line.split(" ").map(Number) or Number(ch); validate with !isNaN(n) or Number.isNaN(n) when needed.map.get(key) ?? 0, arr.find(predicate) ?? fallback.next == null (or next === undefined) and return early.Set for "visited" and "already seen" (e.g. BFS/DFS, loop detection).Map for frequency counts or keyed caches: freq.set(key, (freq.get(key) ?? 0) + 1).Set for visited..reduce((acc, n) => acc + n, 0) or a small sum(arr) helper for numeric aggregation instead of manual loops when it stays readable..find(predicate) and .findLast(predicate) instead of scanning manually twice.toSorted((a, b) => a - b) (or .slice().sort(...)) when you need a sorted copy without mutating the original..filter().map() when .flatMap() or .reduce() could do both).Promise.all: Use when you have independent async operations that can run concurrently. Fails fast—if any promise rejects, the whole result rejects.
const [users, posts] = await Promise.all([fetchUsers(), fetchPosts()]);
Promise.allSettled: Use when you need results from all promises regardless of individual failures. Returns { status: 'fulfilled', value } or { status: 'rejected', reason } for each.
const results = await Promise.allSettled(urls.map(fetch));
const succeeded = results.filter(r => r.status === 'fulfilled').map(r => r.value);
Promise.race: Use when you want the first promise to settle (e.g. timeout patterns).// Bad: sequential, takes sum of times
const a = await fetchA();
const b = await fetchB();
// Good: parallel, takes max of times
const [a, b] = await Promise.all([fetchA(), fetchB()]);
const re = /pattern/g), not inside.structuredClone only when mutation is a real concern; don't defensively clone everything..join() or template literals for building large strings.sum, groupBy, keyBy, chunk, unique, clamp, debounce.parseConfig, validateInput, formatOutput) so the main flow reads like prose.main(), run(), process()) that orchestrates the stages; keep it thin so the flow is obvious.const by default; use let only when reassignment is needed.continue for "skip this item" and keep the main path obvious.input.split("\n").map(line => line.split(" ").map(Number)) when the format is simple..reduce() or a for loop for summing, but don't mix styles randomly in the same file.visited or always seen, not both). Name variables by what they represent, not by type (users not userArray).Result types, or return null/undefined, but pick one pattern per codebase or module.Promise.all or Promise.allSettled, not sequential awaits.Following these practices keeps JS/TS code correct, fast, and easy to trust with minimal inspection.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience