cleaning-up-stale-feature-flags
यह क्या करती है
यह स्किल पुराने या पूरी तरह रोलआउट हो चुके फ़ीचर फ़्लैग खोजती है और वह कोड हटाती है जो अभी भी उन्हें जाँचता है। यह उन डेवलपर्स और टीमों के लिए है जो पुराने फ़्लैग का जंजाल कम करना चाहती हैं।
कब इस्तेमाल करें
- ✓जब आप जानना चाहें कि कौन से फ़ीचर फ़्लैग सुरक्षित रूप से हटाए जा सकते हैं।
- ✓जब कोई फ़्लैग लंबे समय से पूरी तरह रोलआउट हो और कोड अब भी उसे जाँचे।
- ✓जब आप फ़ीचर फ़्लैग का जंजाल घटाने के लिए नियमित समीक्षा करें।
Skill का लिंक
https://github.com/PostHog/posthog/blob/master/products/feature_flags/skills/cleaning-up-stale-feature-flags/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे कौन से फ़ीचर फ़्लैग हटाए जा सकते हैं, और क्या आप उन्हें जाँचने वाला कोड साफ़ कर सकते हैं?”
हर हफ़्ते 5 नई skills, 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
- लाइसेंस
- —
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
depot-ci
41kयह आपके एजेंट को Depot CI वर्कफ़्लो सेट अप करने, चलाने और माइग्रेट करने में मदद करती है, साथ ही रन के लॉग पढ़ने में।
depot-container-builds
41kयह आपके एजेंट को Depot के रिमोट बिल्डर पर Docker इमेज बनाने में मदद करती है, जिसमें मल्टी-प्लेटफ़ॉर्म इमेज और बिल्ड सुधार शामिल हैं।
depot-github-runners
41kयह आपके एजेंट को GitHub Actions जॉब Depot के मैनेज्ड रनर पर ले जाने, रनर का साइज़ और लेबल चुनने, और रनर सेटअप की समस्याएँ ठीक करने में मदद करती है।
editing-agents-md
41kयह आपके एजेंट को तय करने में मदद करती है कि कोई नियम AGENTS.md या CLAUDE.md में जाए या नहीं, और उसे ऐसे लिखे कि फ़ाइल भारी न हो।
मिलती-जुलती skills
openclaw-update
394kयह आपके एजेंट को चल रहे OpenClaw Gateway को अपडेट करने में मदद करती है, इंस्टॉल के तरीके के अनुसार सही विधि चुनकर और सेशन बनाए रखकर।
diagnose-gateway
394kयह आपके एजेंट को सेटिंग्स, चैनल और पोर्ट जांचकर पता लगाने देती है कि OpenClaw Gateway क्यों फ़ेल हो रहा है, बिना कुछ बदले।
crabbox-apps
394kयह आपके एजेंट को किसी अस्थायी क्लाउड मशीन पर ऐप खोलने और चलाने देती है, फिर उसका व्यू आपके चैट के साइड पैनल में दिखाती है।