- Created structured documentation with /patterns/, /examples/, and /reference/ directories - Implemented automatic context loading rules in CLAUDE.md based on file extensions, directories, and keywords - Added technology-specific patterns for Docker, Python, Node.js, Vue.js, Bash, networking, databases, and VM management - Included complete working examples for common workflows and troubleshooting references - Designed for minimal context usage with precise loading triggers 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
33 lines
1005 B
Markdown
33 lines
1005 B
Markdown
# Python Patterns
|
|
|
|
## Project Structure
|
|
- Use virtual environments (venv)
|
|
- Implement proper package structure with `__init__.py`
|
|
- Separate configuration from code
|
|
- Use requirements.txt for dependencies
|
|
|
|
## Code Organization
|
|
- **MVC/MVT patterns** for web applications
|
|
- **Factory pattern** for object creation
|
|
- **Context managers** for resource handling
|
|
- **Async/await** for I/O-bound operations
|
|
|
|
## Error Handling
|
|
- Use specific exception types
|
|
- Implement proper logging with levels
|
|
- Graceful degradation for external dependencies
|
|
- Validation at API boundaries
|
|
|
|
## Performance Considerations
|
|
- Use generators for large datasets
|
|
- Profile before optimizing
|
|
- Leverage caching appropriately
|
|
- Consider async for concurrent operations
|
|
|
|
## Related Documentation
|
|
- Examples: `/examples/python/web-frameworks.md`
|
|
- Examples: `/examples/python/api-clients.md`
|
|
- Examples: `/examples/python/async-patterns.md`
|
|
- Reference: `/reference/python/debugging.md`
|
|
- Reference: `/reference/python/performance.md`
|