Agent skill
assertion-troubleshooting
Diagnoses common assertion failures and non-triggering issues. Use when assertions fail unexpectedly or do not execute.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/assertion-troubleshooting
SKILL.md
Assertion Troubleshooting
Use this when assertions fail unexpectedly, revert with OutOfGas, or never execute.
When to Use
- Tests show "Expected 1 assertion to be executed, but 0 were executed".
- Assertions revert with
OutOfGasor unknown reasons. - Call inputs appear empty or duplicate.
When NOT to Use
- You need invariant design. Use
designing-assertions. - You need implementation details. Use
implementing-assertions. - You need test strategy or fuzzing. Use
testing-assertions.
Quick Start
- Confirm trigger selector matches the target function.
- Ensure
cl.assertion()is immediately before the target call. - Check if the target call reverted before assertions ran.
- Verify cheatcodes are used in assertion functions, not constructors.
- Use
pcl test -vvvfor traces and gas diagnostics. - Confirm
FOUNDRY_PROFILE=assertionswhen runningpcl test.
Rationalizations to Reject
- "The assertion should have run." Verify triggers and call order first.
- "It is probably a test issue." Validate the target call succeeds without assertions.
- "Gas is fine." Happy path often consumes the most gas.
References
- Common Errors and Fixes
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?