asupersync-mega-skill

star 190

Replace Tokio Rust stacks with Asupersync. Use when migrating tokio/axum/hyper/tonic apps, designing native Cx/region-based services, or debugging Asupersync internals.

Dicklesworthstone By Dicklesworthstone schedule Updated 6/7/2026

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 Mega Skill

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. For repo-internal testing choices, use the compact agent router at ../../TESTING_FOR_AGENTS.md before drilling into TESTING.md.

Quick Orient

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:

  • Lead with core runtime, Cx/Scope, cancellation, obligations, channels, sync, time, lab/DPOR, and observability
  • For ordinary services, build next on native service, web, grpc, database, and supervision surfaces
  • Treat Browser Edition, QUIC/H3, messaging, remote/distributed, and RaptorQ as requirement-driven lanes, not default starting points

Default recommendation order for most real projects:

  • core runtime + Cx + Scope
  • native service / web / grpc boundaries
  • native database and actor/supervision surfaces as needed
  • deterministic tests and diagnostics from the start

Do 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.

Start Here

Choose one lane before touching code:

  1. Native greenfield Build directly on RuntimeBuilder, Cx, Scope, LabRuntime, and optional AppSpec.
  2. Brownfield native migration Rewrite your app's async seams around &Cx, region-owned tasks, cancel-aware primitives, and deterministic tests.
  3. Boundary interop Use asupersync-tokio-compat only for crates you cannot remove yet. Keep Tokio out of core business logic.

Default rule:

  • prefer native Asupersync surfaces,
  • use compat only as a quarantine boundary,
  • plan to remove compat once the stubborn dependency is gone.

Non-Negotiables

  • Do not treat Asupersync as an executor swap.
  • Put &Cx first in async APIs you control.
  • Use Scope and child regions for owned work. Avoid detached background tasks.
  • Add cx.checkpoint() in loops, retry bodies, long handlers, and shutdown-sensitive code.
  • Prefer cancel-aware primitives and two-phase effects.
  • Use deterministic tests as part of normal development, not as optional polish.
  • Treat Cx::for_testing() as test-only. Cx::for_request() is a convenience seam, not your whole architecture.
  • Keep Tokio and Tokio-only crates behind explicit adapter modules if you must keep them at all.

Leverage, Not Just Migration

If the target system is doing real work, do not stop after "the code compiles on Asupersync."

Canonical Spine

  • Bootstrap: runtime::RuntimeBuilder, Runtime, RuntimeHandle
  • App code: Cx, Scope
  • Tests: test_utils::{run_test, run_test_with_cx}, LabRuntime, LabConfig
  • Service boundaries: web::request_region::{RequestRegion, RequestContext}, grpc::CallContext::with_cx(...)
  • Higher-level apps: app::AppSpec, actor, gen_server, supervision, spork

Start 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.

Agent-native v2 entry points:

  • Public API navigation: artifacts/api_surface_map_v1.json once br-asupersync-agent-native-dx-zxqaqs.1 lands
  • Error remediation lookup: docs/error_codes/registry.json once br-asupersync-agent-native-dx-zxqaqs.2 lands
  • Testing router: ../../TESTING_FOR_AGENTS.md
  • Full testing contract: ../../TESTING.md
  • Mandatory repo rules: ../../AGENTS.md

Standard Workflow

  • For brownfield work, run the read-only planner first: python3 scripts/migration_readiness_planner.py --project-root /path/to/rust/project --output-root target/migration-readiness.
  • Use python3 scripts/migration_readiness_planner.py --list, --dry-run, and --execute --output-root "${TMPDIR:-/tmp}/asupersync_migration_planner_e2e" to inspect deterministic fixture scenarios before touching a target project.
  • Read summary.final_verdict, proof_pack.proof_commands, semantic_map.recommendations, and operator_report.phase_plan before choosing the first migration edit.
  • Inventory all tokio::*, tokio-util, hyper, axum, tonic, reqwest, sqlx, quinn, h3, rdkafka, and related dependencies.
  • Classify each dependency as: native replacement, compat holdout, or deliberate workaround.
  • Replace runtime bootstrap first.
  • Thread &Cx through your own async APIs.
  • Replace detached spawning with region-owned work.
  • Replace sync/time/net/io/channel/web/db/messaging surfaces domain by domain.
  • Add deterministic tests while migrating, not after.
  • Remove compat boundaries as soon as the underlying dependency no longer needs them.

Reference Index

Quick Router: Start Here For Your Task

I need to... Read (in order)
Plan a brownfield migration before edits Run scripts/migration_readiness_planner.pyBROWNFIELD-MIGRATIONTOKIO-MAPPING
Migrate a Tokio HTTP/gRPC service BROWNFIELD-MIGRATIONTOKIO-MAPPINGWEB-GRPC-HTTP
Build a new service from scratch NATIVE-GREENFIELDGREENFIELD-PATTERNS
Get more than parity and maximize Asupersync leverage LEVERAGE-PLAYBOOKBUDGET-OUTCOME-CAPABILITIESSUPERVISION-OTPTESTING-FORENSICS
Design a supervised long-lived service SUPERVISION-OTPLEVERAGE-PLAYBOOK
Choose the right channel/sync/combinator PRIMITIVES-AND-ORCHESTRATION-CHOOSER
Add deterministic tests inside this repo ../../TESTING_FOR_AGENTS.mdTESTING-FORENSICSLAB-TRACE-DPOR
Add deterministic tests in a consuming project TESTING-FORENSICSLAB-TRACE-DPOR
Debug a runtime error ERROR-TAXONOMYTROUBLESHOOTING
Tune runtime performance RUNTIME-CONTROLSSCHEDULER-INTERNALS
See what to lead with vs use only when required STACK-SURFACESTOKIO-REPLACEMENT-MATRIX
Work inside the Asupersync repo REPO-CONTRIBUTOR-GUIDESOURCE-MAP

All References

Integration and Migration

Architecture and Primitives

Networking and Services

Testing and Diagnostics

Codebase Navigation

Validation

When changing code:

  • run the host project's normal formatter, compiler, lint, and test suite,
  • add deterministic integration tests for the migrated path,
  • verify cancellation, shutdown, and resource-release behavior,
  • verify that no core domain code still depends on Tokio if the goal is full native adoption.

If working inside the Asupersync repo itself, see REPO-CONTRIBUTOR-GUIDE.md for mandatory compiler checks and testing discipline.

Operating Rules

  • When forced to choose between "minimal code churn" and "native Asupersync semantics", choose the latter unless the task explicitly calls for a temporary boundary bridge.
  • Forbidden crates in core: tokio, hyper, reqwest, axum, async-std, smol.
  • Inside the Asupersync repo: follow AGENTS.md. Never delete files without permission. Branch is main, never master.
Install via CLI
npx skills add https://github.com/Dicklesworthstone/asupersync --skill asupersync-mega-skill
Repository Details
star Stars 190
call_split Forks 21
navigation Branch main
article Path SKILL.md
More from Creator
Dicklesworthstone
Dicklesworthstone Explore all skills →