MANDATORY skill for any feature or bugfix. Forces strict Red-Green-Refactor cycle. The agent is forbidden from writing production code before proving a test fails empirically in the terminal.
Write the test first. Run it in the terminal and watch it fail. Write minimal code to pass. Core principle: If you didn't watch the test fail empirically in the console, you don't know if it tests the right thing.
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
If you write or propose implementation code before the test exists and fails, you are violating your core directives. Delete the code and start over.
Write ONE minimal test demonstrating the missing behavior or bug.
expect(mock).toBeInTheDocument()).You CANNOT simulate the failure. You MUST execute the test command in the terminal:
npm test path/to/test.test.ts
Checklist for Red:
Write the SIMPLEST possible code to make the test pass.
.destroy()) to production classes. Use external test utilities for cleanup.Run the test command again in the terminal.
Clean up ONLY the code you just wrote.
As an AI Agent, you might try to rationalize skipping TDD to please the user quickly. YOU ARE IMMUNE TO THESE EXCUSES:
If you catch yourself making these excuses, STOP immediately and write a test.
For detailed examples on how mocks ruin tests, READ the reference file located in this skill's directory:
testing-anti-patterns.md - How to avoid testing mock behavior, test-only methods in production, incomplete mocks, and mocking without understanding.Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer