Communitygithub.com

YepAPI/skills

LaunchDarkly/Flagsmith/Vercel のパターン、段階的ロールアウト、パーセンテージ分割、A/B トグル。

skills とは?

このスキルは、フィーチャーフラグ(Feature Flag)を用いた段階的ロールアウト、A/Bテスト、ターゲティングの実装パターンを提供します。LaunchDarkly(エンタープライズ向け)、Flagsmith(オープンソース)、Vercel Flags / `@vercel/flags`(Next.js向け)といった主要なフラグ管理プラットフォームに対応し、Boolean型、パーセンテージ分割、ユーザーIDベースのバケティングなど、さまざまなフラグタイプを適切に使い分ける方法を解説します。サーバーサイド評価をデフォルトとし、クライアントには評価結果のみを渡すセキュリティパターンや、フラグの命名規則(kebab-case)、100%ロールアウト後のクリーンアップルールなど、プロダクションで実践すべきベストプラクティスを網羅しています。コード例として、LaunchDarkly SDKとVercel Flagsの両方の実装パターンを含み、段階的なリリースと安全な機能展開を支援します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YepAPI/skills/tree/HEAD/skills/feature-flags

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

フィーチャーフラグ

ルール

  • フィーチャーフラグを使用して段階的ロールアウトを行う — コードをフラグの背後に配置し、段階的に有効化する
  • フラグのタイプ: ブール値(オン/オフ)、パーセンテージ(ユーザーの10%)、ユーザーターゲティング(特定のID/セグメント)
  • LaunchDarkly(エンタープライズ向け)、Flagsmith(オープンソース向け)、Vercel Flags または @vercel/flags(Next.js向け)
  • デフォルトでフラグをサーバーサイドで評価する — クライアントにはフラグの値のみを渡し、評価ロジックは渡さない
  • フラグの命名規則: enable-new-checkout、show-pricing-v2 — 説明的で、ケバブケースを使用
  • 完全ロールアウト後はフラグを削除する — 古いフラグは技術負債となる; 有効期限を設定する
  • パーセンテージロールアウト: ユーザーIDをハッシュ化して一貫したバケティングを行う — 同じユーザーは常に同じバリアントを表示する
  • 新機能はデフォルトでフラグオフにする — フラグサービスが利用できない場合に安全に動作する
  • A/Bテストにフラグを使用する: バリアントを定義し、コンバージョンイベントを追跡し、統計的有意性を測定する
  • ローカル開発用にフラグのオーバーライドを環境変数に保存する

パターン

// Vercel Flags / Next.js パターン
import { flag } from "@vercel/flags/next";

export const showNewCheckout = flag({
  key: "show-new-checkout",
  decide: () => false, // デフォルトオフ
});

// サーバーコンポーネント内で使用
const enabled = await showNewCheckout();
// LaunchDarkly パターン
import * as ld from "@launchdarkly/node-server-sdk";
const client = ld.init(process.env.LAUNCHDARKLY_SDK_KEY!);

const showFeature = await client.variation("new-checkout", user, false);

避けるべきこと

  • フラグなしで機能をリリースする — すべての新機能はトグル可能であるべき
  • フラグの依存関係をネストする — フラグロジックはフラットで独立した状態に保つ
  • 100%ロールアウト後にフラグをコードに残したままにする — 2週間以内にクリーンアップを予定する
  • ターゲティングルールを公開するクライアントサイドでのフラグ評価 — サーバーで評価し、結果を送信する

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

Experiment setup, variant splitting, statistical significance, and feature flag integration.

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

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

関連スキル