Apply test-first discipline for behavior changes and bugfixes: define expected behavior, add or run a failing test, then implement minimally. Use when fixing bugs, changing logic, or adding features that need regression protection.
Scanned 5/27/2026
Install via CLI
openskills install charlieviettq/awesome-agent-skill---
name: test-first-development
description: "Apply test-first discipline for behavior changes and bugfixes: define expected behavior, add or run a failing test, then implement minimally. Use when fixing bugs, changing logic, or adding features that need regression protection."
allowed-tools: Read, Glob, Grep
---
# Test-first development
## When to use (default)
- Bug fixes with reproducible symptoms.
- Behavior changes in production code.
- Refactors where regression risk is non-trivial.
## When to relax (document why)
- Throwaway prototypes.
- Generated code with separate validation.
- Pure config or documentation-only changes.
## Workflow (RED-GREEN-REFACTOR)
1. **Define** expected behavior in one sentence.
2. **RED:** Add or identify a test that fails for the right reason (missing behavior, not typo). Run it and confirm failure.
3. **GREEN:** Minimal code to pass. Run the same test and confirm pass.
4. **REFACTOR:** Only after green; keep tests passing.
5. **Verify:** Run targeted tests, then broader suite if scope warrants.
For bugfixes: if production code was written before the failing test, treat as process violation—add the test, confirm fail, then fix.
## Good tests
- One behavior per test; name describes behavior.
- Prefer testing real code paths over heavy mocking.
- For bugs: test reproduces the reported symptom.
## Checklist before done
- [ ] New or updated test exists for the change
- [ ] Saw the test fail before the fix (bugfixes)
- [ ] Targeted tests pass
- [ ] No unrelated test failures introduced
## Testing anti-patterns
- Implement first, add tests only at the end for logic changes.
- Tests that pass immediately without proving anything.
- Vague test names (`test1`, `test_fix`).
- Heavy mocking that does not assert real behavior.
- Test-only methods or flags added to production code solely to make tests pass.
- Incomplete mocks that hide integration failures.
## Related
`systematic-debugging`, `test-failure-triage`, `verify-before-done`
*TDD discipline inspired by [obra/superpowers](https://github.com/obra/superpowers) (MIT).*
No comments yet. Be the first to comment!
Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.
SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.
Python backend development expertise for FastAPI, security patterns, database operations, Upstash integrations, and code quality. Use when: (1) Building REST APIs with FastAPI, (2) Implementing JWT/OAuth2 authentication, (3) Setting up SQLAlchemy/async databases, (4) Integrating Redis/Upstash caching, (5) Refactoring AI-generated Python code (deslopification), (6) Designing API patterns, or (7) Optimizing backend performance.
Drive the full internationalization journey for a project — detect the stack, recommend a library, set up the chosen library, wrap existing strings, and optionally connect a translation platform. Use when the user asks to add or configure i18n, internationalization, localization, multi-language support, or translations — including when they explicitly mention LinguiJS, Lingui, next-intl, "wrap strings", "find hardcoded text", "make my app translatable", or "set up translations". Triggers on g...
PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.