본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)41k · #6884

copying-flags-across-projects

하는 일

이 스킬은 플래그 하나를 같은 조직 안의 하나 이상의 프로젝트로 복사합니다. 스테이징 프로젝트에서 테스트한 플래그를 운영으로 옮기려는 팀을 위한 것입니다.

사용하는 경우

  • ✓스테이징 프로젝트에서 운영 프로젝트로 플래그를 옮기고 싶을 때.
  • ✓코호트를 그대로 유지한 채 다른 작업 공간에 같은 플래그가 필요할 때.
  • ✓두 번째 프로젝트에서 플래그가 어떻게 작동하는지 보려고 사본이 필요할 때.

스킬 링크

https://github.com/PostHog/posthog/blob/master/products/feature_flags/skills/copying-flags-across-projects/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/PostHog/posthog/blob/master/products/feature_flags/skills/copying-flags-across-projects/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“새 가격 플래그를 스테이징 프로젝트에서 운영으로 복사하되, 거기서는 꺼진 상태로 두어 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

플래그의 키와 원본 프로젝트를 찾은 뒤, 플래그를 대상 프로젝트로 복사합니다. 사본은 기본적으로 대상에서 비활성이며, 예약된 변경은 따라가지 않습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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-flags skill 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-all in the source project to find the matching flag and read its key.
  • 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 any warnings

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 to true only 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 key
  • from_project: the source project id
  • target_project_ids: the resolved list of target project ids
  • disable_copied_flag: from step 4 (default true)
  • copy_schedule: from step 4 (default false)
  • `
자주 묻는 질문

다른 조직으로 플래그를 복사할 수 있나요?

아니요. 원본과 대상 프로젝트는 같은 조직에 속해야 합니다.

복사된 플래그가 대상 프로젝트에서 켜지나요?

아니요. 복사본은 대상 프로젝트에서 기본적으로 꺼져 있습니다.

모든 플래그를 한 번에 복사할 수 있나요?

아니요. 한 번에 플래그 하나를 복사하므로, 여러 개를 복사하려면 각각 복사해야 합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
41k
순위
#6884
라이선스
—
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