This skill helps you add PostHog feature flags to PHP applications.
本技能可帮助你在PHP应用中集成PostHog功能开关。
Reference files
参考文件
references/php.md
- Php feature flags installation - docs
references/adding-feature-flag-code.md
- Adding feature flag code - docs
references/best-practices.md
- Feature flag best practices - docs
Consult the documentation for API details and framework-specific patterns.
references/php.md
- PHP功能开关安装文档
references/adding-feature-flag-code.md
- 添加功能开关代码文档
references/best-practices.md
- 功能开关最佳实践文档
如需了解API详情和特定框架的实现模式,请查阅相关文档。
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密钥,切勿硬编码。
最小改动:在现有逻辑旁添加功能开关代码,不要替换或重构现有代码。
优先布尔型开关:默认使用布尔型开关检查,除非用户明确要求多变量开关。
尽可能服务端处理:优先选择服务端开关评估,以避免UI闪烁问题。
PostHog MCP tools
PostHog MCP工具
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.