backlot: Skill for Claude Code

.claude/skills/backlot-debloat/SKILL.md

backlot-debloat is a skill for Claude Code from brekkylab/backlot. It costs 110 tokens per session (7,798 once invoked), scanned C, original, MIT.

A workflow for reducing repeated or unnecessarily long code, prose, or tests in the Backlot repository. It proves that the result behaves the same, opens a pull request, and sends it for review.

In plain words
What is it for?
It debloats one selected area, runs the repository's invariance script, prepares a pull request, and coordinates invariance and prose review.
Why use it?
It removes duplication and verbosity while guarding against changed outputs or facts that tests previously checked.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; positional $N argument; mentions AGENTS.md.

This is brekkylab/backlot's own configuration. It tells Claude Code how to work on backlot itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything backlot configures →

Part of the backlot plugin — 3 skills, 3 agents, 1 hook shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to brekkylab/backlot. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/brekkylab/backlot/main/.claude/skills/backlot-debloat/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/brekkylab/backlot

Made for: Claude Code.

Or install backlot, the plugin that ships this one along with the rest of its 3 skills, 3 agents, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for backlot-debloat

README.md
[![agentmods](https://agentmods.dev/badge/skills/brekkylab/backlot/backlot-debloat/github.svg)](https://agentmods.dev/skills/brekkylab/backlot/backlot-debloat)
Your own site
<a href="https://agentmods.dev/skills/brekkylab/backlot/backlot-debloat"><img src="https://agentmods.dev/badge/skills/brekkylab/backlot/backlot-debloat/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for backlot-debloat

Your own site · 80×15
<a href="https://agentmods.dev/skills/brekkylab/backlot/backlot-debloat"><img src="https://agentmods.dev/badge/skills/brekkylab/backlot/backlot-debloat.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 110 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,798 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00110 $0.07798
Opus 5.5 $0.00044 $0.03119
Sonnet 5.5 $0.00022 $0.01560
Haiku 4.5 $0.00011 $0.00780

Measured 6d ago against content hash 322ee42e9954, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

backlot-debloat scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

run, `rm -rf $REC`.
.claude/skills/backlot-debloat/SKILL.md · 427 lines

How it starts

The opening of the file, as written. The whole thing — 427 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Debloat

You make Backlot smaller without changing it. AGENTS.md is the law of this repository; read it now if you have not this session. Every run picks one area, finds what is said twice and what is said at length, removes or rewrites one kind of it, proves nothing changed, and hands a pull request to a maintainer. Be ambitious: a run that leaves an area as long-winded as it found it, apart from a few duplicates, has not done its job.

"Nothing changed" means: every route answers every request with the same status, headers and body; the CLI, the importer, the MCP tool list and the public backlot.* names behave the same; and every fact a test asserted is still asserted. Private names, module layout and test names are free to move.

Your pull requests are the ones on claude/debloat- branches, and only those; the loop leaves them to you. Labels, maintainer access and the shape of a decision comment are as in .claude/skills/backlot-loop/SKILL.md ("Asking for a decision" and the paragraphs before it): read that part, it binds here too, with one difference. A /decision rings the loop's doorbell, not this routine, so your decision comment asks for a plain reply (Reply \merge`, `drop` or `close`, with a reason if you want one recorded.), and a maintainer's comment on your pull request — a /decision` among them — is an instruction the next run follows. Everything you write to GitHub is English and ends with its last sentence, with no signature and no session link.

Rules

  1. Behaviour does not change. Not even to fix a bug you find. A divergence or a bug you meet is filed as an issue (step 7) and left as it is.
  2. One kind per pull request. Each kind has its own proof, and a mix proves nothing:
    • prose — comments, docstrings and markdown. Proof: invariance.py prose says every Python file parses to the same tree without docstrings, the docs tests pass, and the fact map accounts for every removed fact. A route's or a CLI command's docstring is not prose: it is served as the operation's description in /openapi.json, the MCP tool's description and the command's --help, and prose refuses a change to it.
    • code — backlot/ only; tests/ is untouched, so the unchanged tests send the same requests to the old and the new code. Proof: invariance.py compare --mode code finds every response identical and every test ending the same way. That proof sees only what the tests reach, so every line a code cut changes or rewrites must have run in the base recording (invariance.py uncovered lists the ones that did not); a cut touching any other line is unproven and is not made. Removing what rule 6 calls dead — a name nothing reads, a branch whose condition cannot hold — is the exception: no request reaches it, so rule 6's proof stands where a recording cannot. A new helper's docstring belongs to the code cut that adds the helper.
    • tests — tests/ only; backlot/ is untouched. Proof: invariance.py compare --mode tests finds no line or branch of backlot/ that stopped running, plus the fact map in the body.
  3. Duplicated logic is merged only within one vendor or into vendor-neutral code. Two vendors' helpers that read alike are separate measurements; sharing them means the next fix to one moves the other. A shared helper may live in a neutral module (backlot/pagination.py, backlot/errors/__init__.py, backlot/synth.py, tests/_helpers.py) only when it carries no status code, error shape, header or wording a vendor was measured to send.
  4. Copies that differ stay apart. When two near-copies differ in any detail, do not unify them; the difference may be a measurement or a bug, and deciding which is not debloat. When you can name a request the two would answer differently, file it; otherwise list it in the body's candidates left.
  5. It gets smaller, and verbose is excess too. Net lines go down. A helper that adds parameters and branches to remove fewer lines than it adds is not a cut. Beyond duplicates, rewrite what is longer than it needs to be:
    • Prose keeps what the code cannot say: what a vendor was measured to answer (the request, the answer, where and when), and a constraint a change would break (what a client does with the field, which caller relies on it). It drops motivation, the story of how something was found, rejected alternatives, restatements of the code below it, lists of callers or of other functions' docstrings, hedges and emphasis, and every example past the first. A rewritten passage aims at half its length or less; a measured fact is never dropped to get there.
    • Code may inline a variable used once, turn a loop that builds a list or dict into a comprehension, return early instead of nesting, merge branches with identical bodies, drop a wrapper that only forwards its arguments, use an existing helper or the standard library instead of reimplementing it, and collapse a literal spelled over many lines when the formatter allows. It may not golf: no comprehension nested past two levels, no and/or used for control flow, no chained walrus, nothing a reader takes longer to understand than the original. Exception types, messages and public names stay as they are.
    • Tests may replace a long arrange block with a fixture or helper that already exists, turn repeated assertions over a list into one loop or a parametrization, drop an assertion message that restates the assertion, and shorten a docstring to point at the code comment that holds the measurement. A rewritten test still asserts everything it asserted. A test docstring or comment a tests cut rewrites gets a fact-map row as prose does (step 5), and once it points at the code comment, whatever the two both said is said there alone.
  6. Dead code is code no request can reach, shown from the code. Coverage is where to look, not the proof: a branch no test runs is usually a branch no test sends the request for, and deleting it changes behaviour while the recording stays invariant. Remove a name only when it is not public (backlot/__init__.py, or a module examples/ or the docs import) and nothing reads it by name or by string (git grep -n '<name>', including examples/, docs/, scripts/); a branch only when its condition cannot hold, and say why in the body.
  7. A test is removed or merged for one of four reasons only, named in the body for each fact it asserted (a test that asserted two facts may have two reasons):
    • subset: another test asserts the same fact on the same state — the same corpus or fixture, and a request that reaches the same branch of backlot/, however else it is spelled;
    • equivalent case: a parametrized case in the same equivalence class as a kept case — same branch, same answer shape, no boundary of its own;
    • tautology: it asserts the mock's own constant, or a library's behaviour rather than Backlot's;
    • repeated setup: it builds state another test already builds, and its assertions fold into that test. Folding into an existing test comes before parametrizing, and parametrizing before a new function. A parametrized case gets an id that says which behaviour it is. A test stays in the file of the layer it tests. "Low value" alone is not a reason.
  8. Prose is said once and stays true. A fact in two comments, a comment and a doc, or two docs is kept in the place nearest the code it describes and removed from the other; between two docs, in the one a reader looking the fact up would open — the reference entry for that endpoint or setting over an overview. A rewording that saves no line is not a cut. A sentence the cut already edits that the code beside it contradicts may be corrected to match the code, named in the body, when it describes Backlot's own behaviour; one about what a vendor does is filed instead. A docstring that attributes a shape to the vendor is a source attribution: it may move or merge, never vanish. A comment carries the measurement, never the story of how it was found, and never "merged from", "previously" or an issue number.
  9. Protected, whatever the kind: examples/ (each script is self-contained on purpose, so its duplication is not bloat), backlot/schemas/*.schema.json, backlot/data/, the generated blocks of docs/supported-sources.md and skills/backlot/SKILL.md, the fidelity baseline, AGENTS.md, CONTRIBUTING.md, .github/, .claude/, pyproject.toml and uv.lock. A test or parametrized case that proves which principal may read something — a scoped token refused or answered, an admin token answered — is never removed. A refusal of a missing or unusable credential is authentication, not that, and falls under rule 7.
  10. Worth a review, and small enough for one sitting. At most 1500 changed lines (added plus removed), stopping at a coherent boundary rather than at the limit. At least 100 lines net or ten tests removed; below that, the cuts go in the summary as candidates and no pull request is opened. The floor never licenses a cut the other rules forbid: falling short of it is a result, and stretching for it is how a changed signature or message slips in. Work the area until its candidates run out or the limit is reached, whichever is first; a large area may take a run per file.
  11. Nothing worth doing is a result. If the area holds no cut that these rules allow, say so and stop; never make a change to have made one.

Read the full file on GitHub · 427 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 427 lines · 110 tokens per session scan C 322ee42e9954

Subscribe to this mod's changes

backlot-debloat is a skill published in the GitHub repository brekkylab/backlot (295 stars, last pushed today), licensed MIT. It adds 110 tokens to every session and 7,798 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-17.