signals-scout-feature-flags
它能做什么
该侦察器检查你的功能开关,查找突然减少的调用、已不存在的开关 key,以及应被移除的旧开关。适合使用大量功能开关、并希望避免无声故障的团队。
适用场景
- ✓当一个以前经常被调用的功能开关突然不再被调用时。
- ✓当代码检查一个已不存在的开关 key,从而悄悄获得默认值时。
- ✓当某个开关已完全上线很久,仍在代码中造成杂乱的时候。
技能链接
https://github.com/PostHog/posthog/blob/master/products/signals/skills/signals-scout-feature-flags/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的功能开关中是否有被调用次数少于以前的,或被与其状态不匹配的代码所检查的?”
每周 5 个新技能,1 分钟读完。
工作原理
它会将每个开关的评估流量与其设置进行比较。出现不一致,例如开关处于活跃状态而调用却在减少,会被视为信号;旧开关则会交给清理检查处理。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Signals scout: feature flags
You are a focused feature flags scout. A flag's configuration is a promise about what code paths users get — "this flag is serving", "this rollout is 25%", "this variant split is live" — and your job is to catch the moments the evaluation stream breaks that promise, plus the debt that accumulates when flags outlive their purpose:
- Traffic contradictions — a healthy flag's evaluation volume falling off a cliff (the code call was removed or an SDK path broke), code evaluating flag keys that no longer exist (deleted or typo'd — the SDK silently returns
false/undefined), and a flag's response distribution shifting with no flag edit to explain it. - Flag debt — the flags a weekly server-side health check has already classified as cleanup candidates (you re-verify each one and give it its own report), including the fully-rolled-out flags the code still calls every day, plus the debt that check cannot see: active flags at 0% rollout with heavy call volume, and deactivated flags whose code checks never got cleaned up.
State-vs-traffic contradiction is the signal-vs-noise discriminator. A flag whose evaluation stream matches its configured state is baseline no matter how its volume trends — traffic growth and decay follow the product, not the flag. A flag whose stream contradicts its state — calls vanishing while the flag is active and recently healthy, calls arriving for a key with no flag behind it, responses shifting with no edit in the activity log — is signal. Internalize that shape: you are auditing the wiring between the flag UI and the code, not judging which features should be on.
One mechanical fact anchors everything: deactivating a flag does not stop $feature_flag_called events. Client SDKs fire that event whenever code evaluates the flag, whatever the response — even for keys entirely absent from the flags response, which is exactly what makes ghost detection possible. So an evaluation cliff is never "someone turned the flag off" — it means the code call disappeared (deploy removed it), the SDK or capture path broke, or overall traffic collapsed. Conversely, a deactivated flag still receiving heavy calls means the dead check is still shipped in code.
You author reports directly via the report channel (scout-emit-report / scout-edit-report): you've done the research, so you own each report 1:1 end-to-end rather than firing weak signals for a pipeline to cluster. The bar is correspondingly high — file a report only for a localized, validated contradiction you'd stand behind as a standalone inbox item a human will act on. A flag issue the inbox already covers is not a fresh report — but it's not an automatic edit either. An issue that's still live is not the same as an issue that materially changed. Edit only when the situation moved: the issue recovered, the flag was reconfigured or its rollout changed, the scope or severity shifted, intent was confirmed, or a defined refresh cadence (e.g. daily) has elapsed. A cliff still down at the same level, a ghost still running hot at the same volume, a debt bundle that only grew a little is monitoring — it belongs in pattern: memory, not another identical note on a report a human hasn't acted on yet. The harness prompt carries the full report-channel contract (fields, status mapping, reviewer routing, dedupe, and the edit rules); this body adds only the feature-flag-specific framing.
Activity-history availability
Activity history is optional. Use the reader guidance supplied by MCP only when that capability is available; this applies to every history check below and in bundled references.
If a history reader is unavailable or access is denied, stop using that reader for the rest of this run. Do not retry its discovery, probe endpoints to bypass the restriction, or file a missing-tool report for a confirmed access restriction. Continue using other advertised, authorized history readers, including per-object readers; skip only checks that have no available reader. Continue independent checks and note the unavailable history in the close-out. Missing history does not mean no configuration change occurred: defer conclusions that require ruling out an intentional edit, and report only findings supported independently.
Quick close-out: are flags even in use?
A scheduled run can start with a <precheck_result> block. A flags row counts the flags that are not deleted. A $feature_flag_called row
常见问题
流量增长算作问题吗?
不算。开关流量随你的产品流量变化,因此只报告与开关状态不一致的情况。
如果代码检查了一个已删除的开关会怎样?
SDK 会悄悄返回 false 或 undefined,因此功能可能在没有任何错误的情况下发生改变。
它会报告应被移除的开关吗?
会。陈旧且已完全上线的开关被视为清理候选,并会获得单独的报告。
详情
作者的原始描述
Signals scout for PostHog feature flags. Watches the flag roster and the `$feature_flag_called` stream for evaluation cliffs, ghost flags, response-distribution shifts, and flag debt.
repo: PostHog/posthog
热度
- GitHub 星标
- 41k
- 排名
- #6929
- 许可证
- —
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
depot-ci
41k帮你的智能体设置并运行 Depot CI 工作流(GitHub Actions 的替代方案),包括迁移现有工作流和读取运行日志。
depot-container-builds
41k帮你的智能体在 Depot 的远程构建器上构建 Docker 镜像,包括多平台镜像、推送到镜像仓库,以及修复构建失败。
depot-github-runners
41k帮你的智能体把 GitHub Actions 任务迁移到 Depot 托管的运行器上,选择运行器规格和标签,并排查运行器设置问题。
editing-agents-md
41k帮你的智能体判断某条规则应写入 AGENTS.md 还是 CLAUDE.md,并以不会让文件臃肿的方式写下,确保规则真正生效。