Best Practices
These are patterns that consistently produce better results. They apply whether you are on your first project or your fiftieth.
1. Set project rules before you start
Before writing a single prompt, go to Settings > Knowledge and tell the AI about your project. Include:
- What the app does and who it is for
- Libraries or patterns you want used
- Naming conventions and file structure preferences
The AI reads this before every response, so you do not have to repeat yourself. See Knowledge for details.
2. Plan before you build
Switch to Plan Mode and describe your feature at a high level. The AI will map out the architecture and create a step-by-step plan.
Review it, ask questions, adjust. Once it looks right, switch to Build Mode and execute.
This prevents the classic mistake of building something, realizing the approach is wrong, and having to redo it.
When to use Plan mode
Use Plan mode for anything that touches more than one file or involves new data models. For small changes (fixing a typo, adjusting a color), go straight to Build mode.
3. Write specific prompts
Vague prompts produce vague results.
| Instead of | Try |
|---|---|
| "Make a login page" | "Create a login page with email and password fields, a 'Forgot password' link, and a 'Sign up' link. Use Supabase Auth. Show validation errors inline." |
| "Add a dashboard" | "Add a dashboard page at /dashboard with sidebar navigation, a header showing the user's name, and three metric cards: total users, revenue, active sessions." |
| "Fix the styling" | "The pricing cards on /pricing have uneven heights. Make all three the same height using CSS grid with equal rows." |
More on this in Prompting Tips.
4. Use the visual editor for quick UI tweaks
Not everything requires a prompt. The Visual Editor lets you click on any element and adjust its styles directly: spacing, colors, typography, borders, shadows, layout.
This is faster than describing a visual change in words. Select the element, tweak the values, see the result.
Good candidates for the visual editor:
- Padding, margin, or gap adjustments
- Color or font size changes
- Flex direction or alignment
- Border radius or shadows
5. Handle Supabase carefully
A few areas where things go wrong:
Row-Level Security (RLS): Every table should have RLS policies. Without them, your data is either fully exposed or fully blocked. Set up RLS when creating tables, not after.
Migrations: Review schema changes before applying. Check that they handle existing data correctly, especially NOT NULL columns on tables that already have rows.
Edge Functions: Use them for any server-side logic involving secrets, third-party APIs, or sensitive computations. Never put secret keys in frontend code.
See Supabase integration for the full guide.
6. Use version control
Lyna creates a Git repository for every project. Take advantage of it.
- Commit before major changes. If you are about to refactor a large section, commit first so you can revert if needed.
- Branch for experiments. Try a new approach on a branch. If it works, merge. If not, delete and go back to main.
- Review diffs. After the AI makes changes, check the diff in the code editor. This catches issues early.
- Connect GitHub for backup and collaboration. See GitHub integration.
7. Iterate, do not rebuild
When a result is close but not right, tweak it rather than starting over. The AI retains conversation context, so follow-ups can be short:
- "Move the CTA button above the description"
- "Make the font size 18px instead of 14px"
- "Change the grid to 2 columns on tablet"
Each small adjustment builds on the previous result. Rebuilding from scratch loses all that progress.
8. Use slash commands and @ mentions
Slash commands start common operations with a single keyword:
| Command | What it does |
|---|---|
/build | Generate or modify code |
/ask | Ask a question without making changes |
/plan | Create a step-by-step implementation plan |
/deep-planning | Extended planning with deeper analysis |
/fix | Fix a bug or error |
/review | Review code for issues |
/refactor | Refactor existing code |
/iterate | Iterate on the last result |
/explain-changes | Explain recent code changes |
/newtask | Start a new task |
/newrule | Add a new project rule to Knowledge |
@ mentions attach context to your message:
@file: Reference a specific file@folder: Reference an entire folder@url: Include content from a URL@git-changes: Include recent git changes@problems: Include current errors and warnings
Context pills appear below the input to show what is attached.
9. When all else fails, clone and start fresh
If your project has accumulated too many tangled issues, the fastest path forward may be to clone from a known-good state and rebuild the problematic section.
Go to your project settings, or use the Explore gallery to clone a working version.
10. Give clear feedback
The first result is rarely perfect. That is fine. Give the AI specific feedback:
- What is wrong: "the header overlaps the content on mobile"
- What you expected: "the header should be sticky and the content should scroll below it"
- Where to look: reference specific elements or files
With each iteration, results get better.
Tip
Bookmark the Keyboard Shortcuts page. Learning five or six shortcuts makes a noticeable difference.