Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/danzam98-ab-testing
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: frontend, backend, testing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/ab-testing
What's inside
- Skill name
ab-testing- Description
- Build home-rolled A/B testing platform for Next.js 16 SaaS. Server-side variant assignment, GA4/GTM tracking, Bayesian analysis, Rust-WASM stats, contextual bandits. Use when: A/B test, experiment, variant, conversion optimization, or personalization.
- License
- MIT
- Instructions
- 214 lines in SKILL.md · view on GitHub
Files (8)
- SKILL.md
- ADMIN-DASHBOARD.md · references/
- GA4-GTM-TRACKING.md · references/
- PERSONALIZATION.md · references/
- QUICK-REFERENCE.md · references/
- RUST-WASM.md · references/
- STATISTICAL-ANALYSIS.md · references/
- VARIANT-ASSIGNMENT.md · references/
SKILL.md (first lines)
# A/B Testing Platform for SaaS
> **Stack**: Next.js 16 + Edge Middleware + GA4/GTM + Supabase + Rust-WASM (for stats)
> **Why DIY?**: Google Optimize sunset Sept 2023. GA4 has no native A/B testing.
## Quick Start
```tsx
// middleware.ts - Server-side assignment (no flicker)
import { NextResponse, type NextRequest } from 'next/server'
export function middleware(request: NextRequest) {
const response = NextResponse.next()
if (!request.cookies.get('exp_hero')) {
const variant = Math.random() < 0.5 ? 'A' : 'B'
response.cookies.set('exp_hero', variant, { maxAge: 60*60*24*30, path: '/' })
}
return response
}
```
```tsx
// Track with GA4
window.dataLayer?.push({
event: 'experiment_view',
experiment_name: 'hero_test',
experiment_variant: variant
})
```
---
## Architecture
```
┌─────────────────────────────────────────────────────────────────────┐
│ A/B TESTING FLOW │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ 1. ASSIGN (Edge Middleware) │
│ ══════════════════════════ │
│ Request → Check cookie → Random assign → Set cookie → Response │
│ ✓ No flicker (server-side) ✓ Consistent (cookie-based) │
│ │
│ 2. RENDER │
│ ═════════ │
│ Server/Client Component → Read cookie → Show variant │
│ │
│ 3. TRACK (GTM + GA4) │
│ ════════════════════ │
│ dataLayer.push → GTM triggers → GA4 events with variant param │
│ │
│ 4. ANALYZE │
│ ═════════ │
│ GA4 Explorations OR Supabase + Rust-WASM Bayesian analysis │
│ │
│ 5. PERSONALIZE (Advanced) │
│ ═════════════════════════ │
│ Contextual bandit → Best variant per user segment │
│ │
└─────────────────────────────────────────────────────────────────────┘
```
---
## Workflow
- [ ] 1. Define experiment config (name, variants, weight, segment rules)
- [ ] 2. Implement middleware assignment (see [VARIANT-ASSIGNMENT.md](references/VARIANT-ASSIGNMENT.md))
- [ ] 3. Wire up GTM tracking (experiment_view, conversions with variant param)
- [ ] 4. Register `experiment_variant` as Custom Dimension in GA4
- [ ] 5. Collect data (minimum 2 weeks for weekly patterns)
- [ ] 6. Analyze significance (see [STATISTICAL-ANALYSIS.md](references/STATISTICAL-ANALYSIS.md))
- [ ] 7. Roll out winner or iterate
---
## Statistical Methods (Choose One)
| Method | Best For | Decision Output |
|--------|----------|-----------------|
| **Frequentist** | Fixed sample, strict control | p-value < 0.05 → significant |
| **Bayesian** | Continuous monitoring, intuitive | P(B > A) = 96% → B likely better |
| **Multi-Armed Bandit** | Optimize during test | Auto-shift traffic to winner |
| **Contextual Bandit** | Personalization | Best variant per user segment |
**Quick Bayesian (Beta-Binomial)**:
```python
# A: 50/1000 conversions, B: 72/1000
import scipy.stats as stats
a_samples = stats.beta(51, 951).rvs(100000) # Beta(1+50, 1+950)
b_samples = stats.beta(73, 929).rvs(100000) # Beta(1+72, 1+928)
p_b_wins = (b_samples > a_samples).mean() # → ~0.96 (96%)
```
**Full analysis guide**: [STATISTICAL-ANALYSIS.md](references/STATISTICAL-ANALYSIS.md)
---
## Key Patterns
### Multiple Concurrent Experiments
```tsx
// middleware.ts
const EXPERIMENTS = {
hero_cta: { weight: 0.5 },
pricing_layout: { weight: 0.5 },
signup_flow: { weight: 0.2 }, // 20% on new variant
}
for (const [name, config] of Object.entries(EXPERIMENTS)) {
if (!request.cookies.get(`exp_${name}`)) {
const variant = Math.random() < config.weight ? 'B' : 'A'
response.cookies.set(`exp_${name}`, variant, { maxAge: 2592000, path: '/' })
}
}From danzam98/claude-skills-toolkit, MIT.
More from danzam98/claude-skills-toolkit
- 0.502score
ga4
danzam98
Configure GA4 + GTM for Next.js SaaS: funnel tracking, scroll depth, CTA clicks, conversions, feature usage.
SkillCFreshness: C★ 1Claude Code +9 - 0.437score
beads-workflow
danzam98
Convert markdown plans into beads with dependencies using br CLI.
SkillDFreshness: D★ 1Claude Code +9 - 0.437score
admin-page-for-nextjs-sites
danzam98
Design cohesive Next.js SaaS admin cockpits.
SkillDFreshness: D★ 1Claude Code +9 - 0.433score
e2e-testing-for-webapps
danzam98
E2E testing for Next.js + Playwright + Supabase.
SkillDFreshness: D★ 1Claude Code +9 - 0.426score
deep-project-primer
danzam98
Essential first step to fully understand a project before any work
SkillDFreshness: D★ 1Claude Code +9 - 0.426score
e2e-pipeline-validator
danzam98
Prove the entire system works with real data, no mocks allowed
SkillDFreshness: D★ 1Claude Code +9 - 0.426score
de-slopify
danzam98
Remove telltale AI writing patterns from documentation and text
SkillDFreshness: D★ 1Claude Code +9 - 0.426score
agent-swarm-launcher
danzam98
Initialize multiple agents with full context and coordination protocols
SkillDFreshness: D★ 1Claude Code +9 - 0.426score
code-reorganizer
danzam98
Restructure scattered code files into a sensible, intuitive folder structure
SkillDFreshness: D★ 1Claude Code +9 - 0.426score
cost-estimate
danzam98
Estimate development cost of a codebase based on lines of code and complexity
SkillDFreshness: D★ 1Claude Code +9 - 0.426score
git-committer
danzam98
Intelligently commit all changed files in logical groupings with detailed messages
SkillDFreshness: D★ 1Claude Code +9 - 0.426score
bug-hunter
danzam98
Explore codebase with fresh eyes to find and fix obvious bugs and issues
SkillDFreshness: D★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- May 12, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from danzam98
- 0.502score
ga4
danzam98
Configure GA4 + GTM for Next.js SaaS: funnel tracking, scroll depth, CTA clicks, conversions, feature usage.
SkillCFreshness: C★ 1Claude Code +9 - 0.437score
admin-page-for-nextjs-sites
danzam98
Design cohesive Next.js SaaS admin cockpits.
SkillDFreshness: D★ 1Claude Code +9 - 0.437score
beads-workflow
danzam98
Convert markdown plans into beads with dependencies using br CLI.
SkillDFreshness: D★ 1Claude Code +9 - 0.433score
e2e-testing-for-webapps
danzam98
E2E testing for Next.js + Playwright + Supabase.
SkillDFreshness: D★ 1Claude Code +9 - 0.426score
deep-project-primer
danzam98
Essential first step to fully understand a project before any work
SkillDFreshness: D★ 1Claude Code +9 - 0.426score
deep-performance-audit
danzam98
Systematic identification of optimization opportunities with proof requirements
SkillDFreshness: D★ 1Claude Code +9
Cite this page
ab-testing skill. Agent Mart. https://agentmart.dev/skills/danzam98-ab-testing (last updated 2026-10-24)