Use when: putting a new or existing feature behind a feature flag (dev feature) in OpenCTI, adding attributes, GraphQL endpoints, managers or UI that must be hidden until a flag is enabled, or removing a feature flag
79
99%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Full rules and rationale: Feature Flags.
MY_FEATURE) and its constant (MY_FEATURE_FEATURE_FLAG).Add export const MY_FEATURE_FEATURE_FLAG = 'MY_FEATURE'; with a one-line comment in
opencti-platform/opencti-graphql/src/config/conf.js, next to the other flags.
For each attribute added by the feature — in a module definition's attributes, in
src/modules/attributes/*-registrationAttributes.ts, or as a new entry in the mappings
of an object attribute — add:
featureFlag: MY_FEATURE_FEATURE_FLAG,Without it the field is pushed into the ElasticSearch index mapping at startup even when the flag is off, and nothing fails. Re-read every attribute you added before moving on.
Add @ff(flags: ["MY_FEATURE"]) to every new query, mutation and field
(softFail: true for fields read early by the front end). Run yarn build:schema.
enforceEnableFeatureFlag(MY_FEATURE_FEATURE_FLAG) at the start of mutations / entry
points; isFeatureEnabled(MY_FEATURE_FEATURE_FLAG) for conditional branches.
ManagerDefinition and registerManager from src/manager/managerModule.ts.
Import the new manager file for side effects in src/manager/index.ts, and register it with
if (isFeatureEnabled(MY_FEATURE_FEATURE_FLAG)) { registerManager(DEFINITION); }.
Gate the registration, never enabled() / enabledToStart(): a registered manager shows
in the platform modules and startup logs even when the flag is off. Keep its own
enabledByConfig config. Do not add it to src/managers.ts.isFeatureEnabled(MY_FEATURE_FEATURE_FLAG).Reference: src/manager/workflowStatusCleanupManager.ts. Details in the Managers section of
Feature Flags.
const { isFeatureEnable } = useHelper(); then isFeatureEnable('MY_FEATURE') around
menus, routes, tabs and form fields. Run yarn relay if GraphQL changed.
grep -rn "featureFlag: MY_FEATURE_FEATURE_FLAG" lists every new attribute and mapping.APP__ENABLED_DEV_FEATURES='["MY_FEATURE"]': the feature works end to end.Delete the constant, every featureFlag: MY_FEATURE_FEATURE_FLAG, every @ff(...) and
every enforceEnableFeatureFlag / isFeatureEnabled / isFeatureEnable call for it;
unwrap the if around registerManager.
Search for MY_FEATURE in opencti-graphql and opencti-front and verify that no declarations or guards for this flag remain; retain legitimate feature and manager identifiers.
OpenCTI-Platform/opencti
2cc5089
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.