Agent skill
testing-assertions
Tests Phylax Credible Layer assertions with CredibleTest, fuzzing, and backtesting. Use when writing or reviewing assertion tests.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/testing-assertions-phylaxsystems-agent-skills
SKILL.md
Testing Assertions
Build confidence that assertions block invalid transactions and allow valid ones.
When to Use
- Writing unit, fuzz, or backtesting tests for assertions.
- Investigating false positives or gas-limit risks.
- Adding regression tests after protocol or assertion changes.
When NOT to Use
- You need help designing invariants or triggers. Use
designing-assertions. - You only need implementation details. Use
implementing-assertions. - You need a backtesting setup. Use
backtesting-assertions.
Quick Start
- Use
CredibleTestandcl.assertion(...)to register a single assertion function for the next transaction. cl.assertion(...)is consumed by the next external call and still requires a matching trigger.- Test both passing and failing paths with
vm.expectRevert. - Add batch helper contracts for multi-operation transactions.
- Consider property-based testing (Echidna) for state invariants.
- Run tests with
pcl test; it behaves likeforge test(same flags, fuzzing, verbosity), but may lag Forge versions. - Tests are Solidity functions starting with
test; convention istest/*.t.sol. - Use
FOUNDRY_PROFILE=assertions(or unit/fuzz/backtest profiles) for predictable config. - If proxy/delegatecall makes call inputs unreliable, add a log-based assertion variant and test both.
Core Test Patterns
- Positive path: expected to pass and keep state consistent.
- Negative path: expected to revert with the assertion message.
- Edge cases: zero supply, empty vaults, proxy upgrades, nested batches.
Gas Limit Checks
- Assertions are capped at 300k gas.
- The happy path is often the most expensive. Test with max sizes.
- Use
pcl test -vvvto inspect per-call gas usage.
Rationalizations to Reject
- "One passing test is enough." Assertions must also fail on violations.
- "Gas limits are a production problem." Exceeding 300k drops valid txs.
- "Fuzzing is optional." It finds edge cases that manual tests miss.
References
- Test Patterns
- PCL Test Parity
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?