feature-flags

Manages remote feature flags across the Fedi bridge runtime and web API.

78|27|Updated May 4, 2024
One-click install
npx skills add https://github.com/fedixyz/fedi --skill feature-flags-fedixyz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: feature-flags
Source: https://github.com/fedixyz/fedi/tree/main/.agents/skills/feature-flags
Command: npx skills add https://github.com/fedixyz/fedi --skill feature-flags-fedixyz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Changing, adding, or retiring remotely controlled feature flags in the Fedi codebase requires coordinated edits across the Rust bridge runtime, the web API endpoint, and generated TypeScript bindings, and mistakes can break older app binaries in the field. ## Core Features & Use Cases - Flag Value Changes: Update existing remote flags in ui/web/src/pages/api/features.ts across production and development maps. - New Flag Addition: Step-by-step workflow for adding fields to RemoteFeatures, FeatureCatalog, apply_remote_layer(), compiled defaults, and regenerating TypeScript bindings. - Safe Flag Retirement: Guidance on graduating a flag in stages so old app binaries still receive the served value while new code removes the gate. - Use Case: When shipping a new wallet feature behind a remote flag, follow the checklist to add the flag in Rust, serve it from the web API, consume it via the selectFeatureFlag Redux selector, and later remove it without breaking released clients. ## Quick Start Ask the assistant to add a new remote feature flag to the Fedi bridge runtime and web API following the feature-flags workflow.

Frequently Asked Questions about feature-flags

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new remote feature flag in the Fedi codebase?

Add the field to RemoteFeatures and FeatureCatalog in crates/runtime/src/features.rs, wire it through apply_remote_layer(), set defaults in all four constructors, serve the camelCase key from ui/web/src/pages/api/features.ts, then regenerate TypeScript bindings.

How do I change an existing remote feature flag value?

Edit ui/web/src/pages/api/features.ts and update both the prodRemoteFeatures and devRemoteFeatures maps using camelCase field names. The compiled-in default only affects first launches and permanently offline installs, so it does not need to change in lockstep.

How do I read a feature flag in the Fedi UI code?

Import selectFeatureFlag from @fedi/common/redux and call it with the snake_case FeatureCatalog key, for example selectFeatureFlag(s, 'dummy_feature'). Do not use the camelCase web API key in the Redux selector.

Why did removing a feature flag turn the feature off for old app versions?

Old binaries still deserialize the served RemoteFeatures payload, and a removed field deserializes to false, disabling the feature. Keep serving the value until the app version floor includes the graduated binary, then remove the field in a separate change.

When does a remote feature flag change take effect in the app?

The bridge applies the last cached remote payload at startup, and background refreshes are written for the next launch. A remote change therefore takes effect one launch later, never in the current session.