awesome-claude-notes / rules
loulanyue/awesome-claude-notes/.cursor/rules/python-patterns.md
Python patterns extending common rules
Cursor rule272 starsChanged 6 months ago
What's in it
- Python Patterns
- Protocol (Duck Typing)
- Dataclasses as DTOs
- Context Managers & Generators
- Reference
---
description: "Python patterns extending common rules"
globs: ["**/*.py", "**/*.pyi"]
alwaysApply: false
---
# Python Patterns
> This file extends the common patterns rule with Python specific content.
## Protocol (Duck Typing)
```python
from typing import Protocol
class Repository(Protocol):
def find_by_id(self, id: str) -> dict | None: ...
def save(self, entity: dict) -> dict: ...
```
## Dataclasses as DTOs
```python
from dataclasses import dataclass
@dataclass
class CreateUserRequest:
name: str
email: str
age: int | None = None
```
## Context Managers & Generators
- Use context managers (`with` statement) for resource management
- Use generators for lazy evaluation and memory-efficient iteration
## Reference
See skill: `python-patterns` for comprehensive patterns including decorators, concurrency, and package organization.
More agent context in loulanyue/awesome-claude-notes
178 other files this repository gives its agents, the first 60 shown.
AGENTS.md
CLAUDE.md
Cursor rule
- .cursor/rules/common-agents.md
- .cursor/rules/common-coding-style.md
- .cursor/rules/common-development-workflow.md
- .cursor/rules/common-git-workflow.md
- .cursor/rules/common-hooks.md
- .cursor/rules/common-patterns.md
- .cursor/rules/common-performance.md
- .cursor/rules/common-security.md
- .cursor/rules/common-testing.md
- .cursor/rules/golang-coding-style.md
- .cursor/rules/golang-hooks.md
- .cursor/rules/golang-patterns.md
- .cursor/rules/golang-security.md
- .cursor/rules/golang-testing.md
- .cursor/rules/kotlin-coding-style.md
- .cursor/rules/kotlin-hooks.md
- .cursor/rules/kotlin-patterns.md
- .cursor/rules/kotlin-security.md
- .cursor/rules/kotlin-testing.md
- .cursor/rules/php-coding-style.md
- .cursor/rules/php-hooks.md
- .cursor/rules/php-patterns.md
- .cursor/rules/php-security.md
- .cursor/rules/php-testing.md
- .cursor/rules/python-coding-style.md
- .cursor/rules/python-hooks.md
- .cursor/rules/python-security.md
- .cursor/rules/python-testing.md
- .cursor/rules/swift-coding-style.md
- .cursor/rules/swift-hooks.md
- .cursor/rules/swift-patterns.md
- .cursor/rules/swift-security.md
- .cursor/rules/swift-testing.md
- .cursor/rules/typescript-coding-style.md
- .cursor/rules/typescript-hooks.md
- .cursor/rules/typescript-patterns.md
- .cursor/rules/typescript-security.md
- .cursor/rules/typescript-testing.md
llms.txt
Skill
- article-writing.cursor/skills/article-writing/SKILL.md
- bun-runtime.cursor/skills/bun-runtime/SKILL.md
- content-engine.cursor/skills/content-engine/SKILL.md
- documentation-lookup.cursor/skills/documentation-lookup/SKILL.md
- frontend-slides.cursor/skills/frontend-slides/SKILL.md
- investor-materials.cursor/skills/investor-materials/SKILL.md
- investor-outreach.cursor/skills/investor-outreach/SKILL.md
- market-research.cursor/skills/market-research/SKILL.md
- mcp-server-patterns.cursor/skills/mcp-server-patterns/SKILL.md
- nextjs-turbopack.cursor/skills/nextjs-turbopack/SKILL.md
- agent-evalskills/agent-eval/SKILL.md
- agent-harness-constructionskills/agent-harness-construction/SKILL.md
- agentic-engineeringskills/agentic-engineering/SKILL.md
- ai-first-engineeringskills/ai-first-engineering/SKILL.md
- ai-regression-testingskills/ai-regression-testing/SKILL.md
- android-clean-architectureskills/android-clean-architecture/SKILL.md
- api-designskills/api-design/SKILL.md
Also found in 19 other repositories
The same file, byte for byte, in the weekly crawl of public GitHub; the 10 with the most stars.
- affaan-m/ECC246k
- tpavanipradeep/everything-claude-code104
- mturac/everything-openai-codex89
- mit-network/everything-claude-code76
- Fmarzochi/EGC52
- ysyecust/everything-claude-code44
- j7-dev/everything-github-copilot19
- Infopibe/everything-claude-code8
- yapota2018/affaan-m-everything-claude-code4
- ArogyaReddy/https-github.com-affaan-m-everything-claude-code12
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool public_context_discussion, action report. How to connect one.

