Skills

Write Contract

Write production-quality GenLayer intelligent contracts.

Install

npx skills add internet-court/internet-court-skill --skill write-contract -g -a claude-code -y
Category
Testing
Updated
9d ago
License
See repository
Context cost
Mediumabout 3,000 tokens
Runs scripts
No, instructions only

What it does

Write production-quality GenLayer intelligent contracts. Always pins concrete GenVM runner version hashes and never uses local-only test/latest runner aliases. Covers equivalence principles, storage rules, LLM resilience, and cross-contract interaction.

Write Intelligent Contract

Guidance for writing GenLayer intelligent contracts that pass consensus, handle errors correctly, and survive production.

Critical: Pin the Runner Version

All GenLayer networks reject py-genlayer:test, py-genlayer:latest, and unversioned runner aliases. Every generated contract MUST start with a pinned runner dependency header.

# { "Depends": "py-genlayer:1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" }

test and latest are local-development aliases for GenLayer runtime developers. They may work only in a specially configured local Studio environment with a GenLayer developer environment variable, but they do not work on GenLayer networks and must not appear in generated user contracts.

Before returning any contract code, verify:

  • The first line is a pinned Depends runner version hash.
  • There is no py-genlayer:test.
  • There is no py-genlayer:latest.
  • There is no unversioned py-genlayer.

Always lint with genvm-lint check after writing or modifying a contract.

When to Use GenLayer

Before writing code, decide whether the feature actually needs GenLayer consensus. Recent builder feedback shows many projects start by treating GenLayer as a generic AI backend; push them toward a clear on-chain consensus role.

Use GenLayer when the contract must coordinate or settle around a subjective, external, or AI-mediated judgment that multiple validators should verify independently:

Read the whole SKILL.md on GitHub

More in Testing