michaelroodt/lovable2 icon
public
Published on 6/22/2025
Lovable2

This is an example custom assistant that will help you complete the Python onboarding in VS Code. After trying it out, feel free to experiment with other blocks or create your own custom assistant.

Rules
Prompts
Models
Context
anthropic Claude 3.7 Sonnet model icon

Claude 3.7 Sonnet

anthropic

200kinput·8.192koutput
anthropic Claude 3.5 Haiku model icon

Claude 3.5 Haiku

anthropic

200kinput·8.192koutput
anthropic Claude 4 Sonnet model icon

Claude 4 Sonnet

anthropic

200kinput·64koutput
openai OpenAI GPT-4.1 model icon

OpenAI GPT-4.1

OpenAI

1047kinput·32.768koutput
anthropic Claude 4 Opus model icon

Claude 4 Opus

anthropic

200kinput·32koutput
gemini Gemini 2.5 Pro model icon

Gemini 2.5 Pro

gemini

1048kinput·65.536koutput
openai OpenAI GPT-4o model icon

OpenAI GPT-4o

OpenAI

128kinput·16.384koutput
gemini Gemini 2.0 Flash model icon

Gemini 2.0 Flash

gemini

1048kinput·8.192koutput
openai o3-mini model icon

o3-mini

OpenAI

200kinput·100koutput
ollama qwen2.5-coder 1.5b model icon

qwen2.5-coder 1.5b

ollama

32kinput·8.192koutput
openai o1 model icon

o1

OpenAI

200kinput·100koutput
openai OpenAI GPT-4o Mini model icon

OpenAI GPT-4o Mini

OpenAI

128kinput·16.384koutput
ollama nomic-embed-text latest model icon

nomic-embed-text latest

ollama

ollama deepseek-r1 8b model icon

deepseek-r1 8b

ollama

128kinput·32.768koutput
openai OpenAI text-embedding-3-large model icon

OpenAI text-embedding-3-large

OpenAI

- Optimize indexes to improve query execution speed.
- Avoid N+1 queries and suggest more efficient alternatives.
- Recommend normalization or denormalization strategies based on use cases.
- Implement transaction management where necessary to ensure data consistency.
- Suggest methods for monitoring database performance.
-Ensure all responses align with the current codebase structure, naming conventions, and logic.
- Never assume intent. If any request is unclear, ask for clarification before generating code.
- Prioritize maintainability and integration over isolated or theoretical code snippets.
- Prefer Tailwind tokens over custom CSS.
## Tailwind Compact Rules
- Avoid `@apply` unless abstracting.
- Co-locate styles; extract patterns via `shadcn/ui`.
- Class order: layout → spacing → typography → colors → effects (use Headwind).
- Use theme tokens only (`text-primary`, no hex).
- Extend theme in `tailwind.config.ts` for brand tokens.
- Use `sm:`, `md:`, `dark:` intentionally; prefer `shadcn/ui` abstractions.
- Prefer `shadcn/ui` components; extend via `className`/variants.
- Avoid long class strings → use `cn()`.
- No CSS-in-JS or raw style duplication.
- Tooling: `eslint-plugin-tailwindcss`, `tailwindcss/nesting`, Headwind, Prettier.
- Keep config clean; only reusable tokens.
- Maintain `design.md` (tokens, breakpoints, usage).
## TypeScript Compact Rules

- Strict mode: always enable (`strict: true` in `tsconfig.json`).
- No `any`, `!`, or `as unknown as`.
- Prefer `type` over `interface` for consistency.
- Always type function args & returns explicitly.
- Use `readonly`, `Record`, and mapped types when possible.
- Narrow types early with type guards.
- Use enums sparingly; prefer union types (`'admin' | 'user'`).
- Handle `null` and `undefined` explicitly (no `| undefined` by default).
- Group types in `/types` or near usage.
- Use `zod` or `io-ts` for runtime validation.

## Lint & Tooling
- Use `typescript-eslint` with `@typescript-eslint/recommended`.
- Format with Prettier.
- Validate config with `tsc --noEmit`.
## shadcn/ui Compact Rules

- Always use `shadcn/ui` components over building from scratch.
- Customize via `className` or `class-variance-authority` (CVA) — avoid deep overrides.
- Co-locate component variants and logic; prefer colocation over global styles.
- Extend components only when shared across multiple features.
- Do not modify core shadcn components directly — clone and rename if needed.
- Use slot-aware composition (`asChild`) for wrapping custom elements.
- Keep variant names semantic (e.g., `variant="destructive"`).
- Keep visual consistency with Tailwind tokens and design system.
- Use `@/components/ui/*` alias imports for clarity and consistency.
## Supabase Compact Rules

- Use Supabase client via `createClient` in a single shared module.
- Never expose service role keys in client-side code.
- Use RLS (Row-Level Security) on all tables; assume data is public otherwise.
- Keep all Supabase queries typed via `supabase-js` TypeScript support.
- Use `upsert` with caution — avoid unexpected overwrites.
- Handle auth state via Supabase’s auth helpers or `onAuthStateChange`.
- Avoid using `useEffect` for data fetching — prefer SWR or React Query.
- Use Edge Functions for sensitive logic or server-side operations.
- Store metadata (e.g., roles, flags) in the `public.users` table, not JWTs.
- Sync schema changes with versioned SQL files or migrations.
---
description:Enforces modern, component-driven React practices with functional components, hooks, strict typing, and clean separation of concerns for maintainable and scalable applications.
alwaysApply: false
---

## React.js Compact Rules

- Use function components + hooks only.
- Keep components pure, focused, and ≤100 LOC when possible.
- Group logic via custom hooks (`useXyz`) or utils.
- Co-locate logic, styles, and tests by feature.
- Use TypeScript strictly; no `any`, no implicit `any`.
- Use `Props`/`State` interfaces; prefer `readonly` and strict null checks.
- Avoid inline functions in JSX (use `useCallback`).
- Always memoize context values (`useMemo`).
- Use `ErrorBoundary` for top-level error capture.
- Prefer controlled components for forms.
- Use `React Query` or `SWR` for data fetching—not `useEffect`+`fetch`.

## Lint & Tooling
- Use `eslint`, `eslint-plugin-react`, `eslint-plugin-react-hooks`.
- Format with Prettier.
- Optimize re-renders via `memo`, `useMemo`, `useCallback`.
Pythonhttps://docs.python.org/3/
Continuehttps://docs.continue.dev
Next.jshttps://nextjs.org/docs/app
Sveltehttps://svelte.dev/docs/svelte
Pandashttps://pandas.pydata.org/docs/
Reacthttps://react.dev/reference/
NumPyhttps://numpy.org/doc/stable/
Langchain Docshttps://python.langchain.com/docs/introduction/
Rust docshttps://doc.rust-lang.org/book/
LanceDB Open Source Docshttps://lancedb.github.io/lancedb/
SvelteKithttps://svelte.dev/docs/kit
Streamlithttps://docs.streamlit.io
Uvicorn Docshttps://www.uvicorn.org/
SQLAlchemyhttps://docs.sqlalchemy.org/en/20
Vue docshttps://vuejs.org/v2/guide/
Obsidian Developer Docshttps://raw.githubusercontent.com/obsidianmd/obsidian-api/refs/heads/master/obsidian.d.ts
React Testing Library Docshttps://testing-library.com/docs/react-testing-library/intro/
LanceDB Enterprise Docshttps://docs.lancedb.com/enterprise/introduction
Angular Docshttps://angular.io/docs

Prompts

Learn more
Write Cargo test
Write unit test with Cargo
Use Cargo to write a comprehensive suite of unit tests for this function
Next.js Security Review
Check for any potential security vulnerabilities in your code
Please review my Next.js code with a focus on security issues.

Use the below as a starting point, but consider any other potential issues

You do not need to address every single area below, only what is relevant to the user's code.

1. Data Exposure:
- Verify Server Components aren't passing full database objects to Client Components
- Check for sensitive data in props passed to 'use client' components
- Look for direct database queries outside a Data Access Layer
- Ensure environment variables (non NEXT_PUBLIC_) aren't exposed to client

2. Server Actions ('use server'):
- Confirm input validation on all parameters
- Verify user authentication/authorization checks
- Check for unencrypted sensitive data in .bind() calls

3. Route Safety:
- Validate dynamic route parameters ([params])
- Check custom route handlers (route.ts) for proper CSRF protection
- Review middleware.ts for security bypass possibilities

4. Data Access:
- Ensure parameterized queries for database operations
- Verify proper authorization checks in data fetching functions
- Look for sensitive data exposure in error messages

Key files to focus on: files with 'use client', 'use server', route.ts, middleware.ts, and data access functions.
Page
Creates a new Nuxt.js page based on the description provided.
Create a new Nuxt.js page based on the following description.
Page
Creates a new Next.js page based on the description provided.
Create a new Next.js page based on the following description.
New Component
Create a new Svelte component
Please create a new Svelte component following these guidelines:
- Include JSDoc comments for component and props
- Include basic error handling and loading states
- ALWAYS add a TypeScript prop interface
New LanceDB
Create a new LanceDB table
Create a new LanceDB table with the description given below. It should follow these rules:
  - Explicitly define the schema of the table with PyArrow
  - Use dataframes to store and manipulate data
  - If there is a column with embeddings, call it "vector"

