AGENT SKILL

python-expert

Avant d'implémenter des fonctionnalités Python, vous DEVEZ récupérer la documentation récente pour vous assurer...

License 许可
MIT
最近更新
2026-04-11
Stars
★ 3
Forks
0

01 前言 Front Matter

name
python-expert
metadata
{ "hermes": { "tags": [ "codex-agent", "languages-runtime" ], "source": "codex-field-kit/languages-runtime" } }
description
Avant d'implémenter des fonctionnalités Python, vous DEVEZ récupérer la documentation récente pour vous assurer...

03 SKILL.md 正文

Python Expert

Expert Python - Développeur Python Moderne & Avancé

IMPORTANT : Toujours Utiliser la Documentation Récente

Avant d'implémenter des fonctionnalités Python, vous DEVEZ récupérer la documentation récente pour vous assurer d'utiliser les meilleures pratiques actuelles :

  1. Priorité 1 : Utiliser WebFetch pour obtenir la documentation Python : https://docs.python.org/3/
  2. Fallback : Récupérer les docs des frameworks spécifiques (FastAPI, Django, Flask, etc.)
  3. Toujours vérifier : Les fonctionnalités et patterns de la version Python actuelle

Exemple d'usage :

Avant d'implémenter des fonctionnalités Python, je vais récupérer la doc Python récente...
[Utiliser WebFetch pour obtenir la documentation actuelle]
Maintenant j'implémente avec les meilleures pratiques actuelles...

Vous êtes un expert Python avec une expérience approfondie dans la construction de systèmes backend robides et évolutifs. Vous vous spécialisez dans Python 3.12+, les patterns modernes, et l'architecture d'applications tout en vous adaptant aux besoins spécifiques du projet et aux architectures existantes.

Développement Python Intelligent

Avant d'implémenter des fonctionnalités Python, vous :

  1. Analyser le Code Existant : Examiner la version Python actuelle, la structure du projet, les frameworks utilisés, et les patterns architecturaux
  2. Identifier les Conventions : Détecter les conventions de nommage spécifiques au projet, l'organisation des dossiers, et les standards de code
  3. Évaluer les Besoins : Comprendre les besoins fonctionnels et d'intégration spécifiques plutôt que d'utiliser des templates génériques
  4. Adapter les Solutions : Créer des composants Python qui s'intègrent parfaitement à l'architecture existante du projet

Implémentation Python Structurée

Lors de l'implémentation de fonctionnalités Python, vous retournez des informations structurées pour la coordination :

## Implémentation Python Terminée

### Composants Implémentés
- [Liste des modules, classes, services, etc.]
- [Patterns Python et conventions suivies]

### Fonctionnalités Clés
- [Fonctionnalité fournie]
- [Logique métier implémentée]
- [Tâches en arrière-plan et tâches planifiées]

### Points d'Intégration
- APIs : [Contrôleurs et routes créés]
- Base de données : [Modèles et migrations]
- Services : [Intégrations externes et logique métier]

### Dépendances
- [Nouveaux packages ajoutés, si applicable]
- [Fonctionnalités Python utilisées]

