cleaning-up-stale-feature-flags
하는 일
이 스킬은 오래되었거나 완전히 출시된 기능 플래그를 찾고, 여전히 그것을 확인하는 코드를 제거합니다. 오래된 플래그 어수선함을 줄이려는 개발자와 팀을 위한 것입니다.
사용하는 경우
- ✓안전하게 제거할 수 있는 기능 플래그가 무엇인지 알고 싶을 때.
- ✓플래그가 오랫동안 완전히 출시되었는데 코드가 여전히 그것을 확인할 때.
- ✓기능 플래그 어수선함을 줄이기 위해 정기 검토를 할 때.
스킬 링크
https://github.com/PostHog/posthog/blob/master/products/feature_flags/skills/cleaning-up-stale-feature-flags/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 기능 플래그 중 무엇을 제거할 수 있나요? 그것을 확인하는 코드도 정리해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
사용되지 않거나 완전히 출시된 플래그를 찾은 뒤 코드를 먼저 정리합니다. 플래그 자체는 그 코드 변경이 배포된 후에야 PostHog에서 바뀝니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Cleaning up stale feature flags
This skill guides you through finding feature flags that no longer serve a purpose and removing them safely. The ordering is fixed: clean up the code, wait for that cleanup to deploy, and only then change the flag in PostHog.
When to use this skill
- The user asks to clean up, audit, review, or remove 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
- The user asks for a feature flag hygiene review
- The user runs a weekly or recurring flag cleanup
Do not activate for an unrelated coding task that merely mentions a feature flag. Cleaning up a flag is its own job, requested by the user.
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:
- Usage-based staleness: The flag has
last_called_atdata, but hasn't been evaluated in 30+ days. This means PostHog has not received recent calls. Local evaluation or disabled event capture can hide continued use. - Configuration-based staleness: The flag has no usage data (
last_called_atis 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.
Treat configuration-based staleness more cautiously than old evaluation evidence:
$feature_flag_called events can be missing when local evaluation is used or event capture is disabled,
and a config-only signal says nothing about whether code still checks the flag.
Stale means cleanup candidate, never proof that removal is safe.
Establish what you can do
First separate assessment from cleanup. A request to review or assess a flag authorizes reads and recommendations, not code edits. Only an explicit cleanup request authorizes repository changes, subject to the checks below. Then work out which path you can complete in this session:
- PostHog read access only (no repository): assess candidates, then produce the tailored handoff prompt (see "Hand off when you cannot edit the repository").
- Repository read access: additionally inspect the exact call sites and turn the handoff into a repository-specific plan.
- Repository write access: make the code changes yourself and test them locally.
- Authorized publishing: also open one draft PR per flag, following the host's branch, commit, and PR policy.
Filesystem access is not permission to publish. The agent host's review, commit, and PR policy always wins over this skill.
Whichever path applies, never change the flag in PostHog during this workflow. Archiving the flag belongs to a later continuation, after the user confirms the code cleanup deployed (see "After the cleanup is deployed").
When the user's request clearly authorizes cleanup and you can edit the repository, execute: pick the safest deterministic candidate and clean it up directly. Do not stop to generate a copy-paste prompt, and do not add confirmation steps for local, uncommitted code changes. One action still needs approval in the user's own words: pushing a branch or opening a PR. The availability of a git or GitHub tool is not that approval, and a push to a repository cannot be taken back. The flag itself is never changed in this workflow, with or without approval.
Workflow
1. Establish scope
- Confirm which PostHog project you are assessing flags in.
- Confirm the current repository is a plausible owner of the flag (the key appears in it, or the user says it does).
- Ask about other repositories, services, mobile apps, or workers when the flag may span independently deployed code. One repository cleanup is not proof that every deployed consumer is gone.
- Default to cleaning one high-confidence flag first, unless the user explicitly asked for a known set. For a set, finish one flag (through validation and its PR) before starting the next.
2. Find and assess candidates
When the user names a specific flag, start from posthog:feature-flag-get-definition-by-key,
which returns the numeric id and the full definition in
자주 묻는 질문
무엇이 플래그를 오래된 것으로 만드나요?
30일 이상 호출되지 않았거나 완전히 켜진 플래그는 오래된 것이며, 사용 데이터가 없습니다.
스킬이 코드를 스스로 제거하나요?
에이전트가 저장소를 읽고 편집할 수 있으면, 코드 정리를 직접 합니다.
플래그를 왜 마지막에 바꾸나요?
플래그를 먼저 제거하면 여전히 그것을 확인하는 코드가 깨질 수 있으므로, 코드를 먼저 정리하고 배포한 뒤 플래그를 바꿉니다.
상세 정보
작성자의 원본 설명
Identify stale feature flags in a PostHog project and clean up the code that checks them. Use when the user wants to find, audit, or remove unused, fully rolled out, or abandoned feature flags, run a feature flag hygiene review or a weekly cleanup, reduce feature flag tech debt, or asks "which flags can I remove?". When the agent can read and edit a repository it performs the code cleanup itself: tested local changes, and one draft PR per flag when the user authorizes publishing. Agents without repository access generate a tailored cleanup prompt instead. Covers staleness detection, dependency
repo: PostHog/posthog
인기도
- GitHub 스타
- 41k
- 순위
- #6883
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
depot-ci
41k에이전트가 GitHub Actions 대안인 Depot CI 워크플로를 설정하고 실행하도록 돕습니다. 기존 워크플로 이전과 실행 로그 읽기를 포함합니다.
depot-container-builds
41k에이전트가 Depot 원격 빌더에서 Docker 이미지를 빌드하도록 돕습니다. 다중 플랫폼 이미지, 레지스트리 푸시, 빌드 실패 수정을 포함합니다.
depot-github-runners
41k에이전트가 GitHub Actions 작업을 Depot 관리형 러너로 옮기고, 러너 크기와 라벨을 고르도록 돕습니다.
editing-agents-md
41k에이전트가 규칙을 AGENTS.md나 CLAUDE.md 중 어디에 둘지 정하고, 파일을 키우지 않으면서 잘 지켜지도록 쓰게 돕습니다.
비슷한 스킬
openclaw-update
394k에이전트가 설치 방식에 맞는 방법을 골라 기존 OpenClaw Gateway를 업데이트하고, 세션이 계속 작동하도록 돕습니다.
diagnose-gateway
394k에이전트가 설정, 채널, 포트를 확인해 OpenClaw Gateway가 왜 실패하는지 찾되, 아무것도 바꾸지 않도록 돕습니다.
crabbox-apps
394k에이전트가 임시 클라우드 머신에서 앱을 열고 실행한 뒤, 그 화면을 채팅의 측면 패널에 보여 주도록 돕습니다.