Token导航 LogoToken导航

Agent Skill · 研究检索

cleaning-up-stale-feature-flags(清理过时的功能标志)

cleaning-up-stale-feature-flags 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

cleaning-up-stale-feature-flags 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 42,706。

总安装 1,048周安装 42GitHub Stars 31下载 339核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:cleaning-up-stale-feature-flags(清理过时的功能标志)
来源仓库:https://github.com/posthog/skills
仓库路径:skills/cleaning-up-stale-feature-flags
安装命令:
npx skills add https://github.com/posthog/skills --skill cleaning-up-stale-feature-flags
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/posthog/skills --skill cleaning-up-stale-feature-flags

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

cleaning-up-stale-feature-flags 识别并移除无用的功能标志,降低技术债务与维护成本。适用于 Feature Flag 泛滥的系统、上线后长期未关闭的 flag 清理场景。基于使用频率与 rollout 状态判断 stale 标志,提供安全移除建议清单。

使用前请确认 flag 移除不影响线上功能,并在低峰期执行变更操作。建议保留关键 flag 至少一个发布周期后再评估是否真正废弃。

来源仓库内路径:skills/cleaning-up-stale-feature-flags

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/posthog/skills --skill cleaning-up-stale-featu…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

cleaning-up-stale-feature-flags 怎么安装?

在终端执行 npx skills add https://github.com/posthog/skills --skill cleaning-up-stale-feature-flags。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

cleaning-up-stale-feature-flags 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

cleaning-up-stale-feature-flags 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

cleaning-up-stale-feature-flags 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

cleaning-up-stale-feature-flags 用的人多吗?

公开数据是累计安装 1,048 次,近一周安装 42 次,下载 339 次,GitHub 31 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

cleaning-up-stale-feature-flags 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
cleaning-up-stale-feature-flags

清理过时的功能标志 · 本页

1,04831只读未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Cleaning up stale feature flags

This skill guides you through finding feature flags that are no longer serving a purpose and safely removing them.

When to use this skill

  • The user asks to clean up, audit, or review their feature flags
  • The user wants to find flags that are stale, unused, or fully rolled out
  • The user asks "which feature flags can I remove?" or similar
  • The user wants to reduce tech debt from old feature flags

What makes a flag stale

A feature flag is considered stale when it's no longer doing useful work. PostHog tracks this with two signals:

  1. Usage-based staleness: The flag has last_called_at data, but hasn't been evaluated in 30+ days. This is the strongest signal — the SDKs are no longer checking this flag.
  2. Configuration-based staleness: The flag has no usage data (last_called_at is null), is 30+ days old, and is 100% rolled out (boolean at 100% with no property filters, or a multivariate flag with one variant at 100%). A fully rolled out flag with no conditions is equivalent to a hardcoded value — it can be replaced by removing the flag check from code.

Disabled flags (active: false) are not considered stale — they were intentionally turned off and may be kept for reactivation.

Workflow

1. List stale flags

Call posthog:feature-flag-get-all with active: "STALE". This returns all stale flags in a single request — PostHog handles the staleness detection server-side using the criteria described above.

2. Assess each candidate

For each stale flag, gather context before recommending action:

Check if it's tied to an experiment:

The posthog:feature-flag-get-definition tool returns an experiment_set field. If non-empty, the flag is used by an experiment — check the experiment status before touching it.

Check if other flags depend on it:

Feature flags can have dependencies (flag B only evaluates when flag A is true). The flag definition includes dependency information in its filters. Look for flag_key references in other flags' filter groups.

Check when it was last modified:

A flag last updated years ago with no recent calls is a stronger removal candidate than one updated last month with no calls (it might be newly deployed and waiting for a release).

Summarize for the user:

For each stale flag, present:

  • Flag key and description
  • Why it's considered stale (no calls in N days, or fully rolled out for N days)
  • Whether it's tied to experiments
  • When it was created and last modified
  • A recommended action (clean up from code and disable, or keep with explanation)

3. Generate code cleanup instructions

Generate a cleanup prompt the user can run in their code editor or coding agent. The cleanup instructions must be tailored to each flag's rollout state, because the rollout state determines which code path to keep. This list also serves as the approval checklist — if the user says their code is already cleaned up, they review it and confirm which flags to disable.

Classify each flag into one of three rollout states based on its definition:

  • fully_rolled_out: A boolean flag with a release condition at 100% rollout and no property filters, or a multivariate flag where one variant is at 100%. Record which variant was active (for multivariate flags).
  • not_rolled_out: All release conditions are at 0%, or the flag has no release conditions at all.
  • partial: Everything else — the flag had some targeting but wasn't fully rolled out or fully off.

Then generate instructions following this structure:

For fully rolled out boolean flags — remove the flag check but keep the enabled code path:

Search for: isFeatureEnabled, useFeatureFlag, getFeatureFlag, posthog.isFeatureEnabled, posthog.getFeatureFlag

For flag "example-flag":
- Remove the if-check, keep the body
- If there is an else branch, remove the else branch entirely

For fully rolled out multivariate flags — keep only the winning variant's code:

For flag "example-flag" (keep variant: "winning-variant"):
- For if/else chains: keep only the branch matching "winning-variant", remove the flag check
- For switch statements: keep only the winning variant's case, remove the switch

