skills/python-dev/SKILL.md
Write, review, and test Python code following PEP 8, type hints, and modern best practices (Python 3.12+). Use when writing, editing, debugging, or reviewing Python files. Enforces a mandatory verify-before-deliver rule - all written code must be tested for syntax and functionality using available shell tools before presenting to the user. Covers naming conventions, project layout, docstrings, formatting, and test authoring.
npx skillsauth add gregoryg/aipihkal python-devInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Every piece of Python code you write or edit MUST be tested before presenting it to the user.
After writing or modifying a .py file:
python3 -c "import ast; ast.parse(open('FILE').read())" or python3 -m py_compile FILEpython3 FILEpython3 -m pytest TEST_FILE -vIf any step fails, fix the code and re-test before responding. Do not present broken code and ask the user to debug it. You have shell access—use it.
str | None union syntax (3.10+), not Optional[str].lowercase_with_underscoresPascalCasesnake_caseUPPER_SNAKE_CASEtest_*.py files, test_* functionsdef fetch_user(user_id: int) -> dict:
"""Fetch a user record by ID.
Args:
user_id: The unique user identifier.
Returns:
A dict with user fields.
Raises:
ValueError: If user_id is negative.
"""
black if available (black --check FILE). Do not obsess if unavailable—PEP 8 compliance is sufficient.pytest over unittest unless the project already uses unittest.test_fetch_user_returns_none_for_missing_id.except:.raise ... from e to preserve tracebacks.development
Write correct, idiomatic Org mode (vanilla) including denote-style optional frontmatter, agenda-aware tasks (TODO/STARTED/PAUSED/DONE, SCHEDULED/DEADLINE, repeaters, tags), and interactive executable Org Babel blocks (emacs-lisp, python, bash, sql) that produce in-buffer results. Use when asked to draft or transform .org files, planning/task documents, executable notes, or when Org syntax/agenda/Babel interactivity is needed instead of Markdown.
tools
Control and query Home Assistant via the hass-cli Python CLI. Use when Codex needs to interact with a Home Assistant instance for controlling devices (lights, switches, climate, covers, etc.), querying entity states or attributes, managing areas/devices/entities, calling services, checking system status, or any Home Assistant automation/control tasks. Supports JSON output for structured data.
tools
Write, review, and test Emacs Lisp code following idiomatic conventions and hard-won local best practices. Use when writing, editing, debugging, or reviewing .el files, Emacs packages, or gptel tools. Enforces a mandatory verify-before-deliver rule - all written code must be batch byte-compiled and smoke-tested before presenting to the user. Covers load-path management, buffer-local variable safety, HTML/XML parsing, file I/O patterns, and batch testing workflows.
testing
invoke multiple LLMs to gather different perspectives, review each other's outputs, and act as a council under the directorship of you the Council Head. Or more generally, call other LLM instances as agents to provide summaries without cluttering context.