SkillVaultskills Browse all 500 skills

Code Quality · Version 1.4.0 · Reviewed 2026-08-02

Rust Async Lifetime Advisor

Make a defensible decision about send bound errors and shared state design with evidence, explicit trade-offs, and a verification plan.

4 method steps 6 documented failure modes 5 diagnostic checks 7 quality gates

Resolves borrow-checker conflicts in async code including Send bounds, pinning, and shared-state design.

₹99 one-time

Get this skill archive

What this skill helps you do

  • Send bound errors
  • Shared state design
  • Lifetime resolution

How Rust Async Lifetime Advisor works

You provide

Shared-state access paths, pool sizing, and symptoms

It inspects

Read-modify-write and lock ordering for send bound errors

It decides

A shared state design fix using atomic or constraint enforcement

You verify

Reproduce under real concurrency and confirm one outcome

What it checks first

Rust Async Lifetime Advisor resolves borrow-checker conflicts in async code including Send bounds, pinning, and shared-state design. Use it when the work involves Send bound errors, Shared state design, Lifetime resolution.

  1. Every read-modify-write on shared state and whether it is atomic, locked, or transactional.
  2. Lock acquisition order across code paths, since inconsistent ordering is the definition of a deadlock risk.
  3. Whether async work outlives the request that started it, and what cancels it.
  4. Pool sizing relative to the blocking behavior of the work, because blocking calls on a small pool serialize everything.
  5. Whether the failure reproduces under load or only in production, which indicates a timing-dependent defect.

Failure modes it recognizes

  • Lost update where two transactions read the same value and the second write silently discards the first.
  • Deadlock from two paths acquiring the same two locks in opposite order.
  • Thread-pool exhaustion where blocking I/O on the pool starves the work that would release it.
  • A cancelled request whose downstream work continues, consuming capacity and producing orphaned writes.
  • Double execution of a scheduled job when two instances both believe they hold leadership.
  • Unbounded queue growth converting backpressure into memory exhaustion.

Answers it will reject

  • Adding a sleep to fix a race, which changes the probability without removing the defect.
  • Widening a lock to make a bug disappear, trading correctness ambiguity for a throughput collapse.
  • Assuming a single instance, which becomes false at the first horizontal scale event.
  • Using a database read followed by an application-level uniqueness check instead of a unique constraint.

Decision rules it applies

  • Prefer atomic database operations and unique constraints over application-level coordination.
  • Acquire locks in a globally consistent order and hold them for the shortest possible span.
  • Make operations idempotent so that at-least-once execution is safe.
  • Bound every queue and every retry; unbounded means the failure mode is chosen by the environment.

Evidence it asks for

  • Reproduce under concurrency with a load test rather than reasoning about interleavings alone.
  • Capture a thread or task dump during the stall to see what each worker is blocked on.
  • Add a unique constraint temporarily to prove whether duplicates are occurring.

The method inside

  1. Map the artifact, actors, boundaries, and invariants relevant to send bound errors.
  2. Trace concrete failure or abuse paths for shared state design; do not report checklist items without a mechanism.
  3. Prioritize lifetime resolution findings by impact, likelihood, confidence, and cost of correction.
  4. Recommend the smallest defensible change, then define how an independent reviewer can verify it.

Deliverables

  • Send bound errors assessment
  • Shared state design decision and action plan
  • Lifetime resolution verification checklist

Evidence requirements

  • Functional and quality requirements
  • Scale, latency, consistency, cost, and compliance constraints
  • Current topology and alternatives considered

Quality gates

  • Every material claim traces to supplied evidence or is labeled as a hypothesis.
  • The response follows the declared deliverable contract.
  • No execution, access, measurement, or verification is invented.
  • Secrets and personal data are redacted rather than repeated.
  • The user receives a concrete independent verification step.
  • The relevant failure modes in this domain were considered rather than only the reported symptom.
  • No listed anti-pattern was recommended as a solution.

Example task

Input

Our async Rust handler fails to compile with a Send bound error that only appears after we added a database call.

Expected output

The error is telling you a non-Send guard is held across an await point, which the runtime cannot allow because the task may move threads. Narrow the scope so the lock is released before the await rather than reaching for an Arc or a different runtime...

Boundaries and compatibility

Ideal for

  • Send bound errors: produce a decision or artifact grounded in supplied evidence.
  • Shared state design: produce a decision or artifact grounded in supplied evidence.
  • Lifetime resolution: produce a decision or artifact grounded in supplied evidence.

Out of scope

  • Producing a generic reference architecture without requirements
  • Hiding material trade-offs behind best-practice language

Agent compatibility

  • GitHub Copilot custom agents
  • Claude Agent Skills / SKILL.md
  • Any instruction-following chat model

Tool policy: Advisory by default. No tools are assumed. If the host provides tools, use read-only evidence gathering unless the user explicitly approves a scoped write or execution action.