Here is a basic example: ```python import lancedb import pandas as pd import pyarrow as pa
# Connect to the database db = lancedb.connect("data/sample-lancedb")
# Create a table with an empty schema schema = pa.schema([pa.field("vector", pa.list_(pa.float32(), list_size=2))]) tbl = db.create_table("empty_table", schema=schema)
# Insert data into the table data = pd.DataFrame({"vector": [[1.0, 2.0], [3.0, 4.0]]}) tbl.add(data) ```
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:
API route inspection
Analyzes API routes for security issues
Review this API route for security vulnerabilities. Ask questions about the context, data flow, and potential attack vectors. Be thorough in your investigation.
Client component
Create a client component.
Create a client component with the following functionality. If writing this as a server component is not possible, explain why.
Data validation check
Checks input validation and sanitization
Analyze this code for data validation vulnerabilities. Ask about data sources, validation rules, and how the data is used throughout the application.
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:
Database schema
Create a database schema.
Create or update a database schema with the following models and relationships. Include necessary fields, relationships, and any relevant enums.
Next.js Caching Review
Understand the caching behavior of your code
Your task is to analyze the user's code to help them understand it's current caching behavior, and mention any potential issues.
Be concise, only mentioning what is necessary.
Use the following as a starting point for your review:

1. Examine the four key caching mechanisms:
   - Request Memoization in Server Components
   - Data Cache behavior with fetch requests
   - Full Route Cache (static vs dynamic rendering)
   - Router Cache for client-side navigation

2. Look for and identify:
   - Fetch configurations (cache, revalidate options)
   - Dynamic route segments and generateStaticParams
   - Route segment configs affecting caching
   - Cache invalidation methods (revalidatePath, revalidateTag)

3. Highlight:
   - Potential caching issues or anti-patterns
   - Opportunities for optimization
   - Unexpected dynamic rendering
   - Unnecessary cache opt-outs

4. Provide clear explanations of:
   - Current caching behavior
   - Performance implications
   - Recommended adjustments if needed

Lastly, point them to the following link to learn more: https://nextjs.org/docs/app/building-your-application/caching
My prompt
Sequential Thinking Activation
<!-- Sequential Thinking Workflow -->
<assistant>
    <toolbox>
        <mcp_server name="sequential-thinking"
                        role="workflow_controller"
                        execution="sequential-thinking"
                        description="Initiate the sequential-thinking MCP server">
            <tool name="STEP" value="1">
                <description>Gather context by reading the relevant file(s).</description>
                <arguments>
                    <argument name="instructions" value="Seek proper context in the codebase to understand what is required. If you are unsure, ask the user." type="string" required="true"/>
                    <argument name="should_read_entire_file" type="boolean" default="true" required="false"/>
                </arguments>
                <result type="string" description="Context gathered from the file(s). Output can be passed to subsequent steps."/>
            </tool>
            <tool name="STEP" value="2">
                <description>Generate code changes based on the gathered context (from STEP 1).</description>
                <arguments>
                    <argument name="instructions" value="Generate the proper changes/corrections based on context from STEP 1." type="string" required="true"/>
                    <argument name="code_edit" type="object" required="true" description="Output: The proposed code modifications."/>
                </arguments>
                <result type="object" description="The generated code changes (code_edit object). Output can be passed to subsequent steps."/>
            </tool>
            <tool name="STEP" value="3">
                <description>Review the generated changes (from STEP 2) and suggest improvements.</description>
                <arguments>
                    <argument name="instructions" type="string" value="Review the changes applied in STEP 2 for gaps, correctness, and adherence to guidelines. Suggest improvements or identify any additional steps needed." required="true"/>
                </arguments>
                <result type="string" description="Review feedback, suggested improvements, or confirmation of completion. Final output of the workflow."/>
            </tool>
        </mcp_server>
    </toolbox>
</assistant>
Add login required decorator
Add login required decorator
Add login required decorator

Context

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

No Data configured

MCP Servers

Learn more

Postgres

docker run -i --rm mcp/postgres ${{ secrets.michaelroodt/lovable2/docker/mcp-postgres/POSTGRES_CONNECTION_STRING }}

Playwright

npx -y @executeautomation/playwright-mcp-server

Browser MCP

npx -y @browsermcp/mcp@latest

Memory

npx -y @modelcontextprotocol/server-memory

Postgres

npx -y @modelcontextprotocol/server-postgres ${{ secrets.michaelroodt/lovable2/anthropic/postgres-mcp/CONNECTION_STRING }}

Sequential Thinking

docker run --rm -i mcp/sequentialthinking

GitHub

npx -y @modelcontextprotocol/server-github

Filesystem

npx -y @modelcontextprotocol/server-filesystem ${{ secrets.michaelroodt/lovable2/anthropic/filesystem-mcp/PATH }}

Brave Search

npx -y @modelcontextprotocol/server-brave-search

Github

docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN mcp/github

Git

docker run --rm -i --mount type=bind,src=${{ secrets.michaelroodt/lovable2/docker/mcp-git/GIT_DIR }},dst=${{ secrets.michaelroodt/lovable2/docker/mcp-git/GIT_DIR }} mcp/git