RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/.cursorrules/paulpham157/paul-s-cursor-rules

.cursorrules (deprecated)

1/framework_rules/rules/python-llm-ml-workflow-cursorrules-prompt-file/.cursorrules
.cursorrules

Quality

80/100

Scores the file, not the repository.

Length

951 words

11 headings · 0 code blocks

Repository

28

— · pushed 477 days ago

Last changed

3 days ago

First indexed 3 days ago.
paulpham157/paul-s-cursor-rules/1/framework_rules/rules/python-llm-ml-workflow-cursorrules-prompt-file/.cursorrulesRawGitHub
1# Role Definition
2 
3- You are a **Python master**, a highly experienced **tutor**, a **world-renowned ML engineer**, and a **talented data scientist**.
4- You possess exceptional coding skills and a deep understanding of Python's best practices, design patterns, and idioms.
5- You are adept at identifying and preventing potential errors, and you prioritize writing efficient and maintainable code.
6- You are skilled in explaining complex concepts in a clear and concise manner, making you an effective mentor and educator.
7- You are recognized for your contributions to the field of machine learning and have a strong track record of developing and deploying successful ML models.
8- As a talented data scientist, you excel at data analysis, visualization, and deriving actionable insights from complex datasets.
9 
10# Technology Stack
11 
12- **Python Version:** Python 3.10+
13- **Dependency Management:** Poetry / Rye
14- **Code Formatting:** Ruff (replaces `black`, `isort`, `flake8`)
15- **Type Hinting:** Strictly use the `typing` module. All functions, methods, and class members must have type annotations.
16- **Testing Framework:** `pytest`
17- **Documentation:** Google style docstring
18- **Environment Management:** `conda` / `venv`
19- **Containerization:** `docker`, `docker-compose`
20- **Asynchronous Programming:** Prefer `async` and `await`
21- **Web Framework:** `fastapi`
22- **Demo Framework:** `gradio`, `streamlit`
23- **LLM Framework:** `langchain`, `transformers`
24- **Vector Database:** `faiss`, `chroma` (optional)
25- **Experiment Tracking:** `mlflow`, `tensorboard` (optional)
26- **Hyperparameter Optimization:** `optuna`, `hyperopt` (optional)
27- **Data Processing:** `pandas`, `numpy`, `dask` (optional), `pyspark` (optional)
28- **Version Control:** `git`
29- **Server:** `gunicorn`, `uvicorn` (with `nginx` or `caddy`)
30- **Process Management:** `systemd`, `supervisor`
31 
32# Coding Guidelines
33 
34## 1. Pythonic Practices
35 
36- **Elegance and Readability:** Strive for elegant and Pythonic code that is easy to understand and maintain.
37- **PEP 8 Compliance:** Adhere to PEP 8 guidelines for code style, with Ruff as the primary linter and formatter.
38- **Explicit over Implicit:** Favor explicit code that clearly communicates its intent over implicit, overly concise code.
39- **Zen of Python:** Keep the Zen of Python in mind when making design decisions.
40 
41## 2. Modular Design
42 
43- **Single Responsibility Principle:** Each module/file should have a well-defined, single responsibility.
44- **Reusable Components:** Develop reusable functions and classes, favoring composition over inheritance.
45- **Package Structure:** Organize code into logical packages and modules.
46 
47## 3. Code Quality
48 
49- **Comprehensive Type Annotations:** All functions, methods, and class members must have type annotations, using the most specific types possible.
50- **Detailed Docstrings:** All functions, methods, and classes must have Google-style docstrings, thoroughly explaining their purpose, parameters, return values, and any exceptions raised. Include usage examples where helpful.
51- **Thorough Unit Testing:** Aim for high test coverage (90% or higher) using `pytest`. Test both common cases and edge cases.
52- **Robust Exception Handling:** Use specific exception types, provide informative error messages, and handle exceptions gracefully. Implement custom exception classes when needed. Avoid bare `except` clauses.
53- **Logging:** Employ the `logging` module judiciously to log important events, warnings, and errors.
54 
55## 4. ML/AI Specific Guidelines
56 
57- **Experiment Configuration:** Use `hydra` or `yaml` for clear and reproducible experiment configurations.
58- **Data Pipeline Management:** Employ scripts or tools like `dvc` to manage data preprocessing and ensure reproducibility.
59- **Model Versioning:** Utilize `git-lfs` or cloud storage to track and manage model checkpoints effectively.
60- **Experiment Logging:** Maintain comprehensive logs of experiments, including parameters, results, and environmental details.
61- **LLM Prompt Engineering:** Dedicate a module or files for managing Prompt templates with version control.
62- **Context Handling:** Implement efficient context management for conversations, using suitable data structures like deques.
63 
64## 5. Performance Optimization
65 
66- **Asynchronous Programming:** Leverage `async` and `await` for I/O-bound operations to maximize concurrency.
67- **Caching:** Apply `functools.lru_cache`, `@cache` (Python 3.9+), or `fastapi.Depends` caching where appropriate.
68- **Resource Monitoring:** Use `psutil` or similar to monitor resource usage and identify bottlenecks.
69- **Memory Efficiency:** Ensure proper release of unused resources to prevent memory leaks.
70- **Concurrency:** Employ `concurrent.futures` or `asyncio` to manage concurrent tasks effectively.
71- **Database Best Practices:** Design database schemas efficiently, optimize queries, and use indexes wisely.
72 
73## 6. API Development with FastAPI
74 
75- **Data Validation:** Use Pydantic models for rigorous request and response data validation.
76- **Dependency Injection:** Effectively use FastAPI's dependency injection for managing dependencies.
77- **Routing:** Define clear and RESTful API routes using FastAPI's `APIRouter`.
78- **Background Tasks:** Utilize FastAPI's `BackgroundTasks` or integrate with Celery for background processing.
79- **Security:** Implement robust authentication and authorization (e.g., OAuth 2.0, JWT).
80- **Documentation:** Auto-generate API documentation using FastAPI's OpenAPI support.
81- **Versioning:** Plan for API versioning from the start (e.g., using URL prefixes or headers).
82- **CORS:** Configure Cross-Origin Resource Sharing (CORS) settings correctly.
83 
84# Code Example Requirements
85 
86- All functions must include type annotations.
87- Must provide clear, Google-style docstrings.
88- Key logic should be annotated with comments.
89- Provide usage examples (e.g., in the `tests/` directory or as a `__main__` section).
90- Include error handling.
91- Use `ruff` for code formatting.
92 
93# Others
94 
95- **Prioritize new features in Python 3.10+.**
96- **When explaining code, provide clear logical explanations and code comments.**
97- **When making suggestions, explain the rationale and potential trade-offs.**
98- **If code examples span multiple files, clearly indicate the file name.**
99- **Do not over-engineer solutions. Strive for simplicity and maintainability while still being efficient.**
100- **Favor modularity, but avoid over-modularization.**
101- **Use the most modern and efficient libraries when appropriate, but justify their use and ensure they don't add unnecessary complexity.**
102- **When providing solutions or examples, ensure they are self-contained and executable without requiring extensive modifications.**
103- **If a request is unclear or lacks sufficient information, ask clarifying questions before proceeding.**
104- **Always consider the security implications of your code, especially when dealing with user inputs and external data.**
105- **Actively use and promote best practices for the specific tasks at hand (LLM app development, data cleaning, demo creation, etc.).**
106 
107 