For not-rolled-out flags — remove the entire flag check AND the enabled code path:

For flag "example-flag":
- Remove the if-check AND its body (the feature was never active)
- If there is an else branch, keep only the else body

For partial rollout flags — flag these for manual review:

For flag "example-flag":
- This flag had a partial rollout — check the flag's intent to determine which code path to keep
- Then remove the flag check

End the instructions with: "After cleanup, remove any dead code branches and unused imports."

Present the full cleanup prompt in a copyable format so the user can paste it directly into Claude Code, Cursor, Copilot, or any other AI code editor.

4. Disable flags after code changes are deployed

Never disable flags before the code changes are deployed. Disabling a fully rolled out flag while code still checks it will cause that code path to stop working — a production regression.

Never disable flags without explicit user approval. Always present the list and recommendations first, then ask which flags to act on.

Present the user with both options and their tradeoffs:

  • Disable (active: false) via posthog:update-feature-flag: The flag stops being evaluated but the configuration is preserved. If something was missed in the code cleanup, re-enabling is instant. Recommended as the default.
  • Delete via posthog:delete-feature-flag: A soft-delete — the flag is marked as deleted but not physically removed. Keeps the flag list clean, but re-enabling requires recreating the flag. Better for flags the user is confident they'll never need again.

Once the user has chosen and confirms their code changes are deployed, apply the chosen action one flag at a time. Confirm each action so it's easy to stop if something goes wrong.

Example interaction

User: "Can you help me clean up our stale feature flags?"

Agent steps:
- Call posthog:feature-flag-get-all with active: "STALE" to get all stale flags in one request
- For each stale flag, call posthog:feature-flag-get-definition to check experiment_set and dependencies
- Present findings:

   "I found 7 stale feature flags in your project:

   | Flag | Last called | Reason | Recommendation |
   |------|-------------|--------|----------------|
   | old-checkout-flow | 45 days ago | No evaluations in 45 days | Clean up and disable |
   | beta-dashboard-v2 | Never | 100% rolled out, created 3 months ago | Clean up and disable |
   | holiday-promo-2024 | 90 days ago | No evaluations in 90 days | Clean up and disable |
   | new-pricing-page | 60 days ago | No evaluations in 60 days, tied to experiment #42 | Check experiment first |
   ...

   Want me to generate cleanup instructions for any of these? I'd recommend
   starting with old-checkout-flow and beta-dashboard-v2 since they have no dependencies."

- User confirms: "Yes, do old-checkout-flow and beta-dashboard-v2"
- Classify rollout states from the flag definitions:
   - old-checkout-flow: fully_rolled_out (boolean, 100% rollout, no conditions)
   - beta-dashboard-v2: fully_rolled_out (boolean, 100% rollout, no conditions)
- Generate and present cleanup prompt:

   "Here's a cleanup prompt you can paste into your code editor:

   ---
   Find and remove all references to these feature flags in the codebase.
   For each flag, search for all usages: isFeatureEnabled, useFeatureFlag,
   getFeatureFlag, posthog.isFeatureEnabled, posthog.getFeatureFlag, etc.

   ## Flags that were rolled out to 100%
   These flags were fully rolled out. Remove the flag check but KEEP the enabled code path.

   Boolean flags (remove the if-check, keep the body):
   - old-checkout-flow
   - beta-dashboard-v2

   If there is an else branch, remove the else branch entirely.
   After cleanup, remove any dead code branches and unused imports.
   ---

   Once you've cleaned up your code and deployed, let me know.
   Would you like to disable or delete these flags?
   - Disable (recommended): keeps the config, re-enabling is instant
   - Delete: removes from the list, but you'd need to recreate if needed"

- User confirms: "Disable them, code is deployed"
- Disable each flag using posthog:update-feature-flag (active: false)
- Confirm: "Both flags are now disabled in PostHog."

Important notes

  • Code first, then disable. Disabling a flag while code still references it causes the enabled code path to silently stop working. Always clean up code and deploy before disabling.
  • Prefer disable over delete. Disabling is instantly reversible. Deletion is not — re-enabling requires recreating the flag. Always present both options with tradeoffs and let the user choose.
  • Always confirm before acting. This skill involves disabling flags, which can affect production behavior. Never disable without explicit user approval.
  • Disabled flags are not stale. Don't recommend disabling flags that are already intentionally disabled — they may be kept for emergency reactivation.
  • Experiment flags need extra care. If a flag is tied to an active or recently completed experiment, the user likely wants to keep it until they've analyzed results.
  • Seasonal flags may return. Flags like "black-friday-sale" might look stale but are intentionally reused. Ask the user before removing these.
  • Code cleanup is the real win. Removing the flag from PostHog is the easy part. The value comes from removing the dead code paths.

Related tools

  • posthog:feature-flag-get-all: List and search feature flags (supports active: "STALE" filter)
  • posthog:feature-flag-get-definition: Get full flag details including experiment associations
  • posthog:feature-flags-status-retrieve: Get the status and reason for a single flag
  • posthog:update-feature-flag: Disable a flag by setting active: false
  • posthog:delete-feature-flag: Soft-delete a flag

平台分布

Codex

34.96%
按下载量换算119

Claude

28.9%
按下载量换算98

Cursor

18.24%
按下载量换算62

Gemini CLI

10.06%
按下载量换算34

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills