skills/algorand-core/SKILL.md
Foundational mental model for the Algorand Virtual Machine (AVM). Use when encountering AVM concepts, stack machine questions, resource limit errors, opcode budget issues, program size problems, or constraint errors. Use when an agent defaults to PyTEAL, Beaker, or raw TEAL. Read BEFORE writing any smart contract code. Covers the two-type system (uint64/bytes), compilation from TypeScript/Python to TEAL, hard resource limits, and common LLM anti-patterns.
npx skillsauth add algorand-devrel/algorand-agent-skills algorand-coreInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Read this before writing any contract code.
The AVM is a stack machine with two fundamental data types: uint64 and bytes. No heap, no GC, no objects, no dynamic dispatch, no closures, no exceptions, no standard library.
When you write contracts in TypeScript or Python, you are not writing TypeScript or Python. You are writing AVM programs using TS/Python syntax. The Puya compiler translates a strict subset of the language into TEAL bytecode. Any feature that doesn't map to AVM operations fails at compile time.
At the AVM level, every value is uint64 or bytes (max 4096 bytes). However, the SDKs and AVM provide richer abstractions:
AVM reference types — The AVM natively supports Account, Asset, and Application via dedicated opcodes (acct_params_get, asset_holding_get, app_params_get, etc.). These are passed to contracts via foreign arrays and resolved by index at runtime.
ARC-4 encoded types — The ARC-4 ABI standard defines high-level types encoded as bytes: Bool, UInt8–UInt512, UFixedNxM (fixed-point decimals), String, DynamicBytes, Address, StaticArray, DynamicArray, Struct, and Tuple. The SDKs provide these via the arc4 module.
SDK native types — Both SDKs provide native types that compile to efficient AVM operations: UInt64/uint64, Bytes/bytes, BigUInt/biguint, String/string, Account, Asset, Application, Boolean/bool, plus storage types (GlobalState, LocalState, Box, BoxMap).
Use native types for internal logic (more efficient). Use ARC-4 types for ABI method parameters/returns, storage, and cross-contract interfaces. The compiler auto-converts between native and ARC-4 types at ABI boundaries.
Algorand TypeScript (.algo.ts) ──┐
├──→ Puya Compiler ──→ TEAL ──→ AVM Bytecode
Algorand Python (algopy) ──┘
Contract code (.algo.ts / algopy modules) compiles to TEAL. Test/deploy code is normal TS/Python. Never mix these — see language-subset-model.md.
| Resource | Limit | Notes | | ------------------- | ------------------------------ | ---------------------------------------------------------------------- | | Opcode budget | 700 per app call | Pooled across group (max 11,200; up to 190,400 with inner txn pooling) | | Program size | 2048 bytes per page | Max 4 pages = 8192 bytes total | | Transaction group | 16 transactions | Atomic — all succeed or all fail | | Inner transactions | 256 pooled across group | Max depth 8 levels | | Global state | 64 key-value pairs | Key + value ≤ 128 bytes combined | | Local state | 16 key-value pairs per account | Key + value ≤ 128 bytes combined | | Box storage | 32,768 bytes per box | MBR: 2,500 + 400 × (name + value length) µAlgo; 2,048 bytes I/O per box ref | | Log output | 32 calls, 1024 bytes total | Per app call | | Min transaction fee | 1000 microAlgo | Fee pooling within groups |
Full limits with MBR formulas: avm-resource-limits.md
uint64 and bytes at the AVM level; SDKs provide higher-level abstractions (ARC-4 types, reference types) that compile down to these.algo.ts / algopy compiles to TEAL; test/deploy files are normal TS/Pythonalgorand-typescript or algorand-python for syntax and patterns| Topic | File | When to Read | | --------------- | ----------------------------------------------------------------- | ----------------------------------------------------- | | Execution model | avm-execution-model.md | How programs run, budget pooling, program structure | | Resource limits | avm-resource-limits.md | Hitting limits, planning storage, MBR calculations | | Language subset | language-subset-model.md | Compiler errors, "can I use X?", compilation boundary | | LLM mistakes | common-llm-mistakes.md | Debugging, code review, avoiding anti-patterns |
tools
Guide for writing TypeScript code with AlgoKit Utils (`@algorandfoundation/algokit-utils`). Use this skill whenever the user is building on Algorand with TypeScript — client setup, account management, payments, asset operations, atomic transaction groups, smart contract deployment and interaction (AppFactory, AppClient, ARC-56/ARC-32 specs), raw app calls, key registration, network management, testing with algorandFixture, error handling, and the low-level crypto primitives under `@algorandfoundation/algokit-utils/crypto` (Ed25519 keygen/signing/verification, SHA-512/256 `hash`, Peikert xHD BIP44 wallets, wrapped-secret patterns). Trigger on imports from `@algorandfoundation/algokit-utils` (incl. `/crypto`, `/testing`, `/transact` subpaths), references to `AlgorandClient`, `AppFactory`, `AppClient`, `AlgoAmount`, `algorandFixture`, `ed25519Generator`, `peikertXHdWalletGenerator`, `hash`, `WrappedEd25519Seed`, or `RawEd25519Signer`. Also on any TypeScript or JavaScript code that builds on Algorand.
tools
Guide for writing Python code with AlgoKit Utils (`algokit-utils`). Use this skill whenever the user is building on Algorand with Python — client setup, account management, payments, ASA operations, atomic transaction groups, smart contract deployment and interaction (AppFactory, AppClient, ARC-56/ARC-32 specs), raw app calls, TEAL compilation, key registration, network management, error handling, and the low-level crypto primitives in `algokit_crypto` (Ed25519 keygen/signing/verification, Peikert xHD BIP44 wallets, wrapped-secret patterns) and `algokit_common` (`sha512_256`). Trigger on imports from `algokit_utils` or `algokit_crypto`, references to `AlgorandClient`, `AppFactory`, `AppClient`, `AlgoAmount`, `ed25519_generator`, `peikert_hd_wallet_generator`, `sha512_256`, `WrappedEd25519Seed`, or `RawEd25519Signer`, or any Python code that builds on Algorand.
tools
Builds x402 HTTP-native payment applications on Algorand using TypeScript. Covers clients (fetch, axios), servers (Express, Hono), facilitators, paywalls, Next.js integration, and the @x402-avm core library. Use when implementing x402 payment flows in TypeScript, creating payment-gated APIs, building x402 facilitators or paywalls, or integrating @x402-avm packages.
tools
Builds x402 HTTP-native payment applications on Algorand using Python. Covers clients (httpx, requests), servers (FastAPI, Flask), facilitators, Bazaar discovery, and the x402-avm core library. Use when implementing x402 payment flows in Python, creating payment-gated APIs, building x402 facilitators, or integrating x402-avm packages.