Contributing

Maintainer checklist for scoped changes, validation, docs, and release evidence.

On this page

Repository workflow

The root CONTRIBUTING.md owns coding and PR conventions. Use the unified GPU environment for development, inference, Studio, and evaluation. Each contribution commit needs a Developer Certificate of Origin sign-off: git commit --signoff. Commit subjects and PR titles use [type]Description, with no space after the bracket and an English imperative description, such as [test]Cover session cleanup.

Participants follow the Code of Conduct. Potential vulnerabilities use the private reporting process in the Security Policy. First-party contributions use the Apache License 2.0, with retained upstream terms recorded in Third-party notices.

New Python functions and public contracts are type-annotated. Ruff owns format and import order; ty checks types. Pre-commit validates staged files, and the Python quality PR check validates changed Python files. Keep upstream attribution and the configured imported-code exclusions. Mark weight-free unit tests with unit, CUDA tests with gpu, and keep manual inference scripts under tests/manual/ or tests/stream/.

CODEOWNERS covers the repository. PRs need applicable CI results and an approving maintainer/code-owner review. Use squash merge, a descriptive PR title, and retain DCO trailers. Administrators configure main rulesets as described in CONTRIBUTING.md.

Hosted CI dependencies

The lint requirements in pyproject.toml are a dependency group, installed with python -m pip install --group lint after upgrading pip. They are not a package extra; install the public test and MCP extras separately with python -m pip install -e ".[test,mcp]".

Each CI job installs its own dependencies. The CPU tensor job installs matching Torch/Torchvision CPU wheels and the PyAV, ImageIO and ImageIO-FFmpeg backends used by the codec contracts. Packages installed by the Python quality job are not available to the tensor job.

Agent Skills

Repository-authored Agent Skills live in skills/. The skill index covers model inference, evaluation, model integration, benchmark integration, Studio serving, inference optimization, inference validation, PR review, and repository maintenance. Each skill uses a SKILL.md with YAML name, description, license, and compatibility, and Markdown instructions linked to current framework contracts.

Each skill states its scope and owning docs, then gives a workflow with repository commands, gotchas, and done criteria or a report template. References load only for the task that needs them: route manifests for catalog and binding edits, numerical parity for failing comparisons, test selection for Make gate registration, execution lifecycle for compile, graph, warmup, and offload work, the realtime contract for Studio sessions, and the review checklist for pull requests. The skill index records upstream workflow sources. WorldFoundry's architecture and validation contracts own all commands and gates; model integration does not imply serving reliability.

Load a relevant SKILL.md explicitly, or opt in through your client's local skill directory. From the repository root, choose the command for your client:

# Clients that discover .agents/skills
mkdir -p .agents && ln -s ../skills .agents/skills

# Claude Code
mkdir -p .claude && ln -s ../skills .claude/skills

# Cursor
mkdir -p .cursor && ln -s ../skills .cursor/skills

These client directories are gitignored. To load one skill into an existing skill directory, link only that skill, for example:

mkdir -p .agents/skills
ln -s ../../skills/worldfoundry-model-integration .agents/skills/worldfoundry-model-integration

Client discovery and activation depend on the client's configuration. Skills complement AGENTS.md and CONTRIBUTING.md; those files still own repository rules. skills/index.md is the directory index.

Authoring and validation

Follow the official specification and best practices.

  • SKILL.md starts with YAML frontmatter. Required fields are name and description; the body contains the task procedure.
  • Names are 1–64 lowercase letters, digits, and hyphens, with no leading, trailing, or repeated hyphens, and must match the parent directory. Repository skills use the worldfoundry- prefix.
  • Descriptions are non-empty and at most 1024 characters. Start with "Use this skill when…", describe the user's intent and relevant task contexts, and name the sibling skill for nearby tasks the skill does not cover.
  • license, compatibility, metadata, and allowed-tools are optional standard fields. Repository skills declare Apache-2.0; use compatibility for specific checkout or environment requirements (at most 500 characters).
  • Keep each skill focused and its SKILL.md below 500 lines. Discovery loads name and description, activation loads instructions, and execution loads references as needed. State when to read a reference and resolve file links relative to the skill directory. Repository commands run from the repo root and use wf; repository paths, make targets, and python -m modules named in a skill must exist.
  • Add scripts/, references/, or assets/ only when the task needs them. Scripts use explicit arguments, documented dependencies, --help, and non-interactive execution. Include bundled resources in MANIFEST.in.

Once the official skills-ref reference CLI is installed, validate format and repository references from the repo root:

