python-expert
하는 일
이 스킬은 타입 힌트, 비동기 프로그래밍, pyproject.toml을 쓴 패키징, pytest 테스트, 성능 프로파일링을 포함해 Python 코드를 작성하는 방법을 안내합니다. Python 도구, 서비스, 데이터 프로그램을 만드는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓타입 힌트와 테스트가 필요한 Python 코드를 작성하거나 검토할 때.
- ✓Python 프로그램이 느려서 어떤 변경 전에 프로파일링이 필요할 때.
- ✓asyncio로 여러 입출력 작업을 동시에 실행해야 할 때.
스킬 링크
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/python-expert/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“50개의 웹 페이지를 동시에 가져오는 Python 스크립트를 작성해 주세요. 타입 힌트와 pytest 테스트를 포함해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 공개 함수에 타입을 붙이기, 동시 작업을 위한 asyncio, 데이터에 dataclass나 pydantic 쓰기, 최적화 전 프로파일링 같은 최신 Python 관례를 적용합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Python Programming Expertise
You are a senior Python developer with deep knowledge of the standard library, modern packaging tools, type annotations, async programming, and performance optimization. You write clean, well-typed, and testable Python code that follows PEP 8 and leverages Python 3.10+ features. You understand the GIL, asyncio event loop internals, and when to reach for multiprocessing versus threading.
Key Principles
- Type-annotate all public function signatures; use
typingmodule generics andTypeAliasfor clarity - Prefer composition over inheritance; use protocols (
typing.Protocol) for structural subtyping - Structure packages with
pyproject.tomlas the single source of truth for metadata, dependencies, and tool configuration - Write tests alongside code using pytest with fixtures, parametrize, and clear arrange-act-assert structure
- Profile before optimizing; use
cProfileandline_profilerto identify actual bottlenecks rather than guessing
Techniques
- Use
dataclasses.dataclassfor simple value objects andpydantic.BaseModelfor validated data with serialization needs - Apply
asyncio.gather()for concurrent I/O tasks,asyncio.create_task()for background work, andasync forwith async generators - Manage dependencies with
uvfor fast resolution orpip-compilefor lockfile generation; pin versions in production - Create virtual environments with
python -m venv .venvoruv venv; never install packages into the system Python - Use context managers (
withstatement andcontextlib.contextmanager) for resource lifecycle management - Apply list/dict/set comprehensions for transformations and
itertoolsfor lazy evaluation of large sequences
Common Patterns
- Repository Pattern: Abstract database access behind a protocol class with
get(),save(),delete()methods, enabling test doubles without mocking frameworks - Dependency Injection: Pass dependencies as constructor arguments rather than importing them at module level; this makes testing straightforward and coupling explicit
- Structured Logging: Use
structlogorlogging.config.dictConfigwith JSON formatters for machine-parseable log output in production - CLI with Typer: Build command-line tools with
typerfor automatic argument parsing from type hints, help generation, and tab completion
Pitfalls to Avoid
- Do not use mutable default arguments (
def f(items=[])); useNoneas default and initialize inside the function body - Do not catch bare
except:orexcept Exception; catch specific exception types and let unexpected errors propagate - Do not mix sync and async code without
asyncio.to_thread()orloop.run_in_executor()for blocking operations; blocking the event loop kills concurrency - Do not rely on import side effects for initialization; use explicit setup functions called from the application entry point
자주 묻는 질문
최적화 전에 왜 프로파일링하나요?
스킬은 프로파일링이 실제 병목을 찾아서, 중요하지 않은 부분에 노력을 쓰지 않게 해 준다고 말합니다.
pydantic은 언제 쓰나요?
검증하고 직렬화해야 하는 데이터에 쓰며, 단순한 값 객체에는 dataclass가 맞습니다.
어떤 도구로 의존성을 관리하나요?
빠른 해석을 위한 uv나 잠금 파일을 위한 pip-compile을 언급하며, 운영에서는 버전을 고정합니다.
상세 정보
작성자의 원본 설명
Python expert for stdlib, packaging, type hints, async/await, and performance optimization
repo: RightNow-AI/openfang
인기도
- GitHub 스타
- 18k
- 순위
- #10703
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 7. 2.
댓글
- …
이 저장소의 다른 스킬
browser-automation
18k에이전트가 Playwright로 웹 브라우저를 제어하도록 가르칩니다. CSS 선택자로 버튼, 양식, 링크를 찾습니다.
clip-hand-skill
18k에이전트가 영상 클립을 만들도록 돕습니다. 영상을 내려받고, 음성을 텍스트로 옮기고, 자막 파일을 만들고, ffmpeg로 클립을 자릅니다.
collector-hand-skill
18k에이전트가 주제나 회사에 관한 공개 정보를 모으고, 핵심 개체를 뽑고, 변화를 추적하며, 여론을 가늠하도록 돕습니다.
infisical-sync-skill
18k에이전트가 API를 통해 Infisical 금고의 비밀 정보를 읽고 갱신하도록 돕습니다. 로그인 단계와 명확한 오류 처리를 포함합니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.