Agent skill · Testing & QA

write-contract

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.

Internet Court1,389★ · +222/wk · 1 repos on radarProfile →
claude-codecodexcan modify filesNOASSERTION
Install
npx skills add internet-court/internet-court-skill --skill write-contract --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 3
SKILL.md size: 24 KB
Bundled scripts: none
Allowed tools: -Bash-Read-Write-Edit-Grep-Glob
Path: vendored/genlayer/write-contract/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 1,536 · +147 this week
Language: TypeScript
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

Review
written from the skill's own SKILL.md · Aug 5, 2026

What it does

Guides developers to produce production-quality GenLayer intelligent contracts that pass consensus, handle errors correctly, and survive production. It enforces a pinned GenVM runner version in the first line and prohibits non-versioned or local aliases like py-genlayer:test, py-genlayer:latest, or unversioned runners. It also emphasizes linting with genvm-lint check after writing or modifying a contract. It covers use cases for GenLayer when consensus is needed (dispute resolution, oracle-style markets, compliance, autonomous agents) and requires an architecture boundary note if unclear. It provides a contract skeleton and specific examples for runner dependencies to ensure deterministic, pinned deployment. It details error classification, storage rules, and LLM resilience guidance to ensure validators can independently verify outcomes. It also includes guidance on storage types, layout rules, and how to handle complex state with appropriate GenLayer types and annotations.

How it works

  • Begin each contract with a pinned runner version header, e.g. { "Depends": "py-genlayer:..." }, and ensure there is no py-genlayer:test, py-genlayer:latest, or unversioned py-genlayer references.
  • Use the provided skeleton demonstrating storage fields, init initialization, and public interfaces for on-chain interactions.
  • Pin single-file or multi-file contracts with the appropriate runner section, using the specified formats shown (including py-genlayer-multi for multi-file setups).
  • If embeddings or semantic search are used, prepend the appropriate dependencies in a Seq block, combining required runners in the correct order.
  • Apply Equivalence Principle logic to determine when to use strict_eq for deterministic calls, or a custom validator function for non-deterministic operations, including an example of a validator pattern with leader_fn and validator_fn.
  • Follow the Error Classification and Canonical error handler to distinguish between expected, external, transient, and LLM errors and to route validation accordingly.
  • Store state using GenLayer types (TreeMap, DynArray, u256, etc.) and declare storage fields as class-level annotations, with initialization in init only for non-storage fields.
  • Use the provided guidance for LLM resilience to defensively parse outputs, and avoid trusting leader outputs alone.

When to use it

  • Use GenLayer when the contract must coordinate or settle around a subjective, external, or AI-mediated judgment requiring validator consensus (dispute resolution, oracle-style outcomes, compliance workflows, or auditable settlement).
  • Avoid GenLayer when the task is deterministic, entirely off-chain, or can be handled by a deterministic backend, frontend, or non-consensus workflow.

What it can touch

  • Mentions allowed tools Bash, Read, Write, Edit, Grep, Glob for implementation workflows; contracts themselves must start with a pinned Depends header and lint with genvm-lint.

Caveats

  • The guidance requires strict pinning of runner versions and disallows local aliases; non-deterministic operations should be validated with a custom validator function and possibly non-comparative wrappers if appropriate.
  • It prescribes specific storage typing and layout rules and warns about the complexity of cross-chain interop and the need for precise state management.
From the SKILL.md

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

What's inside
Steps it walks through
  1. Critical: Pin the Runner Version
  2. When to Use GenLayer
  3. Contract Skeleton
  4. Runner Dependencies
  5. Single-file Python contracts
  6. Multi-file Python contract packages
  7. Contracts using embeddings or semantic search
  8. Equivalence Principle — Which One to Use
  9. Decision Tree
  10. Independent verification by default
  11. stricteq — Deterministic calls only
  12. Custom Validator Function (most common)
  13. Convenience Wrappers
  14. Error Classification
Ships with 2 files
  • LICENSE
  • agents/openai.yaml
More from internet-court-skill
All skills →
About this skill
What does the write-contract skill do?

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.

How do I install it?

Run `npx skills add internet-court/internet-court-skill --skill write-contract --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From internet-court/internet-court-skill, a repository with 1,536 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going