Claude-skill-registry backtesting-assertions
Phylax Credible Layer assertions backtesting. Runs assertion backtests against historical transactions. Use when validating phylax/credible layer assertions on real chain data or known exploits.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/backtesting-assertions" ~/.claude/skills/majiayu000-claude-skill-registry-backtesting-assertions && rm -rf "$T"
manifest:
skills/data/backtesting-assertions/SKILL.mdsource content
Backtesting Assertions
Use Credible Layer backtesting to replay historical transactions with assertions enabled.
Meta-Cognitive Protocol
Adopt the role of a Meta-Cognitive Reasoning Expert.
For every complex problem: 1.DECOMPOSE: Break into sub-problems 2.SOLVE: Address each with explicit confidence (0.0-1.0) 3.VERIFY: Check logic, facts, completeness, bias 4.SYNTHESIZE: Combine using weighted confidence 5.REFLECT: If confidence <0.8, identify weakness and retry For simple questions, skip to direct answer.
Always output: ∙Clear answer ∙Confidence level ∙Key caveats
When to Use
- You want to validate assertions against real mainnet transactions.
- You are testing a known exploit block or incident transaction.
- You need to confirm triggers match real protocol entrypoints.
When NOT to Use
- You only need unit or fuzz tests. Use
.testing-assertions - You are designing invariants or triggers. Use
.designing-assertions - You only need Solidity implementation details. Use
.implementing-assertions
Quick Start
- Place backtest files in
(e.g.,assertions/test/backtest/
).VaultAssertion.backtest.t.sol - Create a test that inherits
.CredibleTestWithBacktesting - Configure
with target contract, block range, and assertion selector.BacktestingConfig - Call
and assert failures are zero.executeBacktest - Run with the backtest profile:
(or useFOUNDRY_PROFILE=assertions-backtest pcl test
flag).--ffi
See
pcl-assertion-workflow for the full profile configuration with ffi = true.
Workflow
- Pick a target contract (the assertion adopter address).
- Choose
andendBlock
.blockRange - Verify RPC env vars; skip or fallback when missing.
- Prefer
to detect internal calls; fall back to block scanning if your RPC lacksuseTraceFilter = true
.trace_filter - For large ranges, use a paid RPC to avoid rate limits;
reduces calls.useTraceFilter - Use
only when debugging state-dependent failures.forkByTxHash = true - Use
for a specific known exploit tx.blockRange = 1 - If your invariant is keyed by
(timelocks), rebuild calldata from selector + args; call inputs exclude the selector.msg.data - Interpret results:
,PASS
(selector mismatch or replay failure),NEEDS_REVIEW
(often false positives or gas),ASSERTION_FAIL
(RPC or unexpected).UNKNOWN_ERROR - If many
, the selector/target does not match or you needNEEDS_REVIEW
.forkByTxHash
Rationalizations to Reject
- "We only need unit tests." Backtesting catches real-world call patterns.
- "Trace filter is optional." Without it you miss internal calls.
- "forkByTxHash everywhere." It is slow and RPC-heavy; use it for debugging only.
- "RPC isn't needed." Backtesting requires a working RPC and FFI.