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.
curl -O https://raw.githubusercontent.com/lensapp/lens-sandbox/main/.claude/skills/red-first/SKILL.mdgit clone --depth 1 https://github.com/lensapp/lens-sandboxWrote 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.
[](https://agentmods.dev/skills/lensapp/lens-sandbox/red-first)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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
- 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.
- 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.
- 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.
- 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.
- 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.
- Run the repository's full verification gate, then commit. Small commits keep each loop reversible. Use the repo's commit conventions.
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.
- 9d ago First seen · 134 lines · 155 tokens per session scan A b916b0cff5f5
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.
Other skills, from other repositories
engram-testing-coverage
TDD and coverage standards for Engram. Trigger: When implementing behavior changes in any package.
iterative-development
TDD iteration loops using Claude Code Stop hooks - runs tests after each response, feeds failures back automatically.
python
Python development with ruff, mypy, pytest - TDD and type safety.
nw-fp-clojure
Clojure language-specific patterns, data-first modeling, REPL-driven development, and spec.
strict-tdd
Strict RED->GREEN->REFACTOR test-driven development with enforcement. Never write production code before a failing test. Atomic commits per TDD cycle.
mobiai-mobile-tdd
You MUST use this before writing any implementation code for a mobile feature, bug fix, refactor, or behavior change. Tests come before implementation — no exceptions.