en un clic
asupersync-mega-skill
// Replace Tokio Rust stacks with Asupersync. Use when migrating tokio/axum/hyper/tonic apps, designing native Cx/region-based services, or debugging Asupersync internals.
// Replace Tokio Rust stacks with Asupersync. Use when migrating tokio/axum/hyper/tonic apps, designing native Cx/region-based services, or debugging Asupersync internals.
| name | asupersync-mega-skill |
| description | Replace Tokio Rust stacks with Asupersync. Use when migrating tokio/axum/hyper/tonic apps, designing native Cx/region-based services, or debugging Asupersync internals. |
Asupersync is a spec-first, cancel-correct, capability-secure async runtime for Rust. Not a Tokio wrapper -- a complete replacement with stronger guarantees around structured concurrency, obligation tracking, deterministic testing, and capability security.
This skill is primarily for agents integrating Asupersync into other projects or extracting maximum architectural leverage from it in greenfield systems. It also covers repo-internal work when that is the actual task.
For codebase orientation, types, module map, and workspace layout see SOURCE-MAP.md.
Minimal bootstrap:
use asupersync::runtime::RuntimeBuilder;
fn main() -> Result<(), asupersync::Error> {
let rt = RuntimeBuilder::current_thread().build()?;
rt.block_on(async {
let cx = asupersync::Cx::for_request();
asupersync::proc_macros::scope!(cx, {
cx.trace("running");
asupersync::Outcome::ok(())
});
});
Ok(())
}
This is the smallest runnable seam, not the recommended production architecture. Do not build serious services around Cx::for_request() plus block_on(...) alone; prefer runtime-managed contexts, request/call regions at service boundaries, and graduate to AppSpec + supervision when the topology becomes long-lived.
Where to focus first:
Cx/Scope, cancellation, obligations, channels, sync, time, lab/DPOR, and observabilityservice, web, grpc, database, and supervision surfacesDefault recommendation order for most real projects:
Cx + Scopeservice / web / grpc boundariesDo not lead with Browser Edition, QUIC/H3, messaging, remote/distributed, or RaptorQ unless the target project explicitly needs those capabilities.
Full surface guidance: STACK-SURFACES.md.
Choose one lane before touching code:
RuntimeBuilder, Cx, Scope, LabRuntime, and optional AppSpec.&Cx, region-owned tasks, cancel-aware primitives, and deterministic tests.asupersync-tokio-compat only for crates you cannot remove yet. Keep Tokio out of core business logic.Default rule:
&Cx first in async APIs you control.Scope and child regions for owned work. Avoid detached background tasks.cx.checkpoint() in loops, retry bodies, long handlers, and shutdown-sensitive code.Cx::for_testing() as test-only. Cx::for_request() is a convenience seam, not your whole architecture.If the target system is doing real work, do not stop after "the code compiles on Asupersync."
Budget, Outcome, and capability narrowing are part of the application's semantic contract, not optional polish. See BUDGET-OUTCOME-CAPABILITIES.md.select!-style orchestration. See ADVANCED-FEATURES.md.runtime::RuntimeBuilder, Runtime, RuntimeHandleCx, Scopetest_utils::{run_test, run_test_with_cx}, LabRuntime, LabConfigweb::request_region::{RequestRegion, RequestContext}, grpc::CallContext::with_cx(...)app::AppSpec, actor, gen_server, supervision, sporkStart with RuntimeBuilder + Cx + Scope. Graduate to AppSpec + supervision when you need restart policy, named workers, or explicit application topology.
Macro guidance: scope! is useful. Manual APIs are still the safest authoritative path. Do not assume proc-macro surfaces are automatically the best default path for every task.
tokio::*, tokio-util, hyper, axum, tonic, reqwest, sqlx, quinn, h3, rdkafka, and related dependencies.&Cx through your own async APIs.| I need to... | Read (in order) |
|---|---|
| Migrate a Tokio HTTP/gRPC service | BROWNFIELD-MIGRATION → TOKIO-MAPPING → WEB-GRPC-HTTP |
| Build a new service from scratch | NATIVE-GREENFIELD → GREENFIELD-PATTERNS |
| Get more than parity and maximize Asupersync leverage | LEVERAGE-PLAYBOOK → BUDGET-OUTCOME-CAPABILITIES → SUPERVISION-OTP → TESTING-FORENSICS |
| Design a supervised long-lived service | SUPERVISION-OTP → LEVERAGE-PLAYBOOK |
| Choose the right channel/sync/combinator | PRIMITIVES-AND-ORCHESTRATION-CHOOSER |
| Add deterministic tests | TESTING-FORENSICS → LAB-TRACE-DPOR |
| Debug a runtime error | ERROR-TAXONOMY → TROUBLESHOOTING |
| Tune runtime performance | RUNTIME-CONTROLS → SCHEDULER-INTERNALS |
| See what to lead with vs use only when required | STACK-SURFACES → TOKIO-REPLACEMENT-MATRIX |
| Work inside the Asupersync repo | REPO-CONTRIBUTOR-GUIDE → SOURCE-MAP |
Integration and Migration
Architecture and Primitives
Networking and Services
Testing and Diagnostics
Codebase Navigation
When changing code:
If working inside the Asupersync repo itself, see REPO-CONTRIBUTOR-GUIDE.md for mandatory compiler checks and testing discipline.
tokio, hyper, reqwest, axum, async-std, smol.main, never master.