jeremy-georges-filteau/aipy icon
public
Published on 8/13/2025
AI Python

Rules
Prompts
Models
Context
mistral Codestral model icon

Codestral

mistral

voyage voyage-code-3 model icon

voyage-code-3

voyage

voyage Voyage AI rerank-2 model icon

Voyage AI rerank-2

voyage

gemini Gemini 2.5 Pro model icon

Gemini 2.5 Pro

gemini

1048kinput·65.536koutput
relace Relace Instant Apply model icon

Relace Instant Apply

relace

40kinput·32koutput
gemini Gemini 2.0 Flash model icon

Gemini 2.0 Flash

gemini

1048kinput·8.192koutput
gemini Gemini 2.0 Flash Thinking model icon

Gemini 2.0 Flash Thinking

gemini

1048kinput·8.192koutput
anthropic Claude 4 Opus model icon

Claude 4 Opus

anthropic

200kinput·32koutput
anthropic Claude 4 Sonnet model icon

Claude 4 Sonnet

anthropic

200kinput·64koutput
deepseek DeepSeek-V3 model icon

DeepSeek-V3

deepseek

deepseek DeepSeek-R1 model icon

DeepSeek-R1

deepseek

xAI Grok 3 model icon

Grok 3

xAI

gemini Gemini text-embedding-004 model icon

Gemini text-embedding-004

gemini

cohere rerank-english-v3.0 model icon

rerank-english-v3.0

cohere

together Devstral Together model icon

Devstral Together

together

openrouter Devstral - OpenRouter model icon

Devstral - OpenRouter

openrouter

xAI Grok 4 model icon

Grok 4

xAI

openai GPT-5 model icon

GPT-5

OpenAI

400kinput·128koutput
openai OpenAI GPT-5-nano model icon

OpenAI GPT-5-nano

OpenAI

400kinput·128koutput
# SOLID Design Principles - Coding Assistant Guidelines

When generating, reviewing, or modifying code, follow these guidelines to ensure adherence to SOLID principles:

## 1. Single Responsibility Principle (SRP)

- Each class must have only one reason to change.
- Limit class scope to a single functional area or abstraction level.
- When a class exceeds 100-150 lines, consider if it has multiple responsibilities.
- Separate cross-cutting concerns (logging, validation, error handling) from business logic.
- Create dedicated classes for distinct operations like data access, business rules, and UI.
- Method names should clearly indicate their singular purpose.
- If a method description requires "and" or "or", it likely violates SRP.
- Prioritize composition over inheritance when combining behaviors.

## 2. Open/Closed Principle (OCP)

- Design classes to be extended without modification.
- Use abstract classes and interfaces to define stable contracts.
- Implement extension points for anticipated variations.
- Favor strategy patterns over conditional logic.
- Use configuration and dependency injection to support behavior changes.
- Avoid switch/if-else chains based on type checking.
- Provide hooks for customization in frameworks and libraries.
- Design with polymorphism as the primary mechanism for extending functionality.

## 3. Liskov Substitution Principle (LSP)

- Ensure derived classes are fully substitutable for their base classes.
- Maintain all invariants of the base class in derived classes.
- Never throw exceptions from methods that don't specify them in base classes.
- Don't strengthen preconditions in subclasses.
- Don't weaken postconditions in subclasses.
- Never override methods with implementations that do nothing or throw exceptions.
- Avoid type checking or downcasting, which may indicate LSP violations.
- Prefer composition over inheritance when complete substitutability can't be achieved.

## 4. Interface Segregation Principle (ISP)

- Create focused, minimal interfaces with cohesive methods.
- Split large interfaces into smaller, more specific ones.
- Design interfaces around client needs, not implementation convenience.
- Avoid "fat" interfaces that force clients to depend on methods they don't use.
- Use role interfaces that represent behaviors rather than object types.
- Implement multiple small interfaces rather than a single general-purpose one.
- Consider interface composition to build up complex behaviors.
- Remove any methods from interfaces that are only used by a subset of implementing classes.

## 5. Dependency Inversion Principle (DIP)

- High-level modules should depend on abstractions, not details.
- Make all dependencies explicit, ideally through constructor parameters.
- Use dependency injection to provide implementations.
- Program to interfaces, not concrete classes.
- Place abstractions in a separate package/namespace from implementations.
- Avoid direct instantiation of service classes with 'new' in business logic.
- Create abstraction boundaries at architectural layer transitions.
- Define interfaces owned by the client, not the implementation.

## Implementation Guidelines

- When starting a new class, explicitly identify its single responsibility.
- Document extension points and expected subclassing behavior.
- Write interface contracts with clear expectations and invariants.
- Question any class that depends on many concrete implementations.
- Use factories, dependency injection, or service locators to manage dependencies.
- Review inheritance hierarchies to ensure LSP compliance.
- Regularly refactor toward SOLID, especially when extending functionality.
- Use design patterns (Strategy, Decorator, Factory, Observer, etc.) to facilitate SOLID adherence.

## Warning Signs

