feature-flag-system by aj-geddes/useful-ai-prompts
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill feature-flag-system通过实现功能开关,将部署与发布解耦,支持渐进式发布、A/B 测试,并提供紧急关闭开关。
最小工作示例:
interface FlagConfig {
key: string;
enabled: boolean;
description: string;
rules?: FlagRule[];
variants?: FlagVariant[];
createdAt: Date;
updatedAt: Date;
}
interface FlagRule {
type: "user" | "percentage" | "attribute" | "datetime";
operator: "in" | "equals" | "contains" | "gt" | "lt" | "between";
attribute?: string;
values: any[];
}
interface FlagVariant {
key: string;
weight: number;
value: any;
}
interface EvaluationContext {
userId?: string;
// ... (完整实现请参阅参考指南)
references/ 目录下的详细实现:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 指南 | 内容 |
|---|---|
| 功能开关服务 (TypeScript) | 功能开关服务 (TypeScript) |
| 用于功能开关的 React Hook | 用于功能开关的 React Hook |
| 带分析的功能开关 | 带分析的功能开关 |
| LaunchDarkly 风格 SDK | LaunchDarkly 风格 SDK |
| 功能开关管理界面 | 功能开关管理界面 |
每周安装量
106
代码仓库
GitHub 星标数
116
首次出现
2026年1月21日
安全审计
安装于
opencode89
gemini-cli87
codex85
claude-code84
cursor81
github-copilot72
Implement feature flags to decouple deployment from release, enable gradual rollouts, A/B testing, and provide emergency kill switches.
Minimal working example:
interface FlagConfig {
key: string;
enabled: boolean;
description: string;
rules?: FlagRule[];
variants?: FlagVariant[];
createdAt: Date;
updatedAt: Date;
}
interface FlagRule {
type: "user" | "percentage" | "attribute" | "datetime";
operator: "in" | "equals" | "contains" | "gt" | "lt" | "between";
attribute?: string;
values: any[];
}
interface FlagVariant {
key: string;
weight: number;
value: any;
}
interface EvaluationContext {
userId?: string;
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Feature Flag Service (TypeScript) | Feature Flag Service (TypeScript) |
| React Hook for Feature Flags | React Hook for Feature Flags |
| Feature Flag with Analytics | Feature Flag with Analytics |
| LaunchDarkly-Style SDK | LaunchDarkly-Style SDK |
| Admin UI for Feature Flags | Admin UI for Feature Flags |
Weekly Installs
106
Repository
GitHub Stars
116
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode89
gemini-cli87
codex85
claude-code84
cursor81
github-copilot72
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
133,300 周安装