feature-flag-create-or-remove
When creating or removing a new feature flag from the database
When & Why to Use This Skill
This Claude skill automates the end-to-end process of managing feature flags within a software project. It streamlines the creation and removal of flags by automatically updating TypeScript enums and generating standardized database migration files based on predefined templates. By enforcing naming conventions and best practices for migrations, it reduces manual boilerplate work, prevents configuration errors, and ensures long-term maintainability of the codebase.
Use Cases
- Scenario 1: Rapidly implementing a new feature toggle by automatically updating the feature-flags.enum.ts file and generating the required database migration using the standard creation template.
- Scenario 2: Safely decommissioning and removing deprecated feature flags from both the database and the codebase while ensuring migration scripts use stable string references instead of volatile enums.
- Scenario 3: Enforcing organizational coding standards by ensuring all new feature flags follow camelCase naming conventions and include mandatory team ownership metadata.
| name | feature-flag-create-or-remove |
|---|---|
| description | When creating or removing a new feature flag from the database |
Adding and Removing
- When adding a new feature flag to feature-flags.enum.ts, make sure you also add it to the database following the template migration _feature-flag-create.ts
- When removing feature flags, use the template migration _feature-flag-remove.ts and delete the flag from feature-flags.enum.ts
- When referencing a flag in a migration file, use a string instead of the enum value as the enum could change later.
- Follow the usual rules in migrations.mdc
Naming conventions
- Use camelCase for feature flag names
- Make names descriptive and specific to the feature they control
- Avoid generic names that could be ambiguous
- Ask the user to provide a team name to create the flag with