async-patterns

Analyzes JavaScript/TypeScript code for async/await anti-patterns and applies automated fixes.

4|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/mgd34msu/goodvibes-gemini --skill async-patterns-mgd34msu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: async-patterns
Source: https://github.com/mgd34msu/goodvibes-gemini/tree/main/skills/async-patterns
Command: npx skills add https://github.com/mgd34msu/goodvibes-gemini --skill async-patterns-mgd34msu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill addresses common inefficiencies and potential errors in JavaScript's async/await syntax, leading to cleaner, faster, and more reliable asynchronous code.

Core Features & Use Cases

  • Detects and fixes unnecessary async keywords: Prevents implicit Promise wrapping overhead.
  • Identifies sequential await calls that can be parallelized: Optimizes performance by using Promise.all.
  • Flags await on non-Promise values: Catches potential logic errors or refactoring remnants.
  • Provides advanced patterns: Includes examples for controlled concurrency, retries, and timeouts.
  • Use Case: Refactor a series of sequential API calls that fetch independent data into a single Promise.all call to significantly reduce latency.

Quick Start

Use the async-patterns skill to analyze the file '/path/to/your/code.ts' for potential async/await optimizations.

Frequently Asked Questions about async-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize sequential async/await calls in TypeScript?

To optimize sequential async/await calls in TypeScript, you can parallelize independent operations using Promise.all. This reduces overall latency by executing promises concurrently rather than waiting for each to resolve sequentially.

Why does awaiting non-promise values cause performance issues in JavaScript?

Awaiting non-promise values in JavaScript introduces unnecessary microtask overhead without functional benefit. Static analysis can flag these instances, catching potential logic errors or refactoring remnants to improve code clarity and runtime efficiency.

What is the overhead of unnecessary async keywords in JavaScript functions?

Unnecessary async keywords in JavaScript functions cause implicit Promise wrapping overhead. Removing the async keyword when a function does not actually return a Promise prevents this extra object creation and improves execution performance.

How do I refactor sequential API calls into a Promise.all call?

Refactoring sequential API calls into a Promise.all call involves grouping independent asynchronous fetch operations into a single array. This allows the concurrent execution of promises, significantly reducing data retrieval latency.

Can I implement controlled concurrency and retries using async/await patterns?

Yes, you can implement controlled concurrency, retries, and timeouts using advanced async/await patterns. These techniques manage multiple simultaneous operations and handle transient failures without blocking the main execution thread.

Does static analysis detect anti-patterns in async TypeScript code automatically?

Static analysis detects anti-patterns in async TypeScript code automatically by using AST parsing to evaluate code structure. It identifies inefficient awaits and provides automated fixes and refactoring suggestions to improve performance.