cyotee/cyotee-claude-plugin-crane/crane-code-style
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 "code style", "naming convention", "imports", "section headers", "slot naming", "viaIR", "stack too deep", "formatting", or needs guidance on Crane's code conventions and style requirements.
Install
npx vskill@latest install cyotee/cyotee-claude-plugin-crane/crane-code-styleSKILL.md
The same SKILL.md was published earlier as cyotee/cyotee-claude-plugin-crane/crane-code-style.
Crane Code Style Guide
Crane follows strict code conventions for consistency and maintainability. This skill covers section headers, imports, naming, and critical compilation rules.
Section Headers
Use 78-character wide comment blocks for major sections:
Shorter form for subsections:
Import Organization
Group imports by source, with import aliases:
Import Aliases
Defined in foundry.toml and remappings.txt:
| Alias | Path | |
|---|---|---|
@crane/ | Crane framework contracts | |
@solady/ | Solady library | |
@openzeppelin/ | OpenZeppelin contracts | |
forge-std/ | Foundry test utilities |
Function Organization
Order functions by visibility:
- Constructor
- Receive
- Fallback
- External
- Public
- Internal
- Private
Naming Conventions
| Pattern | Usage | Example | |
|---|---|---|---|
_layout() | Storage access | _layout(), _layout(bytes32 slot_) | |
_initialize() | Storage setup | _initialize(address owner_) | |
_functionName() | Internal Repo functions | _isOperator(), _setOperator() | |
_onlyXxx() | Guard functions in Repos | _onlyOwner(), _onlyOperator() | |
onlyXxx | Modifiers | onlyOwner, onlyOperator | |
layout | Storage parameter name | Storage storage layout | |
param_ | Function parameters | owner_, slot_, name_ |
Parameter Trailing Underscore
All function parameters end with underscore to avoid shadowing:
Storage Slot Naming
Use hierarchical dot-notation for storage slot names:
| Category | Pattern | Example | |
|---|---|---|---|
| Crane core | crane.{domain}.{feature} | "crane.access.operable" | |
| Protocol integrations | protocols.{category}.{protocol}.{version}.{feature} | "protocols.dexes.balancer.v3.vault.aware" | |
| EIP implementations | eip.erc.{number} | "eip.erc.8023" |
Critical: No viaIR Compilation
NEVER enable `via_ir` or `viaIR` in foundry.toml.
IR compilation is forbidden because:
- Dramatically slower compilation (10-100x slower)
- Excessive memory usage
- Breaks parallel agent workflows
- Not necessary when code is properly structured
Resolving Stack Too Deep Errors
When encountering "stack too deep" errors, refactor using structs:
Stack Too Deep Solutions
- Group parameters into structs: Bundle related function parameters
- Group intermediate state: Use
StateorContextstructs - Use `memory` for computation: Struct fields don't consume stack
- Extract helper functions: Split complex functions
- Use block scoping: Limit variable lifetimes with
{ ... }
Configuration
Standard Crane configuration:
- Solidity: 0.8.30
- Optimizer runs: 1 (for contract size limits)
- EVM version: Prague
- via_ir: false (ALWAYS)
Additional Resources
Reference Files
- `references/complete-style-guide.md` - Full style guide with more examples
Key Files
/contracts/StyleGuide.sol- Reference template/foundry.toml- Build configuration/remappings.txt- Import aliases
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/crane-code-style/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
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-code-style)