Agent skill

Cleanup Feature Flags

by harness in harness/harness-skills

Remove a launched Harness FME feature flag from application code, keeping the treatment FME serves today, and open a pull request.

Apache-2.0Auto-check passedDevelopment

Install Cleanup Feature Flags

skills CLI
$ npx skills add harness/harness-skills --skill cleanup-feature-flags -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install harness/harness-skills cleanup-feature-flags --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/harness/harness-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/cleanup-feature-flags .claude/skills/cleanup-feature-flags && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cleanup-feature-flags
GitHub stars
115
Token cost
~2.4k tokens
SKILL.md length
1,172 words
Files
2 (incl. references)
Skills in repo
24
Repo updated
First seen
Licence
Apache-2.0

At a glance

Remove a launched Harness FME feature flag from application code, keeping the treatment FME serves today, and open a pull request.

  • Works in 8 steps: Establish scope → Pick the flag → Forward treatment and verdict → …
  • Asked to remove a flag from code
  • SKILL.md covers Tools, Instructions, Examples and Performance Notes, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Cleanup Feature Flags is an agent skill from harness/harness-skills. Remove a launched Harness FME feature flag from application code, keeping the treatment FME serves today, and open a pull request. Use when asked to remove a flag from code, hardcode the winning treatment after a rollout, or pay down flag debt for a specific flag. Do not use for finding stale flags (discover-feature-flags) or archiving and deleting flags in FME (manage-flag-lifecycle). Trigger phrases: remove flag from code, hardcode treatment, flag cleanup, flag debt, clean up feature flag.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/readiness.md`). Compatibility notes: Requires the Harness MCP server or the Harness CLI

It sits in Development, covering Pull requests. The repository describes itself as: A collection of structured AI agent skills that enable Claude Code, Cursor, GitHub Copilot, and other AI coding assistants to create, operate, debug, and govern Harness CI/CD… The licence is Apache-2.0.

When your agent uses it

  • Asked to remove a flag from code
  • Hardcode the winning treatment after a rollout
  • Pay down flag debt for a specific flag
  • Finding stale flags (discover-feature-flags)

Example prompts

  • “/cleanup-feature-flags”

Requirements

  • Compatibility (from SKILL.md): Requires the Harness MCP server or the Harness CLI

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Establish scope
  2. Pick the flag
  3. Forward treatment and verdict
  4. Find call sites
  5. Present the plan and wait
  6. Edit and verify
  7. Open the PR
  8. Hand off

What it can do on your machine

Read from SKILL.md and the folder at commit c25faee. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Requires the Harness MCP server or the Harness CLI

    From compatibility in the SKILL.md frontmatter.

Context cost

Cleanup Feature Flags loads about 2.4k tokens when it runs, and up to ~3.6k if it reads all its reference files. Until then it costs about 130 tokens; SKILL.md has 1,172 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~130
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from harness/harness-skills at commit c25faee, republished under its Apache-2.0 licence (© harness). 1,172 words, ~2,350 tokens.

Download SKILL.mdSave it as .claude/skills/cleanup-feature-flags/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
cleanup-feature-flags
description
Remove a launched Harness FME feature flag from application code, keeping the treatment FME serves today, and open a pull request. Use when asked to remove a flag from code, hardcode the winning treatment after a rollout, or pay down flag debt for a specific flag. Do not use for finding stale flags (discover-feature-flags) or archiving and deleting flags in FME (manage-flag-lifecycle). Trigger phrases: remove flag from code, hardcode treatment, flag cleanup, flag debt, clean up feature flag.
compatibility
Requires the Harness MCP server or the Harness CLI
metadata.author
Harness
metadata.version
1.2.2
metadata.mcp-server
harness-mcp
license
Apache-2.0

Cleanup Feature Flags

Remove one launched FME flag from application code and keep the branch FME serves today. The work ends with a PR. FME is read-only here; archive happens later in manage-flag-lifecycle.

Related: discover-feature-flags finds candidates (stale audit); manage-flag-lifecycle archives after the change deploys.

Tools

Works through the Harness MCP server or the Harness CLI; names are from tool-map.md.

OperationMCPCLI
List environmentsharness_list · fme_environment · compact: falseharness list fme_environment --json
Get flagharness_get · fme_feature_flag · params: { feature_flag_name }harness get feature_flag <flag> --json
List flag definitionsharness_list · fme_feature_flag_definition · params: { feature_flag_name } · filters: { offset: 0, limit: 100 } · compact: falseharness list feature_flag:definition <flag> --json
List experimentsharness_list · fme_experiment · filters: { parent_type: "FEATURE_FLAG", parent_name, status: ["ACTIVE", "PAUSED"], offset: 0, limit: 100 } (apply pagination completeness checks) · compact: falseharness list experiment --parent-type FEATURE_FLAG --parent-name <flag> --status ACTIVE --json, then again with --status PAUSED

Instructions

Load readiness.md before giving a verdict. Load sdk-patterns.md before searching code.

Phase 1: Establish scope

Follow scope-establishment.md. Fully paginate List environments per pagination before confirming the critical environments: by default those with isProduction, plus any the user adds. The critical set must be non-empty and explicitly confirmed back to the user before any later phase. If no environment is marked isProduction and the user hasn't named any, STOP and ask which environments are critical — do not treat an empty critical set as vacuously ready.

Phase 2: Pick the flag

If the user named a flag, Get flag to confirm it exists and note its status and rolloutStatus. If they want candidates instead, hand off to discover-feature-flags (stale audit) and come back with one flag.

Phase 3: Forward treatment and verdict
  1. Fully paginate List flag definitions for the flag with explicit MCP filters.limit: 100 and advancing filters.offset until a short page (size is ignored). Incomplete coverage stops code removal; it cannot establish a missing definition or the live forward treatment. Resolve the forward treatment for each critical environment per readiness.md. If any call site uses WithConfig, also resolve and compare each critical environment's configurations value for that treatment — identical treatment names with differing configs are blocked, not ready.
  2. Run the experiment check with List experiments, covering every page of ACTIVE and PAUSED results before a verdict. An incomplete scan stops code removal. Here ACTIVE means blocked: code removal ends the experiment. PAUSED means caution.
  3. Give the verdict per readiness.md. Stop on blocked.

Never infer the forward treatment from the code's default or fallback value.

Phase 4: Find call sites

In the application repo, identify the SDK and search for the flag key, batch calls, flag sets, config-file entries and tests per sdk-patterns.md. For each hit, record file:line, which branch is the forward one, and any side effects (tracking, metrics, logging).

  • If you find dynamic keys ("prefix-" + id, `flag-${id}`), the verdict is blocked. Stop and ask the user how to proceed; automated removal can't be complete.
  • If you find no hits, the flag may live in another repo or only in a flag set. That is caution.
Phase 5: Present the plan and wait

Show:

  • the forward treatment for each critical environment and why;
  • each call site with the branch to keep and the code to delete;
  • the verdict, with every caution reason;
  • the last impression for each critical environment.

If the forward treatment is control or a killed defaultTreatment, say plainly that the newer code path will be deleted. Edit nothing until the user explicitly confirms this plan.

Phase 6: Edit and verify
  1. Work on a new branch in the application repo.
  2. At each call site, keep the forward branch and inline the config value if WithConfig is used. Remove the dead branches, plus any flag-only constants, wrappers, imports, tests, fixtures, localhost or offline entries, and docs. Don't refactor unrelated code.
  3. Search again for the key and for the batch and flag-set patterns. Any remaining hits must be explained: homonyms, other services, or fixtures the user wants to keep.
  4. Run the repo's own build, lint and tests. Fix any failures before moving on.
Show full SKILL.md (503 more words)Show less
Phase 7: Open the PR

Confirm with the user before pushing or opening the PR. Use the repo's normal tooling and its own PR template and conventions (for example .github/pull_request_template.md or CONTRIBUTING). Don't impose a format. Whatever the template, the description must capture:

  • the flag key and the treatment (or config value) that was kept;
  • the FME evidence: org and project, critical environments checked, the forward treatment (and config value, if WithConfig is used) in each, the verdict and any caution the user acknowledged, the experiment check result, and the last impression in each critical environment;
  • what was removed: branches, tests, config, imports;
  • how it was verified: the clean search and the build and test run;
  • which repo(s)/service(s) were searched — a clean search here does not prove the flag is unused elsewhere;
  • the follow-up: archive the flag with manage-flag-lifecycle once this change is deployed everywhere the flag is evaluated, plus any other repos or services that may still reference it.
Phase 8: Hand off

Report the PR link and the follow-up: "After this deploys, use manage-flag-lifecycle to archive <flag>." Don't archive or delete here.

Examples

  • "Remove new-checkout-flow from this repo": verdict, plan, confirm, edit, verify, PR, then the archive hand-off.
  • "Hardcode the winning treatment for dark-mode": resolve the forward treatment from the live definitions, not from the code.
  • "This flag is killed in prod, clean it up": the forward treatment is defaultTreatment; warn that the new path is deleted.
  • "Which flags can we clean up?": hand off to discover-feature-flags (stale audit).
  • "Archive the flag too": PR here first, then manage-flag-lifecycle after the deploy.

Performance Notes

  • One complete paginated List flag definitions inventory covers the environments; it may require multiple calls. A page is not the whole inventory.
  • Search the flag key first, then the batch and flag-set patterns. Wrappers often hide the literal key.
  • Keep the diff to the flag. Unrelated refactors make the PR harder to review and revert.

Troubleshooting

IssueAction
Critical environments disagreeblocked. Ask the user to align targeting (update-flag-targeting) or narrow the critical set.
An environment has no definitionIts forward treatment is control, so the fallback branch is live there. Treat it as caution and confirm.
Flag is already archived but still in codeAllowed. The forward treatment is control; confirm the fallback branch is what users get today.
ACTIVE experiment on the flagblocked. Finish it first (manage-experiments).
Code uses WithConfigHardcode the treatment's config value from the definition, not just the name. If critical environments share the treatment name but have different config values, that's blocked, not ready — hardcoding would silently diverge environment behavior.
No explicit critical environment setStop and ask. Don't default to "ready" on an empty or unconfirmed critical set.
Only one repo searchedRecord that scope in the PR and summary. Don't claim the flag is fully unused until other repos/services are confirmed or searched.
Dynamic flag keysblocked. Stop and ask the user.
No call sites foundcaution. Check other repos and flag sets before claiming the flag is unused.

© harness, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/cleanup-feature-flags of harness/harness-skills.

  • SKILL.md
  • references/readiness.md

Open the folder on GitHubat commit c25faee

Compare with similar skills

Cleanup Feature Flags next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cleanup Feature Flags compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cleanup Feature Flags this skillharness/harness-skills115—~2.4kAutomated safety check: PassApache-2.0
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Check PRonyx-dot-app/onyx32k2 repos~2.3kAutomated safety check: PassMIT
Understand Diff AnalysisEgonex-AI/Understand-Anything86k1 repos~1.4kAutomated safety check: PassMIT
PR Design DocOpenHands/OpenHands90k—~2.4kAutomated safety check: PassMIT

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Check PR

    onyx-dot-app/onyx

    Checks a GitHub, GitLab, or Perforce (p4) pull request (or merge request, or shelved changelist) for unresolved review comments, failing status checks, and incomplete PR descriptions.

    32k GitHub starsUsed in 2 repos~2.3k tokens
    DevelopmentAuto-check passed
  • Understand Diff Analysis

    Egonex-AI/Understand-Anything

    Reads your git changes or a pull request against a prebuilt knowledge graph of the project to explain what changed, which components are affected and what is risky.

    86k GitHub starsUsed in 1 repo~1.4k tokens
    DevelopmentAuto-check passed
  • PR Design Doc

    OpenHands/OpenHands

    For a non-trivial pull request, write a self-contained HTML design doc under the temporary .pr/ directory and link a visibility-appropriate preview in the PR description, so maintainers grasp the…

    90k GitHub stars~2.4k tokensUpdated today
    DevelopmentAuto-check passed
  • WooCommerce Code Review

    woocommerce/woocommerce

    Reviews WooCommerce code changes against the project's standards, flagging backend PHP architecture, naming, documentation, data integrity and testing violations.

    11k GitHub starsUsed in 3 repos~1.1k tokens
    DevelopmentAuto-check passed

More from harness/harness-skills

All 24 skills in this repo
  • Audit Report

    harness/harness-skills

    Generate audit reports and compliance trails using Harness audit trail data via MCP v2 tools.

    115 GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • Chaos Dr Test

    harness/harness-skills

    A skill your agent uses when working with Chaos Engineering steps inside a Harness pipeline.

    115 GitHub stars~2.6k tokensUpdated yesterday
    Auto-check passed
  • Chaos Experiment

    harness/harness-skills

    A skill your agent uses when the user asks to create, edit, update, design, or configure a Harness Chaos Experiment — including faults, probes, actions, experiment YAML, fault injection, pod-delete…

    115 GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Configure Repo Scan

    harness/harness-skills

    Configure code scanning in Harness pipelines using STO security scanners.

    115 GitHub stars~2.2k tokensUpdated yesterday
    Auto-check passed
  • Create Agent Template

    harness/harness-skills

    Generate Harness Agent Template files for AI-powered automation agents.

    115 GitHub stars~2.2k tokensUpdated yesterday
    Auto-check passed
  • Create Metric

    harness/harness-skills

    Create a Harness FME metric: helps decide what to measure, suggests candidate metrics from application code, resolves traffic type and event type IDs, drafts the payload, then creates.

    115 GitHub stars~3.4k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Cleanup Feature Flags

What does Cleanup Feature Flags do?

Remove a launched Harness FME feature flag from application code, keeping the treatment FME serves today, and open a pull request. Cleanup Feature Flags is an agent skill from harness/harness-skills. Remove a launched Harness FME feature flag from application code, keeping the treatment FME serves today, and open a pull request.

When should I use Cleanup Feature Flags?

Cleanup Feature Flags fits situations like: asked to remove a flag from code; hardcode the winning treatment after a rollout; pay down flag debt for a specific flag; finding stale flags (discover-feature-flags).

How do I install Cleanup Feature Flags in Claude Code?

Run `npx skills add harness/harness-skills --skill cleanup-feature-flags -a claude-code`. Or copy the skill folder (skills/cleanup-feature-flags in harness/harness-skills) into .claude/skills/cleanup-feature-flags in your project. Claude Code loads it when a task matches its description.

How do I install Cleanup Feature Flags in Codex?

Run `npx skills add harness/harness-skills --skill cleanup-feature-flags -a codex`. Or copy the skill folder (skills/cleanup-feature-flags in harness/harness-skills) into .agents/skills/cleanup-feature-flags in your project. Codex loads it when a task matches its description.

Can I use Cleanup Feature Flags in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add harness/harness-skills --skill cleanup-feature-flags -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cleanup-feature-flags, .gemini/skills/cleanup-feature-flags, .github/skills/cleanup-feature-flags and .opencode/skills/cleanup-feature-flags in your project.

What does Cleanup Feature Flags need to run?

SKILL.md names no scripts, command-line tools or credentials: Cleanup Feature Flags is instructions for the agent only. Compatibility (from SKILL.md): Requires the Harness MCP server or the Harness CLI.

Does Cleanup Feature Flags access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Cleanup Feature Flags safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Cleanup Feature Flags use?

Cleanup Feature Flags is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cleanup Feature Flags use?

About 2.4k tokens (SKILL.md is roughly 9.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.3k tokens, read only when the agent opens those files.

What are the alternatives to Cleanup Feature Flags?

Skills that share tags, products or a category with Cleanup Feature Flags: Finishing a Development Branch (obra/superpowers, 296k stars), PR Babysitter (openinterpreter/openinterpreter, 69k stars), Check PR (onyx-dot-app/onyx, 32k stars) and Understand Diff Analysis (Egonex-AI/Understand-Anything, 86k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cleanup Feature Flags?

harness (a GitHub organization) maintains it in harness/harness-skills, which has 115 GitHub stars. The repository holds 24 skills in this directory. The repository was last updated on October 6, 2026.

Source: harness/harness-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.