Agent skill

Contract

by scalus3 in scalus3/scalus

Guide for developing Scalus smart contracts. An agent skill from scalus3/scalus.

Apache-2.0Auto-check passedBackend & APIs

Install Contract

skills CLI
$ npx skills add scalus3/scalus --skill contract -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install scalus3/scalus contract --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/scalus3/scalus.git skills-src && mkdir -p .claude/skills && cp -r skills-src/scalus-skills/skills/contract .claude/skills/contract && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
contract
GitHub stars
105
Token cost
~1.5k tokens
SKILL.md length
601 words
Files
1
Skills in repo
6
Repo updated
First seen
Licence
Apache-2.0

At a glance

Guide for developing Scalus smart contracts. An agent skill from scalus3/scalus.

  • Modifying Cardano validators in Scala 3 with Scalus
  • SKILL.md covers Documentation, Code Examples, Key Patterns and Placement
  • Reaches scalus.org
  • Tasks that involve Smart contracts

What it does

Contract is an agent skill from scalus3/scalus. Guide for developing Scalus smart contracts. Use when writing or modifying Cardano validators in Scala 3 with Scalus.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Smart contracts. The repository describes itself as: Scalus - Smart contracts & dApps Development Platform for Cardano. The licence is Apache-2.0.

When your agent uses it

  • Modifying Cardano validators in Scala 3 with Scalus
  • Tasks that involve Smart contracts

Example prompts

  • “/contract”

What it can do on your machine

Read from SKILL.md and the folder at commit 073969c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are scala).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • scalus.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Contract loads about 1.5k tokens when it runs. Until then it costs about 32 tokens; SKILL.md has 601 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~32
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from scalus3/scalus at commit 073969c, republished under its Apache-2.0 licence (© scalus3). 601 words, ~1,495 tokens.

