Example rules to help Cursor users build better with LaunchDarkly.
This repo ships Cursor project rules as .mdc files. Each file is a small policy Cursor can apply when you work in Agent or Chat, so suggestions stay aligned with good flag and SDK patterns.
| Rule file | Intent |
|---|---|
using-flags.mdc |
Centralized evaluation, context design, fallbacks |
implementing-launchdarkly.mdc |
SDK wrappers, config, singleton init, shutdown |
troubleshooting-launchdarkly.mdc |
Debugging and operational guidance |
For one repo that contains all your apps (open the monorepo root in Cursor):
- Create
/.cursor/rules/at the repository root (same level as your rootpackage.json/go.work/ etc.). - Copy
using-flags.mdc,implementing-launchdarkly.mdc, andtroubleshooting-launchdarkly.mdcfrom this repo into that folder (keep names and.mdcextension). - Commit
.cursor/rules/*.mdcso the team gets the same rules. - Reload the window or reopen the folder if rules do not show up immediately.
That’s enough for day-to-day use. Verification (Settings UI, alwaysApply / globs, sub-packages) is in the full guide below.
- Cursor installed (rules format targets Cursor’s project rules, not generic Copilot config).
- Your app opened in Cursor as a folder or multi-root workspace (rules apply relative to the workspace).
From this repository, copy the three .mdc files into your repo:
your-project/
.cursor/
rules/
using-flags.mdc
implementing-launchdarkly.mdc
troubleshooting-launchdarkly.mdc
Create .cursor/rules/ if it does not exist. Keep the .mdc extension so Cursor treats them as project rules.
Ways to get the files:
- Download: GitHub → each file → Raw → save with the same name under
.cursor/rules/. - Clone and copy:
git clone https://github.com/launchdarkly-labs/cursor-rules.gitthen copy the three files into your project. - Submodule (optional): add this repo as a submodule and symlink or copy the
.mdcfiles into.cursor/rules/(Cursor does not read rules from arbitrary paths outside.cursor/rules/unless you copy or link them there).
Check .cursor/rules/*.mdc into version control so everyone gets the same guidance:
git add .cursor/rules/*.mdc
git commit -m "chore: add LaunchDarkly Cursor project rules"- Open Cursor Settings → search for Rules (wording may vary by Cursor version, e.g. Cursor Settings → General → Project rules).
- You should see your project rules listed; each rule’s description comes from the YAML frontmatter
descriptionfield in each.mdcfile. - Start Agent or Chat in a file where LaunchDarkly is relevant; ask something that would touch flags or SDK setup—the model should respect the rule content when it’s included in context.
If a rule has alwaysApply: false (the default in these examples), Cursor may attach it when the task matches the rule’s description or globs. You can set alwaysApply: true in the frontmatter if you want that file’s rules considered for every request in that project (heavier context).
To limit a rule to certain paths, edit the frontmatter in that .mdc file, for example:
---
description: LaunchDarkly flag usage conventions for application code
globs: src/**/*.ts,src/**/*.tsx
alwaysApply: false
---Use patterns that match your repo layout. Leave globs empty to rely on description-based inclusion only.
- Single monorepo, root opened in Cursor: use one
.cursor/rules/at the repo root (same as the TL;DR above). Rules apply across the tree for that workspace. - You only open a subpackage as the workspace folder: put
.cursor/rules/inside that package instead (Cursor only loads project rules from the opened root).
- Pull updates: Re-copy or merge changes from this repo when the
.mdcfiles change. - Fork: Fork this repo if your org wants to customize rules and still track upstream.
- Cursor Rules documentation: https://docs.cursor.com/context/rules
- LaunchDarkly documentation: https://docs.launchdarkly.com/
See LICENSE.