cairo-contract-authoring

cairo-contract-authoring is a skill for Claude Code, Codex from keep-starknet-strange/starknet-agentic. It costs 54 tokens per session (1,886 once invoked), scanned A, original, MIT.

Guidance for writing smart contracts in Cairo, the programming language used on Starknet, a blockchain network. It covers contract structure, storage, events, interfaces, security patterns, and reusable OpenZeppelin components.

In plain words
What is it for?
Use it to create or modify Starknet contracts, add storage or events, define interfaces, connect components such as ERC20 or ownership controls, and organize multi-contract Scarb projects.
Why use it?
It helps turn a contract idea into code with the required Starknet structure and security checks. It also checks that the project compiles before handoff to testing or auditing.

Skill for Claude CodeCodex

Written for Claude Code and Codex: allowed-tools in frontmatter, but also agents/openai.yaml present.

Part of the starknet-agentic-skills plugin — 19 skills, 2 commands, 1 plugin shipped together

Good fit Use it to create or modify Starknet contracts, add storage or events, define interfaces, connect components such as ERC20 or ownership controls, and organize multi-contract Scarb projects.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/keep-starknet-strange/starknet-agentic/cairo-contract-authoring
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add keep-starknet-strange/starknet-agentic --skill cairo-contract-authoring
Clone the repo
git clone --depth 1 https://github.com/keep-starknet-strange/starknet-agentic

Made for: Claude Code, Codex.

Or install starknet-agentic-skills, the plugin that ships this one along with the rest of its 19 skills, 2 commands, 1 plugin.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cairo-contract-authoring

README.md
[![agentmods](https://agentmods.dev/badge/skills/keep-starknet-strange/starknet-agentic/cairo-contract-authoring/github.svg)](https://agentmods.dev/skills/keep-starknet-strange/starknet-agentic/cairo-contract-authoring)
Your own site
<a href="https://agentmods.dev/skills/keep-starknet-strange/starknet-agentic/cairo-contract-authoring"><img src="https://agentmods.dev/badge/skills/keep-starknet-strange/starknet-agentic/cairo-contract-authoring/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cairo-contract-authoring

Your own site · 80×15
<a href="https://agentmods.dev/skills/keep-starknet-strange/starknet-agentic/cairo-contract-authoring"><img src="https://agentmods.dev/badge/skills/keep-starknet-strange/starknet-agentic/cairo-contract-authoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,886 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00054 $0.01886
Opus 5 $0.00027 $0.00943
Sonnet 5 $0.00011 $0.00377
Haiku 4.5 $0.00005 $0.00189

Measured 11d ago against content hash 97264b00c6f8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

cairo-contract-authoring scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/cairo-contract-authoring/SKILL.md · 149 lines

How it starts

The opening of the file, as written. The whole thing — 149 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cairo/Starknet Contract Authoring

You are a Cairo contract authoring assistant. Your job is to understand what the user wants to build, load the right references, implement correct and secure code, verify it compiles, and hand off to testing/auditing.

When to Use

  • Writing a new Starknet contract from scratch.
  • Modifying storage, events, or interfaces on an existing contract.
  • Composing OpenZeppelin Cairo components (Ownable, ERC20, ERC721, AccessControl, Upgradeable).
  • Implementing the component pattern with embeddable_as.
  • Structuring a multi-contract Scarb project.

When NOT to Use

  • Gas/performance tuning (cairo-optimization).
  • Test strategy design (cairo-testing).
  • Deployment and release operations (cairo-deploy).
  • Security audit of existing code (cairo-auditor).

Quick Start

  1. Classify mode: new, modify, or component.
  2. Load references based on request type — see the table in Orchestration.
  3. Output a plan (interface, storage, components, events, security posture) and wait for confirmation.
  4. Implement following the mandatory security rules, then run scarb build.
  5. Verify every external function's access posture.
  6. Emit a handoff block using ../references/skill-handoff.md (authoring → testing by default, or authoring → auditor for review-first requests), then run the next skill.

Rationalizations to Reject

  • "We can add access control later."
  • "This is an internal function, so it doesn't need validation."
  • "Zero address will never be passed in practice."
  • "We'll add tests after the feature is complete."

Mode Selection

  • new: User wants a new contract from scratch. Full scaffold.
  • modify: User wants to change an existing contract. Read first, then modify.
  • component: User wants to wire or create an OpenZeppelin component.

Orchestration

Turn 1 — Understand. Classify the request:

(a) Determine mode: new, modify, or component.

(b) If modify or component mode, read the existing contract files to understand current structure. Use Glob to find .cairo files, then Read to inspect them.

Read the full file on GitHub · 149 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 149 lines · 54 tokens per session scan A 97264b00c6f8

Subscribe to this mod's changes

cairo-contract-authoring is a skill published in the GitHub repository keep-starknet-strange/starknet-agentic (80 stars, last pushed 2d ago), licensed MIT. It adds 54 tokens to every session and 1,886 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.