---
name: test-before-ship-64f7ecddfe11
description: Use this skill when implementing a new feature or fixing a bug. Write or update tests before marking the task done. Never consider code complete without verifying it works through automated tests.
category: coding
---

# Test Before Ship

**Test pyramid:**
- Unit tests for pure functions and business logic (fast, many).
- Integration tests for service interactions and DB queries (medium).
- End-to-end tests for critical user journeys (slow, few).

**Test quality checklist:**
- Does the test actually fail when the code is broken?
- Does it cover the happy path AND the most likely error cases?
- Is the test name descriptive enough to diagnose a failure from the name alone?

**For bug fixes:** add a regression test that reproduces the bug before fixing it.

**Anti-patterns:**
- Tests that only test the mock, not the real behavior.
- Skipping tests because "it probably works".


---
Source attribution: aiming-lab
Original project: https://github.com/aiming-lab/MetaClaw
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2026 Gabriel Moreira

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: aiming-lab
Original project: https://github.com/aiming-lab/MetaClaw
Attribution basis: Upstream repository explicitly recorded in package mirror path

Fields of work: Development & Engineering
Roles: Backend Developer, Full-Stack Developer, QA / Test Engineer
Specialties: Cross Platform, Testing
Tools: Tool not specified
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 966b0574afeb87b0aa8139e247f5c5ae1be078e338945cdaa8ce16aa1209f35d
