Showing 28 verified skills. 284 preview entries are hidden until we confirm a real source. Show preview skills · Why?
Make Cursor follow Python best practices and type hints
curl -o .cursorrules https://skills.dev/rules/pythonPython development conventions for Cursor: type hints everywhere, dataclasses over dicts, async best practices, and pytest patterns.
This is the actual SKILL.md file that powers this skill. Copy it to install.
---
name: cursor-python-rules
description: |
Cursor rules for Python projects. Always active when editing Python files
in Cursor. Enforces type hints, modern patterns, and testing conventions.
---
# Python Project Rules for Cursor
## Core rules
1. **Type hints on all functions.** Every function parameter and return value
gets a type hint. Use `from __future__ import annotations` for modern
syntax.
2. **Dataclasses over dicts.** For structured data, always use
`@dataclass` or Pydantic `BaseModel`. Never pass dicts with implicit
string keys.
3. **Async when appropriate.** Use `async/await` for I/O-bound operations
(HTTP requests, database queries, file I/O). Never use sync HTTP
clients in async code.
4. **f-strings for formatting.** Never use `%` formatting or `.format()`.
Always use f-strings.
5. **pytest for testing.** Use `pytest` with fixtures. Never use
`unittest.TestCase`. Use `pytest.mark.parametrize` for test variants.
## Example: typed function with dataclass
```python
from __future__ import annotations
from dataclasses import dataclass
@dataclass
class User:
name: str
email: str
is_active: bool = True
def create_user(name: str, email: str) -> User:
return User(name=name, email=email)
```
## Project structure
```
project/
src/
__init__.py
main.py
tests/
conftest.py
test_main.py
pyproject.toml
```
## Requirements
- Python 3.10+
- pyproject.toml for project config
- pytest installed
mkdir -p ~/.claude/skills/cursor-python-rules~/.claude/skills/cursor-python-rules/SKILL.mdResulting file structure:
~/.claude/
skills/
cursor-python-rules/
SKILL.md <-- skill definitionSkills are loaded automatically by Claude Code when you start a new session. The skill name and description in the frontmatter determine when Claude triggers it.
Recommended from shared domain, career, and tool overlap with Python Project Rules
Query databases, inspect schemas, and explore data from your AI editor
Both used by Software Engineer, Data Scientist
Build RAG pipelines with embedding, retrieval, and cited generation
Both used by Software Engineer, Data Scientist
Catch Python type errors in real-time while coding
Both used by Software Engineer, Data Scientist
Build and test regex patterns with visual debugging
Both used by Software Engineer, Data Scientist
Generate realistic test data with proper relational structure
Both used by Software Engineer, Data Scientist
Design and optimize prompts with evaluation frameworks and A/B testing
Both used by Software Engineer, Data Scientist
Python Project Rules