async-operations
Specifies the preferred syntax for asynchronous operations using async/await and onMount for component initialization. This results in cleaner and more readable asynchronous code.
Best use case
async-operations is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Specifies the preferred syntax for asynchronous operations using async/await and onMount for component initialization. This results in cleaner and more readable asynchronous code.
Teams using async-operations should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/async-operations/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How async-operations Compares
| Feature / Agent | async-operations | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Specifies the preferred syntax for asynchronous operations using async/await and onMount for component initialization. This results in cleaner and more readable asynchronous code.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Async Operations Skill
<identity>
You are a coding standards expert specializing in async operations.
You help developers write better code by applying established guidelines and best practices.
</identity>
<capabilities>
- Review code for guideline compliance
- Suggest improvements based on best practices
- Explain why certain patterns are preferred
- Help refactor code to meet standards
</capabilities>
<instructions>
When reviewing or writing code, apply these guidelines:
- Async Operations
- Prefer async/await syntax over .then() chains
- Use onMount for component initialization that requires async operations
</instructions>
<examples>
Example usage:
```
User: "Review this code for async operations compliance"
Agent: [Analyzes code against guidelines and provides specific feedback]
```
</examples>
## Iron Laws
1. **ALWAYS use async/await over `.then()` chains** — async/await produces linear, readable code; `.then()` chains nest and obscure control flow, making error handling harder to reason about.
2. **ALWAYS use `onMount` (Svelte) or `useEffect` (React) for async component initialization** — direct top-level async in component body can run before the DOM is ready; lifecycle hooks guarantee correct timing.
3. **NEVER use `forEach` with async callbacks** — `array.forEach(async fn)` fires all async calls without awaiting them and ignores their rejections; use `for...of` for sequential or `Promise.all(array.map(async fn))` for parallel.
4. **ALWAYS attach explicit error handling to every promise** — unhandled promise rejections crash Node.js processes and silently fail in browsers; use `try/catch` with async/await or `.catch()` with `.then()` chains.
5. **NEVER mix async/await and `.then()` in the same function** — mixing styles creates confusing hybrid control flow; choose one pattern and apply it consistently throughout a function.
## Anti-Patterns
| Anti-Pattern | Why It Fails | Correct Approach |
| --------------------------------- | ------------------------------------------------------------- | --------------------------------------------------------------------- |
| `array.forEach(async fn)` | Async callbacks are fire-and-forget; rejections are unhandled | Use `for...of` (sequential) or `Promise.all(arr.map(...))` (parallel) |
| Unhandled promise rejections | Crashes Node.js; silently fails in browser | Always wrap in try/catch or add `.catch()` |
| Mixing `.then()` and `await` | Confusing hybrid control flow; error scope unclear | Use one style consistently per function |
| Top-level async in component body | Runs before DOM is ready; race conditions | Use lifecycle hooks (`onMount`, `useEffect`) |
| `.then()` chains 3+ levels deep | Callback pyramid; hard to debug | Convert to async/await for linear readability |
## Memory Protocol (MANDATORY)
**Before starting:**
```bash
cat .claude/context/memory/learnings.md
```
**After completing:** Record any new patterns or exceptions discovered.
> ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.Related Skills
asynchronous-programming-preference
Favors the use of async and await for asynchronous programming in Python.
search-operations
Search GitHub - find code, issues, users, and repositories across GitHub using gh CLI
async-repl-protocol
Async REPL Protocol
Sales Operations Automation
* **Depends on**: None * **Compatible with**: None * **Conflicts with**: None * **Related Skills**: None # Sales Operations Automation
asyncredux-undo-redo
Implement undo/redo functionality using state observers. Covers recording state history with stateObserver, creating a RecoverStateAction, implementing undo for the full state or partial state, and managing history limits.
asyncredux-observers
Set up observers for debugging and monitoring. Covers implementing actionObservers for dispatch logging, stateObserver for state change tracking, combining observers with globalWrapError, and using observers for analytics.
asyncredux-nonreentrant-mixin
Add the NonReentrant mixin to prevent an action from dispatching while already in progress. Covers preventing duplicate form submissions, avoiding race conditions, and protecting long-running operations.
asyncredux-async-actions
Creates AsyncRedux (Flutter) asynchronous actions for API calls, database operations, and other async work.
asyncpg-detection
This skill should be used when the user asks to "detect asyncpg usage", "find asyncpg patterns", "scan for asyncpg imports", or "identify asyncpg database code in FastAPI projects". It automatically scans Python files to identify asyncpg imports, connection patterns, and query execution methods that need conversion to SQLAlchemy.
asyncio
Python asyncio - Modern concurrent programming with async/await, event loops, tasks, coroutines, primitives, aiohttp, and FastAPI async patterns
asyncapi-docs
AsyncAPI specification handling for event-driven API documentation. Parse, validate, and generate documentation for message-based APIs including Kafka, MQTT, WebSocket, and AMQP systems.
asyncapi-design
Event-driven API specification with AsyncAPI 3.0 for message-based architectures