# AI User Simulator — Development Rules
# Purpose
This document defines the core engineering, product, and implementation rules for the project.
These rules exist to:
- prevent hallucinated architecture
- avoid fake implementations
- maintain realistic UX behavior
- ensure production-quality engineering
- keep development scalable and maintainable
Every implementation decision should follow these rules.
---
# CORE PRODUCT RULES
# 1. The Product Must Feel Real
The AI interaction must feel like:
> a real first-time human user
NOT:
- a crawler
- a QA automation script
- a random click bot
- an intentionally confused AI
---
# 2. The Product Must Deliver Real UX Insights
The report must:
- identify actual friction
- explain realistic confusion
- describe onboarding pain points
- provide actionable improvements
Avoid:
- fake AI-generated fluff
- meaningless scoring systems
- generic advice
---
# 3. The AI Must Follow Obvious Human Flows
If a website clearly guides the user:
- “Get Started”
- “Continue”
- “Sign Up”
- “Next”
the AI should follow those flows naturally.
The AI should NOT:
- intentionally wander
- ignore obvious CTAs
- behave irrationally
- create fake friction
---
# 4. Context-Aware Interaction Is Mandatory
Every test session MUST include:
- website URL
- app description
- optional test prompt
The app description helps simulate:
- realistic expectations
- natural interaction
- human-like understanding
Without context:
- interaction quality decreases
- UX feedback becomes unrealistic
---
# ENGINEERING RULES
# 5. Never Hardcode Dynamic Results
NEVER:
- hardcode reports
- hardcode interaction outputs
- fake screenshots
- fake timelines
- fake UX analysis
Everything shown to users must come from:
- real browser interaction
- real screenshots
- actual event logs
- actual AI analysis
---
# 6. Never Fake AI Behavior
The AI must NOT:
- pretend to analyze pages it never visited
- generate flows it never interacted with
- mention buttons it never saw
- hallucinate navigation paths
All reports must be grounded in:
- interaction history
- screenshots
- visited pages
- event logs
---
# 7. All Browser Actions Must Be Logged
Every browser action must generate logs.
This is mandatory.
---
# Required Logs
The system must log:
- browser launch
- page navigation
- clicks
- typing
- scrolling
- screenshots
- model decisions
- reasoning
- errors
- retries
- report generation steps
---
# Example Interaction Log
```json id="1i9c6o"
{
"timestamp": "12:01:22",
"action": "click",
"target": "Get Started",
"reasoning": "Attempting onboarding flow"
}The backend must provide detailed developer logs.
Purpose:
- debugging
- observability
- replay debugging
- error tracing
- interaction understanding
Log:
- API execution
- browser lifecycle
- model prompts
- model responses
- interaction cycles
- screenshot generation
- failed selectors
- retries
- timeout issues
- parsing issues
Logs should be:
- structured
- readable
- timestamped
- searchable
Preferred format:
- JSON logs
{
"service": "interaction-agent",
"event": "selector_not_found",
"selector": ".signup-btn",
"timestamp": "2026-05-21T10:22:12Z"
}If something fails, the user should NEVER see:
- blank screen
- frozen UI
- silent failure
The UI must gracefully explain:
- what failed
- why it failed
- what user can do next
Good:
The website blocked automated interaction.Good:
The page took too long to load.Good:
Unable to complete signup flow because required fields were missing.Bad:
Unknown error.Every error must:
- be logged
- contain context
- contain stack trace
- contain session reference
Errors should include:
- session ID
- current page URL
- last interaction
- model state
- timestamp
Two models must remain separated.
Responsibilities:
- deciding actions
- navigation
- exploration
- interaction reasoning
Must optimize for:
- speed
- cost
- responsiveness
Responsibilities:
- UX analysis
- multimodal reasoning
- friction analysis
- report generation
Must optimize for:
- quality
- reasoning depth
- structured insights
The architecture must follow:
LLM → decides action
Playwright → executes actionNever:
- expose raw browser execution to LLM
- allow unrestricted browser commands
This improves:
- stability
- debugging
- predictability
- security
Do NOT send:
- full HTML pages
- massive DOM trees
- unnecessary tokens
Instead provide:
- simplified interactable elements
- visible text
- important buttons
- forms
- navigation items
This improves:
- speed
- reliability
- cost efficiency
Avoid:
- long loading screens
- unnecessary waiting
- blocking interfaces
Users should quickly see:
- browser launch
- live interaction
- progress updates
The replay system is NOT optional.
The replay experience is:
- the emotional hook
- the trust layer
- the engagement engine
Users should always understand:
what the AI is doing right now
Avoid:
- giant enterprise reports
- excessive analytics
- fake complexity
Reports should focus on:
- usability
- friction
- onboarding clarity
- actionable improvements
The system must reject:
- localhost
- private IPs
- internal networks
- file:// URLs
- malicious redirects
Only allow:
- public websites
Each session must:
- run independently
- clear cookies
- clear local storage
- terminate properly
Prevent:
- session leaks
- data contamination
Prevent:
- browser abuse
- spam sessions
- infrastructure overload
Implement:
- IP-based rate limiting
- request throttling
Major systems should remain isolated.
Recommended modules:
- interaction engine
- replay engine
- report engine
- storage layer
- API layer
Initially:
- modular monolith only
Do NOT:
- split services early
- over-engineer deployment
- create unnecessary infra
Scale only after:
- validated demand
- real traffic
- clear bottlenecks
The architecture should help:
- rapid experimentation
- feature iteration
- debugging
- shipping quickly
NOT:
- resume-driven engineering
- over-abstracted systems
Users reveal product direction through:
- repeated actions
- common prompts
- replay usage
- feature requests
- testing patterns
This data is extremely valuable.
Build features only after observing:
- repeated demand
- repeated workflows
- real usage patterns
Avoid:
- assumption-based development
- random feature additions
Every feature is temporary until validated.
If users do not care:
- simplify it
- remove it
- replace it
The goal is:
- usefulness
- retention
- repeated usage
NOT:
- feature count
- complexity
- engineering ego
The development loop is:
Build
↓
Ship
↓
Observe
↓
Learn
↓
ImproveThis loop should guide all product decisions.
The product should always answer:
“Does this genuinely help builders improve their product?”If not:
- rethink the feature
- simplify the implementation
- remove unnecessary complexity
This product is NOT:
- an SEO checker
- an analytics dashboard
- an enterprise UX suite
- an AI gimmick
This product IS:
An AI-powered first-time user simulator that helps builders understand how real users experience their website.The replay experience is the product.
The report supports the replay.
The emotional realization:
“Users probably struggle here too.” is the core value delivered.