agentleFS
MistralKnown publishermistralai/mistral-vibe/.agents/skills/vibe-python-style/SKILL.md

vibe-python-style

Skill5k starsChanged 3 months agoApache-2.0View on GitHub

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.

Trending

Quiet since October.about the whole repository

Jan 2026: 5 mentionsFeb 2026: 5 mentionsMar 2026: 5 mentionsApr 2026: 3 mentionsMay 2026: 4 mentionsJun 2026: 3 mentionsJul 2026: 2 mentionsAug 2026: 2 mentionsSep 2026: 9 mentionsOct 2026: 2 mentionsNov 2026: 0 mentionsDec 2026: 0 mentions
Jan 2026Jul 2026Dec 2026
Mentions a month of the mistralai/mistral-vibe repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about mistralai/mistral-vibe

The biggest 5 of 47 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 47

Talked about on GitHub, Bluesky and Hacker News (47 times).

On GitHub · 40

35 more on GitHub

On Bluesky · 5

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 4 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Prefer match / case over long if / elif chains.

    line 16
  2. Very specific:

    Use the walrus operator := only when it shortens code and improves clarity.

    line 17
  3. Very specific:

    Use pathlib.Path (and anyio.Path in async paths) instead of os.path.

    line 20
  4. Distinctive:

    Use f-strings, comprehensions, and context managers.

    line 21
  5. Distinctive:

    Write declarative, minimalist code: express intent, drop boilerplate.

    line 23
  6. Distinctive:

    Never call a private method from outside of its class in production code.

    line 24
  7. Distinctive:

    Avoid comments and docstrings, except for when there's a hard to spot corner case

    line 25
  8. Very specific:

    No relative imports — ban-relative-imports = "all".

    line 30
  9. Very specific:

    No inline # type: ignore or # noqa.

    line 31
  10. Very specific:

    Document Raises: only for exceptions the function actually raises (or that propagate from public API calls).

    line 46
  11. Very specific:

    Use from vibe.observability.logging import logger — stdlib logging with StructuredLogFormatter, not structlog.

    line 50
  12. Very specific:

    Prefer vibe.core.utils.io.read_safe / read_safe_async / decode_safe over raw Path.read_text(), Path.read_bytes().decode(), or open().

    line 57

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Vibe Python Style

Conventions for writing Python in the Vibe codebase. Apply whenever writing, reviewing, or refactoring Python code.

Style

  • Prefer match / case over long if / elif chains.
  • 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 import Optional, Union, Dict, List from typing.
  • Use pathlib.Path (and anyio.Path in async paths) instead of os.path.
  • Use f-strings, comprehensions, and context managers; follow PEP 8.
  • Enums: StrEnum / IntEnum with auto() and UPPERCASE members. For type-mixing, the mix-in type comes before Enum in the bases. Add methods or @property rather 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". Always from vibe.core.x import ….
  • No inline # type: ignore or # noqa. Fix with refined signatures (TypeVar, Protocol), isinstance guards, typing.cast when 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:

  • Ruff TC004 (pre-commit hook) — per-file: flags TYPE_CHECKING-only names referenced at runtime.
  • uv run python scripts/check_import_contracts.py — runtime cross-file: imports every from <mod> import <name> across vibe/ and tests/ to verify it resolves; also rebuilds Pydantic models to catch lazily-failing field types. Catches cross-file re-exports TC004 misses. Missing non-vibe deps are non-blocking warnings.
  • uv run scripts/suggest_lazy_imports.py — informational: reports deferral candidates (TC001–TC003 + single-function heuristic). Not gated.

Pydantic

  • Parse external data via model_validate, field_validator, or model_validator(mode="before") — never ad-hoc getattr / hasattr walks or custom from_sdk constructors.
  • Set ConfigDict(extra=…) explicitly. Use validation_alias (or field aliases) for kebab-case TOML keys.
  • Discriminated unions (e.g. MCP transport): use sibling final classes plus a shared base/mixin, and compose with Annotated[Union[...], Field(discriminator=...)]. Never narrow the discriminator field in a subclass — it violates LSP and pyright will reject it.
  • Document Raises: only for exceptions the function actually raises (or that propagate from public API calls). Don't list speculative built-ins.

Logging & errors

  • Use from vibe.observability.logging import logger — stdlib logging with StructuredLogFormatter, not structlog.
  • Configure via env: LOG_LEVEL (default WARNING), LOG_MAX_BYTES. Logs land in ~/.vibe/logs/vibe.log.
  • Pass variables as %s positional args, not f-string interpolation: prefer logger.error("Failed to fetch url=%s", url) over logger.error(f"Failed to fetch {url}"). This defers formatting to the logging framework (only formats if the message is emitted) and keeps messages grep-friendly.
  • Define module-local exception hierarchies. Always chain with raise NewError(...) from e. Rich exceptions expose a _fmt() helper for human-readable output.

File I/O

  • Prefer vibe.core.utils.io.read_safe / read_safe_async / decode_safe over raw Path.read_text(), Path.read_bytes().decode(), or open().
  • They return ReadSafeResult(text, encoding) and try UTF-8, then BOM detection, then locale, then charset_normalizer lazily.
  • Pass raise_on_error=True only when callers must distinguish corrupt files from valid ones; the default replaces undecodable bytes with U+FFFD.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.