# Write Contract

Write production-quality GenLayer intelligent contracts.

- Repository: https://github.com/internet-court/internet-court-skill (7050 stars)
- Category: Testing
- License: see repository
- Last updated: 2026-10-26
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add internet-court/internet-court-skill --skill write-contract -g -a claude-code -y`
Codex: `npx skills add internet-court/internet-court-skill --skill write-contract -g -a codex -y`
Cursor: `npx skills add internet-court/internet-court-skill --skill write-contract -g -a cursor -y`
Gemini CLI: `npx skills add internet-court/internet-court-skill --skill write-contract -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add internet-court/internet-court-skill`

## Description

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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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.

```python
# { "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:

The rest: https://github.com/internet-court/internet-court-skill/blob/HEAD/vendored/genlayer/write-contract/SKILL.md
