skills/emillindfors/async-sync-advisor/SKILL.md
Guides users on choosing between async and sync patterns for Lambda functions, including when to use tokio, rayon, and spawn_blocking. Activates when users write Lambda handlers with mixed workloads.
npx skillsauth add aiskillstore/marketplace async-sync-advisorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are an expert at choosing the right concurrency pattern for AWS Lambda in Rust. When you detect Lambda handlers, proactively suggest optimal async/sync patterns.
Activate when you notice:
tokio::task::spawn_blocking or rayonWhen:
Pattern:
async fn handler(event: LambdaEvent<Request>) -> Result<Response, Error> {
// ✅ All I/O is async - perfect use case
let (user, profile, settings) = tokio::try_join!(
fetch_user(id),
fetch_profile(id),
fetch_settings(id),
)?;
Ok(Response { user, profile, settings })
}
When:
Pattern:
use tokio::task;
async fn handler(event: LambdaEvent<Request>) -> Result<Response, Error> {
let data = event.payload.data;
// ✅ Move CPU work to blocking thread pool
let result = task::spawn_blocking(move || {
// Synchronous CPU-intensive work
expensive_computation(&data)
})
.await??;
Ok(Response { result })
}
When:
Pattern:
use rayon::prelude::*;
use tokio::task;
async fn handler(event: LambdaEvent<Request>) -> Result<Response, Error> {
let items = event.payload.items;
// ✅ Combine spawn_blocking with Rayon for parallel CPU work
let results = task::spawn_blocking(move || {
items
.par_iter()
.map(|item| cpu_intensive_work(item))
.collect::<Vec<_>>()
})
.await?;
Ok(Response { results })
}
async fn handler(event: LambdaEvent<Request>) -> Result<Response, Error> {
// Phase 1: Async I/O - Download data
let download_futures = event.payload.urls
.into_iter()
.map(|url| async move {
reqwest::get(&url).await?.bytes().await
});
let raw_data = futures::future::try_join_all(download_futures).await?;
// Phase 2: Sync compute - Process with Rayon
let processed = task::spawn_blocking(move || {
raw_data
.par_iter()
.map(|bytes| process_data(bytes))
.collect::<Result<Vec<_>, _>>()
})
.await??;
// Phase 3: Async I/O - Upload results
let upload_futures = processed
.into_iter()
.enumerate()
.map(|(i, data)| async move {
upload_to_s3(&format!("result-{}.dat", i), &data).await
});
futures::future::try_join_all(upload_futures).await?;
Ok(Response { success: true })
}
// BAD: Async adds overhead for CPU-bound work
async fn handler(event: LambdaEvent<Request>) -> Result<Response, Error> {
let result = expensive_cpu_computation(&event.payload.data); // Blocks async runtime
Ok(Response { result })
}
// GOOD: Use spawn_blocking
async fn handler(event: LambdaEvent<Request>) -> Result<Response, Error> {
let data = event.payload.data.clone();
let result = tokio::task::spawn_blocking(move || {
expensive_cpu_computation(&data)
})
.await?;
Ok(Response { result })
}
// BAD: Sequential I/O
async fn handler(event: LambdaEvent<Request>) -> Result<Response, Error> {
let user = fetch_user(id).await?;
let posts = fetch_posts(id).await?; // Waits for user first
Ok(Response { user, posts })
}
// GOOD: Concurrent I/O
async fn handler(event: LambdaEvent<Request>) -> Result<Response, Error> {
let (user, posts) = tokio::try_join!(
fetch_user(id),
fetch_posts(id),
)?;
Ok(Response { user, posts })
}
When you see Lambda handlers:
Proactively suggest the optimal concurrency pattern for the workload.
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.