python-notebooks-async skill
✓ 인증됨Jupyter notebook 또는 셀 기반 워크플로 내에서 asyncio 코드 작성 및 리뷰를 도와 이벤트 루프 충돌을 방지합니다.
- GitHub 스타
- 6
- 파일
- 2
- 마지막 커밋
- 2026년 10월 29일
- 라이선스
- CC0-1.0
- 허용된 도구
- —
python-notebooks-async skill은 무엇을 하나요?
python-notebooks-async은(는) agent skill입니다. Jupyter notebook 또는 셀 기반 워크플로 내에서 asyncio 코드 작성 및 리뷰를 도와 이벤트 루프 충돌을 방지합니다.
skill의 SKILL.md에서 생성된 요약입니다.
python-notebooks-async skill 정보
Jupyter notebook 또는 셀 기반 워크플로에서 작업하는 개발자는 이벤트 루프 충돌 없이 비동기 Python 코드를 관리하기 위해 이 SKILL을 사용합니다. 이 SKILL은 노트북 커널이 이미 이벤트 루프를 소유하고 있는 환경에서 비동기 스크립트를 작성, 리뷰 또는 이식하는 작업을 수행하는 에이전트에게 가이드를 제공합니다. 이러한 패턴을 따르면 asyncio.run() 사용 시 발생하는 RuntimeError나 작업이 조용히 완료되지 않는 문제와 같은 일반적인 오류를 방지할 수 있습니다.
에이전트가 셀 내에서 asyncio.run() 실패 문제를 겪거나 IPython 커널 내에서 gather 또는 TaskGroup을 사용하여 동시 작업을 오케스트레이션할 때 이 SKILL을 로드해야 합니다. 이 SKILL은 top-level await 구현, .py 모듈 내 재사용 가능한 로직 관리, 그리고 블로킹 호출 대신 aiohttp 또는 httpx와 같은 라이브러리 선택에 중점을 둡니다. 코드의 신뢰성을 보장하고 근본적인 설계 문제를 숨기지 않도록 nest_asyncio를 기본 해결책이 아닌 폴백으로 취급합니다.
agent가 수행할 수 있는 작업
- 1이벤트 루프 오류 수정노트북 셀 내부에서 asyncio.run()을 호출하여 발생하는 RuntimeError를 해결합니다.
- 2비동기 노트북 코드 리팩터링더 나은 테스트를 위해 노트북 셀의 인라인 비동기 헬퍼 함수를 외부 Python 모듈로 이동합니다.
- 3블로킹 I/O 문제 방지이벤트 루프를 고갈시키는 동기식 호출을 식별하고 이를 비차단(non-blocking) 대안으로 교체합니다.
skill의 SKILL.md를 기반으로 작성되었습니다. 모든 사용 사례는 해당 문서의 인용구와 대조 확인되었습니다.
python-notebooks-async skill 설치 방법
각 명령은 skill 폴더를 클라이언트의 skills 디렉터리에 복사합니다. 클라이언트를 재시작하거나 새 세션을 시작하여 로드하세요.Claude Code에 python-notebooks-async skill 설치
~/.claude/skills/python-notebooks-async/SKILL.md
$ npx degit ahgraber/skills/skills/python-notebooks-async ~/.claude/skills/python-notebooks-asyncClaude Code (project)에 python-notebooks-async skill 설치
.claude/skills/python-notebooks-async/SKILL.md
$ npx degit ahgraber/skills/skills/python-notebooks-async .claude/skills/python-notebooks-asyncCodex에 python-notebooks-async skill 설치
~/.agents/skills/python-notebooks-async/SKILL.md
$ npx degit ahgraber/skills/skills/python-notebooks-async ~/.agents/skills/python-notebooks-asyncGemini CLI에 python-notebooks-async skill 설치
~/.gemini/skills/python-notebooks-async/SKILL.md
$ npx degit ahgraber/skills/skills/python-notebooks-async ~/.gemini/skills/python-notebooks-asyncClaude.ai에 python-notebooks-async skill 설치
npx degit ahgraber/skills/skills/python-notebooks-async python-notebooks-async && zip -r python-notebooks-async.zip python-notebooks-async # claude.ai → Customize → Skills → + → Create skill → Upload a skill → python-notebooks-async.zip
자동 검사
2026년 11월 16일에 실행됨전체 보고서 →자동 검사를 통과했습니다. 보안 감사는 아닙니다. 에이전트가 실행하기 전에 스크립트를 읽어 보세요. 검사 방식
- 소스 저장소 연결 및 접근 가능ahgraber/skills/skills/python-notebooks-async is public and reachablegithub.com/ahgraber/skills/tree/HEAD/skills/python-notebooks ↗통과
- 오픈 소스 라이선스 (OSI)CC0-1.0spdx.org/licenses/CC0-1.0.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit 2026-10-29github.com/ahgraber/skills/commits ↗통과
- 스크립트에 다운로드 후 실행이나 자격 증명 탈취가 없음No scripts in the skill folder통과
- SKILL.md에 숨겨진 지침 없음No override phrases, safeguard switches, credential requests or hidden charactersgithub.com/ahgraber/skills/blob/HEAD/skills/python-notebooks ↗통과
- 사전 허용 도구가 제한됨No pre-approved tools; the agent asks before using onegithub.com/ahgraber/skills/blob/HEAD/skills/python-notebooks ↗통과
- SKILL.md가 Agent Skills 형식을 따름Valid name and description; says when to use it; 66 linesgithub.com/ahgraber/skills/blob/HEAD/skills/python-notebooks ↗통과
SKILL.md
GitHub에서 보기Python Notebooks Async
Overview
Notebook kernels own the event loop; async code must cooperate with that ownership rather than fight it.
This skill covers orchestration patterns, top-level await, and compatibility constraints for .ipynb and #%% workflows.
Treat these recommendations as preferred defaults. When project constraints require deviation, call out tradeoffs and compensating controls.
When to Use
asyncio.run()raisesRuntimeErrorinside a notebook cell.- Event-loop conflicts when mixing async libraries in Jupyter.
- Porting async scripts into notebook workflows.
- Orchestrating concurrent tasks (
gather,TaskGroup) in IPython kernels. - Deciding where to place reusable async logic across notebook/module boundaries.
When NOT to Use
- Pure script or service code with no notebook involvement.
- Synchronous notebook workflows with no async needs.
- General asyncio API design outside notebook contexts — the
pythonskill covers concurrency audit defaults.
Invocation Notice
- Tell the user when this skill is running:
python-notebooks-async. Skip the notice when the user asked for the skill by name or slash command; spelling and spacing need not match. A phrase from this skill's own trigger list is not a name — naming the work is not naming the skill.
Quick Reference
- Treat notebook kernels as loop-owned environments; never create a competing loop.
- Use top-level
awaitinstead ofasyncio.run()in notebook cells. - Orchestrate concurrent work with
asyncio.gather()orasyncio.TaskGroup. - Keep reusable async logic in regular
.pymodules, imported into notebooks. - Use
nest_asyncioonly as a constrained compatibility fallback, not a default. - Avoid fire-and-forget tasks — always
awaitor collect results explicitly.
Common Mistakes
- Calling
asyncio.run()in a notebook cell. The kernel already runs a loop;asyncio.run()tries to start a second one and raisesRuntimeError. Useawaitdirectly instead. - Applying
nest_asyncioglobally by default. It patches the loop to allow reentrant calls but masks design problems and can hide subtle concurrency bugs. Reserve it for legacy compatibility. - Defining async helpers inline in cells instead of modules.
Inline definitions are lost on kernel restart and cannot be tested outside the notebook.
Extract to
.pyfiles. - Ignoring returned tasks or coroutines.
Calling an async function without
awaitsilently produces a never-executed coroutine object, with no error until results are missing downstream. - Mixing blocking I/O with async in the same cell.
Synchronous calls like
requests.get()block the event loop, starving concurrent tasks. Useaiohttp,httpx, orasyncio.to_thread().
References
references/notebooks-async.md— event-loop ownership, background-work and fire-and-forget patterns, script/notebook compatibility, blocking-library interop,nest_asynciopolicy
이 스킬의 파일
2python-notebooks-async skill 질문
Claude Code에 python-notebooks-async skill을 어떻게 설치하나요?
npx degit ahgraber/skills/skills/python-notebooks-async ~/.claude/skills/python-notebooks-async를 실행합니다. Claude Code는 ~/.claude/skills(모든 프로젝트) 또는 .claude/skills(한 프로젝트)에서 skills를 로드하며, 설명이 작업과 일치할 때 skill을 사용합니다.
python-notebooks-async skill을 사용할 수 있는 클라이언트는 무엇인가요?
Agent Skills 형식을 읽는 모든 클라이언트(Claude Code, Codex, Gemini CLI, claude.ai(ZIP으로 업로드))가 사용할 수 있습니다. skill 내 스크립트는 클라이언트가 코드 실행을 허용하는 경우에만 실행됩니다.
왜 제 노트북에서 asyncio.run()이 RuntimeError를 발생시키나요?
노트북 커널이 이미 이벤트 루프를 소유하고 실행 중이기 때문입니다. asyncio.run()을 호출하면 두 번째 루프를 시작하려고 시도하여 충돌이 발생합니다. 대신 top-level await를 사용하십시오.
노트북 워크플로에서 nest_asyncio를 사용해야 하나요?
nest_asyncio는 설계 문제나 동시성 버그를 숨길 수 있으므로 기본 방식이 아닌, 레거시 대응을 위한 제한적인 호환성 폴백(fallback) 용도로만 사용해야 합니다.
노트북 셀에서 이벤트 루프가 차단되는 것을 어떻게 방지할 수 있나요?
requests.get()과 같은 동기식 블로킹 I/O 사용을 피하십시오. 대신 aiohttp, httpx와 같은 비동기 라이브러리를 사용하거나, 동기식 호출을 asyncio.to_thread()로 감싸서 사용하십시오.