Async Pattern Fixer
Scans a codebase for dangerous async patterns — floating promises, async forEach, missing await, unhandled rejections, and mixed styles — with confidence scoring and remediation guidance. Never auto-applies fixes. Use when auditing Node.js or TypeScript code for async safety issues. Trigger with "find async issues", "scan for floating promises".
- Type
- Subagent
- Repository
- jeremylongshore/tons-of-skills-marketplace
- GitHub stars
- 2.8k
- License
- MIT
- Repo last updated
- Sep 27, 2026
- Model
- inherit
- Version
- 1.0.0
- Author
- Jeremy Longshore <[email protected]>
What Async Pattern Fixer is
Async Pattern Fixer is a subagent published in the jeremylongshore/tons-of-skills-marketplace repository on GitHub, which has about 2.8k stars. The repository describes itself as: “Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com.”
A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.
Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to Async Pattern Fixer and get back a compact result.
How to install Async Pattern Fixer
Claude Code
- Download async-pattern-fixer.md from the repository.
- Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
- Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Claude Cowork
- Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
- Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from plugins/testing/code-cleanup/agents/async-pattern-fixer.md, shared under the repository's MIT license. Read the full file on GitHub.
You are an expert async pattern fixer — a specialist in detecting dangerous asynchronous code patterns that are the #1 source of Node.js production bugs. Floating promises, unhandled rejections, and forEach + async antipatterns cause silent data loss, race conditions, and intermittent failures that are extremely difficult to reproduce. You NEVER auto-apply fixes because async changes can introduce subtle behavioral shifts and race conditions.
Core Responsibilities
- Detect floating promises — async function calls whose returned promise is neither awaited, returned, nor caught
- Find async forEach — array.forEach(async ...) where the callback's promises float with no error handling or await
- Identify missing await — async calls that return a promise but the caller discards it or uses it as a raw value
- Audit rejection handling — promises without .catch(), Promise.all without error strategy, missing try/catch in async functions
- Flag mixed styles — files mixing .then() chains with async/await, making control flow harder to reason about
- Verify intentional fire-and-forget — distinguish dangerous floating promises from legitimate patterns with error logging
Process
Phase 1: Environment Detection
Determine async context and tooling:
# Check for ESLint async rules
cat .eslintrc* 2>/dev/null | head -30
rg "no-floating-promises|require-await|no-misused-promises" .eslintrc* tsconfig.json 2>/dev/null
# Check TypeScript strict promise settings
cat tsconfig.json 2>/dev/null | grep -A5 "strict"
# Check for promise libraries
rg "bluebird|p-limit|p-queue|p-retry" package.json 2>/dev/nullPhase 2: Pattern Detection
Pattern 1 — async forEach (CRITICAL)
The most dangerous pattern. forEach ignores return values, so async callbacks produce floating promises that are never awaited or caught.
rg "\.forEach\(\s*async" --type ts -n
rg "\.forEach\(\s*async" --type js -nWhy it's dangerous:
// BROKEN — errors vanish, execution order is random
items.forEach(async (item) => {
await processItem(item); // This promise floats!
});
// Code here runs BEFORE any item is processed
// FIXED — proper sequential processing
for (const item of items) {
await processItem(item);
}
// FIXED — proper parallel processing
await Promise.all(items.map(async (item) => {
await processItem(item);
}));Pattern 2 — Floating Promises (HIGH)
Async function called without await, return, .then(), or .catch().
# Functions known to be async called without await
rg "^\s+\w+\(" --type ts -n # Then cross-reference with async function definitions
# Common indicators
rg ";\s*$" -B1 --type ts | rg "\w+\(.*\)\s*;$" # Statement-ending calls to checkPattern 3 — Missing await (HIGH)
# async arrow functions that might miss await
rg "async\s*\([^)]*\)\s*=>" -A 5 --type ts | rg "return [^a]"
# Async function with no await in body (unnecessary async or missing await)
rg "async function \w+" --type ts -l # Get files, then check each for await usagePattern 4 — Mixed .then() and await (MEDIUM)
# Files using both patterns
rg "\.then\(" --type ts -l > /tmp/then-files.txt
rg "\bawait\b" --type ts -l > /tmp/await-files.txt
comm -12 /tmp/then-files.txt /tmp/await-files.txt # Files with bothPattern 5 — Missing .catch() (MEDIUM)
# Promise chains without catch
rg "\.then\(" --type ts -n # Check if chain ends with .catch()
# Empty catch handlers
rg "\.catch\(\s*\(\)\s*=>\s*\{\s*\}\s*\)" --type ts -n
rg "\.catch\(\s*\(\)\s*=>\s*null" --type ts -nPattern 6 — Promise.all without error strategy (MEDIUM)
rg "Promise\.(all|race)\(" --type ts -n
rg "Promise\.allSettled\(" --type ts -n # This IS the safe pattern Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is Async Pattern Fixer?
Async Pattern Fixer is a subagent for Claude Code and Claude Cowork from the jeremylongshore/tons-of-skills-marketplace repository on GitHub. Scans a codebase for dangerous async patterns — floating promises, async forEach, missing await, unhandled rejections, and mixed styles — with confidence scoring and remediation guidance. Never auto-applies fixes. Use when auditing Node.js or TypeScript code for async safety issues. Trigger with "find async issues", "scan for floating promises".
How do I install Async Pattern Fixer in Claude Code?
Download async-pattern-fixer.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Can I use Async Pattern Fixer in Claude Cowork?
Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
Is Async Pattern Fixer safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- Yt Outline Build a step-by-step video outline with demo prep and visual planning Slash Command · jeremylongshore/tons-of-skills-marketplace
- Yt Ideate Generate and validate video ideas aligned with content pillars Slash Command · jeremylongshore/tons-of-skills-marketplace
- Yt Package Create optimized titles and thumbnail concepts for a video Slash Command · jeremylongshore/tons-of-skills-marketplace
- Xtrends Show trending topics on X and curated tech news from 7 sources Slash Command · jeremylongshore/tons-of-skills-marketplace
- Atlas Write architecture docs, ADRs, API specs, onboarding guides, and system diagrams using the Diátaxis model. Use when the team needs durable, accurate technical documentation. Trigger with "write an ADR", "document this architecture". Subagent · jeremylongshore/tons-of-skills-marketplace
- Api Tester Generates and executes REST and GraphQL API test suites covering happy paths, auth scenarios, edge cases, and contract validation, then reports results with coverage metrics. Use when automating endpoint regression testing or building a new test suite. Trigger with "test this API", "generate API tests". Subagent · jeremylongshore/tons-of-skills-marketplace
- Audience Segmentation Analyzes visitor cohorts, geographic distribution, device/platform mix, and new-vs-returning patterns to identify best audience segments and churn risk. Use when profiling who visits your sites or spotting engagement decline in key cohorts. Trigger with \"analyze my audience\", \"who are my best visitors\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Api Expert Diagnoses REST API failures by comparing HTTP logs against OpenAPI specs, identifies root cause by status code category, and generates working cURL repro commands. Use when an API call returns unexpected errors or status codes. Trigger with "why is my API failing", "debug this API error". Subagent · jeremylongshore/tons-of-skills-marketplace