- God classes that do "everything"
- Methods with boolean parameters that radically change behavior
- Deep inheritance hierarchies
- Classes that need to know about implementation details of their dependencies
- Circular dependencies between modules
- High coupling between unrelated components
- Classes that grow rapidly in size with new features
- Methods with many parameters
Please look at the current `git diff` and then write a new rule in the .continue/rules folder that describes the procedure for making this kind of change in the future. The rule should be a markdown file with an appropriate name and front matter like the following:

```md
---
name: <NAME>
alwaysApply: false
---
... rule goes here ...
```

The rule should describe the workflow step-by-step such that someone could make the necessary changes by following it as a guide.
- Continue is an IDE extension for VS Code and VS Code Insiders running in Windows WSL.
- You have a short session-based memory, so you can use the memory tools (if present) to persist/access data between sessions. 
- Use memory to store insights, notes, and context that is especially valuable for quick access.
# Pyhton coding assistant

You are a Python coding assistant. You use the following tools:

- Python 3 as the primary programming language
- Use type hints consistently
- Optimize for readability over premature optimization
- Write modular code, using separate files for models, data loading, training, and evaluation
- Follow PEP8 style guide for Python code
- Uv for environment and package management

## When using flask
- Follow Flask patterns
- Avoid using global state

## Make proactive use of modern libraries

- Use native Libraries for calling LLMs for simple cases.
- Use frameworks such as LangChain, Crew.ai, Autogen for more complex orchestration.
- PyTorch for deep learning and neural networks
- NumPy for numerical computing and array operations
- Pandas for data manipulation and analysis
- Jupyter for interactive development and visualization
- Other such as pydantic, pytest, uvicorn, fastapi, flask, python-dotenv.
Continuehttps://docs.continue.dev
Pandashttps://pandas.pydata.org/docs/
NumPyhttps://numpy.org/doc/stable/
Vercel AI SDK Docshttps://sdk.vercel.ai/docs/
FireCrawlhttps://docs.firecrawl.dev/introduction
ruff https://docs.astral.sh/ruff/
FastAPIhttps://fastapi.tiangolo.com/
GitHub Actionshttps://docs.github.com/fr/actions
python-doc-3.13https://docs.python.org/3.13/
Langfusehttps://python.reference.langfuse.com/
Crew.AI Documentationhttps://docs.crewai.com/
Pythonhttps://docs.python.org/3/
MCP Python SDK Readmehttps://raw.githubusercontent.com/modelcontextprotocol/python-sdk/refs/heads/main/README.md
Celeryhttps://docs.celeryq.dev/en/stable/
Vercel Edge Runtime Documentationhttps://edge-runtime.vercel.app/
Pydantichttps://docs.pydantic.dev/latest/
Vercelhttps://vercel.com/docs
Flask docshttps://flask.palletsprojects.com/en/2.0.x/
ModelContextProtocol LLMshttps://modelcontextprotocol.io/llms-full.txt
Voyage AIhttps://docs.voyageai.com
PyTorch Lightninghttps://lightning.ai/docs/pytorch/stable/
LangChain Pythonhttps://python.langchain.com/api_reference/
Supabasehttps://supabase.com/docs
MLFLow Docshttps://mlflow.org/docs/latest/index.html
FastAPI Docshttps://fastapi.tiangolo.com/
Pip Docshttps://pip.pypa.io/en/stable/

Prompts

Learn more
RAG Pipeline Design
Comprehensive retrieval-augmented generation system design
Design a RAG (Retrieval-Augmented Generation) system with:

Document Processing:
- Text extraction strategy
- Chunking approach with size and overlap parameters
- Metadata extraction and enrichment
- Document hierarchy preservation

Vector Store Integration:
- Embedding model selection and rationale
- Vector database architecture
- Indexing strategy
- Query optimization

Retrieval Strategy:
- Hybrid search (vector + keyword)
- Re-ranking methodology
- Metadata filtering capabilities
- Multi-query reformulation

LLM Integration:
- Context window optimization
- Prompt engineering for retrieval
- Citation and source tracking
- Hallucination mitigation strategies

Evaluation Framework:
- Retrieval relevance metrics
- Answer accuracy measures
- Ground truth comparison
- End-to-end benchmarking

Deployment Architecture:
- Caching strategies
- Scaling considerations
- Latency optimization
- Monitoring approach

The user's knowledge base has the following characteristics:
Data Pipeline Development
Create robust and scalable data processing pipelines
Generate a data processing pipeline with these requirements:

Input:
- Data loading from multiple sources (CSV, SQL, APIs)
- Input validation and schema checks
- Error logging for data quality issues

Processing:
- Standardized cleaning (missing values, outliers, types)
- Memory-efficient operations for large datasets
- Numerical transformations using NumPy
- Feature engineering and aggregations

Quality & Monitoring:
- Data quality checks at key stages
- Validation visualizations with Matplotlib
- Performance monitoring

Structure:
- Modular, documented code with error handling
- Configuration management
- Reproducible in Jupyter notebooks
- Example usage and tests

The user has provided the following information:
Exploratory Data Analysis
Initial data exploration and key insights
Create an exploratory data analysis workflow that includes:

Data Overview:
- Basic statistics (mean, median, std, quartiles)
- Missing values and data types
- Unique value distributions

