# Work with an LLM

Give your coding assistant this page and the [complete handbook](/llms-full.txt). The [llms.txt index](/llms.txt) links to individual Markdown chapters for assistants that read incrementally.

## Copyable authoring brief

```text
Build a NEW Immutables.art artwork using the current artist handbook at
https://immutables.art/docs/ and https://immutables.art/llms-full.txt.

Ask me for the artistic direction, renderer, intended interactions and whether
time changes the work when those choices are missing. Preserve my aesthetic
intent and artist credit. Do not silently repurpose an existing release.

Deliver the complete posted JavaScript function body, a separate project CSS
stylesheet, an information post, and a short testing report. Include all helper
functions in the script. No HTML wrapper, ES module imports or top-level export.
Do not perform wallet transactions or publish without my explicit instruction.

Runtime:
- p5js receives p; threejs receives t and THREE; vanillajs receives v;
  glsl receives g and must create WebGL with JavaScript.
- Implement context.myCustomRedrawAccordingToNewPropsHandler(props).
- Props: transactionHash (mint transaction), projectId, editionId, tokenId,
  square; non-p5 renderers also get container. IDs can be decimal strings.
- No generic blockHash, timestamp, prevrandao, VRF result or seed prop exists.
- Keep state local per instance. Guard missing inputs. Handle setup, resize and
  cleanup. Distinguish trait identity from layout and animation progression.

Seeds:
- Include the full helper from /docs/examples/edition-seed.js for the current
  deterministic convention, or explain and validate an intentional alternative.
- Mix the full mint transaction hash, full project ID and full edition ID with
  a fixed domain/version. Do not use editionId modulo a small number as the only
  edition input. Preserve the original transactionHash for metadata.
- Use local seeded streams. No Math.random or fresh browser entropy for fixed
  edition traits. Separate named streams can isolate palette, geometry and noise.
- Seed mixing improves differentiation and adds mint-order dependence. It does
  not prevent seed shopping or bots. Do not claim new entropy from extra hashing.
- Stronger allocation requires an actual reviewed contract/reveal integration;
  do not invent one in the art script or describe prospective features as live.

Controls:
- Declare context.immutablesControls with version 1 and supported actions.
- Use descriptive labels; toggle state comes from getState().values[id].
- Text/navigation require onAction; use busy and optional activeControl.
- Non-p5 buttons/toggles use callbacks without key, with native keys implemented
  separately. Exports require an explicit action. Do not auto-download on load.
- Style existing .btn, .form-control, .font-display and .modal-content classes,
  plus the documented .artwork-controls selectors inside #root.
- Preserve idle behavior, focus, reduced motion and 44px touch targets.

Metadata:
- Log console.log('metadata: ', { transactionHash: props.transactionHash, ...traits }).
- Use stable flat string/number traits. Never substitute the derived seed for
  the real transaction hash. Document the current hash-grouping limitation for
  multiple editions minted in one transaction.

Acceptance checks:
- Same hash and IDs reproduce traits and initial composition.
- Same hash with edition IDs 1, 2, 9, 51 and 257 changes the seed.
- Last bytes of the hash affect seed output; normalize IDs consistently.
- Resize, reload and grid/detail mode preserve identity.
- Test native text, keys, toggles, idle handle, exports and CSS in Preview in UI.
- Validate JavaScript and actual rendering; report what was not tested.
- Run the wizard's Hash & mint checks on the final draft; review the copied
  report against its source SHA-256. Resolve defects and explain intentional
  time-dependent or repeating traits. Never turn an inconclusive test into a
  pass just to clear the report, or claim the suite certifies bot resistance.
- Preserve attribution and license. Save exact source and renderer dependencies.
- Use Statistics across rolls to inspect trait frequencies and numerical
  distributions. Report sample mode, count and exclusions. Do not assume equal
  artistic weights, infer missing outcomes are impossible, treat repeated trait
  profiles as identical art, or present synthetic roll statistics as mint odds.

Contract facts:
- Code posts are calldata plus emitted logs on an owned/public code page.
  Reserving a page creates its NFT; every post is not a new NFT.
- The art project references a code-post transaction. Mint events identify
  editions; the viewer recovers the mint transaction hash from those events.
- Projects start inactive and paused. Team controls active; artist/team controls
  pause. Privileged mints still need the configured price and available supply.
- A project lock freezes only fields protected by onlyUnlocked; the contract
  owner can unlock. Do not call it irrevocable or a freeze of every setting.
- Each project's manager receives mint ETH and distributes it on release.
  Anyone may trigger release to configured recipients. ERC-2981 signals royalties
  but does not enforce every marketplace's payment.
- Metadata mode is a platform-owner setting. Contract-generated JSON may still
  reference hosted images. Historical-data access and external dependencies
  must be preserved separately.
```

## Useful source locations for repository-aware assistants

- `clients/art/src/components/P5Cell/P5Wrapper.js` and `ThreeCell/ThreeWrapper.js`: current runtime inputs and lifecycle.
- `clients/art/src/utils/artworkControlConventions.js` and `artworkInput.js`: the declaration validator and callbacks.
- `clients/art/src/services/BlockchainProvider.js`: code-post decoding and mint events.
- `clients/art/public/project-wizard.html`: authoring and publishing flow, adapted built-in examples.
- `contracts/legacy-art/contracts/ImmutablesArt.sol` and `ImmutablesArtRoyaltyManager.sol`: deployed art behavior.
- `contracts/legacy-code/contracts/Immutables.sol`: page NFTs and code posts.

Treat the deployed Solidity, checked-in deployment artifacts and posted artwork as reference material. Make new work in the artist's draft or active client code as instructed. Do not change released seed behavior to make a documentation example pass.

When the docs and source disagree, quote the exact behavior, identify the mismatch and propose a correction. Do not invent a field, method or permission to fit an example.
