New advertisers: 50% off your first month with code FIRSTMONTHSee slots
sergiodxa avatar

Frontend Async Best Practices

Async and Promise optimization rules that eliminate request waterfalls and maximize parallel fetching in loaders and actions.

skills.sh installs
226
GitHub stars
92
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers five rules: parallel fetching, deferred awaits, chained dependencies, early promise starts in API routes, and Suspense boundaries
  • Ranks rules by impact, with parallel, dependencies, and api-routes marked CRITICAL and defer-await and suspense-boundaries marked HIGH
  • Shows bad and good code pairs in TypeScript and TSX for each rule, contrasting sequential awaits with Promise.all()
  • Designed for writing, reviewing, or refactoring Remix loaders, actions, and data-fetching code to remove sequential round trips

Install

$ npx -y skills add sergiodxa/agent-skills --skill frontend-async-best-practices -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Async Best Practices

Performance optimization patterns for asynchronous JavaScript code. Contains 5 rules focused on eliminating request waterfalls and maximizing parallelism.

Impact: CRITICAL - Waterfalls are the #1 performance killer. Each sequential await adds full network latency.

When to Apply

Reference these guidelines when:

  • Writing Remix loaders or actions
  • Implementing data fetching logic
  • Working with multiple async operations
  • Reviewing code for waterfall patterns
  • Optimizing response times

Rules Summary

parallel (CRITICAL) — @rules/parallel.md

Use Promise.all() for independent operations.

// Bad: 3 sequential round trips
const user = await fetchUser();
const posts = await fetchPosts();
const comments = await fetchComments();

// Good: 1 parallel round trip
const [user, posts, comments] = await Promise.all([
  fetchUser(),
  fetchPosts(),
  fetchComments(),
]);

defer-await (HIGH) — @rules/defer-await.md

Move await into branches where actually used.

Details

Repository
github.com/sergiodxa/agent-skills
Categories
Frontend & UI Code, Backend & APIs
First seen
Jun 3, 2026

More from sergiodxa/agent-skills

All 10

Similar to Frontend Async Best Practices

More Frontend & UI Code