lens-sandbox: Skill for Claude Code

.claude/skills/red-first/SKILL.md

red-first is a skill for Claude Code from lensapp/lens-sandbox. It costs 155 tokens per session (1,786 once invoked), scanned A, original, Apache-2.0.

A test-first method for fixing bugs and changing behavior. It writes a test that shows the problem, confirms the expected failure, then makes the smallest code change that passes it.

In plain words
What is it for?
Use it to investigate confirmed bugs and behavior changes by following a claim → failing test → fix → verification loop, including checks for coverage, side effects, and realistic test fixtures.
Why use it?
It turns the reported defect into a clear, repeatable check and leaves a regression test behind. This helps prevent fixes that pass for the wrong reason or break related behavior.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions CLAUDE.md.

This is lensapp/lens-sandbox's own configuration. It tells Claude Code how to work on lens-sandbox 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 lens-sandbox configures →

Reuse

Borrowing it

Nothing to install: this file belongs to lensapp/lens-sandbox. 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/lensapp/lens-sandbox/main/.claude/skills/red-first/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/lensapp/lens-sandbox

Made for: Claude Code.

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 red-first

README.md
[![agentmods](https://agentmods.dev/badge/skills/lensapp/lens-sandbox/red-first/github.svg)](https://agentmods.dev/skills/lensapp/lens-sandbox/red-first)
Your own site
<a href="https://agentmods.dev/skills/lensapp/lens-sandbox/red-first"><img src="https://agentmods.dev/badge/skills/lensapp/lens-sandbox/red-first/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 red-first

Your own site · 80×15
<a href="https://agentmods.dev/skills/lensapp/lens-sandbox/red-first"><img src="https://agentmods.dev/badge/skills/lensapp/lens-sandbox/red-first.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 155 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,786 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00155 $0.01786
Opus 5 $0.00077 $0.00893
Sonnet 5 $0.00031 $0.00357
Haiku 4.5 $0.00015 $0.00179

Measured 9d ago against content hash b916b0cff5f5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

red-first scanned grade A with 0 findings 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 9d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/red-first/SKILL.md · 134 lines

How it starts

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

Red-First Fix Loop

Fix bugs by writing the failing test before the fix. The failure message is the specification; the test outliving the fix is the regression guard. Every loop below has the same shape: claim → red → green → gate → commit.

Arguments

/red-first <issue description> [suspected cause or proposed fix]

  • Issue description given: distill it into the one-sentence claim of loop step 1. If the description is a question ("is this finding real?"), first verify the finding against the code and report; enter the loop only once the defect is confirmed (or the user has asked for the fix).
  • A suspected cause or proposed fix given: treat it as a hypothesis, never as permission to skip steps. The red test still comes first, and it must fail for the claimed reason — if it doesn't, the hypothesis is wrong and that is worth reporting before any code changes. Prefer the user's proposed direction when it survives the red test, but say so explicitly when the evidence points elsewhere.
  • No arguments: take the issue from the conversation context; if there is none, ask for a description of the defect (what happens, what should happen, how to reproduce if known).

The core loop

  1. State the defect as one claim. One sentence: what the code does wrong, and what correct looks like. If you cannot write this sentence, you don't understand the bug yet — investigate first, fix second.
  2. Pick the lowest test layer that can express the claim. Follow the repository's own test-layer conventions (check CLAUDE.md or equivalent). Unit/behavioral layers are the default. Reach for end-to-end only under the conditions in "The optional end-to-end phase" below.
  3. Write the test. Write no production code yet. If the fix will create a new function or trait method, stub it to compile with wrong behavior (return the wrong value), so the failure is behavioral, not a compile error.
  4. Run the test and read the failure. It must fail, and it must fail for the stated reason. A test that fails differently has found a different problem — stop and examine before proceeding. A test that passes means the claim is wrong or the test is aimed at the wrong code.
  5. Write the smallest change that makes it green. Queue any larger redesign as its own loop with its own red test — don't fold it in.
  6. Run the repository's full verification gate, then commit. Small commits keep each loop reversible. Use the repo's commit conventions.

Read the full file on GitHub · 134 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. 9d ago First seen · 134 lines · 155 tokens per session scan A b916b0cff5f5

Subscribe to this mod's changes

red-first is a skill published in the GitHub repository lensapp/lens-sandbox (10 stars, last pushed yesterday), licensed Apache-2.0. It adds 155 tokens to every session and 1,786 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.