# Python 코드 스타일 (python-code-style)

> Python 린트·포맷터 설정, PEP 8 명명, import 순서, 타입 힌트, Google 스타일 docstring 규칙을 다룹니다.

- 카테고리: [코드 규약](https://www.myskills.tools/ko/categories/code-standards/)
- 출처: 커뮤니티 · Seth Hobson
- 저장소: https://github.com/wshobson/agents/tree/main/plugins/python-development/skills/python-code-style (commit cbb6049)
- SKILL.md: https://github.com/wshobson/agents/blob/main/plugins/python-development/skills/python-code-style/SKILL.md
- 설치 명령: `npx skills add wshobson/agents --skill python-code-style`
- 라이선스: MIT
- 호환 도구: Claude Code, Codex, Cursor, Copilot, OpenCode
- 권한: read-repo ✓, write-files ✓, shell ✓, network ✓
- 상태: 스캔 통과
- 규칙 스캔으로 모든 위험을 찾을 수는 없습니다. 설치 전에 이 스킬의 SKILL.md를 읽고 권한을 확인하세요.

## 핵심 규칙

포맷 논쟁은 도구에 맡기고, 한 번 설정해 자동으로 적용합니다.

## 실행 단계

1. **도구 설정** — pyproject.toml에 ruff를 린터 겸 포맷터로 설정하고 mypy나 pyright를 strict 모드로 켭니다.
2. **명명과 import** — PEP 8을 따르고 간결함보다 명확함을 우선하며, import는 표준 라이브러리·서드파티·로컬 순으로 묶고 절대 import만 씁니다.
3. **타입과 문서** — 모든 공개 API에 타입 힌트와 Google 스타일 docstring을 달고 Args, Returns, Raises, 예시를 적습니다.
4. **포맷과 문서** — 줄 길이는 120으로 두고 읽기 좋게 줄바꿈하며, README와 Keep a Changelog 형식 CHANGELOG를 관리하고 CI에서 린터를 돌립니다.

## 권한 설명 (SKILL.md 기준)

| 기능 | 필요 여부 | 설명 |
|---|---|---|
| 파일 쓰기 | 필요 | pyproject.toml 등 설정을 수정하고 코드에 타입과 docstring을 추가하며 프로젝트 문서를 작성합니다. |
| 명령 실행 | 일부 필요 | ruff check --fix, ruff format, 그리고 ruff, mypy 설치 명령을 실행합니다. |
| 네트워크 송신 | 일부 필요 | pip로 ruff, mypy 등을 설치할 때만 패키지 인덱스에 접속합니다. |

## SKILL.md 프런트매터(YAML)

```yaml
---
name: python-code-style
description: Python code style, linting, formatting, naming conventions, and documentation standards. Use when writing new code, reviewing style, configuring linters, writing docstrings, or establishing project standards.
---
```

홈: https://www.myskills.tools/ko/ · URL: https://www.myskills.tools/ko/skills/python-code-style/
