writing-tests
/writing-tests
Generic test writing discipline: test quality, real assertions, anti-patterns, and rationalization resistance. Use when writing tests, adding test coverage, or fixing failing tests for any language or framework. Complements language-specific skills.
- Author
- iliaal ↗
- Repository
- ai-skills ↗
- Licence
- MIT
- Last repository change
- 25.10.2026
Assessment and security
- Files in this package
- 12
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 25.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Generic test writing discipline: test quality, real assertions, anti-patterns, and rationalization resistance. Use when writing tests, adding test coverage, or fixing failing tests for any language or framework. Complements language-specific skills.
Original author description
Generic test writing discipline: test quality, real assertions, anti-patterns, and rationalization resistance. Use when writing tests, adding test coverage, or fixing failing tests for any language or framework. Complements language-specific skills.
How it works
- Procedure
- Select the detail needed
- Verify and report
SKILL.md preview
--- name: writing-tests class: discipline description: >- Generic test writing discipline: test quality, real assertions, anti-patterns, and rationalization resistance. Use when writing tests, adding test coverage, or fixing failing tests for any language or framework. Complements language-specific skills. --- # Writing tests Produce tests that prove the requested behavior and fail when that behavior breaks. Follow user scope and the repository's actual contracts; this skill does not authorize implementation, external actions, or changes to acceptance criteria. ## Procedure 1. Discover the repository's runner, pinned wrapper, configuration, neighboring tests, and CI command before writing tests. Learn both focused and full-suite commands. Use project tooling rather than a global default; keep tracked scripts portable and apply personal wrappers only to the outer invocation. 2. Derive cases from user requirements, implemented behavior, and claims intended for the handoff. Map each acceptance criterion to a discriminating case that a plausible wrong implementation fails. Name tests by observable behavior; keep one behavior per test and make fixtures adversarial on the axis under test. 3. For bug fixes with a reachable test seam, write the reproducer, observe the intended failure, apply the smallest fix, and observe green. If the actual trigger cannot be reached, follow the missing-seam rules in [test-completion.md](./references/test-completion.md). For new features, follow the selected test posture in vertical slices: default to tests-after (one small implementation slice, then its test); with an explicit test-first choice, write one test, then the minimal implementation that passes it. Repeat by slice; writing all tests first and all implementation afterward (horizontal slicing) is an anti-pattern that produces tests for imagined behavior. Refactor after green. Never alter a specification, assertion, fixture, snapshot, or expected output merely to make the implementation pass. 4. Prefer real internal objects, real temporary files, and real test databases. Mock only external boundaries, at the last owned adapter; framework-maintained fakes are appropriate where the framework recommends them. Check the real contract and side effects before mocking. 5. Assert consumer-visible outcomes rather than private structure, mock calls, or framework behavior. Include relevant boundary, invalid-input, concurrency, and failure cases. If error handling catches, logs, substitutes, or rolls back, assert its observable result as well as error visibility. 6. Prove absence/isolation assertions with a run-unique forbidden violation and observe that specific assertion fail. Confirm the control mutation actually landed and its build completed before evaluating it. Remove the control, restore the artifact, and verify green. 7. Run the narrow checks during edits and the applicable complete checks before handoff. Inspect passed/executed counts; an empty or skipped suite is not positive evidence. ## Select the detail needed - When choosing cases, fixture shape, mock boundaries, or unit/integration/E2E balance, read [test-design.md](./references/test-design.md). - For bug reproducers, mutation controls, or assertions that something must not happen, read [regression-proof.md](./references/regression-proof.md). - When reviewing generated tests, changing snapshots, testing async timing, or seeing mocks substitute for behavior, read [test-smells.md](./references/test-smells.md) and the applicable fix ladder in [anti-patterns-extended.md](./references/anti-patterns-extended.md). To audit whether existing tests detect regressions, use ia-test-audit. - For weak aggregates, vacuous assertions, race reproduction, or controls that may never reach their subject, read [oracle-smells.md](./references/oracle-smells.md). It routes to the longer catalogs when those failure shapes apply. - For container state, sandboxing, timeouts, environment relocation, or process/stream isolation, read [isolation-and-sandbox-traps.md](./references/isolation-and-sandbox-traps.md). - For wrappers, filters, conformance oracles, skip conditions, or misleading green summaries, read [false-pass-oracle-traps.md](./references/false-pass-oracle-traps.md). - When byte equivalence or a generated corpus is the contract, read [generated-corpus-techniques.md](./references/generated-corpus-techniques.md); compare against an independent implementation across value shapes and nesting. - When stuck, considering skipping tests, or assembling a test-work handoff, read [test-completion.md](./references/test-completion.md). Before arguing against a needed test, read [rationalization-table.md](./references/rationalization-table.md). ## Verify and report Verify public behavior and edge paths, independence between tests, reviewed expectation changes, and each claimed capability. Mentally remove a guard, flip a branch, or drop a side effect and confirm a test detects it. Prefer a unit suite fast enough for frequent use (under 30 seconds). Report what the tests exercised, actual results, failures, and omissions. Distinguish fixtures from live proof. Use the applicable PHP/Laravel or React/TypeScript skill for framework conventions; this generic skill does not replace them.
Files in this package (12)
- SKILL.md 5 KB
- SPEC.md 4 KB
- references/anti-patterns-extended.md 3 KB
- references/false-pass-oracle-traps.md 9 KB
- references/generated-corpus-techniques.md 2 KB
- references/isolation-and-sandbox-traps.md 6 KB
- references/oracle-smells.md 10 KB
- references/rationalization-table.md 2 KB
- references/regression-proof.md 3 KB
- references/test-completion.md 4 KB
- references/test-design.md 12 KB
- references/test-smells.md 8 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · iliaal/ai-skills | 90 | MIT |
| alexandermattturner/agent-sanitizer | 100 | Apache-2.0 |
| andymai/brepjs | 100 | Apache-2.0 |
| hotovo/aider-desk | 100 | Apache-2.0 |
| jungvonmatt/agent-toolkit | 100 | MIT |
| it-bens/ai-tools | 100 | MIT |
| caarlos0/dotfiles | 100 | MIT |
| tosun-si/bigtesty | 100 | MIT |
| mcp-use/mcp-use | 100 | MIT |
Database snapshot: 13.11.2026 · package version 10f2a8d5c022 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 85implementer-tdd-and-quality
Use when writing tests, running tests, hitting a quality gate, or before reporting a task done. Loads project-specific test and quality discipline that complements superpowers:test-driven-development. - 100testing-strategies
Testing pyramid, AAA structure, test doubles, fixtures, assertions and coverage targets, in any language. Use when writing, reviewing or setting up tests. Do not use for the write-test-first loop — that is test-driven-development. - 100test-quality-analysis
Analyze test code quality to detect coverage-only tests, test smells, and low-value assertions. Use when asked to \"analyze test quality\", \"find coverage-only tests\", \"audit our tests\", \"are these tests valuable\", \"find test smells\", or \"which tests should we delete\".… - 95testing-principles
This skill provides language-agnostic testing principles including TDD, test quality, coverage standards, and test design patterns. Automatically loaded when writing tests, designing test strategies, reviewing test quality, or when the user mentions "TDD", "test coverage", "unit… - 100am-agent-test-engineer
QA engineer specialized in test strategy, test writing, and coverage analysis. Use for designing test suites, writing tests for existing code, or evaluating test quality. - 100awesome-test-writing
Designs and writes tests that catch real regressions: unit, integration or E2E placement, fixtures, behavior-first assertions, characterization and property tests. Use when asked to write tests, add coverage or a regression test.