Lovable Template
Lovable uses Project Knowledge (Settings → Manage Knowledge) as persistent instructions. These entries are included in every conversation — like an always-on rule system.
⚡ Just get me started
Smallest possible Learner Brain in Lovable. Skip the deep-dive on first pass.
- 1Open Settings → Manage Knowledge — Knowledge entries are auto-included in every chat — your always-on rules.
- 2Add the meta-learning entry below — Paste it as a single Knowledge entry titled 'Learner Brain Protocol'.
- 3Build something and watch for upgrade proposals — Lovable will surface 🧠 proposals — say 'add it' to grow Knowledge.
You operate under The Learner Brain methodology.
When you detect:
1. The same correction twice
2. A workaround I shouldn't repeat
3. A stated preference I haven't codified
Propose ONE upgrade in this format:
🧠 BRAIN UPGRADE PROPOSAL
Trigger: <what caused this>
Surface: Knowledge entry
Title: <short name>
Proposed content: <exact text to add>
Rationale: <why it prevents future friction>
Wait for me to say "add it" before treating it as part of Knowledge.That's it — you have a working brain. The rest of this page is for when you want to go deeper.
Knowledge Entries
Plain text instructions added via Settings UI
Always Active
All knowledge entries apply to every conversation
No File System
Managed through the UI — no .rules files needed
Platform Differences
Conceptual Structure
While Lovable doesn't use files, you can organize your Knowledge entries to mirror the Learner Brain structure:
How to Add Knowledge Entries
Open your Lovable project
Go to Settings → Manage Knowledge
Add each entry below as a separate Knowledge item
Use the entry title as the Knowledge entry name for easy identification
Knowledge Entries
Meta-Learning Rule
Always active — Governance
# Meta-Learning Rule
You are a Learner Brain agent. Your job is not just to do the work — it's to improve the way the work is done.
## Triggers
### 1) Repetition Trigger
If I explain the same thing twice, propose a Knowledge entry to prevent it happening again.
### 2) Manual Labor Trigger
If a task requires multiple steps with high context, propose capturing it as a reusable pattern.
### 3) Unwritten Law Trigger
If I correct a preference, propose codifying it immediately.
## Upgrade Format
When a trigger fires, respond with:
🧠 Brain Upgrade Proposed
Observation: [what pattern you detected]
Suggestion: [the Knowledge entry to add/update]
Benefit: [how this reduces future friction]
Action: "Shall I draft this Knowledge entry for you to add?"
## Governance
- NEVER assume approval — always propose and wait
- Keep suggestions focused and minimal
- Reference existing Knowledge entries when relevantTech Stack & Conventions
Architecture & patterns
# Tech Stack & Conventions
## Stack
- React 18 with TypeScript
- Vite build tooling
- Tailwind CSS with shadcn/ui
- Lovable Cloud for backend (database, auth, edge functions)
## Patterns
- Functional components with hooks
- React Query for server state
- Components under 200 lines — split when larger
- Use @/ path aliases for imports
## Anti-Patterns
- No `any` types
- No direct state mutation
- No prop drilling beyond 2 levels
- No custom color classes — use semantic tokensCoding Standards
Code style
# Coding Standards
## TypeScript
- Strict mode always
- Explicit return types on exported functions
- Prefer interfaces over type aliases for objects
## Naming
- Components: PascalCase
- Hooks: camelCase with `use` prefix
- Files: PascalCase for components, kebab-case for utilities
- Constants: SCREAMING_SNAKE_CASE
## Imports
- Group: React → external → internal → types
- Use @/ prefix for absolute imports
## Error Handling
- Handle all promise rejections
- Use error boundaries for component errors
- Toast notifications for user-facing errorsError Patterns & Solutions
Error memory
# Error Patterns & Solutions
## Common Issues
### "Column does not exist"
Cause: Migration not yet applied or types file stale
Solution: Check Cloud database schema, re-run migration if needed
### Component re-renders infinitely
Cause: Object/array in useEffect dependency array
Solution: useMemo/useCallback for reference-stable deps
### RLS policy blocking reads
Cause: Missing or overly restrictive policy
Solution: Check policies in Cloud, ensure auth.uid() matches
## Project-Specific Patterns
Add patterns here as you discover them during development.The Manual Upgrade Loop
Since Lovable can't modify its own Knowledge, the upgrade loop requires a manual step:
1. AI Proposes
The meta-learning rule triggers, and the AI suggests a new Knowledge entry in chat.
2. You Review
Evaluate the suggestion — does it capture a real pattern worth remembering?
3. You Add
Copy the suggestion and add it via Settings → Manage Knowledge.
4. It Compounds
Future conversations benefit from the new entry — the brain grows.
Known limits & gotchas — Lovable
Real-world quirks that bite if you don't know about them. Not deal-breakers — just things to design around.
- Knowledge is UI-managed, not file-based — Entries live in the project settings, not your repo. They're not version-controlled by git — back up via export.
- Every entry loads in every chat — There's no contextual loading. Keep entries short and high-signal — the bigger they get, the more tokens you burn per turn.
- No native subagents or skills folders — Lovable's surface is Knowledge + the chat. Multi-step playbooks live as longer Knowledge entries or get pasted as ad-hoc prompts.
- AGENTS.md in repo is ignored — Lovable doesn't read repo-side instruction files like Codex/Cursor do. Move durable rules into Knowledge.
- Edits don't roll back automatically — If a Knowledge change breaks behavior, you have to manually revert. Keep a backup before refactors.
🧠 Brain Prompts
Copy-paste these prompts into Lovable to bootstrap your Learner Brain setup or harvest knowledge from productive sessions.
Bootstrap Prompt
Paste this into Lovable to generate the complete Learner Brain folder structure and starter files for your project.
🚀 Learner Brain Bootstrap — Lovable
Help me set up the Learner Brain methodology for this Lovable project. Review the current project and suggest Knowledge entries to add via Settings → Manage Knowledge.
Generate these starter Knowledge entries:
1. **Meta-Learning Rule** — Governance entry that enables you to propose Knowledge updates when you detect repeated patterns, corrections, or manual labor
2. **Tech Stack & Conventions** — Architecture, patterns, and anti-patterns specific to THIS project
3. **Coding Standards** — TypeScript, naming conventions, import organization, error handling
4. **Error Patterns & Solutions** — Empty template for documenting bugs and fixes as we discover them
For each entry, provide:
- A suggested entry name (for the Knowledge entry title)
- The full content in Markdown, ready to paste
After generating all entries, explain how to add them via Settings → Manage Knowledge.When to use this
🧠 Brain Harvest Prompt
Paste this into Lovable at the end of a productive session to extract reusable patterns in the platform's native format.
🧠 Brain Harvest — Review & Extract Knowledge
Review our current conversation and any recent code changes. Identify patterns worth preserving as permanent Knowledge entries (Settings → Manage Knowledge).
Scan for these 6 categories:
1. **Rules** — Preferences or constraints stated (e.g., "never use any types", "always use shadcn components")
2. **Skills** — Reusable procedures or multi-step workflows (e.g., "how to add a new page with SEO")
3. **Error Solutions** — Bugs fixed and their root causes (e.g., "infinite re-render caused by object in useEffect deps")
4. **Stack Conventions** — Architecture or tooling decisions (e.g., "use React Query for all server state")
5. **Anti-Patterns** — Things to avoid learned the hard way (e.g., "don't use localStorage for auth tokens")
6. **Calculations / Logic** — Formulas, business rules, or domain logic worth preserving
For each finding, output in this format:
---
**Category:** [one of the 6 above]
**Status:** 🆕 New Entry | ✏️ Update to "[existing entry name]"
**Suggested Entry Name:** [short descriptive title]
**Content:**
```
[Ready-to-paste Knowledge entry text in markdown]
```
---
If nothing worth capturing was found, say so — don't force it.
At the end, summarize:
- Total findings by category
- Which existing entries should be updated vs. new ones to createWhen to use this
Lovable vs File-Based Platforms
Instruction Format
Plain text via Settings UI — no files or frontmatter.
Activation
All entries always active — no glob or conditional modes.
Skills & Workflows
No separate format — document procedures within Knowledge entries.
Self-Improvement
Manual — AI proposes, you add entries yourself.
Universal Learner Brain Guides
These guides apply to all platforms — use your Settings → Knowledge path wherever they reference rule/skill locations.
This template was last reviewed in April 2026 against the official Lovable AI docs. Spot something out of date? Let us know.
Official Documentation
Learn more about Lovable's Knowledge feature and project customization.
Lovable AI Documentation