/launchdarkly:should-auto-approvefrom launchdarkly
Rates a committed code change's review risk as low, medium, or high using a fixed decision graph. Advisory and read-only; never approves or modifies PRs.
Ships in launchdarkly. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill rates one committed change low, medium or high risk. Low is a change that can merge on an automated approval; medium and high need a person's review. It does not rate by judgment. A fixed decision graph asks narrow yes/no questions about the change. The changed paths answer some mechanically, and you answer the rest, each by its written procedure, from the code. The same answers always give the same rating.
Every command below is this skill's command line, should-auto-approve.pyz:
one file, beside this one. Run it as python3 SKILL_DIR/should-auto-approve.pyz
(SKILL_DIR is the directory this file is in). It needs python3 and git.
Finish in one run. Don't stop partway to ask anyone something and wait.
~/.cache/should-auto-approve/ (or
SHOULD_AUTO_APPROVE_RUNS).gh for them. Read the code
and the PR's own title and description only.When your instructions say to run this skill in shadow mode, its rating is for observation only. Run it after your own work is finished and submitted, print its report, and do nothing else with it. Don't let it change, delay or justify anything you did or submitted, don't submit or post anything again because of it, and don't mention it anywhere outside your own reply.
If there's no shell, python3, git or checkout of the change, or the CLI
crashes or reports a setup problem (exit 2) you can't fix by correcting what
you passed it, say so in one line and stop. Don't rate the change yourself
instead.
python3 SKILL_DIR/should-auto-approve.pyz start <REPO_PATH> [--base <REF>] [--head <REF>] \
[--pr-title "<title>"] [--pr-body-file <file>] [--pr-author <login>]
REPO_PATH defaults to the current directory, --head to HEAD, --base
to the remote's default branch (origin/HEAD, else origin/main).--base origin/<base_ref> --head <head_sha>), its title and description (write the description to
a file first), and its author's login (--pr-author).start says
there's no merge base, fetch more history (git fetch --deepen or
--unshallow) and run it again.It prints RUN: <folder> and status lines (CHANGE, PR TEXT,
LAUNCHDARKLY, QUESTIONS).
| Exit | Meaning | What you do |
|---|---|---|
| 0 | Ready | Go to step 2. |
| 4 | Nothing committed to check | Stop and say so. |
| 2 | Setup problem | Fix what you passed (a ref, a file) and run start again, else stop and say why. |
RUN/questions.md holds the questions left after the path answers, each with
its procedure and when it may be left unresolved, then the approval gates
(G1, G3): whether the repository's approval policy files let a low change
merge on an automated approval alone. The gates never change the rating.
questions.md lists every APPROVAL_POLICY.md covering the change; read each
in full at the merge base. B6 and the gates apply every rule in them, as written.
Answer them in the same object, the same way. Read the change and the code
around it:
git -C <REPO_PATH> diff <merge_base>...<head>
git -C <REPO_PATH> show <head>:<path>
git -C <REPO_PATH> grep -n <pattern> <head>
(RUN/case.json has merge_base and head.)
true, false, or "unresolved" (only when that question's
"Unresolved when" actually holds; say which part), with evidence: the files
and lines or symbols that decide it, in one or two sentences.RUN/flags.json lists every LaunchDarkly flag whose key
(or its camelCased SDK name) appears in the change or the ten lines around
each hunk, with its state now in each critical environment: on, the off
and fallthrough variations, and counts of rules and targets. An environment
whose key has prod serves real users. It is a key match, not a gate
analysis. Check in the code that a listed flag really withholds the changed
behavior, and look for a flag check the file missed (a wrapper, a constant, a
flag passed in from a caller, a route gated elsewhere). Read such a flag's
state with python3 SKILL_DIR/should-auto-approve.pyz flag RUN <flag-key>.
When start printed LAUNCHDARKLY: not read, or flag exits 9, read the
flags with your LaunchDarkly tools instead. If you can't read flag state at
all, a question that depends on it is unresolved.Then record the answers, all in one JSON object on stdin:
python3 SKILL_DIR/should-auto-approve.pyz answer RUN <<'JSON'
{
"answers": {
"<question id>": {"value": true, "evidence": "..."}
},
"behavior_hunks": ["path:symbol", "..."],
"flag_keys": ["feature flag keys that gate any changed code"]
}
JSON
| Exit | Meaning | What you do |
|---|---|---|
| 0 | Recorded | Go to step 3. |
| 7 | Missing or invalid answers (listed) | Fix them and send the whole object again. |
python3 SKILL_DIR/should-auto-approve.pyz decide RUN
Run it as is, with its whole output: don't pipe it through grep, sed,
head or tail. It prints RESULT (low, medium, high, or "a person needs to
decide"), WHY, the DECIDING QUESTION with the evidence that settled it,
UNCLEAR, BUT IT DIDN'T MATTER when present, APPROVAL (whether the change
can merge on an automated approval, and any approval gate not met or unclear),
and a fenced block:
```json should-auto-approve
{"rating": "low", "escalated": false, "terminal": "...", "graph": "...", ..., "gates": {...}, "auto_approve": true}
```
| Exit | Meaning | What you do |
|---|---|---|
| 0 | Decided | Go to step 4. |
| 2 | No answers recorded yet | Go back to step 2. |
Print, in a few short lines, using only what decide printed:
WHY, close to verbatim, and a sentence on what in the
change led there, in terms of its code.UNCLEAR, BUT IT DIDN'T MATTER, if present.APPROVAL, and any gate it lists, in one line: a low change that still
needs a person is "low risk, but needs a person because ...".Then copy the should-auto-approve block verbatim as the last thing in
your output. Never edit its fields.
Readers don't know how the check works inside. Don't use its internal words: predicate, node, walk, graph, terminal, outcome codes (T-LO-2, E-UNIT), hunk, merge_base. Say "the check", "the change", "the code it changes", "a person needs to decide". Refer to questions by what they ask.
should-auto-approve block.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub launchdarkly/ai-tooling --plugin launchdarkly56 skills in this plugin
/agent-graphsCreate and manage agent graphs — directed graphs of configs connected by edges with handoff logic. Use when building multi-agent workflows where configs route to each other./aiconfig-agent-graphsDEPRECATED redirect — this skill was renamed to agent-graphs. Do not use this skill; invoke agent-graphs instead. Kept only so old references to aiconfig-agent-graphs still point users to the new name./aiconfig-ai-metricsDEPRECATED redirect — this skill was renamed to built-in-metrics. Do not use this skill; invoke built-in-metrics instead. Kept only so old references to aiconfig-ai-metrics still point users to the new name.Other plugins' skills for the same job