Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/tugkanboz/awesome-cursorrules/page-object-patternsgit clone --depth 1 https://github.com/tugkanboz/awesome-cursorrulesWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01767 |
| Opus 5 | $0.00000 | $0.00883 |
| Sonnet 5 | $0.00000 | $0.00353 |
| Haiku 4.5 | $0.00000 | $0.00177 |
Grade A, and why
page-object-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 215 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Page Object Model Excellence
Advanced POM Architecture
- Inheritance Hierarchy: BasePage class with common functionality
- Component Pattern: Reusable UI components across pages
- Fluent Interface: Method chaining for readable test code
- Smart Locators: Dynamic locator strategies with fallbacks
Base Page Implementation
from typing import Optional, List, Union, Tuple
from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.common.exceptions import TimeoutException, StaleElementReferenceException
import logging
logger = logging.getLogger(__name__)
class BasePage:
"""Enhanced base page with advanced interaction methods."""
def __init__(self, driver, timeout: int = 10):
self.driver = driver
self.wait = WebDriverWait(driver, timeout)
self.timeout = timeout
self.actions = ActionChains(driver)
def find_element_safely(self, locator: Tuple[str, str], timeout: Optional[int] = None) -> Optional[WebElement]:
"""Find element with comprehensive error handling and retry logic."""
timeout = timeout or self.timeout
wait = WebDriverWait(self.driver, timeout)
try:
element = wait.until(EC.presence_of_element_located(locator))
logger.debug(f"Element found successfully: {locator}")
return element
except TimeoutException:
logger.warning(f"Element not found within {timeout}s: {locator}")
return None
except StaleElementReferenceException:
logger.warning(f"Stale element detected, retrying: {locator}")
return self.find_element_safely(locator, timeout)
def click_when_clickable(self, locator: Tuple[str, str], timeout: Optional[int] = None) -> bool:
"""Click element only when it's clickable with retry logic."""
timeout = timeout or self.timeout
wait = WebDriverWait(self.driver, timeout)
try:
element = wait.until(EC.element_to_be_clickable(locator))
# Scroll element into view before clicking
self.driver.execute_script("arguments[0].scrollIntoView(true);", element)
# Use Actions for more reliable clicking
self.actions.move_to_element(element).click().perform()
logger.info(f"Successfully clicked element: {locator}")
return True
except TimeoutException:
logger.error(f"Element not clickable: {locator}")
return False
except Exception as e:
logger.error(f"Click failed for {locator}: {str(e)}")
return False
def enter_text_safely(self, locator: Tuple[str, str], text: str,
clear_first: bool = True, validate: bool = True) -> bool:
"""Enter text with validation and error handling."""
element = self.find_element_safely(locator)
if not element:
return False
try:
# Scroll to element and focus
self.driver.execute_script("arguments[0].scrollIntoView(true);", element)
element.click() # Focus the element
if clear_first:
element.clear()
element.send_keys(text)
# Verify text was entered correctly if validation is enabled
if validate:
entered_value = element.get_attribute('value')
if entered_value == text:
logger.info(f"Text entered successfully: '{text}' in {locator}")
return True
else:
logger.warning(f"Text entry verification failed. Expected: '{text}', Got: '{entered_value}'")
return False
logger.info(f"Text entered (no validation): '{text}' in {locator}")
return True
except Exception as e:
logger.error(f"Failed to enter text in {locator}: {str(e)}")
return False
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 215 lines · 1,767 tokens per session scan A 95a577555e07
page-object-patterns is a cursor rule published in the GitHub repository tugkanboz/awesome-cursorrules (20 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,767 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
nestjs-testing-guidelines
为测试 NestJS 应用程序设置标准,包括单元、集成和端到端测试,以及 Jest 的使用。.
cursorrules
You are building an AI/ML project with Python. The project uses PyTorch for model training, handles data pipelines with proper validation, tracks experiments systematically, and follows production ML engineering practices. Code is type-hinted, tested, and reproducible.
unity-input
Guidelines for working with the New Input System in Unity 6.2.
unity-ui
Assets/ ├── UI/ │ ├── Runtime/ │ │ ├── Controllers/ │ │ │ └── MainMenuController.cs │ │ ├── Views/ │ │ │ └── MainMenuView.cs │ │ ├── ViewModels/ │ │ │ └── HealthViewModel.cs │ │ ├── UXML/ │ │ │ └── MainMenu.uxml │ │ └── USS/ │ │ └── MainMenu.uss │ └── Editor/ │ └── UIBuilderExtensions.cs.
java
Modern Java: records, sealed classes, streams, virtual threads.
javascript
Modern JavaScript: ES2023+, async patterns, common traps.