Skip to content
Back to skills

Python Like Mimi

ASecurity

Enforce functional-first, type-safe Python with Pydantic, dataclasses, enums, decorators, hooks, and lightweight modular architecture. Use when writing, editing, or refactoring Python.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
ai-agentspythongoshellrefactoringapi

Works with

  • api
  • mcp

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add whoamimi/plugin-mimi --skill python-like-mimi --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python Like Mimi?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Python Like Mimi
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/whoamimi-python-like-mimi/badge)](https://www.skillsdirectory.com/skills/whoamimi-python-like-mimi)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: python-like-mimi
description: Enforce functional-first, type-safe Python with Pydantic, dataclasses, enums, decorators, hooks, and lightweight modular architecture. Use when writing, editing, or refactoring Python.
---

# Python Modular Coding Style

## Core Principles

- Prefer functional programming and composition over inheritance.
- Write small, pure, single-responsibility functions.
- Require explicit type annotations for parameters and returns.
- Follow PEP 8 and modern Python conventions.
- Minimize mutable state, dependencies, and abstractions.
- Separate business logic from I/O and side effects.

## Type Safety & Schemas

- Use Python 3.11+ typing conventions.
- Prefer built-in generics: `list[str]`, `dict[str, int]`.
- Use `X | None` instead of `Optional[X]`.
- Use `Protocol`, `TypeAlias`, and generics where justified.
- Use `Enum` or `StrEnum` for fixed categorical values.
- Use `Literal` for small, context-specific value constraints.
- Avoid `Any` unless unavoidable.

### Schema Selection

- **Pydantic v2 BaseModel:** API contracts, external data,
  configuration, serialization, and runtime validation.
- **dataclasses:** Internal typed data structures and
  lightweight domain models without runtime validation.
- **Enum / StrEnum:** Reusable categorical constants.
- **TypedDict:** Lightweight typed dictionary interfaces.

## Design Patterns

- **Functions:** Keep domain logic independently testable.
- **Decorators:** Reuse logging, retries, caching, and validation.
- **Hooks:** Prefer typed callbacks for extensibility.
- **Dependency Injection:** Pass dependencies explicitly.
- **Composition:** Prefer small functions over class hierarchies.
- **Modules:** Organize by feature and responsibility.

## Conventions

- Prefer `@dataclass(frozen=True, slots=True)` for immutable models.
- Use Pydantic `Field` and validators for external constraints.
- Prefer `pathlib`, `collections.abc`, and standard-library tools.
- Use `async`/`await` only for asynchronous I/O.
- Avoid global mutable state and hidden side effects.
- Raise specific exceptions; never silently swallow errors.
- Add concise docstrings for non-obvious behavior.
  -Usage: Pydantic validates inputs and outputs at system boundaries; frozen dataclasses represent internal domain state; enums encode finite states; typed functions implement business logic; decorators and callbacks provide reusable extension points.

## Refactoring Rules

1. Preserve existing behavior and public interfaces.
2. Introduce explicit types and appropriate schemas.
3. Extract repeated logic into reusable functions.
4. Introduce decorators or hooks only when justified.
5. Keep modules loosely coupled and independently testable.
6. Avoid unnecessary classes, wrappers, and dependencies.
7. Add or update focused tests for changed behavior.

## Output Expectations

- Produce concise, type-safe, production-quality Python.
- Prefer functional core and imperative shell architecture.
- Use Pydantic only where runtime validation is beneficial.
- Avoid overengineering and redundant abstractions.
- Explain architectural decisions only when necessary.

## Example Directory Structure

```
inventory-mcp/
├── pyproject.toml
└── src/
    └── inventory/
        ├── __init__.py
        ├── schemas.py       # Pydantic, dataclasses, enums
        ├── core.py          # Pure functions and generators
        └── server.py        # MCP decorators and lifecycle hooks
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.