fix(feature-flags): correct SDK method names, rollout weight units and broken references - #183
Closed
allen-mithra wants to merge 1 commit into
Closed
allen-mithra wants to merge 1 commit into
allen-mithra wants to merge 1 commit into
Conversation
…d broken references
- targeting-patterns: `update-rollout` takes human percentages, but the
batching section sent it thousandths alongside `toggle-flag`. Scope raw
instruction batching to approval requests.
- flag-create, flag-cleanup, flag-drift: the Python and Ruby server SDKs have
no typed `*_variation` methods; use `variation` / `variation_detail`.
- flag-cleanup: `useFlags()` returns the flag map, not `{ flags }`.
- flag-discovery: fix the relative link to the cleanup skill from references/.
- flag-targeting: restore two table rows orphaned by a mid-table paragraph;
drop an "Or by index" example that showed a variation id.
- guarded-rollout: 1000 = 1% is thousandths of a percent, not basis points.
- flag-release: make the worked example's hold date consistent.
- Patch-bump metadata.version on each touched skill; regenerate skills.json.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Correctness fixes in the feature-flag skills, found while auditing a local install. Following these passages produces wrong or failing output today.
update-rolloutweight units (launchdarkly-flag-targeting/references/targeting-patterns.md). The batching section told agents to turn a flag on and set a rollout "in one call totoggle-flagandupdate-rollout", withrolloutWeightsof10000/90000.update-rollouttakes human percentages: its MCP description says "Weights must sum to 100. Use human-friendly percentages (e.g., 80 for 80%)", which also matches this skill's own SKILL.md. An agent following the reference would be off by 1000×. The section now says raw semantic-patch batching belongs in an approval request'sinstructions, and that direct changes are separate calls.launchdarkly-flag-create/references/sdk-evaluation-patterns.md,launchdarkly-flag-cleanup/references/sdk-patterns.md,launchdarkly-flag-drift/references/sdk-default-patterns.md). The server SDKs expose onlyvariation,variation_detailandmigration_variation: PythonLDClient, RubyLDClient. flag-create writes evaluation code from this reference, sobool_variation/string_variation/int_variation/number_variation/json_variationfailed at runtime withAttributeError/NoMethodError. In cleanup and drift they were search patterns for methods that can't appear in code.useFlags()(launchdarkly-flag-cleanup/references/sdk-patterns.md). The hook returns the flag map, soconst { flags } = useFlags()destructures a key that doesn't exist. It now matches the shapelaunchdarkly-flag-create/references/sdk-evaluation-patterns.mdalready uses.launchdarkly-flag-discovery/references/removal-readiness-checklist.md). The link../launchdarkly-flag-cleanup/SKILL.mdfromreferences/resolved inside the discovery skill. It's now../../, as sibling references already do.launchdarkly-flag-targeting/SKILL.md). A paragraph inserted mid-table left the "Full rollout" and "Copy from staging" rows rendering as stray text. The paragraph now sits below the table. Also removed an "Or by index" example intargeting-patterns.mdthat showed avariationId, not an index.launchdarkly-guarded-rollout/SKILL.md). With1000= 1%, the unit is thousandths of a percent; a basis point is 0.01%.flag-release/SKILL.md). The example holds production "until 2026-09-01", but its report line said 2026-08-01.metadata.versionis patch-bumped on each touched skill, andskills.jsonis regenerated.Testing
Not applicable
Manual (describe below)
python3 scripts/validate_skills.py: validated 49 SKILL.md files.python3 scripts/generate_catalog.py --check: up to date.python3 -m unittest discover -s tests: 9 tests OK.The Promptfoo evals were not run.
Notes
get-environments(flag-drift SKILL.md) andget-code-references(flag-discovery removal checklist). I left them unchanged, since they may target a different server version.🤖 Generated with Claude Code
Note
Overview
This PR corrects agent-facing feature-flag skill docs so following them no longer produces wrong rollouts, broken code, or bad links. Touched skills get a patch bump in metadata and
skills.json.SDK references now match real APIs: Python and Ruby docs drop non-existent typed helpers (
bool_variation, etc.) in favor ofvariation/variation_detail; React cleanup patterns useconst flags = useFlags()instead of destructuring a non-existentflagsproperty.Targeting guidance separates MCP
update-rollout(human percentages 0–100) from raw semantic-patchrolloutWeights(thousandths in approval batches), fixes a markdown table broken by mid-table prose, and trims a misleading fallthrough example.Smaller fixes: guarded-rollout weight unit wording, discovery → cleanup link path, and a flag-release example date aligned with the hold scenario (2026-09-01).
Reviewed by Cursor Bugbot for commit 449f951. Bugbot is set up for automated code reviews on this repo. Configure here.