setup-cairo-contracts

Scaffold a Cairo Starknet project and configure OpenZeppelin Contracts in Scarb.toml.

203|28|Updated Feb 5, 2026
One-click install
npx skills add https://github.com/OpenZeppelin/openzeppelin-skills --skill setup-cairo-contracts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-cairo-contracts
Source: https://github.com/OpenZeppelin/openzeppelin-skills/tree/main/skills/setup-cairo-contracts
Command: npx skills add https://github.com/OpenZeppelin/openzeppelin-skills --skill setup-cairo-contracts

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill removes friction for developers who need to create and configure Cairo projects on Starknet and correctly integrate OpenZeppelin Contracts for Cairo, including selecting umbrella versus individual packages and applying import and component patterns.

Core Features & Use Cases

  • Project scaffolding: Guidance to install the Starknet toolchain and scaffold a Scarb project with a Starknet test runner.
  • Dependency configuration: Instructions for adding OpenZeppelin umbrella or individual package entries to Scarb.toml and notes on versioning exceptions.
  • Import conventions & component patterns: Clear examples of import paths for umbrella vs individual packages and how to integrate components using the component! macro and embedded impls.
  • Use case: Rapidly scaffold a new ERC20 contract project, choose only the token package to reduce compile time, and wire up component integrations for upgradeability.

Quick Start

Create a new Scarb Starknet project with a test runner, add the appropriate OpenZeppelin dependency entries to Scarb.toml (umbrella or individual packages), and update your Cairo imports and component implementations to match the chosen package layout.

Frequently Asked Questions about setup-cairo-contracts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a Cairo project on Starknet with OpenZeppelin Contracts?

To set up a Cairo Starknet project with OpenZeppelin Contracts, scaffold a new Scarb project with a Starknet test runner, then add the appropriate OpenZeppelin dependency entries to your Scarb.toml file using either umbrella or individual packages.

What is the difference between OpenZeppelin umbrella and individual packages in Scarb?

OpenZeppelin umbrella packages include all contracts in one dependency, while individual packages let you import only specific modules like tokens. Choosing individual packages reduces compile time by limiting the build scope to only the contracts you need.

How do I import OpenZeppelin components in Cairo using the component! macro?

Importing OpenZeppelin components in Cairo involves using the component! macro and embedded impls. You update your Cairo import paths to match your chosen package layout, wiring up component integrations for features like upgradeability.

Can I use Scarb to scaffold a Starknet project with a test runner?

Yes, you can use Scarb to scaffold a Starknet project with a test runner. The setup process guides you through installing the Starknet toolchain and initializing a Scarb project configured for Starknet testing.

Why does my Cairo build take so long when using OpenZeppelin umbrella packages?

Your Cairo build takes longer with OpenZeppelin umbrella packages because they compile the entire contract library. To speed up builds, switch to individual OpenZeppelin packages in your Scarb.toml to compile only the specific contracts your project requires.

What are the import path conventions for OpenZeppelin Contracts in Cairo?

Import path conventions for OpenZeppelin Contracts in Cairo differ between umbrella and individual packages. The umbrella package uses a unified import path, while individual packages require specific module paths, and both must align with your component! macro integrations.