python-coding

Enforces Python 3.14 style, logging, typing, and testing rules when writing or reviewing code.

Updated Jun 13, 2026
One-click install
npx skills add https://github.com/jenreh/project-kit-template --skill python-coding-jenreh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-coding
Source: https://github.com/jenreh/project-kit-template/tree/main/.agents/agent-skills/skills/python-coding
Command: npx skills add https://github.com/jenreh/project-kit-template --skill python-coding-jenreh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Inconsistent Python code style, missing type annotations, improper logging, and insufficient test coverage slow down reviews and introduce bugs. This Skill applies a single, enforceable rulebook for Python 3.14 projects so every module, refactor, and test follows the same standards. ## Core Features & Use Cases - Style & Logging Enforcement: 88-char line length via Ruff, parameterized logging (no f-strings in logger calls), no print statements, and full type annotations on every function. - Testing Strategy: Coverage targets of at least 80% for services, repositories, models, and Reflex State classes, with concrete pytest patterns for async handlers, streaming, and mocked I/O. - Database & Security Rules: SQLAlchemy async query patterns, manual Alembic migrations (no autogenerate), SecretStr handling, and caller-owned transaction boundaries. - Use Case: When asked to add a new service module or fix a bug, the Skill guides writing regression tests first, implementing a minimal diff, then running task format && task lint && task test before committing with Conventional Commits. ## Quick Start Ask the assistant to write a new Python service module with tests following the project coding standards, then run the format, lint, and test tasks.

Frequently Asked Questions about python-coding

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

FAQPage Schema
How do I write Python logging that passes Ruff lint rules?

Use parameterized logging like log.info("Loaded items: %d", count) instead of f-strings inside logger calls. Never use print statements, and choose levels by severity: debug for internal state, info for milestones, warning for recoverable issues, error for serious problems.

How do I test Reflex State classes with pytest?

Reflex State is a plain Python class, so instantiate it directly in a fixture and call handlers with pytest and pytest-asyncio. Async handlers use await, streaming handlers are consumed with async for, and external I/O is mocked at the module path with AsyncMock.

Why does pytest raise ImportPathMismatchError with multiple test directories?

This happens when two tests directories exist without proper configuration. Register both in testpaths, set import-mode to importlib in pyproject.toml, and remove __init__.py from component test directories while keeping it in the root tests folder.

Should I use Alembic autogenerate for database migrations?

No, write Alembic migrations manually instead of using --autogenerate. BaseRepository methods must not commit either, since transaction boundaries are owned by the calling code.

What test coverage is required for Python services and Reflex apps?

Services, repositories, models, utilities, and Reflex State classes require at least 80 percent coverage. Reflex UI component rendering is best-effort, and Alembic migrations only need manual review.