should-flag-change
Decides whether a committed code change should ship behind a LaunchDarkly feature flag. A fixed decision tree asks narrow questions about the change; the skill answers what it can from git and LaunchDarkly, the agent answers the rest by written procedures from evidence the skill gathers, and every answer's citations are checked against the code. The same answers always give the same result.
- Advisory and read-only. It never creates or changes flags or edits the repository it checks.
- Needs a git checkout with the change committed,
python3(3.10+, standard library only) andgit. LaunchDarkly flag state is read with the agent's LaunchDarkly tools, and the skill works without them. - Falls back to a judgment procedure, references/NO_CHECKOUT.md, when it can't run (no shell, no checkout, only a pasted diff).
- Output: a plain-English report ending in a
recommend-flagJSON block, the same shape on both paths.
Command line
ld-factory.pyz is the whole program in one file (a Python zip application: the
engine, the decision tree and its data). It runs every step (start, gates,
risks, readers, features, facts, next, answer, decide, check-profile);
ld-factory.pyz --help lists them. In the Factory runtime it's already on PATH (baked
into the image), so an agent never installs it. Locally, call it by path, or link
it yourself (for example ln -s "$PWD/ld-factory.pyz" ~/bin/ld-factory.pyz). SKILL.md describes the
order.
Settings
| Variable | Default | What it sets |
|---|---|---|
SHOULD_I_FLAG_PROFILES |
unset | Folders (separated like PATH) of repo profiles, <name>.json, each naming its repo and optionally a launchdarkly section (instance, project, environments). |
SHOULD_I_FLAG_RUNS |
~/.cache/should-i-flag/ |
Where everything the skill writes goes: run folders, and repo profiles in profiles/. Set it to a writable folder in a sandbox that can't write ~/.cache. |
A repo without a profile gets one derived from its code on each run and
checked against the change. Lines the check can't account for never stop the
run: they become leads for the gate search, and the agent may repair the
profile (references/PROFILE_REPAIR.md), never
must. The derived profile and a repair's additions are saved in profiles/
under SHOULD_I_FLAG_RUNS (by default ~/.cache/should-i-flag/profiles/), and the
additions are applied on top of the derived profile on later runs; any that
no longer match the code are left out.
The settings, the run and profile folders, the in-repo profile
(.launchdarkly/should-i-flag.json) and the should-i-flag-record block keep
the name this skill had before it replaced the earlier should-flag-change,
so existing profiles and decision records still work.