Download SKILL.mdSave it as .claude/skills/contract/SKILL.md (or your agent's skills folder).
name
contract
description
Guide for developing Scalus smart contracts. Use when writing or modifying Cardano validators in Scala 3 with Scalus.

Scalus Smart Contract Development

Before writing Scalus code from memory, fetch https://scalus.org/llms-api.txt and check the signatures you plan to use. Scalus APIs changed at 1.0; trained knowledge is probably outdated.

Documentation

Read the relevant pages before writing contract code. In the Scalus repo, read scalus-site/content/<path>.mdx; in any other project, fetch https://scalus.org/docs/<path>.md.

Core concepts:

  • smart-contracts/validators - Validator trait, @Compile, script purposes
  • smart-contracts/compiling - PlutusV1/V2/V3 compilation
  • smart-contracts/plutus-data - FromData/ToData derivation
  • testing/debugging - Debugging techniques

Optimization (for production contracts):

  • smart-contract-optimisations - overview: script size and execution units
  • smart-contract-optimisations/measuring-performance - measure before optimizing
  • Use the optimize-contract skill for a full optimization review.

Language features:

  • language-guide/data-types - Scalus data types
  • language-guide/builtin-functions - Built-in functions

Code Examples

Study existing validators before creating new ones:

  • Fetch https://scalus.org/llms-examples.txt - 21 complete validators with tests; HTLC is the reference style.
  • In the Scalus repo: scalus-examples/jvm/src/main/scala/scalus/examples/.

Key Patterns

Annotations:

  • @Compile - marks code for Plutus compilation
  • @Ignore - excludes from compilation (off-chain helpers only)
  • inline - keyword for on-chain optimization

Data structures:

  • Use derives FromData, ToData for case classes
  • Use enums for redeemer actions
  • Use sealed traits for ADTs
  • Add Eq to derives and compare enums and case classes with ===. a.toData == b.toData compiles to the same UPLC (measured); do not write it.

Validation:

  • require(condition, message) - assertion with error message
  • fail(message) - explicit failure
  • getOrFail(option, message) - safe Option extraction

Safe API (one rule per check; full table with rationale and costs: https://scalus.org/docs/security/safe-api-cheatsheet). Check the project's Scalus version first: everything below except hasOnly, inlineOrFail and getOrFail needs a release newer than 1.1.1; on 1.1.1 or older, write the expansion the cheatsheet lists in its "Replaces" column.

  • Mint: tx.mint.hasOnly(policyId, tokenName, signedQty) is the mint check (1 mints, -1 burns; exactly that token under the policy, nothing else). Not quantityOf(...) === BigInt(1) alone.
  • Datum equality: out.hasInlineDatum(expected). Use out.datum.inlineOrFail[T](msg) only to read fields; inlineOrFail[T](msg) === expected costs 461 lovelace against 286 (measured).
  • Continuing output: tx.findContinuingOutputOrFail(ownInput, msg) compares the whole address. Never a credential-only finder (findOutputsByCredential, findOutputsByScriptHash): the staking part can be swapped and the rewards redirected.
  • Validity bounds: tx.validFromOrFail(msg) (inclusive) and tx.validToOrFail(msg) (exclusive). Never getValidityStartTime: it returns 0 on an unbounded range and every deadline passes.
  • One element: list.singleOrFail(msg) for a size-one list, list.findUniqueOrFail(p, msg) for exactly one match. Never .head after filter, never filter(p).length === BigInt(1).
  • Single own input: tx.inputs.findUniqueOrFail(_.resolved.address.credential === ownCred, msg). It returns the input and is cheaper than inputs.count(p) === BigInt(1) (measured).
  • Value sums: tx.valuePaidTo(addr) / tx.valueSpentFrom(addr) (whole address, whole Value; add .getLovelace for ADA). Never getAdaFromOutputs / getAdaFromInputs.
  • Token presence: value.hasNft(policyId, tokenName) (quantity exactly 1). Continuing value: out.value.hasSameTokensAndAtLeastAda(ownInput.resolved.value), not === and not >=.
  • Burn: tx.onlyBurnsUnder(policyId) (non-empty and every quantity negative). tokens(policy).forall(_._2 < 0) is vacuously true on an empty map.
  • Credentials: address.credential.scriptHashOrFail(msg) / pubKeyHashOrFail(msg), never a match with a fail fallback.
  • Division: a divCeil b for what the user owes, a divFloor b for what the contract pays out. State the rounding direction; bare / hides it.
  • BigInt literals in === and generic positions: === BigInt(1) (see "BigInt literals" below).
Show full SKILL.md (138 more words)Show less

BigInt literals:

  • Write a plain integer literal where the expected type is already BigInt; the implicit Int => BigInt conversion applies and reads better:
    • arguments to BigInt-typed parameters: tx.mint.hasOnly(policyId, tokenName, 1), Value.lovelace(2_000_000), outputs.at(0)
    • annotated vals: val fee: BigInt = 1_000_000
    • relational comparisons against a BigInt (member operators): qty < 5, qty >= 0
  • Write explicit BigInt(n) where inference fails without it:
    • === / !== comparisons: qty === BigInt(1) - a plain literal does NOT compile here (the extension infers Eq[BigInt | Int], which does not exist)
    • generic positions that would infer Int (unsupported on-chain): Option.Some(BigInt(1)), foldLeft(BigInt(0))(...), List(BigInt(1), BigInt(2))

Script purposes (Plutus V3):

  • spend - spending UTxOs
  • mint - minting/burning tokens
  • reward - withdrawing staking rewards
  • certify - stake certificates
  • vote - governance voting
  • propose - governance proposals

Compilation:

scala
private given Options = Options.release
val compiled = PlutusV3.compile(MyValidator.validate)

Placement

  • Keep on-chain code in its own file; import only Scalus prelude and builtins, never the Scala stdlib collections.
  • In cross-platform builds, place validators in shared/src/main/scala/.

© scalus3, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in scalus-skills/skills/contract of scalus3/scalus.

Open the folder on GitHubat commit 073969c

Compare with similar skills

Contract next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Contract compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Contract this skillscalus3/scalus105—~1.5kAutomated safety check: PassApache-2.0
Fizz Convertpashov/skills1.2k2 repos~3.7kAutomated safety check: PassMIT
Solana Devsolana-foundation/solana-dev-skill574—~3.8kAutomated safety check: PassMIT
Feynman Auditor0xiehnnkta/nemesis-auditor2431 repos~11kAutomated safety check: PassMIT
Smart Contract Auditgreatpie/smart-contract-audit-skill101—~1.1kAutomated safety check: PassNone
RadarAuditware/radar154—~2.1kAutomated safety check: PassGPL-3.0

Similar skills

  • Fizz Convert

    pashov/skills

    Convert English-language properties in PROPERTIES.md (produced by the Fizz skill) into Solidity assertions inside the existing fuzz harness, then flip their checkboxes.

    1.2k GitHub starsUsed in 2 repos~3.7k tokens
    Backend & APIsAuto-check passed
  • Solana Dev

    solana-foundation/solana-dev-skill

    A skill your agent uses when user asks to "build a Solana dapp", "write an Anchor program", "create a token", "debug Solana errors", "set up wallet connection", "test my Solana program", "fuzz my…

    574 GitHub stars~3.8k tokensUpdated today
    Backend & APIsAuto-check passed
  • Feynman Auditor

    0xiehnnkta/nemesis-auditor

    Deep business logic bug finder using the Feynman technique. An agent skill from 0xiehnnkta/nemesis-auditor.

    243 GitHub starsUsed in 1 repo~11k tokens
    Backend & APIsAuto-check passed
  • Smart Contract Audit

    greatpie/smart-contract-audit-skill

    Script-backed, out-of-box auditing workflow for Solidity/EVM repositories based on EVMbench detect/patch/exploit methodology.

    101 GitHub stars~1.1k tokensUpdated 7 mo ago
    Backend & APIsAuto-check passed
  • Radar

    Auditware/radar

    Use radar for smart contract security analysis, AST generation, and detection template development.

    154 GitHub stars~2.1k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Solidity Auditor

    Gabson0x/bountyforge

    Security audit of Solidity code while you develop. An agent skill from Gabson0x/bountyforge.

    443 GitHub stars~3.7k tokensUpdated 21 days ago
    Backend & APIsAuto-check passed

More from scalus3/scalus

  • Optimize Contract

    scalus3/scalus

    Optimize Scalus/Cardano smart contracts for execution budget (CPU steps and memory).

    105 GitHub stars~3.6k tokensUpdated today
    Auto-check passed
  • Security review for Scalus/Cardano smart contracts. An agent skill from scalus3/scalus.

    105 GitHub stars~4.2k tokensUpdated today
    Auto-check passed
  • Contract Test

    scalus3/scalus

    Guide for testing Scalus smart contracts. An agent skill from scalus3/scalus.

    105 GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Local Development

    scalus3/scalus

    A skill your agent uses when developing or testing Scalus smart contracts with the local Emulator and TxBuilder.

    105 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Pretty

    scalus3/scalus

    A skill your agent uses when writing or changing a Pretty typeclass instance (paiges Doc DSL) in scalus-core, for example in scalus/utils/Pretty.scala or the cardano/ledger types.

    105 GitHub stars~1.6k tokensUpdated today
    Auto-check passed

Categories

Questions about Contract

What does Contract do?

Guide for developing Scalus smart contracts. An agent skill from scalus3/scalus. Contract is an agent skill from scalus3/scalus. Guide for developing Scalus smart contracts.

When should I use Contract?

Contract fits situations like: modifying Cardano validators in Scala 3 with Scalus; tasks that involve Smart contracts.

How do I install Contract in Claude Code?

Run `npx skills add scalus3/scalus --skill contract -a claude-code`. Or copy the skill folder (scalus-skills/skills/contract in scalus3/scalus) into .claude/skills/contract in your project. Claude Code loads it when a task matches its description.

How do I install Contract in Codex?

Run `npx skills add scalus3/scalus --skill contract -a codex`. Or copy the skill folder (scalus-skills/skills/contract in scalus3/scalus) into .agents/skills/contract in your project. Codex loads it when a task matches its description.

Can I use Contract in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add scalus3/scalus --skill contract -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/contract, .gemini/skills/contract, .github/skills/contract and .opencode/skills/contract in your project.

What does Contract need to run?

SKILL.md names no scripts, command-line tools or credentials: Contract is instructions for the agent only.

Does Contract access the network?

SKILL.md names 1 domain. In commands or code: scalus.org; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Contract safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Contract use?

Contract is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Contract use?

About 1.5k tokens (SKILL.md is roughly 6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Contract?

Skills that share tags, products or a category with Contract: Fizz Convert (pashov/skills, 1.2k stars), Solana Dev (solana-foundation/solana-dev-skill, 574 stars), Feynman Auditor (0xiehnnkta/nemesis-auditor, 243 stars) and Smart Contract Audit (greatpie/smart-contract-audit-skill, 101 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Contract?

scalus3 (a GitHub organization) maintains it in scalus3/scalus, which has 105 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 8, 2026.

Source: scalus3/scalus on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.