Skip to content
Back to skills

Python Async Runtime

ASecurity

Write correct async Python runtime code with explicit blocking-I/O boundaries, cancellation, and timeout handling. Use when editing `asyncio` workflows, background loops, async services, or mixed sync/async integrations.

  • 549 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 5, 2026
developmentpython

Works with

  • cli

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add HoangNguyen0403/agent-skills-standard --skill python-async-runtime --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python Async Runtime?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Python Async Runtime
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hoangnguyen0403-python-async-runtime-c1cc4334/badge)](https://www.skillsdirectory.com/skills/hoangnguyen0403-python-async-runtime-c1cc4334)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: python-async-runtime
description: Write correct async Python runtime code with explicit blocking-I/O boundaries, cancellation, and timeout handling. Use when editing `asyncio` workflows, background loops, async services, or mixed sync/async integrations.
metadata:
  triggers:
    files:
      - "**/*.py"
    keywords:
      - asyncio
      - async
      - await
      - background task
      - cancellation
      - timeout
---

# Python Async Runtime

## **Priority: P1 (HIGH)**

## Rules

- Keep blocking DB, subprocess, and legacy HTTP calls out of event-loop code.
- Use `asyncio.to_thread` only as an explicit boundary around blocking libraries.
- Make timeout and cancellation behavior visible in the call path.
- Track long-lived tasks, cleanup, and retries deliberately.

## Recipe

1. **Use async-native clients first**.
2. **Wrap blocking calls once** at the adapter seam.
3. **Propagate cancellation and timeout context** instead of swallowing it.
4. **Separate poll loop logic from work-item processing**.
5. **Test the timeout and error path**, not only the happy path.

## Anti-Patterns

- **No direct blocking I/O inside `async def`**.
- **No hidden infinite loops** without stop condition or observability.
- **No broad `except Exception` around await chains** that erases task state.
- **No orphan background tasks** without lifecycle ownership.

## References

- [Framework Map](../references/framework-map.md)
- [Async Boundaries](references/async-boundaries.md)

Files in this skill

  • SKILL.md1.5 KB
  • evals/evals.json1.2 KB
  • references/async-boundaries.md379 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…