/scalus:typescriptfrom scalus
Evaluates Plutus scripts, applies parameters, and balances transactions using the Scalus npm package. Useful when working with Cardano smart contracts from TypeScript or JavaScript.
Ships in scalus. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The npm package scalus is Scalus compiled to JavaScript. It gives you a Cardano node Emulator,
a Plutus script evaluator with the exact budgets of a node, parameter application, and transaction
evaluation and balancing. It does not write validators: validators are Scala code. For that work,
use the scalus:contract skill in the Scala project.
Before you write code, read these two files. They ship in the package and match the version the project uses:
node_modules/scalus/scalus.d.ts - every exported class, function and option, with doc comments.node_modules/scalus/README.md - the guide, with examples and upgrade notes.If the package is not installed yet, read https://scalus.org/llms-ts.txt. It holds the same two
files for the latest release. Do not use https://scalus.org/llms-api.txt: it is the Scala API.
Do not rely on remembered names. The 1.2.0 entry points Scalus.evaluateScript,
Scalus.applyDataArgToScript and Scalus.evalPlutusScripts are deprecated.
Each example is a starting point. Check every signature in scalus.d.ts before you use it.
Emulator - an in-process Cardano ledger for tests:
import { CardanoInfo, Emulator, Utxo, Value } from "scalus";
const emulator = Emulator.create(CardanoInfo.preview(), {
utxos: [new Utxo("00".repeat(32), 0, aliceAddress, Value.ada(1000n))],
});
const result = emulator.submitTx(signedTxBytes); // never throws
if (!result.isSuccess) console.log(result.errorRule, result.error, result.logs);
Script evaluation - run one script with arguments and read its budget:
import { evaluator, EvaluationOptions } from "scalus";
const options = EvaluationOptions.mainnet("PlutusV3");
const r = evaluator.evaluateScript(scriptHex, [datumCbor, redeemerCbor, contextCbor], options);
r.isSuccess; r.budget.memory; r.budget.steps; r.error?.code; r.logs;
To evaluate one script many times, build new PlutusVM(options) once and call its
evaluateScript.
Parameter application - the same contract as the Lucid and Mesh function of the same name:
import { uplc } from "scalus";
const applied = uplc.applyParamsToScript(blueprintCompiledCode, [paramCbor]); // double-CBOR hex
Transaction evaluation - the execution units of every redeemer:
for (const r of emulator.evaluateTx(txBytes)) {
console.log(`${r.tag}[${r.index}]: ${r.budget.memory} mem, ${r.budget.steps} steps`);
}
Without an Emulator, evaluator.evaluateTx(tx, utxos, slotConfig, costModels, protocolMajorVersion)
takes the resolved inputs and the network settings explicitly. balancer.balanceTx sets the
execution units, the fee and the change; it is experimental.
SDK provider - the Emulator answers what Lucid's Provider and Mesh's
IFetcher/ISubmitter/IEvaluator ask. The npm README section "As a Transaction-Builder
Backend" and https://scalus.org/docs/testing/js-emulator show complete adapters.
require("scalus") works only on Node 22.12+ and 20.19+. On older Node, use
const scalus = await import("scalus").EvaluationOptions.mainnet(...) uses a bundled mainnet snapshot at protocol
version 11. It makes no network request and does not follow later parameter changes. To match
an Emulator or a live network, use EvaluationOptions.fromProtocolParams(version, params).error.code === "INVALID_RETURN_VALUE". The budget is still reported, so you can cost a pure
function. Under V1 and V2 any result is accepted.evaluateScript returns isSuccess: false
with an error.code. Branch on code, not on the message text. evaluateTx and
balanceTx throw PlutusScriptEvaluationError instead.Utxo, Value, Asset, ProtocolParams and CardanoInfo expose
fields through prototype accessors. JSON.stringify and toEqual see an empty object. Call
toObject() before you compare or print them.bigint. Write 1000n, not 1000.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub scalus3/scalus --plugin scalus7 skills in this plugin
/contractGuide for developing Scalus smart contracts. Use when writing or modifying Cardano validators in Scala 3 with Scalus./contract-testGuide for testing Scalus smart contracts. Use when writing unit, property, budget, or Emulator tests for Cardano validators./local-developmentUse when developing or testing Scalus smart contracts with the local Emulator and TxBuilder. Covers how to create an Emulator provider, submit transactions, test negative validator cases, and test confirmation delay and rollbacks./optimize-contractOptimize Scalus/Cardano smart contracts for execution budget (CPU steps and memory). Analyzes @Compile annotated validators for performance issues — expensive patterns, unnecessary allocations, redundant traversals, missed short-circuits. Provides concrete Scalus rewrites with budget impact estimates. Use when reviewing on-chain code performance or when /optimize-contract is invoked. Requires explicit path argument./smart-contract-security-reviewSecurity review for Scalus/Cardano smart contracts. Analyzes @Compile annotated validators for vulnerabilities like redirect attacks, inexact value validation, missing token verification, broken token lifecycle invariants, honest transactions the validator rejects, ADA-only comparisons, rounding direction, and self-dealing. Use when reviewing on-chain code, before deploying validators, or when /smart-contract-security-review is invoked. Requires explicit path argument./using-scalusUse at the start of any task in a Scalus project, to choose the Scalus skill for smart contract work or for TypeScript and JavaScript code that uses the npm package scalus.Other plugins' skills for the same job