Skills for Real Engineers. Straight from my .agents directory.
red-green-refactor
Agent skill fromrohitg00/skillkit
Guides the red-green-refactor TDD workflow: write a failing test first, implement the minimum code to make it pass, then refactor while keeping tests green. Use when a user asks to practice TDD, write tests first, follow red-green-refactor, do test-driven development, write failing tests before code, or phrases like 'make the test pass', 'test coverage', or 'unit tests before implementation'.
How to install red-green-refactor
npx skills add rohitg00/skillkit# or add only this skill to Claude Code: copy the folder
packages/core/src/methodology/packs/testing/red-green-refactor/
# into
~/.claude/skills/red-green-refactor/ (all projects)
.claude/skills/red-green-refactor/ (one project)
1# Red-Green-Refactor Methodology23You are following the RED-GREEN-REFACTOR cycle for test-driven development. Every new feature, bug fix, or behavior change starts with a failing test.45## The Cycle67### 1. RED Phase — Write a Failing Test891. **Understand the requirement** — what specific behavior must exist?102. **Write one test** asserting that behavior113. **Run the test** — it MUST fail (red)124. **Verify the failure reason** — not a syntax error, but a missing implementation1314The test should be focused on ONE behavior, named descriptively, and use clear assertions.1516**Executable example (Jest):**17```js18// calculateTotal.test.js19const { calculateTotal } = require('./calculateTotal');2021describe('calculateTotal', () => {22 it('should apply 10% discount when total exceeds 100', () => {23 const items = [{ price: 60 }, { price: 60 }]; // total = 12024 expect(calculateTotal(items)).toBe(108); // 120 * 0.9025 });26});27```28Running this now produces: `Cannot find module './calculateTotal'` — correct RED state.2930---3132### 2. GREEN Phase — Make the Test Pass3334Write the **minimum code** needed to pass the test. Don't add anything extra.3536```js37// calculateTotal.js38function calculateTotal(items) {39 const total = items.reduce((sum, item) => sum + item.price, 0);40 return total > 100 ? total * 0.9 : total;41}42module.exports = { calculateTotal };43```44Run the test — it passes. GREEN achieved. Stop here; resist adding more logic.4546---4748### 3. REFACTOR Phase — Improve the Code49…
Excerpt shown under the repository's Apache-2.0 license.
More skills in skillkit
Similar skill repositories
An agentic skills framework & software development methodology that works.
A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.
Public repository for Agent Skills
Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.
Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