skills-ref validate skills/worldfoundry-model-integration
python -m pytest -q tests/core/test_agent_skills.py

Format validation does not prove activation reliability or task quality. For behavior evaluation, start with two or three representative tasks and a nearby request that should not activate the skill. Use clean contexts with and without the skill, check whether the relevant SKILL.md was loaded, and compare concrete outputs and commands. Keep generated evaluation outputs under tmp/, outside Git.

Before a PR

Before opening a PR, confirm the following:

  • Scope — Keep the change to one pipeline, benchmark path, runner layer, or documentation area.
  • Runtime — Name the intended environment: runtime profile, hosted API, checkpoint-backed local run, plus any official repo provenance.
  • Assets — Do not commit checkpoints, generated videos, local caches, credentials, or large downloaded datasets. Keep generated assets and benchmark data explicit, reproducible, and outside git.
  • Evidence — Include commands, output paths, skipped stages, and blockers in the PR description.

Code expectations

  • Python — Keep imports lazy when a model or benchmark has heavy optional dependencies.
  • Public entry points — Put user-facing runtime classes under worldfoundry/pipelines/ or evaluation runners under worldfoundry/evals/.
  • Model runtimes — Implement runtime integrations under worldfoundry/synthesis/** in-tree. Do not depend on machine-local external checkouts; record external repos/checkpoints only as provenance or acquisition metadata until ported or vendor-reviewed.
  • Vendored code — Treat reviewed thirdparty/ code as isolated code. Record its license name and upstream URL in the repository notice and provenance files linked from Third-party notices. Retain component license files required by upstream distribution terms and declare them in package data; the license gate records reviewed exceptions. Keep the project license at the repository root and provenance in the central notices. Operational documentation belongs in Fumadocs. Prefer git submodules for large independently versioned upstreams; keep in-tree copies only when heavy patching is required. Do not duplicate code that already lives under worldfoundry/base_models/ or worldfoundry/synthesis/. thirdparty/UPSTREAM_PROVENANCE.md indexes every component. In-tree: matrix-game/ is an optional Git submodule, gsplat/ is vendored source, and fastvideo-kernel/ is the optional STA / VSA / VMoBA / TurboDiffusion kernel tree (build with CUDA_HOME + ./build.sh; ThunderKittens only on Hopper sm_90a non-aarch64; FP4 attention only on Blackwell sm_120a with CUDA ≥ 12.8). Not distributed: FlashAttention (install with scripts/setup/install_flash_attn.sh), diff-gaussian-rasterization (the depth-capable Gaussian rasterizer used by pixelSplat), and simple-knn (CUDA KNN extension); provide them in the environment that needs them.
  • Synthesis — Keep worldfoundry/synthesis/** infer-only: runtime wrappers, model code needed at inference time, checkpoint/path helpers, and minimal runtime configs. Do not add training launchers, dataset builders, demo media, notebooks, or generated outputs. Keep local demo assets under the gitignored testcase/ directory.
  • Formatting — Avoid large unrelated formatting changes. Do not rewrite generated or vendored files unless the task requires it.
  • Naming — Prefer canonical ids and direct runner paths; when a public name changes, document the migration instead of adding long-lived compatibility maps.

Validation selection

Match validation evidence to the surface you changed:

  • Runner, scorecard, tasks, registry — Public CLI discovery, planning, and artifact validation commands.
  • Single pipeline run — The smallest documented validation script and its generated manifest.
  • Stateful or interactive pipeline — A documented stream command with bounded runtime evidence.
  • Benchmark runner — Runner execution plus zoo benchmark-run --mode official-validation with official-shaped result files when normalizer review is needed.
  • Model runner — Resolver/manifest validation plus a clear skipped path for missing checkpoint or credentials.

Docs expectations

Fumadocs is the maintained surface for user and developer guides. Add or update paired English and Chinese pages under docs/fumadocs/content/docs. Any directory may keep a README.md for its own code or tooling. Inside the package, worldfoundry/, each top-level package, and each worldfoundry/base_models/<subpackage>/ keep one short README.md as a package map (purpose, layout, entry points, links to these pages); update it when modules are added, moved, or removed.

When you change behavior, update the page that owns it:

  • New model or runtime profile — guides/supported-models, the per-model article at guides/supported-models/<model-id>.mdx (and .zh.mdx), reference/environments, and the model guide if behavior changes. Refresh checked-in homepage recipes and generated model pages with npm --prefix docs/fumadocs run models:generate, then verify them with npm --prefix docs/fumadocs run models:check. Set pageSource: authored on a model MDX file before hand-editing so later generates will not overwrite it. To refresh paper titles and teaser figures, run npm --prefix docs/fumadocs run models:media after generate.
  • New benchmark — evaluation/benchmark-hub/<benchmark-id>, the benchmark guide, and maintainer architecture pages when internals change.
  • CLI or output schema — reference/cli and architecture pages that own the changed behavior.
  • Internal workflow — maintainers/architecture (especially workflow and evaluation-core).

Python-backed docs codegen and drift checks (api:*, models:*, coverage:*, and cli:screenshots) go through docs/fumadocs/scripts/run-python.sh. Override the interpreter with WF_DOCS_PYTHON (then PYTHON, then python3 / python) when needed.

Documentation setup and deployment

The documentation app uses Next.js 16, React 19, Fumadocs, and Tailwind CSS 4. Use Node.js 22 (docs/fumadocs/.nvmrc), npm, and the unified Python environment. From the repository root:

npm --prefix docs/fumadocs ci
npm --prefix docs/fumadocs run dev
bash scripts/docs/build.sh
npm --prefix docs/fumadocs start

The development and static-preview servers use http://localhost:3000; both /docs and /zh/docs are available. Add --skip-install to the build command when dependencies are already installed. The build checks types and generated data before exporting docs/fumadocs/out/.

Inside docs/fumadocs/, app/ owns routes, components/ shared UI, content/docs/ paired pages, mdx/partials/ shared prose, lib/ helpers and catalog data, public/ assets, and scripts/ tooling. source.config.ts configures collections; next.config.mjs configures static export and caching. .source/, generated/, tmp/, .next/, and out/ are generated. Run api:generate, models:generate, benchmarks:generate, or coverage:generate after changing their inputs; for the last three, then run the matching *:check. models:homes:check validates model pages; types:check generates MDX/types and checks TypeScript.

.github/workflows/deploy-docs.yml publishes the static export on matching main changes or manual dispatch. Set these values before the deployment build:

VariableOfficial deployment
NEXT_PUBLIC_BASE_PATH/WorldFoundry; empty for local development.
NEXT_PUBLIC_SITE_URLhttps://openenvision.github.io.

Fast site iteration

Docs development does not need git lfs pull.

GIT_LFS_SKIP_SMUDGE=1 git clone https://github.com/OpenEnvision/WorldFoundry.git

WorldFoundry ships one maintained web site: the Fumadocs docs app at docs/fumadocs/. Homepage, benchmark hub, model catalog, and API reference are routes inside that app — not separate build targets. Studio (worldfoundry/studio/) is a Python FastAPI app, not a Next.js site.

Every site must keep fast iteration npm scripts in-repo. Production CI runs scripts/docs/build.sh through deploy-docs.yml.

Site

  • Docs (Fumadocs)

    Pathdocs/fumadocs/

    Env prefixWF_DOCS_*

    dev:fastnpm run dev:fast

    dev:ssdnpm run dev:ssd

    dev:localnpm run dev:local

    build:fastnpm run build:fast

From the repo root you can also use make docs-dev-fast, make docs-dev-ssd, make docs-dev-local, or make docs-build-fast.

The docs app contains hundreds of bilingual model and benchmark pages and large generated JSON catalogs. On a shared filesystem, npm run dev can feel slow because each start may rerun MDX codegen and cold webpack caches.

Fastest dev on shared storage (recommended):

cd docs/fumadocs
npm run dev:ssd
# or from repo root: make docs-dev-ssd

dev:ssd symlinks hot paths to local SSD (~/.cache/worldfoundry-docs/<checkout-id> by default): tmp/ (Next.js + webpack), .source/ (MDX codegen), and node_modules/.cache. Sources stay on the shared checkout — no full rsync on each start. First run migrates existing .source/ output; Next.js and webpack caches are rebuilt on SSD.

For day-to-day UI/CSS polish when already on fast local disk:

cd docs/fumadocs
npm run dev:fast

dev:fast reuses existing .source/ output without checking for content changes and reuses generated/python-api.json unless missing. Regenerate MDX after adding pages or changing navigation or frontmatter. Development caches use tmp/ by default; on shared storage, prefer dev:ssd to place them on local SSD.

If node_modules I/O is also slow, mirror the whole site to local SSD:

cd docs/fumadocs
npm run dev:local

dev:local refreshes source files in a checkout-specific mirror under /tmp/wf-docs-dev/<checkout-id>/WorldFoundry and reuses its installed dependencies. Set WF_DOCS_LOCAL_ROOT to choose another mirror root.

To smoke-test static export locally without CI drift checks:

cd docs/fumadocs
npm run build:fast

Useful environment variables (WF_DOCS_*):

Variable

  • WF_DOCS_SKIP_MDX=1

    Reuse existing MDX output on dev start; missing output is generated once. Run npm run mdx:generate after adding pages or changing navigation or frontmatter. WF_DOCS_REFRESH_MDX=1 forces regeneration.

  • WF_DOCS_REFRESH_MDX=1

    Force MDX regeneration on the next dev start.

  • WF_DOCS_REFRESH_API=1

    Regenerate generated/python-api.json.

  • WF_DOCS_KEEP_DIST=1

    Retained in fast-script invocations; cache placement is controlled by next.config.mjs and the cache variables below. Development uses tmp/next; production uses .next.

  • WF_DOCS_CACHE_ROOT

    Override the webpack cache root; use WF_DOCS_SSD_ROOT with dev:ssd to relocate all hot caches.

  • WF_DOCS_SSD_ROOT

    Override SSD symlink root for dev:ssd (default: ~/.cache/worldfoundry-docs/<checkout-id>).

  • WF_DOCS_UI_ONLY=1

    Ignore model/benchmark MDX dirs in webpack watch (CSS/component edits only; model page HMR disabled).

  • WF_DOCS_WEBPACK_CACHE_DIR

    Override webpack filesystem cache location.

SSD cache helpers: npm run ssd:setup, npm run ssd:status, npm run ssd:clean (add -- --purge to delete SSD data).

After changing model manifests, run npm run models:generate once, then WF_DOCS_REFRESH_MDX=1 npm run dev (or npm run mdx:generate while the dev server is stopped). Editing an existing MDX page during dev hot-reloads without regenerating .source/; new pages or meta.json changes require WF_DOCS_REFRESH_MDX=1.

npm run dev:turbo tries Turbopack instead of webpack. Treat it as experimental — production GitHub Pages still uses npm run build (webpack + static export).

Adding a new site

When you add another Next.js or static site under docs/<name>/:

  1. Add dev:fast, dev:local (optional SSD mirror script), and build:fast npm scripts.
  2. Use env vars prefixed WF_<SITE>_ (e.g. WF_STUDIO_SKIP_MDX=1) for skip/refresh toggles.
  3. Add a predev.mjs (or equivalent) that smart-skips codegen when outputs are current.
  4. Wire make docs-<site>-dev-fast targets if the site is commonly used from the repo root.
  5. Extend the site catalog in this section (English and Chinese pages).

Production deploy speed is separate: CI runs full types:check, catalog drift checks, and static export for all pages.

Local validation

bash scripts/setup/bootstrap_worldfoundry.sh
source tmp/worldfoundry_unified_env.sh
conda activate "${WORLDFOUNDRY_UNIFIED_ENV_PREFIX}"
python -m pip install -e ".[dev,test]"
pre-commit install
pre-commit run
make lint
make docs-check
cd docs/fumadocs && npm run types:check && npm run build

Run the fast, weight-free checks in the same GPU development environment:

make test-infer
make cli-check cli-entrypoint-check packaging-check

For model/profile audits:

wf run --all-benchmarks --plan-only \
  --output-dir tmp/worldfoundry_plan_matrix \
  --json
wf validate-artifact tmp/worldfoundry_plan_matrix/suite_manifest.json \
  --kind suite-manifest \
  --strict \
  --json

For staged zoo validation:

conda run -p "${WORLDFOUNDRY_UNIFIED_ENV_PREFIX}" wf zoo models --json
conda run -p "${WORLDFOUNDRY_UNIFIED_ENV_PREFIX}" wf zoo benchmarks --json
conda run -p "${WORLDFOUNDRY_UNIFIED_ENV_PREFIX}" wf run --all-benchmarks --plan-only --output-dir tmp/worldfoundry_plan_matrix --json
conda run -p "${WORLDFOUNDRY_UNIFIED_ENV_PREFIX}" wf validate-artifact tmp/worldfoundry_plan_matrix/suite_manifest.json --kind suite-manifest --strict --json

PR evidence

Use the repository's PR template. Include commands, results, hardware and asset requirements, affected docs, and relevant run artifacts. After signing your commits, run:

make pr-check BASE_REF="$(git merge-base origin/main HEAD)"

Review rule

A PR can add planned or source-verified entries without runnable support. It must not claim demo parity, checkpoint parity, or benchmark readiness without matching fresh evidence.

Public test sources live under tests/; model weights, test media and generated replay evidence stay outside git. Inference changes must replay affected real-checkpoint cases and pass make test-geometry against an accepted reference. See Validation for numerical comparison and source-hash verification.