← ClaudeAtlas

python-classlisted

Scaffold Python files and class architectures in Tsukini's style - the Python equivalent of cpp-class - class (one per file, attributes with their defaults in __init__), abstract class (abc, abstract methods), tool (one function per file, MAGIC tool/), module of free functions, exception (subclass of the project error with its code), const category (frozen dataclass + instance), pytest test file, with the Xartania header, the
TsukiNi22/ai-utils · ★ 1 · Data & Documents · score 74
Install: claude install-skill TsukiNi22/ai-utils
# Python files in Tsukini's style `SKILL_DIR` = the directory of this file. Load `python-style` (code) and `python-comments` (comments) first; a project layout comes from `python-project`. Generator (`--help` for every option): ```bash python3 SKILL_DIR/scripts/new_file.py <kind> <Name> --dir <folder> [--desc "..."] [--base Parent] \ [--attributes "name: type = default # comment; ..."] [--methods "name(params) -> type # what it does; ..."] \ [--relative] [--export] [--banner xartania|none|<text>] ``` > **Architecture only: never write the logic of a function.** Every body is `pass` (no return value), the smallest > return of its type (`return 0`, `""`, `False`, `[]`, `{}`, `None` for `X | None`), `...` (abstract method) or > `raise NotImplementedError` (any other type), even if the user describes the behavior: the description goes in the > docstring of a public method or the trailing comment of the `def`. The user writes the logic. Allowed: attributes > with their defaults in `__init__`, `super().__init__()`, the constants of a `const.py` category. ## 1. Understand the request | Kind | File | Content | |---|---|---| | `class` | `<folder>/<snake_name>.py` (`Class/` of an application, `src/<pkg>/` of a package) | class `PascalCase`, docstring, `__init__` with the typed attributes (`self._x: int = 0 # meaning`), the methods | | `abstract` | same | `class X(ABC)` + `@abstractmethod` methods with `...` (the `I` / `A` of `cpp-class`: the interface of a family) | | `tool`