Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Deprecate one or more facet or periphery contracts by removing them from the codebase
.claude/skills/lifinance-deprecate-contract/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-07 | ✗→✓ | ▲ Improved | 265% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 130% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 125% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 430% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 226% | 0% |
> Usage: /deprecate-contract <ContractName1> [ContractName2] [ContractName3] ...
This command completely removes one or more contracts (facets or periphery) from the codebase by:
src/ (works with any folder structure)bash# Single contract /deprecate-contract RelayFacet # Multiple contracts /deprecate-contract RelayFacet RelayDepositoryFacet # Mix of facet and periphery /deprecate-contract RelayFacet Permit2Proxy TokenWrapper
The command performs these steps in order:
src/ directory tree for {ContractName}.sol filesscript/deploy/**/Deploy{ContractName}.s.sol, Update{ContractName}.s.sol, zksync variants)test/solidity/**/{ContractName}.t.sol)docs/{ContractName}.md)script/demoScripts/demo{ContractName}.ts)script/deploy/resources/deployRequirements.jsonscript/deploy/_targetState.json (all networks/environments)config/{contractNameLowercase}.json (if contract-specific, or remove entries if shared)config/whitelist.json and config/whitelist.staging.json (PERIPHERY section)config/global.json (coreFacets/corePeriphery arrays)forge coverage --report lcov --force --ir-minimum, filter with bun script/utils/filter_lcov.ts lcov.info lcov-filtered.info 'test/' 'script/', and record line coverage percentageforge test to ensure newly added adapted tests pass (required per .agents/rules/099-finish.md)deployRequirements.json_targetState.json (all networks/environments)global.json core lists if presentbun update-whitelist-periphery once after all removalsforge test to verify ALL tests pass (required per .agents/rules/099-finish.md - tests must pass after any Solidity changes)Deprecation removes the facet from the codebase only; it stays registered and callable on every production diamond until a governance proposal removes it. That removal is not proposed now — it is parked into the deferred diamond-cleanup queue and drained into a timelock-wrapped Safe proposal later (riding the next rollout to that network), so signers aren't asked to sign a standalone per-chain removal at deprecation time. See docs/DeferredDiamondCleanupQueue.md and docs/FacetRemovalReconciliation.md.
network whose deploy log (deployments/<network>.json) lists it — that log is the authoritative facet → address map. Read the diamond address and the facet address from that log; do not delete those entries yet (see step 7).
the originating PR URL (--prUrl) so the reviewer sees it at signing, and that URL only exists once gh pr create has returned it. So the enqueue is the last removal-related action — run it once the deprecation PR is open, passing the real PR URL, and only then continue with steps 7–8 (remaining-occurrences review and final reminders). One invocation per (facet, network):
bash bunx tsx script/deploy/safe/enqueue-parked-task.ts \ --network <network> \ --facetName <FacetName> \ --diamondAddress <diamond address from deployments/<network>.json> \ --facetAddress <facet address from deployments/<network>.json> \ --prUrl <deprecation PR URL>
--environment defaults to production and v1 parks production removals only (the CLI rejects any other environment). Re-running for an already-parked (facet, network) is a safe no-op.
drained into the removal proposal; the governance flow (on-chain loupe → buildDiamondCutRemoveCalldata → timelock scheduleBatch → Safe → quorum) is unchanged, and core/machinery facets are refused by the queue's protected-name guard. Periphery is out of scope here (de-register via the periphery flow).
node_modules, .git, out, cache, broadcast, typechain, lib)deployments/*.json facet→address entries until the parked removal task (step 6) has retired (executed, cancelled, or superseded) on that network — they are the address snapshot the drain relies on and the record of on-chain state.forge test again to ensure all tests still passfind src/ -name "{ContractName}.sol" to locate files (not hardcoded paths)src/ subdirectory (Facets, Periphery, Security, Helpers, etc.)relay.json is shared, remove relayReceiver/relaySolver but keep relayDepository if used by RelayDepositoryFacetLiFiDiamond key in target state.agents/rules/099-finish.md, tests must pass after any Solidity changes. Report failures, do not mark deprecation successful, and require manual remediation before completing the command (see "Test verification" under Safety Features).src/**/{ContractName}.sol - Contract source (deleted)script/deploy/**/Deploy{ContractName}.s.sol - Deployment scripts (deleted)script/deploy/**/Update{ContractName}.s.sol - Update scripts (deleted)script/deploy/**/Deploy{ContractName}.zksync.s.sol - ZKSync deployment (deleted)script/deploy/**/Update{ContractName}.zksync.s.sol - ZKSync update (deleted)script/deploy/resources/deployRequirements.json - Removes contract entryscript/deploy/_targetState.json - Removes from all networks/environmentsconfig/{contractNameLowercase}.json - Deleted if contract-specific, or entries removed if sharedconfig/whitelist.json - Removes from PERIPHERY sectionconfig/whitelist.staging.json - Removes from PERIPHERY sectionconfig/global.json - Removes from coreFacets/corePeriphery arraystest/solidity/**/{ContractName}.t.sol - Test files (replaced with similar bridge tests for bridge facets, deleted for non-bridge contracts)docs/{ContractName}.md - Documentation (deleted)script/demoScripts/demo{ContractName}.ts - Demo scripts (deleted)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔍 Deprecating contract: RelayFacet
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Contract type: Facet
✓ Removed src/Facets/RelayFacet.sol
✓ Removed script/deploy/facets/DeployRelayFacet.s.sol
✓ Removed script/deploy/facets/UpdateRelayFacet.s.sol
✓ Removed script/deploy/zksync/DeployRelayFacet.zksync.s.sol
✓ Removed script/deploy/zksync/UpdateRelayFacet.zksync.s.sol
✓ Removed 'RelayFacet' from script/deploy/resources/deployRequirements.json
✓ Removed 'RelayFacet' from script/deploy/_targetState.json (all networks/environments)
✓ Removed entries from config/relay.json (relayReceiver and relaySolver)
⚠ Warning: config/relay.json still contains relayDepository entries (used by RelayDepositoryFacet) - keeping file
📊 Test Coverage Preservation
✓ Measured baseline coverage: 85.2% line coverage
✓ Identified similar bridge: StargateFacetV2 (similar swap integration, native token support)
✓ Adapted 12 test cases from RelayFacet.t.sol to StargateFacetV2.t.sol
✓ Added adapted tests to test/solidity/Facets/StargateFacetV2.t.sol
✓ Verified new tests pass
✓ Measured final coverage: 85.8% line coverage (+0.6%)
✓ Removed test/solidity/Facets/RelayFacet.t.sol
✓ Removed docs/RelayFacet.md
✓ Removed script/demoScripts/demoRelay.ts
✓ Running full test suite (required after Solidity changes per `.agents/rules/099-finish.md`)...
✓ All tests passed
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 Remaining Occurrences Review
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ ACTION REQUIRED: Review all occurrences below and clean up as needed.
Found additional occurrences of "RelayFacet" in the codebase:
📄 deployments/mainnet.json
Line 45: "RelayFacet": "0x..."
Total matches: 1
📄 deployments/base.json
Line 23: "RelayFacet": "0x..."
Total matches: 1
📄 script/demoScripts/utils/cowSwapHelpers.ts
Line 8: import { RelayFacet__factory } from '../../typechain'
Line 12: type RelayFacet
Total matches: 2
📄 typechain/index.ts
Line 1234: export * from './RelayFacet'
Total matches: 1
⚠️ Note:
- Deployment log files (deployments/*.json) may contain historical references
- TypeScript type files (typechain/) are generated and will be regenerated
- Some files may intentionally keep contract values for historical reference
Please review the above list and indicate which files/occurrences should be removed:
- Type the file paths you want to clean up
- Or say "none" if all occurrences should remain
- Or say "all" to remove all occurrences (use with caution)
- Or say "deployments only" to remove only from deployment log files — but **never** the `deployments/*.json` facet→address entry of any facet whose parked removal task (step 6) is still pending; those stay until the task retires (executed/cancelled/superseded)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ FINAL MANUAL STEPS REQUIRED
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. ⚠️ Update Product Target State Spreadsheet:
Action: Move the "RelayFacet" column to the deprecated section in the [Product Target State Spreadsheet](https://docs.google.com/spreadsheets/d/1jX1wfFkSn1s19I_KzMA7vB1kfgGxXUv7kRqwUGJJLF4/edit#gid=0).
2. ⚠️ Review codebase search results above:
Action: Clean up any remaining occurrences as needed (deployments, typechain will regenerate, etc.)
3. ⚠️ On-chain removal (step 6): parked into the deferred diamond-cleanup queue
for RelayFacet across the PROD diamonds that still register it — drained into a
Safe proposal on a later rollout. Do NOT clean deployments/*.json RelayFacet
entries until those parked tasks retire (executed/cancelled/superseded).
Successfully deprecated RelayFacet.Before executing, validate:
src/ directory treeforge test after all changes to ensure ALL tests pass (required per .agents/rules/099-finish.md - tests must pass after any Solidity changes, including test file modifications)src/ subdirectoryforge coverage --report lcov --force --ir-minimum, then filter with bun script/utils/filter_lcov.ts lcov.info lcov-filtered.info 'test/' 'script/'| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 5,012 | 4,829 | -4% | 1 | 1 | 0% | 215 | 4,980 | +2216% | 0 | 0 | — |
case-02 | fail→fail | 13,823 | 5,292 | -62% | 1 | 1 | 0% | 2,338 | 5,154 | +120% | 0 | 0 | — |
case-03 | fail→fail | 9,533 | 4,501 | -53% | 1 | 1 | 0% | 1,728 | 4,929 | +185% | 0 | 0 | — |
case-04 | pass→pass | 15,850 | 5,014 | -68% | 1 | 1 | 0% | 3,127 | 5,069 | +62% | 0 | 0 | — |
case-05 | pass→pass | 16,093 | 7,215 | -55% | 1 | 1 | 0% | 2,906 | 5,610 | +93% | 0 | 0 | — |
case-06 | pass→pass | 9,332 | 3,575 | -62% | 1 | 1 | 0% | 1,745 | 4,714 | +170% | 0 | 0 | — |
case-07 | fail→pass | 7,965 | 2,915 | -63% | 1 | 1 | 0% | 1,300 | 4,750 | +265% | 0 | 0 | — |
case-13 | pass→pass | 5,654 | 3,049 | -46% | 1 | 1 | 0% | 950 | 4,804 | +406% | 0 | 0 | — |
case-08 | pass→pass | 11,449 | 4,172 | -64% | 1 | 1 | 0% | 1,869 | 4,980 | +166% | 0 | 0 | — |
case-09 | fail→pass | 13,770 | 5,311 | -61% | 1 | 1 | 0% | 2,226 | 5,127 | +130% | 0 | 0 | — |
case-10 | fail→pass | 11,808 | 2,416 | -80% | 1 | 1 | 0% | 2,010 | 4,528 | +125% | 0 | 0 | — |
case-11 | fail→fail | 7,644 | 2,717 | -64% | 1 | 1 | 0% | 1,454 | 4,694 | +223% | 0 | 0 | — |
case-12 | fail→pass | 5,321 | 2,536 | -52% | 1 | 1 | 0% | 871 | 4,617 | +430% | 0 | 0 | — |
case-14 | pass→pass | 3,786 | 1,981 | -48% | 1 | 1 | 0% | 590 | 4,507 | +664% | 0 | 0 | — |
case-15 | fail→pass | 9,323 | 4,461 | -52% | 1 | 1 | 0% | 1,568 | 5,104 | +226% | 0 | 0 | — |
case-16 | fail→pass | 5,075 | 2,139 | -58% | 1 | 1 | 0% | 676 | 4,609 | +582% | 0 | 0 | — |
case-17 | fail→pass | 10,544 | 2,147 | -80% | 1 | 1 | 0% | 1,739 | 4,565 | +163% | 0 | 0 | — |
case-18 | fail→pass | 14,486 | 5,492 | -62% | 1 | 1 | 0% | 2,361 | 5,067 | +115% | 0 | 0 | — |
case-19 | pass→pass | 11,513 | 2,291 | -80% | 1 | 1 | 0% | 1,945 | 4,633 | +138% | 0 | 0 | — |
case-20 | fail→pass | 10,671 | 1,948 | -82% | 1 | 1 | 0% | 1,799 | 4,551 | +153% | 0 | 0 | — |
case-21 | pass→pass | 8,991 | 1,694 | -81% | 1 | 1 | 0% | 1,596 | 4,462 | +180% | 0 | 0 | — |
case-22 | fail→pass | 7,111 | 1,860 | -74% | 1 | 1 | 0% | 1,192 | 4,456 | +274% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +45 percentage points is the difference between those two pass rates over the 21 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.