Add and manage feature flags for gating features in Hamster Studio across environments and integrations.
Pro scans all 2 files and shows the line behind each finding
Scanned 9/27/2026
npx -y skills add gethamster/skills --skill hamster-feature-flags --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Hamster Feature Flags?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/gethamster-hamster-feature-flags)More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.
---
name: hamster-feature-flags
description: "Add and manage feature flags for gating features in Hamster Studio across environments and integrations."
version: "1.1.0"
---
# Feature Flags Skill
Add and manage feature flags for gating features in Hamster Studio.
## When to Use
- Adding a new feature that should be gated behind a flag
- Enabling/disabling features per environment (dev, staging, production)
- Rolling out features gradually with environment-specific toggles
- Adding new connector integrations that need to be gated
## Quick Reference
### Files Involved
| File | Purpose |
| --- | --- |
| `apps/web/config/feature-flags.config.ts` | Schema definition and parsing |
| `apps/web/.env.1p` | 1Password references for each environment |
| Component files | Import and use `featuresFlagConfig` |
### Adding a New Feature Flag
1. **Add to schema** in `feature-flags.config.ts`:
```typescript
enableMyFeature: z.boolean({
error: (issue) =>
issue.input === undefined
? 'Provide the variable NEXT_PUBLIC_ENABLE_MY_FEATURE'
: 'Value must be a boolean',
}).describe('Enable my new feature.'),
```
1. **Add to config parsing** in the same file:
```typescript
enableMyFeature: getBoolean(
process.env.NEXT_PUBLIC_ENABLE_MY_FEATURE,
false, // default value when not set
),
```
1. **Add to `.env.1p`** with 1Password reference:
```
NEXT_PUBLIC_ENABLE_MY_FEATURE=op://${VAULT_NAME}/features/next-public-enable-my-feature
```
1. **Create in 1Password** for each environment vault:
- Path: `/features/next-public-enable-my-feature`
- Value: `true` or `false`
### Using Feature Flags
```typescript
import featuresFlagConfig from '~/config/feature-flags.config';
// In component logic
if (featuresFlagConfig.enableMyFeature) {
// Feature-specific code
}
// Filtering arrays (e.g., services)
const filteredItems = items.filter((item) =>
item.id === 'my-feature' ? featuresFlagConfig.enableMyFeature : true,
);
```
## Naming Conventions
| Convention | Example |
| --- | --- |
| Env variable | `NEXT_PUBLIC_ENABLE_*` or `NEXT_PUBLIC_*_ENABLED` |
| Config key | `enableMyFeature` (camelCase, starts with `enable`) |
| 1Password path | `/features/next-public-enable-my-feature` |
## References
- [Feature Flag Patterns](references/feature-flag-patterns.md) - Detailed patterns and examples
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!