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.
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.
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.
double-check
在修改任何文件后(包括删除功能),自动进行两次独立验证(测试/编译/运行检查/文档或配置检查),确保无误才结束。本技能应默认应用于所有文件修改任务。 / After any file changes (including feature removal), automatically perform two independent verifications (tests/compilation/runtime checks/docs or config checks) to ensure correctness. This skill should be applied by default to any file modification task.
api-contract-auditor
审查 API 文档、示例和字段定义是否一致,输出 breaking change 风险。;use for api, contract, audit workflows;do not use for 直接改线上接口, 替代契约测试平台.