Getting Started
Crane is a Diamond-first (ERC-2535) framework for building modular, upgradeable Solidity contracts with deterministic deployment, reusable logic, and first-class support for AI agents.
Why reuse matters
Security. Prefer attaching already deployed and verified facets (via DFPkgs) instead of redeploying large surfaces of new bytecode—especially when an AI agent writes the change.
Cost. Facets and packages deployed once can be reused by many proxies and projects, so you do not pay full deployment cost for the same logic every time.
Cross-chain reproducibility. CREATE3 salts yield the same addresses when configuration matches.
Documentation map
| Topic | Page |
|---|---|
| CREATE3 / new chain / factory reuse | CREATE3 & New Chain Setup |
| DFPkg operations | Diamond Factory Packages · DFPkg Pattern |
| Registries | Registries |
| Testing / TestBases | Testing Patterns |
| DEX / lending ports | DEX Integrations · Lending |
| Sets / ConstProdUtils | Utilities Overview · Sets · Math |
| Building modules | Building with Crane |
| Architecture map | Codebase Map |
| AI agent skills | Agent Skills |
Install
git clone --recurse-submodules https://github.com/cyotee/crane.git
cd crane
forge build
# Core path (matches CI)
FOUNDRY_PROFILE=ci forge build
FOUNDRY_PROFILE=ci forge test
As a Foundry dependency:
forge install cyotee/crane
Update your remappings.txt and foundry.toml (see this repo for aliases such as @crane/).
Bootstrap factories in tests:
import {InitDevService} from "@crane/contracts/InitDevService.sol";
(ICreate3FactoryProxy create3Factory, IDiamondPackageCallBackFactory diamondFactory) =
InitDevService.initEnv(address(this));
For AI agents
- Load skills — Prefer in-repo
.claude/skills/and/or install marketplaces:- Developer: cyotee/cyotee-claude-plugins →
crane@cyotee - Ops: cyotee/defi-agent-skills (on-chain runbooks; not architecture dumps)
- Developer: cyotee/cyotee-claude-plugins →
- Start with
crane-architecture,crane-deployment, andcrane-testing. - Use Facet-Target-Repo + DFPkg for new features — Repo for storage, Target for logic, Facet for Diamond exposure.
- Bootstrap via
Init*Serviceor Crane test bases — avoid ad-hocnewfor production deployment paths. - Follow NatSpec conventions in AGENTS.md and NatSpec docs.
- Optional BattleChain gate — significant factories/packages may be exercised on BattleChain before mainnet promotion; see BattleChain.
Next steps
- Read Building with Crane
- Skim Facet-Target-Repo
- Try CREATE3 setup and DFPkg