Skip to main content

Why Prompts Matter

AI Action is powerful, but its effectiveness depends entirely on how you communicate your intent. A vague prompt leads to unpredictable behavior. A well-crafted prompt leads to reliable, repeatable automation. This guide introduces the PRECISE framework — a mental model for writing effective prompts. Not every prompt needs all seven elements, but understanding each lever helps you diagnose issues and improve results.

The PRECISE Framework

Think of PRECISE as diagnostic levers, not a checklist. When something isn’t working, identify which lever to adjust.

P — Position

Ground the element in its UI context. When the agent clicks the wrong element or can’t find the right one, add positional context to disambiguate.
click on create button
When to use: Multiple similar elements exist on the page (multiple “Create” buttons, multiple inputs, etc.)

R — Route

Specify the interaction method. When the default interaction doesn’t work, explicitly state how to interact with the element.
click on the folder
add emails to the field
Common interaction methods to specify:
  • right click vs left click
  • double click
  • press Enter after entering the value
  • hover over (for tooltips or dropdowns)
  • drag and drop

E — Effect

Describe what should change after the action. When the agent doesn’t wait for UI changes or moves on too quickly, describe the expected outcome.
click on create button
click submit
When to use: Actions that trigger animations, modals, page transitions, or loading states.

C — Constraints

Set boundaries on what should NOT happen. When the agent overshoots, repeats actions, or continues beyond the intended scope, add explicit limits.
scroll down the page
close the modal
fill the form
Common constraints:
  • ONCE only, not more than that
  • don't click submit after filling
  • don't close the modal
  • don't navigate away from this page

I — Interval

Provide wait expectations for async operations. When actions fail due to loading states, animations, or network requests, add timing guidance.
click submit and wait
open the page
When to use: Page loads, form submissions, API calls, animations, dynamic content loading.

S — Specifics

Use exact values, properly formatted. When inputs are misinterpreted or malformed, be explicit about the exact data.
enter a random name
select today's date
fill user details
Best practices:
  • Use single quotes around literal values: 'value'
  • Use expressions for dynamic data: {{random.email()}}
  • Be explicit about date formats, number formats, etc.

E — End State

Define how to verify success. When you need confirmation that the action worked before proceeding, ask for explicit verification.
create the api key
delete the environment
When to use: Critical actions where you need confirmation before proceeding (CRUD operations, form submissions, state changes).

Quick Diagnostic Guide

Use this table to quickly identify which PRECISE lever to adjust:
If the agent…Adjust this lever
Clicks the wrong elementPosition
Uses wrong click type or misses keystrokesRoute
Doesn’t wait for UI changesEffect
Does too much or repeats actionsConstraints
Fails on loading/animationInterval
Enters wrong or malformed dataSpecifics
Moves on without confirming successEnd State

When multiple actions are logically connected, batch them in a single prompt with clear sequencing.
Step 1: click on add variable button
Step 2: enter variable name
Step 3: enter variable value
Step 4: click save
When to batch:
  • Create → Verify → Delete flows
  • Form fill → Submit → Verify success
  • Navigate → Interact → Assert

Complete Examples

Example 1: Context Menu Interaction

Right click on the first folder in the content section to open the context menu.
From the menu, click on 'Open in new tab'.
Do this ONCE only.
PRECISE elements used:
  • Position: “first folder in the content section”
  • Route: “Right click”
  • Effect: “to open the context menu”
  • Constraints: “ONCE only”

Example 2: Form with Dynamic Behavior

Click on create plan button in the test plans page to open the test plan creation modal.
Fill the form:
- Enter 'Weekly Smoke Test' in the name field
- Enter '[email protected]' in the email field and press Enter after entering
- Select 'Production' from the environment dropdown

Wait for each field to accept input before moving to the next (fields may take 1-2 sec).
Don't click the create button in the form.
PRECISE elements used:
  • Position: “in the test plans page”
  • Effect: “to open the test plan creation modal”
  • Specifics: exact values in quotes
  • Route: “press Enter after entering”
  • Interval: “may take 1-2 sec”
  • Constraints: “Don’t click the create button”

Example 3: Full CRUD Flow

Click the '+' button on the environments page to open the environment creation modal.
Enter '{{random.firstName()}}' into the environment name field and click submit.
Verify the environment appears in the sidebar list.
Wait 2-3 seconds for the UI to update.
Right click on the newly created environment entry and click 'Delete' from the context menu.
Confirm the deletion in the confirmation modal.
Verify the environment is removed from the sidebar.
PRECISE elements used:
  • Position: “on the environments page”, “in the sidebar list”
  • Effect: “to open the environment creation modal”
  • Specifics: '{{random.firstName()}}'
  • End State: “Verify the environment appears”, “Verify removed”
  • Interval: “Wait 2-3 seconds”
  • Route: “Right click”

Example 4: Scroll with Constraints

Scroll down the page ONCE only, not more than that.
PRECISE elements used:
  • Constraints: “ONCE only, not more than that”

Example 5: Submit with Wait

Click the 'Submit' button and wait for the loading spinner to disappear.
This can take somewhere around 3-5 seconds and will close the modal.
Once the modal is closed, don't reopen it.
PRECISE elements used:
  • Effect: “will close the modal”
  • Interval: “3-5 seconds”
  • Constraints: “don’t reopen it”

Common Patterns

Pattern: Create and Verify

Click [create button] in [location] to open [modal/form].
Enter [values] in the respective fields.
Click [submit] and verify [new item] appears in [list/table].

Pattern: Delete with Confirmation

Click the 3-dot menu on [item row] and select 'Delete'.
Confirm the deletion in the modal that appears.
Verify [item] is removed from [list/table].

Pattern: Filter and Select

Click the Filter button in [section].
Select [filter option] as [value].
Verify the filtered results show [expected items].
Click on [specific item] from the results.

Pattern: Multi-Input Form

Fill the form:
- Enter '[value1]' in [field1]
- Enter '[value2]' in [field2], press Enter after entering
- Select '[option]' from [dropdown]

Wait for form validation (1-2 sec).
[Don't click submit / Click submit to verify success message].

Tips for Success

Begin with the basic action. If it fails, progressively add PRECISE elements until it works reliably.
When a prompt fails, check the AI’s execution logs to understand what it did and why. This reveals which PRECISE lever needs adjustment.
UI state changes (modal opens, page navigates, drawer slides in) are common failure points. Always describe what should happen after an action.
Using single quotes around values ('value') makes it clear what the exact input should be, preventing interpretation errors.
If the agent does more than expected, add explicit “don’t” statements. The agent follows instructions literally — boundaries prevent runaway behavior.