Skip to main content
skill CX Codex

python · mindrally — Claude Code skill: Python rules for your agent

This skill tells your coding agent how to write Python: PEP 8, type hints, early returns, async for I/O. Useful when the agent edits or generates code in a Python repo.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Mindrally/skills --skill python -a claude-code
Open on GitHub

What python does

The skill covers Python across web work, data analysis, automation and machine learning. It sets rules the agent follows: PEP 8, mandatory type hints, error handling through early returns and guard clauses, async/await for I/O-bound operations. Modular and functional patterns come before classes.

For data work it points at pandas, matplotlib, seaborn and NumPy, and asks for vectorized operations instead of explicit loops. Web sections split by framework: class-based and function-based views in Django with select_related and prefetch_related for queries, Pydantic v2 and the RORO pattern in FastAPI, Blueprints and application factories in Flask.

Everything lives in a single SKILL.md file of written rules. Nothing runs, nothing lints your code — it is guidance the agent reads, so ambiguous cases it will interpret on its own. If your project already follows a different style, these rules will argue with it, and that is worth settling before the agent starts writing.

What it helps with

  • keep agent-written Python consistent across a repo
  • get type hints and PEP 8 without repeating yourself
  • replace pandas loops with vectorized operations
  • pick between class-based and function-based Django views
  • set up async I/O handling in FastAPI

Example prompts for the agent

  • add a FastAPI endpoint with Pydantic v2 validation
  • refactor this module to PEP 8 and add type hints
  • rewrite this dataframe processing without loops, using pandas

How to install python

1Skills CLI (Vercel)

npx skills add Mindrally/skills --skill python -a claude-code

2Manually: put the files in place

~/.claude/skills/python/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/python/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about python

How do I install the python skill in Claude?

Run npx skills add Mindrally/skills --skill python -a claude-code. The file lands at ~/.claude/skills/python/SKILL.md.

What does the python skill do?

It gives the agent Python development rules: PEP 8, type hints, early returns for errors, async for I/O, plus guidance for Django, FastAPI, Flask and data analysis.

Does the skill check my code?

No. It is a set of written rules in SKILL.md that the agent reads while generating code. There are no scripts or linters inside.

Source text

SKILL.md · Apache-2.0
---
name: python
description: Expert in Python development with best practices across web, data science, and automation
metadata:
  maintainer: Mindrally
  source: https://github.com/Mindrally/skills
---

# Python

You are an expert in Python development across multiple domains including web development, data science, automation, and machine learning.

## Universal Principles

- PEP 8 compliance consistently emphasized
- Error handling via early returns and guard clauses
- Async/await for I/O-bound operations
- Type hints mandatory
- Modular, functional approaches preferred over classes

## Code Style

- Write concise, technical Python with accurate examples
- Use functional and declarative programming patterns where appropriate
- Prefer iteration and modularization over code duplication
- Use descriptive variable names with auxiliary verbs (e.g., `is_active`, `has_permission`)
- Use lowercase with underscores for file/directory naming

## Data Analysis

- Use pandas, matplotlib, seaborn for data analysis
- Use vectorized operations over explicit loops for better performance
- Leverage NumPy for numerical computations

## Web Development

### Django
- Use class-based views (CBVs) for complex views
- Prefer function-based views (FBVs) for simpler logic
- Query optimization using select_related and prefetch_related
- Use Django's ORM; avoid raw SQL unless necessary

### FastAPI
- Use def for pure functions and async def for asynchronous operations
- Use Pydantic v2 for validation
- Implement the RORO pattern: Receive an Object, Return an Object

### Flask
- Use Blueprint-based organization
- Implement Flask application factories for modularity and testing

## Error Handling

- Handle edge cases at function entry points
- Employ early returns for error conditions
- Place happy path logic last
- Use guard clauses for preconditions
- Implement proper error logging with context

## Performance

- Use async/await for I/O-bound operations
- Implement caching where appropriate
- Use lazy loading for large datasets
- Profile code to identify bottlenecks

© Mindrally · Apache-2.0 · Mindrally/skills

Similar skills

All skills for Programming languages →

python by other authors comes first.

python pproenca A skill with 42 Python 3.11+ optimization rules: it steers the agent on async code, data structures and memory use. CX Codex +1 315installs python siviter-xyz Gives the agent one set of Python conventions: typing, dependency injection, module and test layout. Useful when edits land in an existing codebase. CX Codex +1 349installs python-patterns affaan-m Tells the agent how to write and review Python: idioms, type hints, exception handling, context managers. CX Codex +1 5,500installs python-development Seth Hobson A plugin that gives your agent context for modern Python: 3.12+, Django, FastAPI and async patterns. CX Codex ★ 41,729repo stars sentry-python-sdk getsentry A skill that scans your Python project and walks you through Sentry setup: errors, tracing, profiling, logs, crons and AI monitoring. CX Codex +1 2,600installs Python Security Scan sugarforever Scans Python, Flask, Django, and FastAPI projects for OWASP Top 10 flaws, hardcoded credentials, and vulnerable packages. Useful for pre-deployment audits and security reviews. CX Codex +1 540installs python-pro https://github.com/Jeffallan Skill for writing type-safe Python 3.11+ with complete annotations, async code, and test suites. Generates code with type hints, configures mypy in strict mode, writes pytest tests with fixtures and mocking. CX Codex +1 8,800installs dataverse-python-advanced-patterns official github Guides GitHub Copilot to generate Dataverse Python code with error recovery, batch work, and OData query patterns. 9,213installs

From the same set168

vuejs-typescript-best-practices Hands your agent a rulebook for Vue.js and TypeScript: Composition API, Pinia, VueUse, Tailwind, plus Vite build tuning. Useful once a Vue codebase outgrows one person's style. CX Codex +1 1,000installs drizzle-orm A skill that gives your agent Drizzle ORM conventions: schema as code, inferred types, queries and migrations. CX Codex +1 1,000installs elasticsearch-best-practices Provides rules and code patterns for Elasticsearch index mappings, shard planning, and search query optimization directly to your agent. CX Codex +1 999installs numpy-best-practices A skill that gives your agent NumPy ground rules: vectorize instead of looping, pick dtypes, watch memory, use np.linalg. Useful whenever Python code crunches numbers. CX Codex +1 997installs nlp-natural-language-processing Technical guidelines for natural language processing tasks using transformers, spaCy, and NLTK. Guides agents on proper tokenization, entity extraction, and vector search. CX Codex +1 980installs ui-design Gives the agent a checklist for interfaces: accessibility, responsive layout, performance. Useful when it writes or reviews frontend code. CX Codex +1 981installs internationalization-i18n This skill gives the agent a rulebook for internationalization: translations, locale-aware dates and numbers, RTL layout. Useful when an app ships in more than one language. CX Codex +1 978installs java A skill that tells the agent how to write Java: layered structure, Spring Boot 3.x, JUnit and Mockito tests. Useful when a Java codebase needs one consistent style. CX Codex +1 966installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor