Agent skill
feature-flag
Create or remove feature flags in the Commons application. Use when the user wants to add a new feature flag, delete a feature flag, or asks about feature flag naming conventions.
Install this agent skill to your Project
npx add-skill https://github.com/jakewaldrip/.dotfiles/tree/main/.config/opencode/skill/feature-flag-create-or-remove
SKILL.md
Feature Flags
Adding a Feature Flag
-
Add to enum in
commons-packages/shared/graphql/enums/feature-flags.enum.ts:typescriptexport enum FeatureFlags { // ... existing flags (alphabetically sorted) myNewFeatureFlag = 'myNewFeatureFlag', } -
Create migration using
npm run migrate:make add-feature-flag-my-new-feature:typescriptimport type { Knex } from 'knex'; import { createFeatureFlagWithDescriptionAndTeam, rollbackCreateFeatureFlag, } from '@commons/backend/models/migrations/helpers/feature-flag-helpers'; const FEATURE_FLAG_NAME = 'myNewFeatureFlag'; // Use string literal, NOT enum export async function up(knex: Knex): Promise<number[]> { return createFeatureFlagWithDescriptionAndTeam( FEATURE_FLAG_NAME, knex, 'Brief description of what this flag controls', 'Team Name', // e.g., 'Care Delivery', 'Platform', 'Growth' ); } export async function down(knex: Knex): Promise<number> { return rollbackCreateFeatureFlag(FEATURE_FLAG_NAME, knex); } -
Ask user for team name to associate with the flag.
Removing a Feature Flag
-
Create migration using
npm run migrate:make remove-feature-flag-my-feature:typescriptimport type { Knex } from 'knex'; import { markFeatureFlagDeleted, rollbackMarkFeatureFlagDeleted, } from '@commons/backend/models/migrations/helpers/feature-flag-helpers'; const FEATURE_FLAG_NAME = 'myFeatureFlag'; // Use string literal, NOT enum export async function up(knex: Knex): Promise<any> { await markFeatureFlagDeleted(FEATURE_FLAG_NAME, knex); } export async function down(knex: Knex): Promise<any> { await rollbackMarkFeatureFlagDeleted(FEATURE_FLAG_NAME, knex); } -
Remove from enum in
commons-packages/shared/graphql/enums/feature-flags.enum.ts
Naming Conventions
- camelCase for flag names (e.g.,
carePlanImprovements,gcAiTextAgent) - Descriptive and specific to the feature
- Avoid generic names like
newFeatureorenableThing
Important
- In migrations, always use string literals, not enum values—the enum may change before the migration runs in all environments.
- Flags are disabled by default; they must be enabled per-market in the database.
- Template files:
commons-packages/backend/models/migrations/examples/_feature-flag-*.ts
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
react-component-writing
React component patterns and style guide for the Commons monorepo. Use when creating React components, working with GraphQL in components, or implementing internationalization with MessageFormat.
graphite-cli
Use Graphite CLI (gt) for stacked PRs and branch management. Use when creating branches, committing changes, submitting PRs, syncing with trunk, or managing stacked pull requests.
test-running
Run Jest tests in the Commons monorepo. Use when testing code changes, validating implementations, debugging test failures, or when the user mentions running tests.
document-type-adding
Add new document types to the DocuSign integration in the Commons monorepo. Use when the user wants to add a patient document, consent form, or agreement to the DocuSign workflow.
dataloader-dual-mode-migration
Migrate dataloaders to dual-mode pattern supporting both patientId and enrollmentId for Member Model 2.0. Use when converting a patient-based dataloader to support the MemberModelV2Switch.
feature-flag-create-or-remove
Create or remove feature flags in the Commons application. Use when the user wants to add a new feature flag, delete a feature flag, or asks about feature flag naming conventions.
Didn't find tool you were looking for?