assert
Assertion patterns reference — guard clauses, preconditions, invariants, and contract programming. Use when writing defensive code, validating inputs, or implementing design-by-contract.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/bytesagain3/assertAssert — Assertion Patterns Reference
Quick-reference skill for assertion techniques, design-by-contract, and defensive programming patterns.
When to Use
- Writing precondition checks for function inputs
- Implementing class invariants and postconditions
- Choosing between assertions and exceptions
- Applying design-by-contract methodology
- Understanding assertion behavior across languages
Commands
intro
scripts/script.sh intro
Overview of assertions — purpose, philosophy, and when to use them vs exceptions.
preconditions
scripts/script.sh preconditions
Precondition patterns: validating inputs, guard clauses, and fail-fast design.
postconditions
scripts/script.sh postconditions
Postcondition patterns: validating outputs and return value contracts.
invariants
scripts/script.sh invariants
Class and loop invariants — maintaining consistent state throughout execution.
languages
scripts/script.sh languages
Assertion syntax and behavior in Python, Java, C, JavaScript, Rust, Go.
contracts
scripts/script.sh contracts
Design-by-contract methodology — Bertrand Meyer's approach and modern implementations.
antipatterns
scripts/script.sh antipatterns
Common assertion mistakes: side effects, catching AssertionError, using in production flow.
strategies
scripts/script.sh strategies
Assertion strategies for different contexts: unit tests, production code, APIs, libraries.
help
scripts/script.sh help
version
scripts/script.sh version
Powered by BytesAgain | bytesagain.com | [email protected]
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-bytesagain3-assert": {
"enabled": true,
"auto_update": true
}
}
}Tags
Related Skills
human_test
Call real humans to test your product (URL or app). Get structured usability feedback with screen recordings, NPS scores, and AI-aggregated findings.
goldenseed
Deterministic entropy streams for reproducible testing and procedural generation. Perfect 50/50 statistical distribution with hash verification. Not cryptographically secure - use for testing, worldgen, and scenarios where reproducibility matters more than unpredictability.
api-contract-auditor
审查 API 文档、示例和字段定义是否一致,输出 breaking change 风险。;use for api, contract, audit workflows;do not use for 直接改线上接口, 替代契约测试平台.
undertow
Skill discovery engine for AI coding agents. Recommends and installs the right skill when you need it — code review, test generation, debugging, commit messages, PR preparation, security scanning, dependency audits, Docker setup, CI/CD pipelines, API documentation, refactoring, performance optimization, bundle analysis, git recovery, README generation, license compliance, migration guides, dead code removal, and secret detection. One install gives your agent access to a curated library of 20+ developer workflow skills. Use when the user asks for help with any development workflow, code quality, DevOps, security, testing, documentation, or project setup task.
regression-story-builder
基于历史问题生成回归测试故事集、风险等级和优先级。;use for regression, testing, qa workflows;do not use for 宣称已经执行测试, 跳过高风险路径.