# Code Style

> Apply Python coding standards, typing discipline, and readability rules in theme-extractor. Use when writing or reviewing production code, especially around interfaces, CLI, and domain models. Use when this capability is needed.

- Skill: `tomevault-io/code-style-7` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/code-style-7`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/code-style-7/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/code-style-7

---


# Code Style Skill

## Purpose
Keep code consistent, typed, and easy to maintain.

## Standards
- Use Python 3.13+ idioms.
- Type public interfaces explicitly.
- Keep functions small and focused.
- Use clear domain-oriented names.
- Add comments only when logic is non-obvious.

## Conventions
- Separate models/config/protocols from runtime services.
- Use `pydantic` for input and config validation.
- Raise explicit domain exceptions.
- Keep CLI parsing separate from business logic.
- Keep output schemas explicit and versionable.
- Prefer `enum.StrEnum` for single-choice options.
- Prefer `enum.Flag`/`enum.IntFlag` for combinable options, with conversion helpers (`str -> flag`, `flag -> str`).
- Use Google-style docstrings with explicit argument and return types to keep Sphinx generation reliable.

## Static Checks
- Formatting: Ruff formatter.
- Linting: Ruff.
- Type checking: Ty.

## Commands
- `uv run ruff format .`
- `uv run ruff check .`
- `uv run ty check src tests`

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/guillaume-lombardo) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-14 -->