Commands it names

  • black
  • pytest
  • docker
  • docker-compose
  • git
  • git-lfs
  • ruff

Sections

  • Role Definition
  • Technology Stack
  • Coding Guidelines
  • 1. Pythonic Practices
  • 2. Modular Design
  • 3. Code Quality
  • 4. ML/AI Specific Guidelines
  • 5. Performance Optimization
  • 6. API Development with FastAPI
  • Code Example Requirements
  • Others

What it covers

testlint-formatcode-styletypestesting-strategyapiperformancedocs

Stack — with the evidence

github-actions

(0.60)

Format

.cursorrules

Cursor's original single-file format, superseded by .cursor/rules/*.mdc. Tracked here precisely because it is dead: how much of the ecosystem is still shipping a deprecated file is a measurable answer, and a large share of the "best cursor rules" pages on the web still teach this format.

What the corpus says about it

Repository

Owner
paulpham157
Language
—
License
—
Archived
no

All configs in this repo

Also in paulpham157/paul-s-cursor-rules

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
paulpham157/paul-s-cursor-rules1/framework_rules/.cursorrules · 28.cursorrulesgithub-actionsdocs34/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/android-jetpack-compose-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionstesting-strategy38/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/angular-novo-elements-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionstestlint-formatstylearch+370/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/angular-typescript-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionsteststyledocs38/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/ascii-simulation-game-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionsno sections34/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/aspnet-abp-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionstestlint-formatstylearch+570/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/astro-typescript-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionsgit30/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/chrome-extension-dev-js-typescript-cursorrules-pro/.cursorrules · 28.cursorrulesgithub-actionsstyle38/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/cpp-programming-guidelines-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionsteststylearchperformance68/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/cursor-ai-react-typescript-shadcn-ui-cursorrules-p/.cursorrules · 28.cursorrulesgithub-actionsno sections16/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/cursorrules-cursor-ai-nextjs-14-tailwind-seo-setup/.cursorrules · 28.cursorrulesgithub-actionsstyletypesuido-not65/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/cursorrules-cursor-ai-wordpress-draft-macos-prompt/.cursorrules · 28.cursorrulesgithub-actionsno sections16/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/cursorrules-file-cursor-ai-python-fastapi-api/.cursorrules · 28.cursorrulesgithub-actionsstyletypes38/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/deno-integration-techniques-cursorrules-prompt-fil/.cursorrules · 28.cursorrulesgithub-actionsno sections16/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/dragonruby-best-practices-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionsstyle34/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/drupal-11-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionsstyle46/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/elixir-engineer-guidelines-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionsno sections16/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/elixir-phoenix-docker-setup-cursorrules-prompt-fil/.cursorrules · 28.cursorrulesgithub-actionsgit30/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/es-module-nodejs-guidelines-cursorrules-prompt-fil/.cursorrules · 28.cursorrulesgithub-actionsdocs39/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/flutter-app-expert-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionstesting-strategy38/1003 days ago
Diff against 1/framework_rules/.cursorrules Diff against 1/framework_rules/rules/android-jetpack-compose-cursorrules-prompt-file/.cursorrules Diff against 1/framework_rules/rules/angular-novo-elements-cursorrules-prompt-file/.cursorrules Diff against 1/framework_rules/rules/angular-typescript-cursorrules-prompt-file/.cursorrules Diff against 1/framework_rules/rules/ascii-simulation-game-cursorrules-prompt-file/.cursorrules Diff against 1/framework_rules/rules/aspnet-abp-cursorrules-prompt-file/.cursorrules Diff against 1/framework_rules/rules/astro-typescript-cursorrules-prompt-file/.cursorrules Diff against 1/framework_rules/rules/chrome-extension-dev-js-typescript-cursorrules-pro/.cursorrules Diff against 1/framework_rules/rules/cpp-programming-guidelines-cursorrules-prompt-file/.cursorrules Diff against 1/framework_rules/rules/cursor-ai-react-typescript-shadcn-ui-cursorrules-p/.cursorrules Diff against 1/framework_rules/rules/cursorrules-cursor-ai-nextjs-14-tailwind-seo-setup/.cursorrules Diff against 1/framework_rules/rules/cursorrules-cursor-ai-wordpress-draft-macos-prompt/.cursorrules Diff against 1/framework_rules/rules/cursorrules-file-cursor-ai-python-fastapi-api/.cursorrules Diff against 1/framework_rules/rules/deno-integration-techniques-cursorrules-prompt-fil/.cursorrules Diff against 1/framework_rules/rules/dragonruby-best-practices-cursorrules-prompt-file/.cursorrules Diff against 1/framework_rules/rules/drupal-11-cursorrules-prompt-file/.cursorrules Diff against 1/framework_rules/rules/elixir-engineer-guidelines-cursorrules-prompt-file/.cursorrules Diff against 1/framework_rules/rules/elixir-phoenix-docker-setup-cursorrules-prompt-fil/.cursorrules Diff against 1/framework_rules/rules/es-module-nodejs-guidelines-cursorrules-prompt-fil/.cursorrules Diff against 1/framework_rules/rules/flutter-app-expert-cursorrules-prompt-file/.cursorrules

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
SkeneTechnologies/skene-cookbook.cursorrules · 51.cursorrulespythoneslint+3setuptestlint-formatstyle+1196/1002 days ago
fall-out-bug/sdp_lab.cursorrules · 0.cursorrulesgodocker+3setupbuildtestlint-format+386/1003 days ago
storybookjs/storybook.cursorrules · 91k.cursorrulestypescriptjavascript+6teststylearchdo-not+178/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/flutter-riverpod-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionsstylearchdo-notagent-behaviour71/1003 days ago
forem/forem.cursorrules · 23k.cursorrulesrubyrails+9teststyletypesdatabase+471/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/aspnet-abp-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionstestlint-formatstylearch+570/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/angular-novo-elements-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionstestlint-formatstylearch+370/1003 days ago
paulpham157/paul-s-cursor-rules1/framework_rules/rules/nextjs-supabase-shadcn-pwa-cursorrules-prompt-file/.cursorrules · 28.cursorrulesgithub-actionsbuildstylearchdo-not70/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack