AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Flag Create

skill-growthbook-skills-flag-create · by growthbook

Create a new feature flag in GrowthBook via the REST API. Use when the user asks to "create a feature flag", "add a flag for X", "wrap this in a feature flag", "I need a flag to gate this", or "feature toggle for X". For adding rules to an existing flag, use flag-rules. For removing a flag, use flag-cleanup.

No reviews yet
0 installs
7 views
0.0% view→install

Install

$ agentstack add skill-growthbook-skills-flag-create

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-growthbook-skills-flag-create)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Flag Create? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

flag-create

Create a new feature flag in GrowthBook. We always set {enabled: false} for every environment explicitly in the payload, so the flag ships disabled regardless of the org's default-state-for-new-environments setting — the user must enable it after creation. Feature keys are permanent; pick the name carefully.

All API calls go through the bundled helper: ${CLAUDE_PLUGIN_ROOT}/scripts/gb-call. It needs GB_API_KEY — set in your shell, or written to ~/.config/growthbook/.env by /growthbook:setup. If it's missing or invalid, gb-call's error message points back at /growthbook:setup.

Workflow

  1. Confirm intent. Restate what the flag will gate in one sentence. Stop if the user wants to run an A/B test (route to the appropriate experiment skill based on what's already in scope) or a rule on an existing flag (route to flag-rules).
  1. Check the key isn't taken.

``bash gb-call GET /api/v2/feature-keys `` Verify the proposed key isn't already in the returned list. If it is, propose a variant; the API will reject the collision and the key cannot be renamed afterward.

  1. Pick a value type. One of string, number, boolean, json. Default to boolean for an on/off gate. Use string or json only when the flag carries config (variant copy, threshold values, structured payload).
  1. Resolve the project (optional). If the user mentions a project name, list projects and pick the ID:

``bash gb-call GET /api/v1/projects `` Flags scoped to a project are easier to govern than the default org-wide bucket. If unclear, ask the user.

  1. Resolve environments. GrowthBook expects the create payload to include an environments map listing every environment. Get them:

``bash gb-call GET /api/v1/environments `` Build the map with each environment disabled.

  1. Confirm naming. The v2 endpoint regex accepts [a-zA-Z0-9_.:|-] (the user-facing docs and error messages recommend the narrower [a-zA-Z0-9_-]). Default to kebab-case (new-checkout-flow, dark-mode, pricing-experiment-2026-q2) — it matches what the docs recommend, keeps keys consistent across teams, and avoids any future tightening of the regex. Show the proposed key to the user before creating.
  1. Build the payload and create the flag. Construct a JSON object:

``json { "id": "", "valueType": "boolean", "defaultValue": "false", "description": "", "environments": { "production": { "enabled": false }, "staging": { "enabled": false } }, "project": "" } ` Then POST it: `bash echo '' | gb-call POST /api/v2/features - ``

  1. State what happens next. Tell the user explicitly: the flag is disabled in all environments and has no rules yet. Offer two follow-ups:
  • To turn it on in an environment or attach a targeting rule, use flag-targeting.
  • To use this flag as the variation switch in an A/B test, use experiment-design with the flag's ID.

Guardrails

  • Feature keys are permanent. GrowthBook does not let you rename a flag's id after creation. Confirm the proposed name with the user before calling the API.
  • owner defaults to the token's user. Omit owner from the create payload — the API attributes the flag to the user the GB_API_KEY belongs to. Only set owner explicitly (an email or u_... userId) if the user wants to assign the flag to someone else.
  • ID character set: prefer kebab-case. The v2 endpoint regex still accepts [a-zA-Z0-9_.:|-], but the user-facing docs and error messages recommend [a-zA-Z0-9_-]. Don't propose IDs with ., :, or | — they may be tightened in a future version. Existing legacy keys with those characters can be left alone.
  • Always set {enabled: false} explicitly per environment. Don't rely on the org's default-state-for-new-environments setting — it's configurable and may default to enabled. Tell the user the flag is disabled everywhere; silent zero evaluation (or worse, accidentally-enabled evaluation) is a top GrowthBook footgun.
  • defaultValue is always serialized as a string. "false" for boolean off, "0" for numeric, JSON-encoded text for json. The API rejects non-string values.
  • v2 environments map is just {enabled: bool} per env. Rules are no longer nested under each environment — they're a top-level array on the flag, added later via flag-targeting (or directly through the v2 revision endpoints). Do not include rules: [] inside each env.
  • Stop before creating if the user wants an experiment. Hand off to experiment-design. Creating a flag without the corresponding experiment is a common confusion that produces orphaned flags.
  • Ask, do not guess. If valueType, defaultValue, or project are ambiguous, ask. The flag is permanent.

Endpoints used

  • GET /api/v2/feature-keys — list all feature flag keys (no pagination cap)
  • GET /api/v1/projects — list projects, used to resolve a project name to an ID
  • GET /api/v1/environments — list environments, used to construct the environments map
  • POST /api/v2/features — create the flag

After creation

The response contains the flag's full configuration. Show the user the flag ID, a reminder that it's disabled everywhere, and a link to the flag in the GrowthBook UI. Derive ` from GBAPIURL by replacing api.app. (cloud default: https://app.growthbook.io). Link: /features/`.

Handoffs

  • flag-toggle — to enable the flag in an environment
  • flag-rules — to add rules (routes to the appropriate rule type skill)
  • flag-default-value — to change the fallback value served when no rules match
  • flag-metadata — to set project, tags, description, or owner after creation
  • flag-experiment — to wire this flag to an A/B experiment
  • experiment-design — if the user actually wants a full A/B test (create experiment first, flag second)

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.