名称:功能开关 描述:用于受控发布的功能开关配置和推出计划 允许的工具:
- 读取
- 写入
- 全局搜索
- 文本搜索
- Bash
功能开关技能
概述
专门用于功能开关配置和推出计划的技能。使产品团队能够通过适当的定向、监控和回滚策略来规划和管控功能发布。
能力
开关设计
- 生成功能开关规范
- 设计开关命名约定
- 创建开关文档模板
- 定义开关类型(发布、实验、运维、权限)
- 规划开关依赖关系和交互
推出计划
- 设计推出百分比策略
- 创建开关定向规则
- 规划金丝雀和渐进式推出
- 定义地理或基于用户分组的推出
- 创建推出时间表
运维
- 生成紧急关闭程序
- 跟踪开关生命周期和清理
- 监控开关对指标的影响
- 规划开关弃用
- 创建事件响应程序
目标流程
此技能与以下流程集成:
product-launch-gtm.js- 用于产品发布的功能开关推出beta-program.js- Beta版功能开关conversion-funnel-analysis.js- A/B测试开关管理
输入模式
{
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": ["design", "rollout", "audit", "deprecate"],
"description": "操作模式"
},
"feature": {
"type": "object",
"properties": {
"name": { "type": "string" },
"description": { "type": "string" },
"type": { "type": "string", "enum": ["release", "experiment", "ops", "permission"] },
"owner": { "type": "string" },
"impactLevel": { "type": "string", "enum": ["low", "medium", "high", "critical"] }
}
},
"rolloutStrategy": {
"type": "object",
"properties": {
"type": { "type": "string", "enum": ["percentage", "segment", "geographic", "gradual"] },
"stages": { "type": "array", "items": { "type": "object" } },
"criteria": { "type": "object" }
}
},
"existingFlags": {
"type": "array",
"items": { "type": "object" },
"description": "用于审计或清理的现有开关"
}
},
"required": ["mode"]
}
输出模式
{
"type": "object",
"properties": {
"flagSpec": {
"type": "object",
"properties": {
"key": { "type": "string" },
"name": { "type": "string" },
"description": { "type": "string" },
"type": { "type": "string" },
"defaultValue": { "type": "boolean" },
"variations": { "type": "array", "items": { "type": "object" } },
"targetingRules": { "type": "array", "items": { "type": "object" } },
"prerequisites": { "type": "array", "items": { "type": "string" } }
}
},
"rolloutPlan": {
"type": "object",
"properties": {
"stages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"stage": { "type": "string" },
"percentage": { "type": "number" },
"targeting": { "type": "object" },
"duration": { "type": "string" },
"successCriteria": { "type": "array", "items": { "type": "string" } },
"rollbackTriggers": { "type": "array", "items": { "type": "string" } }
}
}
},
"metrics": { "type": "array", "items": { "type": "string" } },
"alerts": { "type": "array", "items": { "type": "object" } }
}
},
"killSwitch": {
"type": "object",
"properties": {
"procedure": { "type": "array", "items": { "type": "string" } },
"owner": { "type": "string" },
"escalation": { "type": "array", "items": { "type": "string" } }
}
},
"lifecycle": {
"type": "object",
"properties": {
"createdDate": { "type": "string" },
"plannedRemovalDate": { "type": "string" },
"cleanupTasks": { "type": "array", "items": { "type": "string" } }
}
}
}
}
使用示例
const flagPlan = await executeSkill('feature-flags', {
mode: 'rollout',
feature: {
name: '新仪表板体验',
description: '带有AI洞察的重新设计的分析仪表板',
type: 'release',
owner: 'product-team',
impactLevel: 'high'
},
rolloutStrategy: {
type: 'gradual',
stages: [
{ name: 'internal', percentage: 100, duration: '3 days' },
{ name: 'beta', percentage: 10, duration: '1 week' },
{ name: 'early-adopters', percentage: 25, duration: '1 week' },
{ name: 'general', percentage: 100, duration: 'permanent' }
]
}
});
依赖项
- 功能开关平台(LaunchDarkly, Split, Flagsmith)
- 监控和警报系统