Skip to main content

add-private-feature-flag

Use when adding a new private (developer experiments) feature flag to Ghost, including the backend registration and settings UI toggle.

소스 정보

저장소
TryGhost/Ghost
최근 소스 활동
2026년 10월 9일 14:25
감지된 SKILL.md 언어
영어
스타
55,544
포크
11,995

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
add-private-feature-flag
description
Use when adding a new private (developer experiments) feature flag to Ghost, including the backend registration and settings UI toggle.
# Add Private Feature Flag ## Overview Adds a new private feature flag to Ghost. Private flags appear in Labs settings under the "Private features" tab, visible only when developer experiments are enabled. Read and follow the canonical [feature flag guide](../../../docs/practices/feature-flags.md) before adding a flag. The guide covers when a Labs flag is appropriate, safe gating across server and Admin, testing, and the cleanup lifecycle. For Admin 7 milestone flags, also use the [Admin 7 feature flags skill](../admin7-feature-flags/SKILL.md) for naming and shared presentation guidance. ## Steps 1. **Add the flag to `ghost/core/shared/labs.js`** - Add the flag name (camelCase string) to the `PRIVATE_FEATURES` array. 2. **Add a UI toggle in `apps/admin/src/settings/advanced/labs/private-features.tsx`** - Add a new entry to the `features` array with `title`, `description`, and `flag` (must match the string in `labs.js`). 3. **Run tests and update the config API snapshot** - Unit: `cd ghost && pnpm test:single test/unit/shared/labs.test.js` - Update snapshots: `cd ghost && pnpm test:single test/e2e-api/admin/config.test.js -u && pnpm test:single test/e2e-api/admin/settings.test.js -u` - Review both snapshot diffs to confirm only your new flag was added. ## Notes - No database migration is needed. Labs flags are stored in a single JSON `labs` setting. - The flag name must be identical in `labs.js`, `private-features.tsx`, and the snapshots. - Flags are camelCase strings (e.g. `welcomeEmailDesignCustomization`). - For public beta flags (visible to all users), add to `PUBLIC_BETA_FEATURES` in `labs.js` instead and add the toggle to `apps/admin/src/settings/advanced/labs/beta-features.tsx`.
GitHub에서 보기