Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

configs-targeting

БесплатноБез исполняемых скриптовНе проверен

Configure config targeting rules to control which variations serve to different users. Enable percentage rollouts, attribute-based rules, segment targeting…

launchdarklyот launchdarkly★ 32 звезды на GitHub

Об этом скилле

Config Targeting

Configure targeting rules for configs to control which variations serve to different contexts. Works the same for both completion and agent mode.

Prerequisites

  • LaunchDarkly account with AgentControl enabled
  • Project key and environment key
  • Existing config with variations (use configs-create skill)

API Access

Use the LaunchDarkly MCP server tools: they authenticate via OAuth and need no token. The REST examples under Scripting without MCP are for code that runs without the agent; if the user wants one run in this session, ask them to paste an API access token and substitute it for {api_token}. Do not search environment variables, .env files, or agent/MCP config files for credentials.

Core Concepts

Evaluation Order

Targeting rules evaluate in this order (same as feature flags):

  1. Individual targets - Specific context keys (highest priority)
  2. Segment rules - Pre-defined segments
  3. Custom rules - Attribute-based conditions (evaluated in order)
  4. Default rule - Fallthrough for all others
  5. Off variation - When targeting is disabled

Key Concepts

  • Variations: MCP targetingInstructions and fallthrough take variationKey (a variation key or name) or variationId (a UUID from the targeting read). Raw REST needs the UUID.
  • Weights: Thousandths (50000 = 50%, 100000 = 100%)
  • Clause logic: Multiple clauses = AND, multiple values = OR
  • Null attributes: Rules with null/missing attributes are skipped

Workflow

Every write below is one update-agent-config call with resource: "targeting" and requires confirm: true. Show the user the change and pass it only after they agree. A single call may combine on, fallthrough, and targetingInstructions.

Step 1: Get Targeting

Call get-agent-configs with projectKey, configKey, section: "targeting", and env. The response lists the variations (key, name, and _id), the rules with their _ids, individual targets, and the current fallthrough.

Step 2: Edit the Default Rule

Set the default rule to the variation you created with fallthrough:

{
  "projectKey": "my-project",
  "configKey": "chat-assistant",
  "resource": "targeting",
  "env": "production",
  "fallthrough": {"variationKey": "default"},
  "confirm": true
}

For a percentage split, pass fallthrough as {"weights": [{"variationKey": "default", "percent": 80}, {"variationKey": "experimental", "percent": 20}]}; the percents sum to 100. Add contextKind or bucketBy beside weights to change what is bucketed.

Important: The turnTargetingOn instruction does not work for configs. A new config serves its disabled variation until you set the default rule.

Step 3: Add Targeting Rules

Use targetingInstructions. It accepts addRule, removeRule, replaceRules, reorderRules, updateRuleDescription, addClauses, removeClauses, addValuesToClause, removeValuesFromClause, and updateClause.

Attribute-based rule:

{
  "projectKey": "my-project",
  "configKey": "model-selector",
  "resource": "targeting",
  "env": "production",
  "targetingInstructions": [{
    "kind": "addRule",
    "clauses": [{
      "contextKind": "user",
      "attribute": "selectedModel",
      "op": "contains",
      "values": ["sonnet"],
      "negate": false
    }],
    "variationKey": "sonnet"
  }],
  "comment": "Route sonnet requests",
  "confirm": true
}

Percentage rollout on a rule: send an addRule instruction with percentageRolloutConfig in place of variationKey, as in the Manual Percentage Rollout shape below.

Segment rule: a clause with attribute: "segmentMatch", op: "segmentMatch", an empty contextKind, and the segment keys as values.

Step 4: Target Individuals

Use targetingInstructions with addTargets, removeTargets, replaceTargets, or clearTargets. addTargets and removeTargets require contextKind and values:

{
  "projectKey": "my-project",
  "configKey": "chat-assistant",
  "resource": "targeting",
  "env": "production",
  "targetingInstructions": [{"kind": "addTargets", "contextKind": "user", "variationKey": "experimental", "values": ["user-123"]}],
  "confirm": true
}

Step 5: Verify

Call get-agent-configs with section: "targeting" again and confirm the fallthrough, rules, and targets match what the user approved.

Scripting without MCP

For CI or scripts that can't use the MCP server, the same steps go through the REST API's semantic patch endpoint:

PATCH /api/v2/projects/{projectKey}/ai-configs/{configKey}/targeting
Content-Type: application/json; domain-model=launchdarkly.semanticpatch
import requests
import os
from typing import Dict, List, Optional

class AIConfigTargeting:
    """Manager for config targeting rules"""

    def __init__(self, api_token: str, project_key: str):
        self.api_token
Полный SKILL.md на GitHub

Установить configs-targeting в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

README.md

FAQ

Что делает скилл configs-targeting?

Configure config targeting rules to control which variations serve to different users. Enable percentage rollouts, attribute-based rules, segment targeting, and guarded rollouts.

Как установить скилл configs-targeting?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл configs-targeting запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить configs-targeting с