$npx -y skills add launchdarkly/ai-tooling --skill launchdarkly-guarded-rolloutConfigure guarded rollouts with progressive traffic increases, metric monitoring, and automatic rollback. Use when releasing features gradually with safety thresholds.
| 1 | # LaunchDarkly Guarded Rollouts |
| 2 | |
| 3 | You're using a skill that will guide you through configuring guarded rollouts in LaunchDarkly. Your job is to design rollout stages, select monitoring metrics, configure regression thresholds, and start the rollout. |
| 4 | |
| 5 | ## Prerequisites |
| 6 | |
| 7 | This skill requires the remotely hosted LaunchDarkly MCP server to be configured in your environment. |
| 8 | |
| 9 | **Required MCP tools:** |
| 10 | - `start-guarded-rollout` -- start a progressive rollout with monitoring |
| 11 | - `get-flag` -- inspect the flag and its variations |
| 12 | - `list-metrics` -- find metrics to monitor during the rollout |
| 13 | |
| 14 | **Optional MCP tools:** |
| 15 | - `stop-guarded-rollout` -- halt an active rollout immediately |
| 16 | - `toggle-flag` -- ensure the flag is turned on before starting |
| 17 | - `create-metric` -- create metrics if they don't exist |
| 18 | |
| 19 | ## Core Concepts |
| 20 | |
| 21 | ### What Are Guarded Rollouts? |
| 22 | |
| 23 | A guarded rollout progressively increases traffic to a new feature flag variation through a series of stages. At each stage, LaunchDarkly monitors selected metrics for regressions. If a regression is detected, the rollout can automatically pause and notify the team — or even roll back. |
| 24 | |
| 25 | ### Key Components |
| 26 | |
| 27 | | Component | Description | |
| 28 | |-----------|-------------| |
| 29 | | **Test variation** | The new variation being rolled out | |
| 30 | | **Control variation** | The existing/baseline variation | |
| 31 | | **Stages** | Steps with increasing traffic percentage and monitoring windows | |
| 32 | | **Metrics** | What to monitor for regressions (error rate, latency, etc.) | |
| 33 | | **Regression threshold** | How much a metric can degrade before triggering action | |
| 34 | | **On regression** | Whether to notify, rollback, or both when a threshold is breached | |
| 35 | |
| 36 | ### Rollout Weight Units |
| 37 | |
| 38 | Rollout weights use thousandths (basis points): |
| 39 | - `1000` = 1% |
| 40 | - `10000` = 10% |
| 41 | - `50000` = 50% |
| 42 | - `100000` = 100% |
| 43 | |
| 44 | ### Monitoring Window |
| 45 | |
| 46 | The monitoring window is specified in milliseconds: |
| 47 | - `3600000` = 1 hour |
| 48 | - `86400000` = 24 hours |
| 49 | - `604800000` = 7 days |
| 50 | |
| 51 | ## Core Principles |
| 52 | |
| 53 | 1. **Start Small**: Begin with a low percentage (1-5%) to catch issues early |
| 54 | 2. **Monitor What Matters**: Choose metrics that reflect user experience |
| 55 | 3. **Set Realistic Thresholds**: Too tight = false alarms; too loose = missed regressions |
| 56 | 4. **Allow Time**: Each stage needs enough monitoring time for signal to emerge |
| 57 | 5. **Have a Rollback Plan**: Always configure at least notification on regression |
| 58 | |
| 59 | ## Workflow |
| 60 | |
| 61 | ### Step 1: Prepare |
| 62 | |
| 63 | Before starting a guarded rollout: |
| 64 | |
| 65 | 1. Use `get-flag` to inspect the flag — note the variation IDs for test and control |
| 66 | 2. Use `list-metrics` to find metrics suitable for monitoring |
| 67 | 3. Ensure the flag is **on** in the target environment (use `toggle-flag` if needed) |
| 68 | 4. Confirm there's no active guarded rollout on this flag already |
| 69 | |
| 70 | ### Step 2: Design Stages |
| 71 | |
| 72 | Plan the rollout progression. A typical pattern: |
| 73 | |
| 74 | | Stage | Traffic | Monitoring Window | Purpose | |
| 75 | |-------|---------|-------------------|---------| |
| 76 | | 1 | 1% | 1 hour | Smoke test — catch obvious crashes | |
| 77 | | 2 | 10% | 24 hours | Early signal on metrics | |
| 78 | | 3 | 50% | 24 hours | Confidence building | |
| 79 | | 4 | 100% | 24 hours | Full rollout with monitoring | |
| 80 | |
| 81 | ### Step 3: Configure Metrics |
| 82 | |
| 83 | Select metrics that indicate problems: |
| 84 | |
| 85 | | Metric Type | Example | Threshold | Action | |
| 86 | |-------------|---------|-----------|--------| |
| 87 | | Error rate | `api-error-rate` | 0.05 (5% increase) | Rollback | |
| 88 | | Latency | `p99-response-time` | 0.2 (20% increase) | Notify | |
| 89 | | Conversion | `checkout-completed` | 0.1 (10% decrease) | Notify + Rollback | |
| 90 | |
| 91 | ### Step 4: Start the Rollout |
| 92 | |
| 93 | Use `start-guarded-rollout`: |
| 94 | |
| 95 | ```json |
| 96 | { |
| 97 | "projectKey": "my-project", |
| 98 | "flagKey": "new-checkout-flow", |
| 99 | "environmentKey": "production", |
| 100 | "testVariationId": "variation-id-for-new-flow", |
| 101 | "controlVariationId": "variation-id-for-current-flow", |
| 102 | "randomizationUnit": "user", |
| 103 | "stages": [ |
| 104 | {"rolloutWeight": 1000, "monitoringWindowMilliseconds": 3600000}, |
| 105 | {"rolloutWeight": 10000, "monitoringWindowMilliseconds": 86400000}, |
| 106 | {"rolloutWeight": 50000, "monitoringWindowMilliseconds": 86400000}, |
| 107 | {"rolloutWeight": 100000, "monitoringWindowMilliseconds": 86400000} |
| 108 | ], |
| 109 | "metrics": [ |
| 110 | { |
| 111 | "metricKey": "api-error-rate", |
| 112 | "onRegression": {"notify": true, "rollback": true}, |
| 113 | "regressionThreshold": 0.05 |
| 114 | }, |
| 115 | { |
| 116 | "metricKey": "checkout-completed", |
| 117 | "onRegression": {"notify": true, "rollback": false}, |
| 118 | "regressionThreshold": 0.1 |
| 119 | } |
| 120 | ] |
| 121 | } |
| 122 | ``` |
| 123 | |
| 124 | ### Step 5: Verify |
| 125 | |
| 126 | 1. Use `get-flag` to confirm the guarded rollout is active |
| 127 | 2. Check that the flag shows the rollout configuration in the environment |
| 128 | 3. Monitor for any immediate regression notifications |
| 129 | |
| 130 | **Rep |