Install
$ agentstack add skill-growthbook-skills-flag-prerequisites ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo 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.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
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 →About
flag-prerequisites
Add, remove, or inspect feature-level prerequisites on a GrowthBook feature flag. A feature-level prerequisite is a boolean gate: if the specified prerequisite flag is off for a user, the current flag skips all its rules and returns its defaultValue for that user.
Feature-level prerequisites are boolean-flag-only. The prerequisite flag must have valueType: "boolean". The gate condition is always "prerequisite flag is on" ({"value": true}) — no custom conditions. If the user wants a more nuanced dependency (e.g. gate on a string flag's value, or gate a single rule rather than the whole flag), route to flag-targeting.
This is distinct from rule-level prerequisites (which gate a single rule and support richer conditions) — feature-level prerequisites apply to every rule on the flag simultaneously.
All API calls go through the bundled helper: ${CLAUDE_PLUGIN_ROOT}/scripts/gb-call. It needs GB_API_KEY set in env or written to ~/.config/growthbook/.env by /growthbook:setup.
Workflow
Path A — Add a prerequisite
- Fetch the flag's current prerequisites:
``bash gb-call GET /api/v2/features/ ` Capture the existing prerequisites` array. The PUT below replaces the full array, so you need the current contents to avoid overwriting existing prerequisites.
- Confirm the prerequisite flag exists and is boolean:
``bash gb-call GET /api/v2/features/ ` Check valueType. If it is not "boolean", halt: > "Feature-level prerequisites only support boolean flags. is a ` flag. To gate on a non-boolean flag's value, add a rule-level prerequisite instead via flag-targeting."
- Build the new prerequisites array. Append to any existing entries. The condition is always
{"value": true}— the gate means "prerequisite flag is on":
``json [ { "id": "", "condition": "{\"value\": true}" }, { "id": "", "condition": "{\"value\": true}" } ] ``
- Apply via draft:
``bash echo '{"prerequisites":[...]}' \ | gb-call PUT /api/v2/features//revisions/new/prerequisites - ``
- Hand off to flag-publish.
Path B — Remove a prerequisite
- Fetch current prerequisites (step A-1 above).
- Show the list and ask which to remove.
- Build the updated array without the removed entry.
- Apply via draft (step A-4 above) with the filtered array. An empty array
[]removes all prerequisites. - Hand off to flag-publish.
Path C — Inspect current prerequisites
gb-call GET /api/v2/features/
Surface the prerequisites array. For each entry, fetch the prerequisite flag to show its current evaluated state and value type. Use flag-graph to trace the full dependency chain if needed.
Guardrails
- Draft version threading. If a version number is already in context from a previous write skill in this session, use it explicitly (e.g.
.../revisions/42/prerequisites) instead ofnew. This keeps all changes in the same draft. Fall back tonewwhen starting fresh — it auto-creates or reuses the most recently updated open draft. PUT /prerequisitesreplaces the full array. It's not additive. Always fetch the current array first and include all existing entries when adding or modifying — otherwise you'll silently delete prerequisites the user didn't intend to touch.- Prerequisite flags must be boolean. Halt and route to flag-targeting if the user specifies a non-boolean flag as a prerequisite.
- The condition is always
{"value": true}. Do not accept or generate custom conditions for feature-level prerequisites. The backend is permissive but we intentionally constrain this — the gate means "this flag is on". If the user wants a richer condition (e.g. string flag equals a value, flag is live but not necessarily true), route to flag-targeting rule-level prerequisites. - Feature-level vs rule-level prerequisites. This skill gates the entire flag. If the user wants a prerequisite scoped to a single rule, route to flag-targeting.
- Circular dependencies must be avoided. If flag A requires flag B and flag B requires flag A, neither will ever evaluate. Check the existing dependency chain via flag-graph before adding a prerequisite.
- Prerequisite flags must be in the same GrowthBook project (or org-wide). Cross-project prerequisites may not resolve correctly depending on SDK configuration.
- Deleting a prerequisite flag breaks any flag that depends on it. The dependent flag's prerequisite condition will silently always fail. Surface this when the user is reviewing dependencies via flag-graph before cleanup.
Endpoints used
GET /api/v2/features/:id— fetch flag state including currentprerequisitesarrayPUT /api/v2/features/:id/revisions/new/prerequisites(body:{ "prerequisites": [...] })
Handoffs
flag-search— to find the prerequisite flag's ID if the user gives a nameflag-graph— to trace the full dependency chain and detect circular dependenciesflag-targeting— to add rule-level prerequisites (scoped to a single rule rather than the whole flag)flag-publish— to publish the draft, handle approval-required (400) and merge conflicts (409)
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: growthbook
- Source: growthbook/skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.