Specifies the preferred syntax for asynchronous operations using async/await and onMount for component initialization. This results in cleaner and more readable asynchronous code.
.then() chains — async/await produces linear, readable code; .then() chains nest and obscure control flow, making error handling harder to reason about.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.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.try/catch with async/await or .catch() with .then() chains..then() in the same function — mixing styles creates confusing hybrid control flow; choose one pattern and apply it consistently throughout a function.| 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 |
Before starting:
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.
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer