Core Principles for Great Prompts
- Be Clear and Specific: Always clarify what you want and how. Avoid vague language; instead of “Make this app better,” specify “Refactor the app to clean up unused components and improve performance, without changing UI or functionality”. Provide context on who the app is for, what it should do, and any must-have features.
- Focus on the User’s Journey: Consider the sequence of actions a user will take in your app. For example ——
- Describe the “What,” Not the “How”: Lumi handles the backend complexity, so focus on the desired outcome or appearance. For example ——
- Iterate and Refine: Don’t settle for the first output. Prompts can be refined iteratively through dialogue with the AI. Lumi offers a fully functional output from the start, but it’s a foundation for further refinement.
The C.L.E.A.R. Framework
- Concise: Get straight to the point, avoiding fluff or vague language. Aim for precision and brevity.
- Logical: Organise your prompt in a step-by-step or structured manner, breaking complex requests into ordered steps.
- Explicit: State exactly what you want and don’t want, providing examples of format or content if possible.
- Adaptive: Refine your prompts based on the AI’s output, clarifying instructions or pointing out errors in follow-up prompts.
- Reflective: Review what worked and what didn’t after each interaction to improve future prompts.
The Four Levels of Prompting
- Structured “Training Wheels” Prompting (Explicit Format): Useful for beginners or complex tasks, this involves using labelled sections:
- Context: Background or role setup for the AI.
- Task: The specific goal.
- Guidelines: Preferred approach or style.
- Constraints: Hard limits or must-not-dos.
- For example ——
- Conversational Prompting (No Training Wheels): Once comfortable, you can write more naturally, like explaining a task to a colleague, while maintaining clarity and completeness without formal labels.
- Meta Prompting (AI-Assisted Prompt Improvement): Ask Lumi’s AI to help you improve your prompts or plans. For example ——
- Reverse Meta Prompting (AI as a Documentation Tool): Use the AI to summarise or document what happened after a task, which is excellent for debugging and knowledge capture. For example ——
Prompt Frameworks
- The “Who / What / Why” Prompt:
- WHO is this app for?
- WHAT does it help them do?
- WHY would someone use it?
- The “User Story” Prompt: Frame your request from an end-user perspective, e.g.,
- The “Feature Breakdown” Prompt: List the capabilities you want to add, e.g.,
Advanced Techniques and Tips for Better Results
- Zero-Shot vs. Few-Shot Prompting:
- Zero-Shot: Ask the model to perform a task with no examples, relying on its general training. Works well for common or clearly described tasks.
- Few-Shot: Provide a couple of examples or demonstrations in your prompt to show the AI the exact format or style you want. Improves output quality for specific or unusual tasks.
- Managing Hallucinations and Ensuring Accuracy:
- Provide Grounding Data: Leverage your project’s Knowledge Base (PRD, user flows, tech stack) for persistent context.
- In-Prompt References: Include relevant documentation snippets or data for factual queries or external interactions.
- Ask for Step-by-Step Reasoning: Prompt the AI to show its reasoning to catch errors or reveal uncertainties.
- Instruct Honesty: Include guidelines like “If you are not sure… do not fabricate it – instead, explain what would be needed or ask for clarification”.
- Iterative Verification: Ask the AI to double-check its output after critical tasks.
- Leveraging Model Insights (Know Your AI Tools):
- Discuss Mode vs. Default Mode (Agent Mode): Use Discuss Mode for brainstorming, discussing designs, or debugging without immediate code changes. Use Default Mode (Agent Mode) for executing changes (writing code, creating components).
- Token Length: Break large tasks into smaller prompts if the output might exceed token limits.
- Formatting and Code Preferences: State your preferences (e.g., “output code in markdown format”) to guide the AI.
- Techniques to refine your app
- “Make it more…” / “Make it less…”: Adjust tone, layout, or emphasis.
- “Add a…” / “Remove the…”: Add or remove specific features or UI blocks.
- “Change [this] to [that]”: Adjust text, visuals, layout, or component logic.
- “It should feel like…”: Borrow familiar app styles to guide layout or behavior.
- “Add logic for…”: Add functional rules or flows without needing code.
- “Group or organize…”: Structure content for clarity or workflow.
- “Add conditional behavior…”: Introduce smart branching or state-based functionality.
- “Let users…” statements: Frame functionality from the end-user’s perspective.
- Build in Layers when Building Complexity: Start simple, then add features, and finally polish visuals. This incremental approach prevents overwhelming the system or yourself.
- Include Constraints and Requirements: Explicitly state what must or must not be done, such as “Create a simple to-do app with a maximum of 3 tasks visible at a time”.
- Avoid Ambiguity: Clarify any terms that could be interpreted in different ways.
- Mind Your Tone and Courtesy: Polite phrasing can add context and detail, helping the AI understand instructions more clearly.
- Use Formatting to Your Advantage: Structure lists or steps, especially when you want the AI to output a list or follow a sequence.
- Leverage Examples or References: Provide a target design, code style, or image to give the AI a concrete reference.
- Feedback Integration: Review AI output and provide specific feedback for refinements.
- Emphasising Accessibility: Prompt for code that adheres to accessibility standards, including ARIA labels and keyboard navigation.
- Predefined Components and Libraries: Specify UI libraries (e.g.,
shadcn/ui
with Tailwind CSS) for consistency. - Multilingual Prompting: Specify the desired language for code comments and documentation.
- Defining Project Structure and File Management: Outline file names and paths to ensure organised code generation.
- Provide Precise Edit Instructions (Focus the AI): Be specific about where and what to change, or use Lumi’s “Select” feature to highlight components. Tell the AI what not to touch.
- Locking Files (Workaround): Consistently instruct the AI not to alter critical files in every prompt.
- Design and UI Tweaks: For visual changes, explicitly state “purely visual changes” and guide the AI through a plan for responsiveness.
- Refactoring and Optimising Code: Emphasise “no change in behaviour” when asking for refactoring. You can also ask for a refactor plan first, then implement in stages.
- Debugging with AI Assistance: Copy error logs into a prompt (ideally in Discuss Mode) and ask for the cause and solution. If the fix doesn’t work, adapt and provide new information.
- When (and When Not) to Involve the AI: Use AI for complex logic, boilerplate generation, or multi-step operations. For trivial tasks (e.g., changing a text label), it might be faster to make manual edits.