cyotee/cyotee-claude-plugin-crane/crane-architecture
Claude Code and agent skill by cyotee/cyotee-claude-plugin-crane
- community
Checking that the SKILL.md file is still in the repository.
This skill should be used when the user asks about "facet", "target", "repo", "diamond pattern", "storage slot", "guard function", "DFPkg", "AwareRepo", "Service pattern", "Modifiers", "ERC2535", or needs guidance on Crane's core architectural patterns for building modular, upgradeable smart contracts.
Install
npx vskill@latest install cyotee/cyotee-claude-plugin-crane/crane-architectureSKILL.md
The same SKILL.md was published earlier as cyotee/cyotee-claude-plugin-crane/crane-architecture.
Crane Architecture Patterns
Crane is a Diamond-first (ERC2535) Solidity development framework for building modular, upgradeable smart contracts. This skill provides guidance on the core architectural patterns.
Core Pattern: Facet-Target-Repo
Every feature in Crane follows a three-tier architecture:
| Layer | File Pattern | Purpose | |
|---|---|---|---|
| Repo | *Repo.sol | Storage library with assembly-based slot binding. Defines Storage struct and dual _layout() functions. No state variables. | |
| Target | *Target.sol | Implementation contract with business logic. Uses Repo for storage access. Inherits interfaces. | |
| Facet | *Facet.sol | Diamond facet. Extends Target and implements IFacet for metadata (name, interfaces, selectors). |
When to Create Each Layer
- Repo: Always create first. Contains all storage and internal helper functions.
- Target: Create when business logic needs to be shared or tested independently.
- Facet: Create when exposing functionality through the Diamond proxy.
Storage Slot Pattern
All Repos use the Diamond storage pattern with dual function overloads:
Dual Function Overload Pattern
Every Repo function has TWO overloads:
This enables:
- Default usage with standard storage slot
- Custom slot usage for multi-instance patterns
- Composability between Repos
Guard Functions Pattern
Repos contain _onlyXxx() guard functions with access control logic. Modifiers are thin wrappers:
Additional Patterns
Modifiers Contract (*Modifiers.sol)
Abstract contracts with reusable modifiers delegating to Repo guards:
Service Library (*Service.sol)
Stateless libraries for complex business logic. Use structs to avoid stack-too-deep:
AwareRepo (*AwareRepo.sol)
Dependency injection for external contract references:
Diamond Factory Package (*DFPkg.sol)
Bundles facets into deployable packages. See references/dfpkg-pattern.md for complete details.
IFacet Interface
All facets implement IFacet:
Storage Slot Naming Convention
Use hierarchical dot-notation:
| Pattern | Example | |
|---|---|---|
| Crane core | "crane.access.operable" | |
| Protocol integrations | "protocols.dexes.balancer.v3.vault.aware" | |
| EIP implementations | "eip.erc.8023" |
Key Reference Files
For complete implementations, examine these files in the Crane codebase:
contracts/access/operable/- Complete Facet-Target-Repo examplecontracts/introspection/ERC2535/ERC2535Repo.sol- Diamond storage managementcontracts/access/ERC8023/- Two-step ownership (EIP-8023)contracts/protocols/dexes/camelot/v2/services/CamelotV2Service.sol- Service pattern
Additional Resources
Reference Files
For detailed patterns and complete examples:
- `references/dfpkg-pattern.md` - Diamond Factory Package pattern in depth
- `references/factory-service.md` - FactoryService pattern for deployment
Quick Decision Guide
| Need | Pattern | |
|---|---|---|
| Storage for a feature | Create *Repo.sol | |
| Business logic | Create *Target.sol or *Service.sol | |
| Diamond-exposed functions | Create *Facet.sol | |
| External contract reference | Create *AwareRepo.sol | |
| Reusable access control | Create *Modifiers.sol | |
| Deployable package | Create *DFPkg.sol |
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNeutral, 70 of 100Ineffective. 1 run. Evaluated 9 months ago.
Source
- SKILL.md in the repositoryCheckingskills/crane-architecture/SKILL.md
Popularity
- 7-day trend score
- 0
Refreshed 18 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Grok Build (Cursor)
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cyotee/cyotee-claude-plugin-crane/crane-architecture)