Implement synthetic monitoring and automated testing to simulate user behavior and detect issues before users. Use when creating end-to-end test scenarios, monitoring API flows, or validating user workflows.
Set up synthetic monitoring to automatically simulate real user journeys, API workflows, and critical business transactions to detect issues and validate performance.
Minimal working example:
// synthetic-tests.js
const { chromium } = require("playwright");
class SyntheticMonitor {
constructor(config = {}) {
this.baseUrl = config.baseUrl || "https://app.example.com";
this.timeout = config.timeout || 30000;
}
async testUserFlow() {
const browser = await chromium.launch();
const page = await browser.newPage();
const metrics = { steps: {} };
const startTime = Date.now();
try {
// Step 1: Navigate to login
let stepStart = Date.now();
await page.goto(`${this.baseUrl}/login`, { waitUntil: "networkidle" });
metrics.steps.navigation = Date.now() - stepStart;
// Step 2: Perform login
stepStart = Date.now();
await page.fill('input[name="email"]', "test@example.com");
await page.fill('input[name="password"]', "password123");
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents | |---|---| | Synthetic Tests with Playwright | Synthetic Tests with Playwright | | API Synthetic Tests | API Synthetic Tests | | Scheduled Synthetic Monitoring | Scheduled Synthetic Monitoring |
Copy a source-pinned command for your client. You run it yourself.
Destination: .claude/skills/synthetic-monitoring · pinned to the source commit
git clone https://github.com/aj-geddes/useful-ai-prompts.git
cd useful-ai-prompts
git checkout 3f5182cfd739fc113f4af5244a1cf342ad7f7911
mkdir -p ".claude/skills/synthetic-monitoring"
cp -r "skills/synthetic-monitoring" ".claude/skills/synthetic-monitoring"Review the source before running. This copies files into your project; it is not a one-click install and does not verify runtime safety.
Scanner static-checks@0.1.0 · commit 3f5182cfd739. Static checks cannot prove runtime safety – review the source and the exact diff before installing. How checks work.
References credentials, tokens or secret files that a skill should not need.
Evidence: [redacted]· fingerprint 5e884898da280471