Command Palette

Search for a command to run...

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

should-flag-change

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

Decide whether a committed code change should ship behind a LaunchDarkly feature flag. Use when a developer asks whether a change should be behind a flag…

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

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

Should This Change Be Behind a Flag?

This skill answers one question about a committed change: should it ship behind a LaunchDarkly feature flag? It does not decide by judgment. A fixed decision tree asks a series of narrow questions about the change, some answered mechanically from git and LaunchDarkly, the rest by you, each by a written procedure, from evidence the skill gathers. The same answers always give the same result.

Every command below is this skill's command line, ld-factory.pyz: one file, beside this one. Where it isn't on your PATH, run it as SKILL_DIR/ld-factory.pyz (SKILL_DIR is the directory this file is in), or python3 SKILL_DIR/ld-factory.pyz. It needs python3 and git, nothing else.

Finish in one run. Don't stop partway to ask anyone something and wait. Everything below, including fetching flags and answering a question a second time, happens in the same turn.

On a pull request, start with this, filling in the PR's base branch, head commit and title, then go by start's exit code (step 1's table). Read the rest of this file as each step comes up. First save the PR's body to /tmp/pr-body.txt (from your PR tools, or gh pr view <number> --json body -q .body where gh works); if you can't get it, leave --pr-body-file out and the commit message stands in.

ld-factory.pyz start <REPO_PATH> --base origin/<base_ref> --head <head_sha> \
    --pr-title "<PR title>" --pr-body-file /tmp/pr-body.txt

Exit 7: do what it printed under LAUNCHDARKLY NEEDED (the flags and the calls to make) and run the same start again. Exit 0: it printed the first question; read the evidence and answer it (step 3).

Scope

  • Advisory and read-only. Never create, toggle, or modify a flag, and never edit the repo being checked. Everything the skill writes goes under ~/.cache/should-i-flag/, or SHOULD_I_FLAG_RUNS when it's set: its run folders, and the repo profiles it derives and repairs, in profiles/.
  • Committed changes only: the branch's commits against its base, the same change a pull request shows. Uncommitted edits and untracked files are not part of it. A long-lived branch is checked as one change, all its commits together (start prints the count as CHANGE).

When it can't run: decide by judgment

When the check can't run, follow references/NO_CHECKOUT.md instead, and say in your summary that you did and why. It can't run when:

  • there's no shell, no python3 or no git, or no checkout of the change (for example, only a pasted diff);
  • ld-factory.pyz crashes, or reports a setup problem (exit 2) you can't fix by correcting what you passed it or, for a partial clone, by cloning again.

Follow that page from the start, and never mix the two.

Steps

1. Prepare

ld-factory.pyz start <REPO_PATH> [--base <REF>] [--head <REF>] \
    [--pr-title "<title>"] [--pr-body-file <file>] [--client-repo <NAME>=<PATH>] \
    [--flag-type multivariate|string|number|json]
  • REPO_PATH defaults to the current directory, --head to HEAD, --base to the remote's default branch (origin/HEAD, else origin/main).
  • The whole tree at the change's commit and its base. The evidence reads files the change doesn't touch: callers, routes, middleware, flag declarations. A shallow clone (--depth) is fine, and so is a sparse working tree. In a partial clone (--filter=blob:none, --filter=tree:0) start fetches the files it lacks at those two commits from the clone's remote first (PARTIAL CLONE); it adds objects only, never a checkout or a ref. When that fetch can't fill them, it stops with exit 2.
  • On a pull request (CI, a PR review), pass the PR's base and head: --base origin/<base_ref> --head <head_sha>, and its title and body (write the body to a file first). Without them the commit message stands in for the PR text.
  • --client-repo (repeatable) names a checkout of another repository whose code calls this one's interfaces, e.g. the frontend for a backend. Without it, checkouts beside REPO_PATH of the other repositories the skill knows are used when present. Only the gate search's caller coverage and the consumer search below read them.
  • --flag-type: pass it only when the developer says which type of flag they want (string, number and json are multivariate). If a flag is suggested, it is that type rather than a boolean. It never changes whether one is suggested. Without it, a PR text that says "multivariate" does the same.

It prints RUN: <folder> and status lines (CHECKING, CHANGE, UNCOMMITTED, PR TEXT, FLAG TYPE, PROFILE CHECK, LAUNCHDARKLY, PARTIAL CLONE). By exit code:

Exit Meaning What you do
0 Ready It printed the first question (QUESTION). Go to step 3: read the evidence, then answer it.
7 LaunchDarkly flags are needed Fetch the flags it printed (also in `RUN/launchdarkl
Полный SKILL.md на GitHub

Установить should-flag-change в Claude Code и Claude Desktop

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

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

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

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

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

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

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

README.mdld-factory.pyzmarketplace.jsonreferences/CONSUMERS.mdreferences/FACTS.mdreferences/FEATURES.mdreferences/GATES.mdreferences/LAUNCHDARKLY.mdreferences/NO_CHECKOUT.mdreferences/PROFILE.mdreferences/PROFILE_REPAIR.mdreferences/RISK.md

FAQ

Что делает скилл should-flag-change?

Decide whether a committed code change should ship behind a LaunchDarkly feature flag. Use when a developer asks whether a change should be behind a flag, when reviewing a diff or pull request, or when running in CI on a PR. Runs a fixed decision tree over the change and the code around it, with checked evidence, and emits a structured advisory recommendation. Run it on every change, including test-only, docs, dependency and already-flagged ones: those finish in a minute or two, and its verdict, not your own read of the diff, is the decision. Read-only: it never creates or modifies flags.

Как установить скилл should-flag-change?

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

Скилл should-flag-change запускает скрипты?

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

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

Сравнить should-flag-change с