This topic describes how to install and use the LaunchDarkly flag cleanup custom agent for GitHub Copilot.
The flag cleanup agent uses the LaunchDarkly MCP server to help you to automate feature flag workflows using either the Github UI or the GitHub Copilot CLI.
When using the agent, you can provide natural language prompts to safely perform tasks such as:
Before you can install or use the agent, you must configure the LaunchDarkly Feature management (feature flags) MCP server for GitHub Copilot. To learn more, read LaunchDarkly hosted MCP server.
The LaunchDarkly custom agent file, hosted in the Awesome GitHub Copilot repo, defines the specialized agent behavior to use when performing LaunchDarkly workflows.
To install the agent file:
.github/agents/ directory in the top level of your GitHub repository if it does not already exist..github/agents/launchdarkly.agent.md.After you add the LaunchDarkly agent profile to your repository, you can use the agent from either the GitHub Copilot UI or the Copilot CLI.
To use the LaunchDarkly agent at github.com:
Copilot uses the custom agent rules with the LaunchDarkly API to execute the task and create a PR.
First, install the GitHub Copilot CLI if necessary:
To use the agent in interactive mode:
Copilot uses the custom agent rules with the LaunchDarkly API to execute the task and create a PR.
You can also execute agent commands directly from your shell prompt by using the --prompt option. For example:
The custom agent specification file ensures that Copilot performs common flag operations in a safe and organized fashion. For example, if you enter a prompt such as “Check if the flag ‘beta-search-v2’ is safe to remove from the codebase”, the LaunchDarkly agent performs the following actions, in order: