Writing Objectives
The objective string is the most important input to Kane CLI. How you phrase it determines what the agent does and whether it succeeds. Objectives follow three patterns that you can combine freely.
Three Patterns
| Pattern | Keywords | Purpose |
|---|---|---|
| 🎯 Action | go to, click, type, fill, search, scroll, hover, select, submit | Performs browser actions |
| ✅ Assertion | assert, verify, confirm, check that, ensure | Validates a condition: produces pass/fail |
| 📦 Extraction | store X as 'name' | Reads a value from the page, persists in output |
Assertions and extractions are evaluated as Checkpoints. See the reference for all analyze methods (Visual, Textual, URL, Title, DevTools) and comparison operators.
Actions
Use imperative verbs to describe what the agent should do:
"go to https://example.com"
"click the 'Add to Cart' button"
"fill the email field with user@example.com"
"scroll down to the pricing section"
"select 'Premium' from the plan dropdown"
Assertions
Assertions validate page state. The test fails if the condition is not met.
"assert the page contains 'Order Confirmed'"
"verify the cart total shows '$29.99'"
"confirm no error message is visible"
"check that the Submit button is disabled"
Extractions: The "store as" Pattern
Extractions read a value from the page and store it in the run output's final_state field.
Always use the explicit store X as 'name' syntax. Vague phrasing like "tell me" or "read" does not reliably capture data.
❌ Bad: agent may see it but won't persist it:
"go to example.com and tell me the price"
"read the page title"
✅ Good: value is captured in final_state:
"go to example.com, store the price of the first item as 'price'"
"store the page title as 'page_title'"
Combining Patterns
Chain all three patterns in one objective:
"go to {{app_url}}/dashboard,
store the welcome message as 'welcome_text',
store the user role in the sidebar as 'role',
assert the role is 'Admin',
click the Settings button,
assert the page contains 'Account Settings'"
This objective: navigates → extracts two values → validates a condition → performs an action → validates the result.