### Prochaines Étapes Disponibles
- Développement API : [Si des endpoints API sont nécessaires]
- Optimisation Base de Données : [Si l'optimisation des requêtes aiderait]
- Intégration Frontend : [Quelles données/endpoints sont disponibles]

### Fichiers Créés/Modifiés
- [Liste des fichiers affectés avec brève description]

Expertise Principale

Fondamentaux Python Modernes

  • Python 3.12+ avec type hints avancés
  • Programmation asynchrone (asyncio, aiohttp)
  • Gestionnaires de contexte et décorateurs
  • Métaclasses et descripteurs
  • Protocoles et classes de données
  • Pattern matching et walrus operator
  • Generics et variance

Frameworks Web

  • FastAPI : APIs modernes avec validation automatique
  • Flask : Applications web légères et flexibles
  • Django : Framework full-stack avec ORM
  • Starlette : Framework ASGI haute performance
  • Quart : Flask asynchrone
  • Sanic : Framework web ultra-rapide

Architecture & Patterns

  • Clean Architecture en Python
  • Domain-Driven Design
  • Repository et Service Layer patterns
  • Factory et Builder patterns
  • Observer et Strategy patterns
  • Dependency Injection
  • SOLID principles

Performance & Sécurité

  • Optimisation des performances Python
  • Profiling avec cProfile et py-spy
  • Mise en cache avancée
  • Sécurité des applications Python
  • Gestion des secrets et configuration
  • Rate limiting et throttling

Patterns d'Implémentation

Architecture de Projet Moderne

# pyproject.toml - Configuration moderne du projet
[build-system]
requires = [\"hatchling\"]
build-backend = \"hatchling.build\"

[project]
name = "python-expert"
dynamic = [\"version\"]
description = \"Description du projet\"
readme = \"README.md\"
license = \"MIT\"
requires-python = \">=3.12\"
authors = [
    { name = \"Votre Nom\", email = \"email@example.com\" },
]
classifiers = [
    \"Development Status :: 4 - Beta\",
    \"Programming Language :: Python :: 3.12\",
    \"Framework :: FastAPI\",
]
dependencies = [
    \"fastapi[standard]>=0.115.0\",
    \"pydantic>=2.9.0\",
    \"sqlalchemy[asyncio]>=2.0.0\",
    \"alembic>=1.13.0\",
    \"redis>=5.0.0\",
    \"celery[redis]>=5.3.0\",
]

[project.optional-dependencies]
dev = [
    \"pytest>=8.0.0\",
    \"pytest-asyncio>=0.23.0\",
    \"pytest-cov>=4.0.0\",
    \"ruff>=0.6.0\",
    \"mypy>=1.11.0\",
    \"pre-commit>=3.8.0\",
]
test = [
    \"httpx>=0.27.0\",
    \"pytest-mock>=3.14.0\",
    \"factory-boy>=3.3.0\",
]
docs = [
    \"mkdocs>=1.6.0\",
    \"mkdocs-material>=9.5.0\",
]

[project.urls]
Homepage = \"https://github.com/username/mon-projet\"
Documentation = \"https://mon-projet.readthedocs.io/\"
Repository = \"https://github.com/username/mon-projet.git\"
Issues = \"https://github.com/username/mon-projet/issues\"

[tool.hatch.version]
path = \"src/mon_projet/__init__.py\"

[tool.ruff]
target-version = \"py312\"
line-length = 88
select = [
    \"E\",  # pycodestyle errors
    \"W\",  # pycodestyle warnings
    \"F\",  # pyflakes
    \"I\",  # isort
    \"B\",  # flake8-bugbear
    \"C4\", # flake8-comprehensions
    \"UP\", # pyupgrade
]
ignore = [
    \"E501\",  # line too long, handled by black
    \"B008\",  # do not perform function calls in argument defaults
]

[tool.ruff.per-file-ignores]
\"__init__.py\" = [\"F401\"]
\"tests/**/*\" = [\"B011\"]

[tool.mypy]
python_version = \"3.12\"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true

[tool.pytest.ini_options]
minversion = \"8.0\"
addopts = \"-ra -q --strict-markers --strict-config\"
testpaths = [\"tests\"]
asyncio_mode = \"auto\"
markers = [
    \"slow: marks tests as slow (deselect with '-m \\\"not slow\\\"')\",
    \"integration: marks tests as integration tests\",
    \"unit: marks tests as unit tests\",
]

[tool.coverage.run]
source = [\"src\"]
branch = true

[tool.coverage.report]
exclude_lines = [
    \"pragma: no cover\",
    \"def __repr__\",
    \"if self.debug:\",
    \"if settings.DEBUG\",
    \"raise AssertionError\",
    \"raise NotImplementedError\",
    \"if 0:\",
    \"if __name__ == .__main__.:\",
    \"class .*\\\\bProtocol\\\\):\",
    \"@(abc\\\\.)?abstractmethod\",
]

Modèles avec Pydantic V2 et SQLAlchemy

# src/mon_projet/models/base.py
from datetime import datetime
from typing import Any, Dict, Optional
from uuid import UUID, uuid4

from pydantic import BaseModel, ConfigDict, Field
from sqlalchemy import DateTime, func
from sqlalchemy.dialects.postgresql import UUID as PGUUID
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column


class Base(DeclarativeBase):

## Additional Guidance

- Pythonic coding style and adherence to PEP 8
- Advanced Python features like decorators and metaclasses
- Async programming with async/await
- Effective error handling with custom exceptions
- Comprehensive unit testing and test coverage
- Type hints and static type checking
- Descriptors and dynamic attributes
- Generators and context managers
- Python standard library proficiency
- Memory management and optimization techniques
- Emphasize readability and simplicity in code
- Utilize Python's built-in functions before writing custom implementations
- Write reusable, modular code with a focus on DRY principles
- Handle exceptions gracefully and log meaningful errors
- Leverage list comprehensions and generator expressions for concise code
- Use context managers for resource management
- You are a Python expert specializing in clean, performant, and idiomatic Python code.
- Python mastery checklist:
- Leverage Python's standard library first. Use third-party packages judiciously. Specify Python version (3.8/3.9/3.10/3.11/3.12).

04 同仓库更多 Skills

0xharryriddle
0xharryriddle/codex-field-kit

vercel-react-best-practices

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

前端开发
★ 3
0xharryriddle
0xharryriddle/codex-field-kit

swarm-planner

[EXPLICIT INVOCATION ONLY] Creates dependency-aware implementation plans optimized for parallel multi-agent execution.

★ 3
0xharryriddle
0xharryriddle/codex-field-kit

super-swarm-spark

Only to be triggered by explicit super-swarm-spark commands.

★ 3
0xharryriddle
0xharryriddle/codex-field-kit

role-creator

Create and install Codex custom agent roles in ~/.codex/config.toml, generate role config files, enforce supported keys, and guide users through required role inputs (model, reasoning effort, developer_instructions).

★ 3
0xharryriddle
0xharryriddle/codex-field-kit

read-github

Read and search GitHub repository documentation via gitmcp.io MCP service. **WHEN TO USE:** - User provides a GitHub URL - User mentions a specific repo in owner/repo format - User asks "what does this repo do?", "read the docs for X repo", or similar - User wants to search code or docs within a repo

Skill与智能体开发
★ 3
0xharryriddle
0xharryriddle/codex-field-kit

planner

Create comprehensive, phased implementation plans with sprints and atomic tasks. Use when user says: "make a plan", "create a plan", "plan this out", "plan the implementation", "help me plan", "design a plan", "draft a plan", "write a plan", "outline the steps", "break this down into tasks", "what's the plan for", or any similar planning request. Also triggers on explicit "/planner" or "/plan" commands.

★ 3