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.
npx skills add Mindrally/skills --skill python -a claude-codeWhat 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-code2Manually: put the files in place
~/.claude/skills/python/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/python/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill python -a codex2Manually: put the files in place
.agents/skills/python/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill python -a cursor2Manually: put the files in place
.cursor/skills/python/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills python2Manually: put the files in place
.github/skills/python/SKILL.md1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill python -a gemini-cli2Platform CLI
gemini skills install https://github.com/Mindrally/skills --path pythonManually: put the files in place
.devin/skills/python/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Mindrally/skills --skill python -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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.