Communitygithub.com

YepAPI/skills

實驗設置、變體分組、統計顯著性與功能旗標整合。

skills 是什麼?

此技能提供了一套完整的A/B測試最佳實踐指南,涵蓋從實驗設計、變體分配、統計分析到功能旗標整合的各個環節。它採用基於雜湊的確定性變體分配機制,透過 `hash(userId + experimentId) % 100` 確保跨會話的一致性,避免隨機性漂移。技能明確規定伺服器端分流(例如在中介軟體或API路由中分配,並設定Cookie以維持一致性),防止客戶端分流導致的閃爍問題。統計分析方面要求達到95%信心水準(p < 0.05)才能宣布勝出變體,並使用z檢定進行比例檢驗;同時需在實驗開始前根據最小可檢測效應計算所需樣本量。此外,技能強調實驗之間的互斥性(透過實驗層)以及使用功能旗標包裹實驗程式碼,以便在實驗結束後清理失敗變體。它支援至少1-2個完整業務週期(7-14天)的實驗執行時間,並要求記錄每次曝光和轉換事件。此技能適用於需要在多平台(如Claude Code、Cursor、Codex等)上實施穩健A/B測試的開發者與AI代理。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YepAPI/skills/tree/HEAD/skills/ab-testing

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

A/B 測試

規則

  • 基於雜湊的分配:使用 hash(userId + experimentId) % 100 進行確定性變體選擇 — 在會話之間不會有隨機性漂移
  • 變體配置:將實驗儲存在配置物件 { id, name, variants: [{ id, weight }], status } 中 — 絕不硬編碼變體
  • 伺服器端分流:在中介軟體或 API 路由中分配,設定 Cookie 以保持一致性 — 客戶端分流會導致閃爍
  • 統計顯著性:在宣告勝出者之前要求 95% 信心水準(p < 0.05)— 使用 z 檢定進行比例檢驗
  • 樣本量:在開始前計算最小樣本量 — n = (Z^2 * p * (1-p)) / E^2,其中 E 為最小可檢測效應
  • 每個實驗一個指標:事先定義一個主要指標(轉換率、點擊率、收入)— 次要指標僅供探索性分析
  • 互斥性:同一個實驗中的使用者不應與其他衝突實驗重疊 — 使用實驗層
  • 功能旗標:將實驗程式碼包裝在功能旗標檢查中 — 實驗結束後清理失敗的變體
  • 持續時間:至少執行 1-2 個完整業務週期(最少 7-14 天),以考慮週間效應
  • 記錄:追蹤每次曝光和轉換事件的 experiment_id、variant_id、user_id、timestamp

避免

  • 在樣本量達到之前偷看結果 — 會提高假陽性率
  • 在實驗進行中更改實驗參數 — 會使統計分析失效
  • 一次測試過多變體 — 會指數級增加所需樣本量
  • 在沒有 Cookie 的情況下進行客戶端變體分配 — 會導致閃爍和不一致的體驗

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

YepAPI/skills

WCAG 2.1 AA — semantic HTML, keyboard navigation, screen readers.

YepAPI/skills

CRUD generators, data tables, user management, role-based access, and bulk operations.

YepAPI/skills

Monitor what ChatGPT and Gemini say about your brand using YepAPI.

YepAPI/skills

Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

YepAPI/skills

Commander.js, interactive prompts with Clack, spinners, colors, config files, exit codes, and npm publishing.

YepAPI/skills

cmdk integration, Cmd+K trigger, fuzzy search, grouped actions, keyboard navigation, and dynamic action registration.

YepAPI/skills

Content planning with trend and sentiment data from YepAPI.

YepAPI/skills

Content calendar, keyword-driven planning, and content briefs.

YepAPI/skills

Theme switching with CSS variables, system preference detection, next-themes, and persistence.

YepAPI/skills

Threaded comments, @mentions, reactions, moderation queue, optimistic UI, and cursor pagination.

YepAPI/skills

Competitive analysis between domains using YepAPI.

YepAPI/skills

Layout grids, KPI cards, data tables with sorting/filtering, sidebar navigation, and responsive breakpoints.

YepAPI/skills

Data encryption — TLS everywhere, AES-256-GCM for PII, bcrypt passwords, encrypted backups.

YepAPI/skills

Chart patterns with Recharts/Nivo/D3, responsive containers, color scales, and accessibility.

YepAPI/skills

Drizzle schema definition, push vs migrate, type-safe queries, relations, transactions, and prepared statements.

YepAPI/skills

Upload handling, resize/compress, CDN delivery, blur placeholders, and next/image patterns.

YepAPI/skills

Local business and Google Maps research using YepAPI.

YepAPI/skills

Cursor-based pagination, IntersectionObserver, virtualized lists with @tanstack/react-virtual, and scroll position restoration.

YepAPI/skills

Tenant isolation (row-level vs schema), subdomain routing, per-tenant config, and data partitioning.

YepAPI/skills

Chat UI components, streaming responses with AI SDK, context window management, and RAG patterns.

相關技能