mcpField
F
feature-flags-api

feature-flags-api

github.com/posthogDevelopment76111 installsUpdated today
Repository

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

  1. 01API 应用集成 PostHog 功能标志
  2. 02使用环境变量保存 PostHog 密钥
  3. 03优先采用布尔标志
  4. 04尽可能在服务器端评估标志
  5. 05提供功能标志管理参考文档

Use cases

  1. 01为 API 应用添加功能标志检查
  2. 02通过环境变量配置 PostHog 密钥
  3. 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-api

After 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.md
api.md
best-practices.md

Details

From the project README

PostHog feature flags for API

This skill helps you add PostHog feature flags to API applications.

Reference files

  • references/api.md - API 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.

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.

Comments

Markdown supported