OSS-first docs
These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.
Create a new feature flag.
Goal
Define a new feature flag for toggling features.
Context
Called when setting up a new feature flag.
Source Definition
import { defineCommand, defineQuery } from '@lssm-tech/lib.contracts-spec';
import { defineSchemaModel, ScalarTypeEnum } from '@lssm-tech/lib.schema';
export const CreateFlagContract = defineCommand({
meta: {
key: 'flag.create',
version: '1.0.0',
stability: 'stable',
owners: ['platform.feature-flags'],
tags: ['feature-flags', 'create'],
description: 'Create a new feature flag.',
goal: 'Define a new feature flag for toggling features.',
context: 'Called when setting up a new feature flag.',
},
io: {
input: CreateFlagInput,
output: FeatureFlagModel,
errors: {
KEY_ALREADY_EXISTS: {
description: 'Flag key already exists',
http: 409,
gqlCode: 'FLAG_KEY_EXISTS',
when: 'A flag with this key already exists',
},
},
},
policy: {
auth: 'admin',
},
});