Hypothesis formation, null/alternative, control/variant setup, randomization hash-based, stratification
This skill enables precise A/B test design for OpenClaw, covering hypothesis formulation (e.g., null and alternative), setup of control/variant groups, hash-based randomization, and stratification to ensure balanced experiments.
Use this skill when designing experiments for feature comparisons, such as testing website layouts, app features, or marketing campaigns, to validate hypotheses with statistical rigor and minimize bias.
Always start by defining your hypothesis and groups. Use CLI for quick designs or API for programmatic integration. Provide all required inputs (e.g., hypothesis strings, variant names) in a single command or request. For repeated use, store configurations in JSON files and reference them via flags. Validate inputs before execution to avoid runtime errors.
openclaw abtesting-design --hypothesis-null "No effect on conversion" --hypothesis-alt "Variant increases conversion" --variants control,variantA --randomize hash --stratify age,gender to design a test. Use --config path/to/config.json for JSON configs like {"variants": ["control", "variantA"], "strata": ["age", "gender"]}./api/abtesting/design with a JSON body, e.g., {"hypothesis_null": "No difference", "hypothesis_alt": "Increase in engagement", "variants": ["control", "variantB"], "randomization": "hash", "stratification": ["device_type"]}. Set auth via header: Authorization: Bearer $OPENCLAW_API_KEY.import requests
headers = {'Authorization': f'Bearer {os.environ["OPENCLAW_API_KEY"]}'}
data = {"hypothesis_null": "No effect", "variants": ["control", "variant"]}
response = requests.post('https://api.openclaw.com/api/abtesting/design', json=data, headers=headers)
export OPENCLAW_API_KEY=your_key_here
openclaw abtesting-design --hypothesis-null "Baseline equal" --variants control,testVariant --output results.json
Integrate by setting $OPENCLAW_API_KEY as an environment variable for authentication. For multi-service setups, chain this skill with data tools (e.g., via OpenClaw's workflow API at /api/workflows/add). Use JSON configs for consistency, e.g., {"api_endpoint": "/api/abtesting/design", "auth_env": "OPENCLAW_API_KEY"}. Ensure your application handles asynchronous responses by polling /api/abtesting/status/{job_id}.
Check for errors by parsing response codes: HTTP 400 for invalid inputs (e.g., missing hypothesis), 401 for auth failures. In code, use try-except blocks: