launchdarkly-flag-create by launchdarkly/agent-skills
npx skills add https://github.com/launchdarkly/agent-skills --skill launchdarkly-flag-create您正在使用一个技能,它将指导您在代码库中引入新的功能开关。您的任务是探索此代码库中已如何使用开关,以符合现有模式的方式在 LaunchDarkly 中创建开关,添加匹配现有模式的评估代码,并验证所有内容是否正确连接。
此技能要求您的环境中已配置远程托管的 LaunchDarkly MCP 服务器。
必需的 MCP 工具:
create-flag — 在项目中创建新的功能开关get-flag — 验证开关是否正确创建可选的 MCP 工具(增强工作流程):
list-flags — 浏览现有开关以了解命名约定和标签update-flag-settings — 更新开关元数据(名称、描述、标签、临时/永久状态)在创建任何内容之前,先了解此代码库如何使用功能开关。
* 在导入中查找 `launchdarkly`、`ldclient`、`ld-client`、`LDClient`
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
* 检查 `package.json`、`requirements.txt`、`go.mod`、`Gemfile` 或等效文件中的 SDK 依赖项
* 确定正在使用哪个 SDK(服务器端 Node、React、Python、Go、Java 等)
2. 查找现有的开关评估。 搜索变体调用以了解此代码库使用的模式:
* 直接 SDK 调用:`variation()`、`boolVariation()`、`useFlags()` 等。
* 包装器模式:此代码库是否将开关抽象到服务或工具后面?
* 常量定义:开关键是否在某处定义为常量?
* 有关按语言划分的模式,请参阅 [SDK 评估模式](https://github.com/launchdarkly/agent-skills/blob/HEAD/skills/feature-flags/launchdarkly-flag-create/references/sdk-evaluation-patterns.md)
3. 了解约定。 查看现有开关以了解:
* **命名约定**:键是 `kebab-case`、`snake_case`、`camelCase` 吗?
* **组织方式**:开关键是与功能放在一起,还是集中在常量文件中?
* **默认值**:现有评估使用什么默认值?
* **上下文/用户构建**:此代码库如何构建传递给 SDK 的用户/上下文对象?
4. 检查 LaunchDarkly 项目约定。 可选地使用 list-flags 查看现有开关:
* 常用哪些标签?
* 开关是否标记为临时或永久?
* 项目中存在哪些命名模式?
根据用户需求,选择适当的开关配置。完整指南请参阅开关类型和模式。
快速决策:
| 用户意图 | 开关类型 | 变体 |
|---|---|---|
| "切换功能开/关" | boolean | true / false |
| "逐步推出功能" | boolean | true / false |
| "在选项之间进行 A/B 测试" | multivariate (string) | 用户定义的值 |
| "配置数字阈值" | multivariate (number) | 用户定义的值 |
| "提供不同的配置对象" | multivariate (JSON) | 用户定义的值 |
要应用的默认值:
temporary: true。大多数开关是发布开关,最终应被清理。key(例如,"New Checkout Flow" → new-checkout-flow),但如果存在代码库的命名约定,则与之匹配。使用 create-flag 并应用步骤 2 中确定的配置。
创建后:
offVariation。现在添加评估开关的代码,匹配您在步骤 1 中找到的模式。
有关按语言和框架划分的实现示例,请参阅SDK 评估模式。
确认开关已正确设置:
get-flag 确认它是以正确的配置创建的。如果用户想要更改开关元数据(而非定位),请使用 update-flag-settings。支持的更改:
| 更改 | 指令 |
|---|---|
| 重命名 | {kind: "updateName", value: "New Name"} |
| 更新描述 | {kind: "updateDescription", value: "New description"} |
| 添加标签 | {kind: "addTags", values: ["tag1", "tag2"]} |
| 移除标签 | {kind: "removeTags", values: ["old-tag"]} |
| 标记为临时 | {kind: "markTemporary"} |
| 标记为永久 | {kind: "markPermanent"} |
多个指令可以在一次调用中批量处理。这些更改是项目范围的,而非特定于环境的。
重要提示: 元数据更新(上述)与定位更改(切换、推出、规则)是分开的。如果用户想要更改谁看到什么,请引导他们使用开关定位技能。
每周安装次数
131
代码仓库
GitHub 星标数
2
首次出现
2026年2月13日
安全审计
安装于
claude-code113
github-copilot69
codex69
opencode68
gemini-cli68
amp68
You're using a skill that will guide you through introducing a new feature flag into a codebase. Your job is to explore how flags are already used in this codebase, create the flag in LaunchDarkly in a way that fits, add the evaluation code matching existing patterns, and verify everything is wired up correctly.
This skill requires the remotely hosted LaunchDarkly MCP server to be configured in your environment.
Required MCP tools:
create-flag — create a new feature flag in a projectget-flag — verify the flag was created correctlyOptional MCP tools (enhance workflow):
list-flags — browse existing flags to understand naming conventions and tagsupdate-flag-settings — update flag metadata (name, description, tags, temporary/permanent status)Before creating anything, understand how this codebase uses feature flags.
Find the SDK. Search for LaunchDarkly SDK imports or initialization:
launchdarkly, ldclient, ld-client, LDClient in importspackage.json, requirements.txt, go.mod, Gemfile, or equivalent for the SDK dependencyFind existing flag evaluations. Search for variation calls to understand the patterns this codebase uses:
variation(), boolVariation(), useFlags(), etc.Understand conventions. Look at existing flags to learn:
kebab-case, snake_case, camelCase?Check LaunchDarkly project conventions. Optionally use list-flags to see existing flags:
Based on what the user needs, choose the appropriate flag configuration. See Flag Types and Patterns for the full guide.
Quick decision:
| User intent | Flag kind | Variations |
|---|---|---|
| "Toggle a feature on/off" | boolean | true / false |
| "Gradually roll out a feature" | boolean | true / false |
| "A/B test between options" | multivariate (string) | User-defined values |
Defaults to apply:
temporary: true unless the user explicitly says this is a permanent/long-lived flag. Most flags are release flags that should eventually be cleaned up.key from the name if not provided (e.g., "New Checkout Flow" → new-checkout-flow), but match the codebase's naming convention if one exists.Use create-flag with the configuration determined in Step 2.
After creation:
offVariation to everyone until targeting is turned on.Now add the code to evaluate the flag, matching the patterns you found in Step 1.
See SDK Evaluation Patterns for implementation examples by language and framework.
Confirm the flag is properly set up:
get-flag to confirm it was created with the right configuration.If the user wants to change flag metadata (not targeting), use update-flag-settings. Supported changes:
| Change | Instruction |
|---|---|
| Rename | {kind: "updateName", value: "New Name"} |
| Update description | {kind: "updateDescription", value: "New description"} |
| Add tags | {kind: "addTags", values: ["tag1", "tag2"]} |
| Remove tags | {kind: "removeTags", values: ["old-tag"]} |
| Mark as temporary | {kind: "markTemporary"} |
| Mark as permanent | {kind: "markPermanent"} |
Multiple instructions can be batched in a single call. These changes are project-wide, not environment-specific.
Important: Metadata updates (above) are separate from targeting changes (toggle, rollout, rules). If the user wants to change who sees what, direct them to the flag targeting skill.
Weekly Installs
131
Repository
GitHub Stars
2
First Seen
Feb 13, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
claude-code113
github-copilot69
codex69
opencode68
gemini-cli68
amp68
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
157,400 周安装
Biomni:开源生物医学AI代理框架,自动化基因组学、药物发现与临床分析
197 周安装
实体SEO指南:优化品牌与产品在知识图谱中的识别,提升AI搜索可见度3.2倍
105 周安装
Claude Code技能搜索与管理工具 - 快速查找安装AI编程助手技能
194 周安装
HR业务合作伙伴(HRBP)技能指南:人才战略、绩效管理与组织发展
197 周安装
Postman 集合生成器 - 自动从代码库生成 API 测试集合,支持 Express/Next.js/Fastify 等框架
197 周安装
GEO数据库使用指南:Python检索基因表达数据与生物信息学分析
196 周安装
| "Configure a numeric threshold" | multivariate (number) | User-defined values |
| "Serve different config objects" | multivariate (JSON) | User-defined values |