hamster-feature-flags
Add and manage feature flags for gating features in Hamster Studio across environments and integrations.
- License 许可
- MIT
- 最近更新
- 2026-11-05
- Stars
- ★ 4
- Forks
- 0
01 前言 Front Matter
- name
- hamster-feature-flags
- version
- 1.1.0
- description
- Add and manage feature flags for gating features in Hamster Studio across environments and integrations.
02 资源文件 1
- 参考文档references/feature-flag-patterns.md5.1 KB
03 SKILL.md 正文
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
- Add to schema in
feature-flags.config.ts:
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.'),
- Add to config parsing in the same file:
enableMyFeature: getBoolean(
process.env.NEXT_PUBLIC_ENABLE_MY_FEATURE,
false, // default value when not set
),
- Add to
.env.1pwith 1Password reference:
NEXT_PUBLIC_ENABLE_MY_FEATURE=op://${VAULT_NAME}/features/next-public-enable-my-feature
- Create in 1Password for each environment vault:
- Path:
/features/next-public-enable-my-feature - Value:
trueorfalse
Using Feature Flags
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 - Detailed patterns and examples
04 同仓库更多 Skills
writing-waterfall-requirements-documents
Write a waterfall requirements document: elicit, structure and review testable, traceable requirements, then baseline the specification before design.
writing-vision-and-values-statements
Write a V2MOM vision a reader can test and a ranked list of values that settles real tradeoffs, so the rest of the document has a clear anchor.
writing-system-prompts-for-claude
Write Claude prompts and CLAUDE.md files that supply exact inputs, scope the task, and define done so the first attempt can be checked.
writing-page-specific-website-copy
Website copywriting by page type: write homepage, landing page, pricing page and feature page copy that fits each page's visitor and single job.
writing-internal-press-releases
How to write an internal press release: the one-page working backwards press release that opens a PR/FAQ document before anything is built.
writing-email-sequences-that-sell
Email sequence copywriting for nurture and sales: give each email one job, write clear subject lines, and close with one specific call to action.