一键导入
python
Conventions for Python code style, organisation, quality checks, and documentation. Use when building or reviewing Python projects.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Conventions for Python code style, organisation, quality checks, and documentation. Use when building or reviewing Python projects.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
GitHub CLI (gh) — the official command-line interface to GitHub. Use when the user needs to create or manage pull requests, issues, repositories, GitHub Actions, gists, API calls, authentication, or any other GitHub workflow from the terminal. Also use for scripting GitHub automation, querying the GraphQL/REST API, managing forks/clones, and viewing workflow run logs. Prefer gh over web browsing or the raw REST API.
CLI for Gmail via Google's REST API — list, search, read, send, draft, label, delete. Use for all Gmail email operations.
Draft, post, and review Dan's LinkedIn posts (handle saattrupdan) via the `linkedin` CLI, which drives the real LinkedIn web UI with agent-browser. Use when the user wants to write/post a LinkedIn post, save or view a draft, or fetch their recent posts with engagement stats. Also use whenever drafting LinkedIn content, to match Dan's voice and formatting.
Edit Microsoft Excel .xlsx files in place while preserving all formatting — surgical raw-OOXML cell editing that keeps styles, charts, data validations, formulas and named ranges intact. Use when filling in or revising .xlsx workbooks (bid sheets, budgets, forms, trackers) rather than regenerating them.
Edit Microsoft Word .docx files in place while preserving all formatting — surgical raw-OOXML editing, Word comments, page breaks, character-limit fields. Use when filling in or revising .docx documents (grant applications, forms, reports) rather than regenerating them.
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.
| name | python |
| description | Conventions for Python code style, organisation, quality checks, and documentation. Use when building or reviewing Python projects. |
| tagline | Python code style, organisation, quality checks |
| last-updated | "2026-05-09T00:00:00.000Z" |
| autoload | {"tools":["read","write","edit"],"extensions":[".py",".pyi"],"files":["pyproject.toml","requirements.txt","setup.py","setup.cfg","tox.ini","uv.lock"]} |
uv run to execute Python scripts and commands — never use
.venv/bin/python, python -m, or activate a virtual environment. E.g.:
uv run script.py, uv run pytest, uv run ruff check.pyproject.toml, not requirements.txt for dependency managementsrc/<project_name> directory. These are not executed but
are imported by the scriptssrc/scripts directory. These are executed with uv runtests/ directoryconfig/ directorypyproject.toml file in the root directoryuv add <package> to add packages to the project, do not just add them manually
to pyproject.toml. Add development dependencies with uv add --group=dev <package>tree -a --gitignore -I .git . command to see the directory structuremake check to run formatters, linters and type
checkers. If this doesn't work, then you can code formatters with
uv run ruff format, linters with uv run ruff check --fix and type checkers with
uv run ty check.
pyproject.toml file. You have to fix them.make check, since that runs the checks with the --fix flag.make test. If this doesn't work, you can use uv run pytest instead. Only run tests if the tests/ directory exists.Code should always fit within 88 characters
All imports should happen at the top of each file. The only excuse for not doing this is if the import would cause a circular import, in which case this should be stated in a comment next to the import statement
Never use the old %-style string formatting. Use f-strings instead
Never use print statements - use a logger instead
Use pathlib.Path objects over strings for file paths
Functions and classes in a module or script should be ordered from the most high-level
to the most low-level. For example, if a function is a helper function that is only
used by another function, then the helper function should come after the function that
uses it. If there is a main function, then it should always be first
When we import things in modules from other modules in the package, we always do it using relative imports:
from .another_module import some_function
When we import things in scripts from other modules or other scripts, we always do it using absolute imports:
from mypackage.module import some_function
from another_script import some_other_function
This also holds when we're importing things from modules in our tests.
list[T], dict[K, V], set[T] (not List, Dict, Set from typing)X | Y for unions (not Union[X, Y])X | None for optional types (not Optional[X])import typing as t and use the t. prefix for types from the typing
module, such as t.Literal, t.TypeAlias or t.TYPE_CHECKINGIterable, Generator and Callable, use these from the collections.abc
module, not from typing. Import this as import collections.abc as c and refer to
the types as c.Iterable, c.Generator and c.Callable, etc.Any type. You can often use t.TypeVar instead, but always give
such type variables meaningful names, and not just single letter names like T. If
it's a dictionary, you can use t.TypedDict instead.None return type for functions that do not return anything. Never use the
NoReturn type.Use a single leading underscore (_) for protected functions which should not be
imported from outside the module, or for protected methods which should not be used
outside the class they are defined in
Always prefer to call functions with keyword arguments over positional arguments
Example:
def process_items(items: list[Item]) -> list[Result]:
...
process_items(items=items)
Avoid tutorial-style # comments that explain what code does.
Comments should explain why, not what (the code itself should be self-explanatory)
Use Google-style docstrings for all public functions, classes, and modules.
Always include a newline after the name of each argument and exception in the docstring.
Always prefer ascii characters over unicode (e.g., arrows as -> over →)
Example:
def process_items(items: list[Item], log: bool) -> list[Result]:
"""Process items and return results.
Args:
items:
List of items to process.
log:
Whether to log progress.
Returns:
List of processed results.
Raises:
ValueError:
If items list is empty.
"""
if log:
logger.info("Processing items")
return batch_process(items=items)
You don't have to include the "Returns" section if the function doesn't return anything - example:
def process_items(items: list[Item], log: bool) -> None:
"""Process items and return results.
Args:
items:
List of items to process.
log:
Whether to log progress.
"""
if log:
logger.info("Processing items")
batch_process(items=items)
If an argument has a default value, mark it as optional in the docstring - example:
def process_items(items: list[Item], log: bool = False) -> list[Result]:
"""Process items and return results.
Args:
items:
List of items to process.
log (optional):
Whether to log progress. Defaults to False.
Returns:
List of processed results.
"""
if log:
logger.info("Processing items")
return batch_process(items=items)