About feature-flags-api
feature-flags-api is a skill for adding PostHog feature flags to API applications. It guides developers toward minimal code changes, environment-based keys, and server-side evaluation where possible.
Key features
- 01API 应用集成 PostHog 功能标志
- 02使用环境变量保存 PostHog 密钥
- 03优先采用布尔标志
- 04尽可能在服务器端评估标志
- 05提供功能标志管理参考文档
Use cases
- 01为 API 应用添加功能标志检查
- 02通过环境变量配置 PostHog 密钥
- 03借助 PostHog MCP 工具管理标志
MCP support
该技能会检查是否连接了 PostHog MCP 服务,并可使用其工具创建、列出、更新或删除功能标志。
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ posthog/ skills --skill feature-flags-apiAfter installing, type/feature-flags-apiin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
references/adding-feature-flag-code.mdapi.mdbest-practices.mdDetails
From the project READMEPostHog feature flags for API
This skill helps you add PostHog feature flags to API applications.
Reference files
references/api.md- API feature flags installation - docsreferences/adding-feature-flag-code.md- Adding feature flag code - docsreferences/best-practices.md- Feature flag best practices - docs
Consult the documentation for API details and framework-specific patterns.
Key principles
- Environment variables: Always use environment variables for PostHog keys. Never hardcode them.
- Minimal changes: Add feature flag code alongside existing logic. Don't replace or restructure existing code.
- Boolean flags first: Default to boolean flag checks unless the user specifically asks for multivariate flags.
- Server-side when possible: Prefer server-side flag evaluation to avoid UI flicker.
PostHog MCP tools
Check if a PostHog MCP server is connected. If available, look for tools related to feature flag management (creating, listing, updating, deleting flags). Use these tools to manage flags directly in PostHog rather than requiring the user to do it manually in the dashboard.
Framework guidelines
No specific framework guidelines.