tdd
Test-Driven Development
Philosophy
Core principle: Tests should verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't.
Good tests are integration-style: they exercise real code paths through public APIs. They describe what the system does, not how it does it. A good test reads like a specification - "user can checkout with valid cart" tells you exactly what capability exists. These tests survive refactors because they don't care about internal structure.
Bad tests are coupled to implementation. They mock internal collaborators, test private methods, or verify through external means (like querying a database directly instead of using the interface). The warning sign: your test breaks when you refactor, but behavior hasn't changed. If you rename an internal function and tests fail, those tests were testing implementation, not behavior.
See tests.md for examples and mocking.md for mocking guidelines.
Anti-Pattern: Horizontal Slices
DO NOT write all tests first, then all implementation. This is "horizontal slicing" - treating RED as "write all tests" and GREEN as "write all code."
This produces crap tests:
- Tests written in bulk test imagined behavior, not actual behavior
More from costicapuntaru/agentica
opsx-apply-subagents
Orchestrates dependency-aware parallel subagents for OpenSpec workflows, supporting OPSX commands, legacy openspec commands, and Codex CLI prompt aliases. Use when running /opsx:apply, /openspec:apply, or any opsx command with multiple independent tasks that can be parallelized.
15write-a-prd
Create a PRD through user interview, codebase exploration, and module design, then submit as a GitHub issue. Use when user wants to write a PRD, create a product requirements document, or plan a new feature.
9epic-workflow
End-to-end Epic planning — grill requirements, write a PRD, decompose into GitHub issues with dependencies, and create a feature branch for autonomous implementation. Use when starting a new epic, planning a large feature, or when user says "epic workflow", "plan this feature", or "start a new epic".
8openspec-bugfix
Start a new bugfix using the OpenSpec artifact workflow. Use when the user describes a bug, defect, or unexpected behavior and wants to fix it using a structured approach.
8github-auto-implement
Autonomous GitHub issue implementation — picks the next ready issue, triages it, implements with TDD, and opens a PR targeting the correct branch (default, epic feature branch, or PR-chained dependency branch). Use when running the autobot daemon, implementing GitHub issues autonomously, or starting the auto-implement loop.
8grill-me
Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
7