Vibe Python Style
Python coding conventions for Mistral Vibe.
Install
npx skills add mistralai/mistral-vibe --skill vibe-python-style -g -a claude-code -y- Repository
- mistralai/mistral-vibe5.3k
- Category
- Writing
- Updated
- 5d ago
- License
- Apache-2.0
- Context cost
- Lightabout 1,037 tokens
- Runs scripts
- No, instructions only
What it does
Python coding conventions for Mistral Vibe. Use when writing, reviewing, or refactoring Python code in the Vibe codebase. Covers style, type hints, imports, Pydantic patterns, logging, error handling, and file I/O.
Vibe Python Style
Conventions for writing Python in the Vibe codebase. Apply whenever writing, reviewing, or refactoring Python code.
Style
- Prefer
match/caseover longif/elifchains. - Use the walrus operator
:=only when it shortens code and improves clarity. - Be a never-nester: early returns and guard clauses over nested blocks.
- Modern type hints only: built-in generics (
list,dict) and|unions. Never importOptional,Union,Dict,Listfromtyping. - Use
pathlib.Path(andanyio.Pathin async paths) instead ofos.path. - Use f-strings, comprehensions, and context managers; follow PEP 8.
- Enums:
StrEnum/IntEnumwithauto()and UPPERCASE members. For type-mixing, the mix-in type comes beforeEnumin the bases. Add methods or@propertyrather than parallel lookup tables. - Write declarative, minimalist code: express intent, drop boilerplate.
- Never call a private method from outside of its class in production code. Accessing private methods in tests is acceptable.
- Avoid comments and docstrings, except for when there's a hard to spot corner case
Typing & imports
- Pyright is strict and gates CI; fix types at the source.
- No relative imports,
ban-relative-imports = "all". Alwaysfrom vibe.core.x import …. - No inline
# type: ignoreor# noqa. Fix with refined signatures (TypeVar, Protocol),isinstanceguards,typing.castwhen control flow guarantees the type, or a small typed wrapper at the boundary.
TYPE_CHECKING and lazy imports
Moving imports under if TYPE_CHECKING: or into function bodies cuts startup time but risks runtime NameError. Before merging any import-deferral change, run:
