feature-flags-rust

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

PostHog feature flags for Rust

适用于Rust应用的PostHog功能标志

This skill helps you add PostHog feature flags to Rust applications.
本技能可帮助你在Rust应用中添加PostHog功能标志。

Reference files

参考文件

  • references/rust.md
    - Rust 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/rust.md
    - Rust功能标志安装文档
  • 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.
检查是否已连接PostHog MCP服务器。如果已连接,查找与功能标志管理相关的工具(创建、列出、更新、删除标志)。使用这些工具直接在PostHog中管理标志,无需用户在控制面板中手动操作。

Framework guidelines

框架指南

No specific framework guidelines.
无特定框架指南。