copying-flags-across-projects
Fungsinya
Skill ini menyalin satu feature flag ke satu atau beberapa proyek dalam organisasi yang sama. Ditujukan untuk tim yang menguji di proyek staging dan ingin memindahkan flag ke produksi.
Kapan dipakai
- βSaat Anda ingin memindahkan flag dari proyek staging ke proyek produksi.
- βSaat Anda menginginkan flag yang sama di ruang kerja lain, dengan kohort yang tetap utuh.
- βSaat Anda memerlukan salinan flag di proyek kedua untuk melihat cara kerjanya di sana.
Link skill
https://github.com/PostHog/posthog/blob/master/products/feature_flags/skills/copying-flags-across-projects/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
βSalin flag harga baru dari proyek staging saya ke produksi, tetapi biarkan tetap nonaktif di sana.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill menemukan kunci flag dan proyek sumbernya, lalu menyalin flag ke proyek tujuan. Salinan dinonaktifkan di tujuan secara default dan tidak membawa perubahan yang dijadwalkan.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Copying feature flags across projects
This skill guides you through duplicating a feature flag from a source project into one or more target projects within the same PostHog organization.
When to use this skill
- The user asks to "copy a flag to another project", "duplicate this flag", or "sync a flag between projects"
- The user wants to promote a flag from a staging project to a production project (or vice versa)
- The user wants to replicate a flag configuration in a different workspace and keep cohort dependencies intact
- The user is working around the absence of true environments by using projects-as-environments
What this skill does not cover
- Cross-organization copy is not supported. The endpoint requires source and target projects to belong to the same org.
- Bulk copying every flag in a project. The tool copies one flag at a time. For batch copies, loop through flag keys; each call is independent.
- Cleaning up old or stale flags β see the
cleaning-up-stale-feature-flagsskill instead.
Workflow
1. Resolve the source flag
You need the flag's key and the source project's id.
- If the user gave a flag key and a project id, use them directly.
- If the user gave a flag name (e.g. "the new pricing flag"), call
posthog:feature-flag-get-allin the source project to find the matching flag and read itskey. - If the user only gave a flag and not a project, ask which project it lives in. Don't assume the active MCP project β copying out of the wrong source is a common foot-gun.
2. Resolve target project ids
Targets must be in the same organization as the source. Call posthog:projects-get to list available projects and confirm membership before issuing the copy.
For a multi-target copy, the tool accepts up to 50 target project ids in a single call. Successes and failures are reported per target, so a partial failure does not block the rest.
3. Preview the source flag and its dependencies
Call posthog:feature-flag-get-definition on the source flag. Then always call posthog:feature-flags-copy-dependencies-check with feature_flag_key, from_project, and target_project_ids, rather than trying to detect dependencies first β it copies nothing, and returns an empty result with no warnings when the flag has none, so running it on every copy is cheap and never skips a real dependency.
A false can_copy_dependencies does not always mean the copy is blocked. It is also false when there is nothing to copy. Report a problem only when warnings is non-empty.
Present a concise summary to the user before copying:
- Flag key, name, and active state in the source
- Filter groups (rollout %, property filters, variant splits)
- Any cohort references in
filters.groups[].properties[]β these will be remapped server-side, but the user should know whether the target project already has matching cohorts - Whether the flag has encrypted payloads (
has_encrypted_payloads) or is remote configuration (is_remote_configuration) - Whether scheduled changes exist (the user can opt to copy them in step 4)
- The dependency check's
copied_dependency_keys(dependencies a copy would create in a target),reused_dependency_keys(dependencies a target already satisfies), and anywarnings
4. Confirm copy options
One confirmation covers all three options. Default to the safest combination and ask the user to override only if they explicitly want different behavior:
disable_copied_flag: trueβ the copied flag lands disabled in the target. Recommended by default; turning a flag on in a new project should be a deliberate, observed action.copy_schedule: falseβ scheduled changes do not come along. Recommended by default; schedules are usually project-specific.copy_dependencies: falseβ dependency flags do not come along. Set it totrueonly when the user approves copying the keys step 3's check reported.
If the user says "promote it as-is" or "turn it on in prod", switch disable_copied_flag to false. If they say "include the rollout schedule" or "with the scheduled rollout", switch copy_schedule to true.
5. Execute the copy
Call posthog:feature-flags-copy-flags-create with:
feature_flag_key: the source flag's keyfrom_project: the source project idtarget_project_ids: the resolved list of target project idsdisable_copied_flag: from step 4 (defaulttrue)copy_schedule: from step 4 (defaultfalse)- `
Pertanyaan umum
Bisakah saya menyalin flag ke organisasi lain?
Tidak. Proyek sumber dan tujuan harus berada dalam organisasi yang sama.
Apakah flag yang disalin akan aktif di proyek tujuan?
Tidak. Salinan dinonaktifkan secara default di proyek tujuan.
Bisakah menyalin semua flag saya sekaligus?
Tidak. Skill menyalin satu flag dalam satu waktu, sehingga menyalin banyak flag memerlukan satu salinan untuk setiap flag.
Detail
Deskripsi asli dari pembuat
Copy a feature flag from one PostHog project to one or more target projects in the same organization. Use when the user wants to duplicate a flag, promote a flag from staging to production, sync flags across projects, or replicate a flag configuration in a different workspace. Covers cohort remapping, scheduled-change handling, encrypted payloads, and the safe defaults (disabled in target, no scheduled changes).
repo: PostHog/posthog
Popularitas
- Bintang GitHub
- 41k
- Peringkat
- #6884
- 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.