Add Assertion
Testing & Qualityadd-assertionAdd Assertion is an Agent Skill for testing & quality published in the TypedDevs/bashunit repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Add new assertion function with comprehensive tests following TDD
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/TypedDevs/bashunit/blob/HEAD/.claude/skills/add-assertion/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/add-assertion, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Add Assertion Skill
Add a new assertion function to bashunit following strict TDD methodology.
Prerequisites
- Task file must exist — create
.tasks/YYYY-MM-DD-add-assertion-name.md - Study patterns — read
tests/unit/assert_test.shandsrc/assertions.sh
Workflow
1. Plan
Ask user: assertion name, parameters, success/failure behavior, error messages.
Document acceptance criteria and test inventory in task file.
2. Study Existing Patterns
Read src/assertions.sh and tests/unit/assert_test.sh to understand:
- Parameter validation, assertion logic, error message format
- Return codes (0 = success, 1 = failure)
- How tests verify both success and failure cases
3. TDD Cycles
For each test in inventory, follow RED -> GREEN -> REFACTOR:
- Basic success case — assertion passes with valid input
- Failure case — assertion fails correctly, use
assert_fails - Edge cases — empty input, special characters, nested structures, malformed data
4. Integration
- Source new file in
src/bashunit.shif created export -fthe assertion function- Run full test suite:
./bashunit tests/ - Quality checks:
make sa && make lint && shfmt -w .
5. Documentation
- Add function header with Arguments/Returns/Example
- Update CHANGELOG.md
- Update user-facing docs if applicable
Final Checklist
- All tests passing (success, failure, edge cases)
- Function documented and exported
- Quality gate passes
- CHANGELOG updated
- Task file completed