Visualizations:
- Numerical: histograms, box plots
- Categorical: bar charts, frequency plots
- Relationships: correlation matrices
- Temporal patterns (if applicable)

Quality Assessment:
- Outlier detection
- Data inconsistencies
- Value range validation

Insights & Documentation:
- Key findings summary
- Data quality issues
- Variable relationships
- Next steps recommendations
- Reproducible Jupyter notebook

The user has provided the following information:
Check SOLID
Create a new PyTorch module
Please analyze the provided code and evaluate how well it adheres to each of the SOLID principles on a scale of 1-10, where:

1 = Completely violates the principle
10 = Perfectly implements the principle

For each principle, provide:
- Numerical rating (1-10)
- Brief justification for the rating
- Specific examples of violations (if any)
- Suggestions for improvement
- Positive aspects of the current design

## Single Responsibility Principle (SRP)
Rate how well each class/function has exactly one responsibility and one reason to change.
Consider:
- Does each component have a single, well-defined purpose?
- Are different concerns properly separated (UI, business logic, data access)?
- Would changes to one aspect of the system require modifications across multiple components?

## Open/Closed Principle (OCP)
Rate how well the code is open for extension but closed for modification.
Consider:
- Can new functionality be added without modifying existing code?
- Is there effective use of abstractions, interfaces, or inheritance?
- Are extension points well-defined and documented?
- Are concrete implementations replaceable without changes to client code?

## Liskov Substitution Principle (LSP)
Rate how well subtypes can be substituted for their base types without affecting program correctness.
Consider:
- Can derived classes be used anywhere their base classes are used?
- Do overridden methods maintain the same behavior guarantees?
- Are preconditions not strengthened and postconditions not weakened in subclasses?
- Are there any type checks that suggest LSP violations?

## Interface Segregation Principle (ISP)
Rate how well interfaces are client-specific rather than general-purpose.
Consider:
- Are interfaces focused and minimal?
- Do clients depend only on methods they actually use?
- Are there "fat" interfaces that should be split into smaller ones?
- Are there classes implementing methods they don't need?

## Dependency Inversion Principle (DIP)
Rate how well high-level modules depend on abstractions rather than concrete implementations.
Consider:
- Do components depend on abstractions rather than concrete classes?
- Is dependency injection or inversion of control used effectively?
- Are dependencies explicit rather than hidden?
- Can implementations be swapped without changing client code?

## Overall SOLID Score
Calculate an overall score (average of the five principles) and provide a summary of the major strengths and weaknesses.

Please highlight specific code examples that best demonstrate adherence to or violation of each principle.
Generate a complete FastAPI route handler, including path, method, pydantic model, and response model.
Deployment optimization
Deployment optimization
Recommend strategies to improve CI/CD, automating tests and releases.
Identify bottlenecks in the deployment process and suggest optimizations.
Ensure all applications have a solid logging and monitoring system.
Recommend performance analysis tools to anticipate potential production issues.
Training Data Pipeline
End-to-end data preparation for language models
Design a data pipeline for language model training that includes:

Data Collection:
- Source identification and quality assessment
- Data collection and scraping methods
- Representativeness analysis
- Bias detection methodology

Preprocessing Framework:
- Text extraction and normalization
- Deduplication strategy
- Data cleaning protocols
- PII removal approach

Annotation System:
- Labeling schema design
- Quality control mechanisms
- Inter-annotator agreement metrics
- Annotation tool selection

Training/Validation Split:
- Stratification approach
- Temporal considerations
- Domain coverage analysis
- Evaluation set design

Data Augmentation:
- Syntactic transformation techniques
- Paraphrasing methodology
- Adversarial example generation
- Domain adaptation approaches

Pipeline Architecture:
- Scalability considerations
- Reproducibility guarantees
- Monitoring and alerting
- Version control integration

The user's training data has the following characteristics:

Context

Learn more
@diff
Reference all of the changes you've made to your current branch
@codebase
Reference the most relevant snippets from your codebase
@url
Reference the markdown converted contents of a given URL
@folder
Uses the same retrieval mechanism as @Codebase, but only on a single folder
@terminal
Reference the last command you ran in your IDE's terminal and its output
@code
Reference specific functions or classes from throughout your project
@file
Reference any file in your current workspace
@docs
Reference the contents from any documentation site
@problems
Get Problems from the current file
@clipboard
Reference recent clipboard items
@repo-map
Reference the outline of your codebase
@open
Reference the contents of all of your open files
@currentFile
Reference the currently open file
@commit
@os
Reference the architecture and platform of your current operating system
@web
Reference relevant pages from across the web

No Data configured

MCP Servers

Learn more

Playwright

npx -y @executeautomation/playwright-mcp-server

Filesystem

npx -y @modelcontextprotocol/server-filesystem ${{ secrets.jeremy-georges-filteau/aipy/anthropic/filesystem-mcp/PATH }}

Exa

npx -y exa-mcp-server

GitHub

npx -y @modelcontextprotocol/server-github

Memory

npx -y @modelcontextprotocol/server-memory

Context 7

npx -y @upstash/context7-mcp@latest