python-style

Enforces Python conventions for uv projects, Nix packaging, type checking, and ruff linting.

Updated Aug 5, 2026
One-click install
npx skills add https://github.com/harivansh-afk/loom-index-e2e --skill python-style-harivansh-afk
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: python-style
Source: https://github.com/harivansh-afk/loom-index-e2e/tree/main/skills/python-style
Command: npx skills add https://github.com/harivansh-afk/loom-index-e2e --skill python-style-harivansh-afk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams writing Python in a Nix monorepo need consistent project structure, packaging, type checking, and lint rules; this Skill defines those conventions so every Python app follows the same standard. ## Core Features & Use Cases - uv Project Standard: Defaults repo-owned Python apps to uv with pyproject.toml, committed uv.lock, src layout, and Nix packaging via ix.buildUvApplication. - Type Checking at Build Time: Runs zuban check --strict by default (with ty or mypy as alternatives) so new apps must be fully annotated to pass. - Shared Ruff Lint Selector: Applies one high-signal ruff rule set (ANN, S, TID251, and more) across package build gates and a repo-wide lint stage covering every tracked .py file. - Use Case: When adding a new Python CLI tool to the repo, follow this Skill to scaffold it as a uv project, annotate all functions, parse external JSON with pydantic models, and pass the ruff and type-check gates on the first CI run. ## Quick Start Apply the python-style conventions to scaffold a new uv-based Python application with full type annotations and passing ruff lints.

Frequently Asked Questions about python-style

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I package a Python application with uv and Nix?▼

Create a uv project with pyproject.toml, a committed uv.lock, and a src/<package>/ layout, then package it with ix.buildUvApplication. For tiny single-file scripts without PyPI dependencies, use ix.writePythonApplication instead.

Which Python type checker should I use: zuban, ty, or mypy?▼

Zuban is the default, running zuban check --strict including disallow-untyped-defs. Set pyChecker to "ty" for the older gradual checker or "mypy" only for a deliberate reason, and disable checking with check = false only when justified.

How do I handle untyped JSON from an API without typing.cast?▼

Parse external JSON into a pydantic model at the boundary instead of casting or threading dict[str, Any] through the code. The model validates the shape once with path-precise errors, and every downstream access is typed.

Why is typing.Any banned in Python annotations?▼

The ruff ANN401 rule bans bare typing.Any in annotations everywhere, and TID251 bans typing.cast because a wrong cast is a latent bug no checker can catch. Use pydantic models for untrusted data or explicit local annotations for known stdlib return types.

How do I suppress a ruff lint false positive?▼

Opt out per line with an annotated noqa comment in the form # noqa: <rule> -- <reason>, never a blanket silence. The rare unavoidable cast opts out per file with # noqa: TID251 plus a one-line reason.