finding-deleted-feature-flags
Fungsinya
Skill ini menemukan feature flag yang dihapus dari proyek PostHog dalam rentang waktu yang Anda pilih. Ditujukan untuk orang yang memerlukan audit penghapusan flag terbaru.
Kapan dipakai
- βSaat Anda ingin tahu feature flag mana yang dihapus minggu lalu.
- βSaat Anda perlu mencari tahu siapa yang menghapus flag tertentu dan kapan.
- βSaat Anda meninjau perubahan terbaru pada feature flag Anda untuk keperluan audit.
Link skill
https://github.com/PostHog/posthog/blob/master/products/feature_flags/skills/finding-deleted-feature-flags/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βFeature flag mana yang dihapus dalam 14 hari terakhir, dan siapa yang menghapusnya?β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
PostHog tidak menyimpan waktu penghapusan di flag itu sendiri, sehingga skill terlebih dahulu mendaftar flag yang dihapus, lalu memeriksa log aktivitas setiap flag untuk mencari event penghapusannya.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Finding recently deleted feature flags
This skill produces a list of feature flags that were soft-deleted in the active project within a user-specified time window, along with who deleted each one and when.
When to use this skill
- The user asks "what flags got deleted last week / in the last N days?"
- The user wants an audit of recent flag deletions (who, when, what was removed)
- The user wants to find when a specific flag was deleted, or by whom
- Any "recently deleted feature flags" framing
Don't use this for active stale-flag cleanup β that's cleaning-up-stale-feature-flags. This skill is for flags that have already been removed.
The gotcha that makes this non-trivial
system.feature_flags exposes deleted as a boolean but does not expose deleted_at, updated_at, or last_modified_at. There's no way to filter soft-deleted flags by deletion time in a single SQL query β trying to use those columns will return Unable to resolve field.
The actual deletion timestamp lives in the per-flag activity log, reachable only via posthog:feature-flags-activity-retrieve (one call per flag id). There is no bulk activity endpoint.
So the workflow is two-stage: SQL to enumerate candidates, then parallel activity-log lookups to find each deletion event.
Workflow
1. Clarify the window if ambiguous
"Last week" is ambiguous β it can mean rolling 7 days from now, or the previous calendar week (MonβSun). If the user wasn't explicit, ask, or surface both interpretations in the final report.
Always compute the cutoff in UTC and keep the user's local interpretation in your head separately.
2. Enumerate soft-deleted flags via SQL
Query system.feature_flags for deleted = true in the active project, ordered by created_at DESC:
SELECT id, key, created_at
FROM system.feature_flags
WHERE team_id = <team_id> AND deleted = true
ORDER BY created_at DESC
LIMIT 100
Order by created_at DESC because deletions empirically cluster near creation β most flags get deleted within a few days of being created β so walking the most-recently-created candidates first finds recent deletions fastest. But this is a heuristic, not a guarantee: an older flag deleted recently won't be at the top of this list. Be explicit about that limitation when you report.
team_id defaults to the active project, but include it explicitly for clarity.
3. Fan out activity-log lookups in parallel
For each candidate id, call posthog:feature-flags-activity-retrieve with limit: 5, page: 1. Issue all calls in one message so they run concurrently β sequential calls are dramatically slower.
call feature-flags-activity-retrieve {"id": <flag_id>, "limit": 5, "page": 1}
Reasonable batch sizes:
- "last 7 days" β top 20β25 candidates
- "last 30 days" β top 50
- "last 90 days" β walk the full ~100
If you sample fewer than the full set, say so in the report and offer to walk the rest as a follow-up.
4. Extract the deletion event from each response
In each response, find the entry where activity == "deleted". That entry's created_at is the actual deletion time, and user.email / user.first_name identify the deleter. These fields are reliable on every delete path.
For most flags there's exactly one delete event. If a flag has been deleted-and-restored multiple times, take the most recent activity: deleted event within the window.
5. Recover the original key and report
Feature flags are renamed to <original>:deleted:<flag_id> when soft-deleted while still referenced elsewhere (e.g. a stopped experiment) β the id-based suffix frees the original key for reuse. Don't try to recover the original from the activity log's own fields: detail.changes only carries the rename on UI/ORM deletes (and is often empty, or missing the key entry, on API/MCP/programmatic deletes), and detail.name just mirrors whatever the current key is β tombstoned or not.
Instead, strip the suffix deterministically with scripts/strip_deleted_suffix.py. Pass it the whole step 2 candidate list as JSON in one call β not one invocation per flag:
echo '[{"id": 1001, "key": "example-banner:deleted:1001"}]' | python3 scripts/strip_deleted_suffix.py
# prints the same array back (pretty-printed), each object gaining an "original_key" field:
# "original_key": "example-banner"
Filter the collected deletion events to those whose created_at falls inside
Pertanyaan umum
Mengapa ini proses dua langkah?
Waktu penghapusan hanya disimpan di log aktivitas setiap flag, sehingga skill memeriksa setiap flag satu per satu.
Apakah skill ini membersihkan flag lama?
Tidak. Skill ini menemukan flag yang sudah dihapus, sedangkan skill pembersihan menangani flag yang masih aktif.
Apa yang dianggap sebagai minggu lalu?
Skill akan meminta Anda memperjelas jika rentang waktunya tidak jelas, misalnya tujuh hari bergulir atau minggu kalender.
Detail
Deskripsi asli dari pembuat
Find feature flags that were soft-deleted in the active project within a recent time window. Use when the user asks "what flags were deleted in the last N days", "show me recently deleted feature flags", "who deleted flag X", "audit recent flag deletions", or anything similar. Handles the non-obvious gotcha that system.feature_flags exposes the deleted boolean but does not expose a deletion timestamp β the actual deleted-at time lives in the per-flag activity log and must be cross-referenced.
repo: PostHog/posthog
Popularitas
- Bintang GitHub
- 41k
- Peringkat
- #6885
- Lisensi
- β
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
depot-ci
41kMembantu agent Anda menyiapkan dan menjalankan alur kerja Depot CI, alternatif GitHub Actions, termasuk memigrasikan alur kerja yang ada dan membaca log eksekusi.
depot-container-builds
41kMembantu agent Anda membangun image Docker di builder jarak jauh Depot, termasuk image multi-platform, pengiriman ke registry, dan perbaikan kegagalan build.
depot-github-runners
41kMembantu agent Anda memindahkan job GitHub Actions ke runner yang dikelola Depot, memilih ukuran dan label runner, serta memecahkan masalah pengaturan runner.
editing-agents-md
41kMembantu agent Anda memutuskan apakah sebuah aturan layak masuk ke berkas AGENTS.md atau CLAUDE.md, dan menulisnya agar tetap dipatuhi tanpa membuat berkas membengkak.
Skill serupa
openclaw-update
394kMembantu agent Anda memperbarui OpenClaw Gateway yang sudah ada, dengan memilih metode pembaruan yang sesuai cara pemasangannya dan menjaga sesi Anda tetap berjalan.
diagnose-gateway
394kMembantu agent Anda mencari tahu mengapa OpenClaw Gateway gagal dengan memeriksa pengaturan, channel, dan port tanpa mengubah apa pun.
crabbox-apps
394kMembantu agent Anda membuka dan menjalankan aplikasi di mesin cloud sementara, lalu menampilkan tampilannya di panel samping chat Anda.