testing-commands
OfficialMaster CLI testing with unit and E2E patterns
Authoropenkaiden
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This skill provides comprehensive testing patterns for CLI commands, including unit tests for preRun validation and end-to-end tests for full command execution.
Core Features & Use Cases
- Unit Tests: Validate the preRun method directly to ensure argument and flag handling logic is correct.
- E2E Tests: Verify the full command flow, Cobra wiring, and persistence of results in an end-to-end scenario.
- Patterns & Best Practices: Demonstrates how to structure tests with t.Run subtests, temporary directories, and output capture for robust validation.
Quick Start
Create a unit test for preRun and an end-to-end test for full command execution to validate your CLI robustly.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: testing-commands Download link: https://github.com/openkaiden/kdn/archive/main.zip#testing-commands Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 510,000+ vetted skills library on demand.