Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/rohitg00/skillkit/red-green-refactornpx skills add rohitg00/skillkit --skill red-green-refactorgit clone --depth 1 https://github.com/rohitg00/skillkitWrote 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/rohitg00/skillkit/red-green-refactor)<a href="https://agentmods.dev/skills/rohitg00/skillkit/red-green-refactor"><img src="https://agentmods.dev/badge/skills/rohitg00/skillkit/red-green-refactor.svg" alt="Measured on agentmods" 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 | $0.00090 | $0.01319 |
| Opus 5 | $0.00045 | $0.00660 |
| Sonnet 5 | $0.00018 | $0.00264 |
| Haiku 4.5 | $0.00009 | $0.00132 |
Grade A, and why
red-green-refactor 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 4d 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 — 169 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Red-Green-Refactor Methodology
You are following the RED-GREEN-REFACTOR cycle for test-driven development. Every new feature, bug fix, or behavior change starts with a failing test.
The Cycle
1. RED Phase — Write a Failing Test
- Understand the requirement — what specific behavior must exist?
- Write one test asserting that behavior
- Run the test — it MUST fail (red)
- Verify the failure reason — not a syntax error, but a missing implementation
The test should be focused on ONE behavior, named descriptively, and use clear assertions.
Executable example (Jest):
// calculateTotal.test.js
const { calculateTotal } = require('./calculateTotal');
describe('calculateTotal', () => {
it('should apply 10% discount when total exceeds 100', () => {
const items = [{ price: 60 }, { price: 60 }]; // total = 120
expect(calculateTotal(items)).toBe(108); // 120 * 0.90
});
});
Running this now produces: Cannot find module './calculateTotal' — correct RED state.
2. GREEN Phase — Make the Test Pass
Write the minimum code needed to pass the test. Don't add anything extra.
// calculateTotal.js
function calculateTotal(items) {
const total = items.reduce((sum, item) => sum + item.price, 0);
return total > 100 ? total * 0.9 : total;
}
module.exports = { calculateTotal };
Run the test — it passes. GREEN achieved. Stop here; resist adding more logic.
3. REFACTOR Phase — Improve the Code
With a passing test as your safety net, clean up the implementation. Run tests after every change.
// calculateTotal.js — refactored for clarity
const DISCOUNT_THRESHOLD = 100;
const DISCOUNT_RATE = 0.9;
function calculateTotal(items) {
const subtotal = items.reduce((sum, { price }) => sum + price, 0);
return subtotal > DISCOUNT_THRESHOLD ? subtotal * DISCOUNT_RATE : subtotal;
}
module.exports = { calculateTotal };
Test still passes — GREEN maintained. Constants now communicate intent.
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.
- 4d ago First seen · 169 lines · 90 tokens per session scan A a20e71fb1428
red-green-refactor is a skill published in the GitHub repository rohitg00/skillkit (1,480 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 90 tokens to every session and 1,319 once invoked, about $0.0005 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-30.
Other skills, from other repositories
tdd
Use this skill to practice test-driven development — writing tests before implementation, using tests to drive design, and validating implementation against pre-written tests. Activates when implementing new functionality, refactoring code, or fixing bugs where regression coverage is needed.
regression-test
Classify an iOS/Swift bug into its Apple-specific root-cause class (force unwrap, try!, fatalError, MainActor isolation, App Group mismatch, lifecycle) and sweep for sibling instances of that class. Complements a generic TDD/debugging skill (e.g. superpowers:test-driven-development, superpowers:systematic-debugging)…
workflow-patterns
Systematic task implementation using TDD, phase checkpoints, and structured commits. Ensures quality through red-green-refactor cycles, 80% coverage gates, and verification protocols before proceeding.
test-driven-development
TDD: enforce RED-GREEN-REFACTOR, tests before code.
superpowers-zh
Use when constraining AI coding with Chinese TDD methodology, systematic debugging, code review, and verification workflows. Superpowers-zh: Chinese adaptation of the Superpowers AI-assisted programming skills and methodologies.
drill-tdd
Use when implementing any feature or bugfix — enforces the Red-Green-Refactor drill with no production code allowed without a failing test first.