python

Enforces Python development standards with ruff, mypy, and pytest for type-safe TDD workflows.

Updated Jan 16, 2026
One-click install
npx skills add https://github.com/dudqks0319-cpu/antigravity-skills --skill python-dudqks0319-cpu
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: python
Source: https://github.com/dudqks0319-cpu/antigravity-skills/tree/main/python
Command: npx skills add https://github.com/dudqks0319-cpu/antigravity-skills --skill python-dudqks0319-cpu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ruff, mypy, pytest, pydantic, pre-commit.

What problem does it solve? Python projects often suffer from inconsistent code quality, missing type safety, and untested business logic. This Skill provides a complete, opinionated development standard covering project structure, linting, type checking, testing, and CI automation so every Python project starts with a solid foundation. ## Core Features & Use Cases - Quality Toolchain Configuration: Ready-to-use settings for ruff (linting and formatting), mypy in strict mode, and pytest with 80% coverage enforcement via pyproject.toml. - Layered Project Architecture: A src-layout template separating pure business logic (core/) from side effects (infra/), with patterns like dependency injection, Pydantic validation, and the Result pattern. - CI/CD and Pre-Commit Automation: GitHub Actions quality gate and pre-commit hooks that run ruff, mypy, and pytest on every commit and push. - Use Case: When starting a new FastAPI service, apply this Skill to scaffold the directory structure, configure strict type checking, write AAA-pattern unit tests, and set up the CI pipeline in one pass. ## Quick Start Set up my Python project with ruff, strict mypy, pytest coverage, pre-commit hooks, and a GitHub Actions quality gate following the python skill standards.

Frequently Asked Questions about python

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

FAQPage Schema
How do I set up ruff and mypy for a Python project?▼

Add a [tool.ruff] section with line-length and rule selections (E, F, I, N, W, UP) and a [tool.mypy] section with strict = true to pyproject.toml. Then run ruff check and mypy src/ locally or in CI.

How to enforce test coverage with pytest in Python?▼

Configure pytest in pyproject.toml with addopts containing --cov=src, --cov-report=term-missing, and --cov-fail-under=80. This fails the test run whenever coverage drops below 80 percent.

What is the recommended Python project structure for testability?▼

Use a src layout separating core/ (pure business logic, Pydantic models, pure functions) from infra/ (API routes, database operations). Pass dependencies like database handles as function arguments instead of importing them directly.

Does mypy strict mode work with Pydantic models?▼

Yes, Pydantic models are fully typed and work under mypy strict mode. Add pydantic to the mypy pre-commit hook's additional_dependencies so type checking resolves the package correctly.

Why should Python business logic avoid raising exceptions?▼

The Result pattern returns a dataclass containing either a value or an error string, keeping core logic pure and explicit about failure modes. This makes unit testing simpler since tests assert on returned values instead of using pytest.raises.