Skip to content

fix(feature-flags): correct SDK method names, rollout weight units and broken references - #183

Closed
allen-mithra wants to merge 1 commit into
launchdarkly:mainfrom
allen-mithra:fix/feature-flag-skill-correctness
Closed

allen-mithra wants to merge 1 commit into
launchdarkly:mainfrom
allen-mithra:fix/feature-flag-skill-correctness

Conversation

@allen-mithra

@allen-mithra allen-mithra commented Sep 29, 2026 •

Copy link
Copy Markdown

Summary

Correctness fixes in the feature-flag skills, found while auditing a local install. Following these passages produces wrong or failing output today.

  • update-rollout weight 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 to toggle-flag and update-rollout", with rolloutWeights of 10000 / 90000. update-rollout takes 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's instructions, and that direct changes are separate calls.
  • Python and Ruby typed evaluation methods (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 only variation, variation_detail and migration_variation: Python LDClient, Ruby LDClient. flag-create writes evaluation code from this reference, so bool_variation / string_variation / int_variation / number_variation / json_variation failed at runtime with AttributeError / NoMethodError. In cleanup and drift they were search patterns for methods that can't appear in code.
  • React useFlags() (launchdarkly-flag-cleanup/references/sdk-patterns.md). The hook returns the flag map, so const { flags } = useFlags() destructures a key that doesn't exist. It now matches the shape launchdarkly-flag-create/references/sdk-evaluation-patterns.md already uses.
  • Broken relative link (launchdarkly-flag-discovery/references/removal-readiness-checklist.md). The link ../launchdarkly-flag-cleanup/SKILL.md from references/ resolved inside the discovery skill. It's now ../../, as sibling references already do.
  • Orphaned table rows (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 in targeting-patterns.md that showed a variationId, not an index.
  • Unit label (launchdarkly-guarded-rollout/SKILL.md). With 1000 = 1%, the unit is thousandths of a percent; a basis point is 0.01%.
  • Worked example (flag-release/SKILL.md). The example holds production "until 2026-09-01", but its report line said 2026-08-01.

metadata.version is patch-bumped on each touched skill, and skills.json is 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

  • Two tool names these skills reference don't appear in the hosted LaunchDarkly MCP server's tool list as of today: get-environments (flag-drift SKILL.md) and get-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 of variation / variation_detail; React cleanup patterns use const flags = useFlags() instead of destructuring a non-existent flags property.

Targeting guidance separates MCP update-rollout (human percentages 0–100) from raw semantic-patch rolloutWeights (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.

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant