redgreen skill
Use when implementing any feature or bugfix, before writing implementation code
- GitHub stars
- 13
- Files
- 2
- Last commit
- Jun 23, 2026
- License
- MIT
- Allowed tools
- —
What does the redgreen skill do?
redgreen uses when implementing any feature or bugfix, before writing implementation code.
How to install the redgreen skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the redgreen skill in Plugin
/plugin marketplace add devnomad-byte/techneering /plugin install tn@techneering
Install the redgreen skill in Claude Code
~/.claude/skills/redgreen/SKILL.md
$ npx degit devnomad-byte/techneering/skills/redgreen ~/.claude/skills/redgreenInstall the redgreen skill in Claude Code (project)
.claude/skills/redgreen/SKILL.md
$ npx degit devnomad-byte/techneering/skills/redgreen .claude/skills/redgreenInstall the redgreen skill in Codex
~/.agents/skills/redgreen/SKILL.md
$ npx degit devnomad-byte/techneering/skills/redgreen ~/.agents/skills/redgreenInstall the redgreen skill in Gemini CLI
~/.gemini/skills/redgreen/SKILL.md
$ npx degit devnomad-byte/techneering/skills/redgreen ~/.gemini/skills/redgreenInstall the redgreen skill in Claude.ai
npx degit devnomad-byte/techneering/skills/redgreen redgreen && zip -r redgreen.zip redgreen # claude.ai → Customize → Skills → + → Create skill → Upload a skill → redgreen.zip
SKILL.md
View on GitHubTest-Driven Development (TDD)
Core Principle
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST.
If you didn't watch the test fail, you don't know if it tests the right thing.
Violating the letter of the rules is violating the spirit of the rules.
The Iron Law
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
Write code before the test? Delete it. Start over.
Red-Green-Refactor
digraph tdd_cycle {
rankdir=LR;
red [label="RED\nWrite failing test", shape=box];
verify_red [label="Verify fails\ncorrectly", shape=diamond];
green [label="GREEN\nMinimal code", shape=box];
verify_green [label="Verify passes\nAll green", shape=diamond];
refactor [label="REFACTOR\nClean up", shape=box];
next [label="Next", shape=ellipse];
red -> verify_red;
verify_red -> green [label="yes"];
verify_red -> red [label="wrong failure"];
green -> verify_green;
verify_green -> refactor [label="yes"];
verify_green -> green [label="no"];
refactor -> verify_green [label="stay green"];
verify_green -> next;
next -> red;
}
RED - Write Failing Test
Write one minimal test showing what should happen.
- One behavior
- Clear name
- Real code (no mocks unless unavoidable)
Verify RED - Watch It Fail
MANDATORY. Never skip.
Confirm: Test fails (not errors), failure message is expected, fails because feature missing.
GREEN - Minimal Code
Write simplest code to pass the test. Don't add features, refactor other code, or "improve" beyond the test.
Verify GREEN - Watch It Pass
MANDATORY. Confirm test passes, other tests still pass, output pristine.
REFACTOR - Clean Up
After green only: Remove duplication, improve names, extract helpers. Keep tests green.
Testing Anti-Patterns
Read testing-anti-patterns.md in this directory for detailed guidance on:
- Testing mock behavior instead of real behavior
- Adding test-only methods to production classes
- Mocking without understanding dependencies
Common Rationalizations
| Excuse | Reality |
|---|---|
| "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
| "I'll test after" | Tests passing immediately prove nothing. |
| "Deleting X hours is wasteful" | Sunk cost fallacy. Keeping unverified code is technical debt. |
| "TDD will slow me down" | TDD faster than debugging. |
Red Flags - STOP and Start Over
- Code before test
- Test passes immediately
- Can't explain why test failed
- Rationalizing "just this once"
Quick Reference
| Dimension | Key point |
|---|---|
| Cycle | RED → Verify RED → GREEN → Verify GREEN → REFACTOR |
| Red phase | One behavior, one test, watch it fail first |
| Green phase | Minimal code to pass, no extra features |
| Refactor | Only after GREEN, keep tests green |
| Forbidden | Code before test / skip Verify / "just this once" |
Verification Checklist
Before marking work complete:
- Every new function/method has a test
- Watched each test fail before implementing
- Wrote minimal code to pass each test
- All tests pass
- Output pristine (no errors, warnings)
- Tests use real code (mocks only if unavoidable)
Can't check all boxes? You skipped TDD. Start over.
Next Step
When done:
- Normal case → return to caller (usually
tn:assembleortn:diagnose) - Tests still failing after 3 RED→GREEN attempts on the same behavior → invoke
tn:diagnosefor systematic root-cause investigation (matchestn:diagnose's 3-attempt limit — do not keep guessing past 3) - User requests stop → end the current flow
Guardrails
- No production code without a failing test first — delete and start over if violated
- Verify RED is MANDATORY — never skip watching the test fail
- Verify GREEN is MANDATORY — never skip watching the test pass
- Violating the letter of the rules is violating the spirit of the rules
- Use real code in tests — mocks only when unavoidable
- Read
testing-anti-patterns.mdfor detailed anti-pattern guidance
Files in this skill
2redgreen skill questions
How do I install the redgreen skill in Claude Code?
Run npx degit devnomad-byte/techneering/skills/redgreen ~/.claude/skills/redgreen. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the redgreen skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.