Dependency and permission contracts

September 18, 2026 · View on GitHub

Machine-readable declarations that /nanlabs-core:setup (skill nanlabs-setup) uses to detect, request approval for, install, and verify dependencies.

Canonical path: contracts/requirements/<id>.yaml

Schema (v1)

FieldRequiredDescription
apiVersionyesMust be nanlabs.dev/v1
kindyesMust be RequirementContract
metadata.nameyesKebab-case id; must match filename stem
metadata.descriptionyesHuman summary
metadata.appliesTonoList of skill/plugin/MCP ids this contract covers
spec.requirements.binariesyesList of binary requirements (may be empty)
spec.capabilitiesyesList of capability strings (may be empty)
spec.setupnoInteractive / verification hints
spec.envnoRequired env-var names (never values)

Binary entry

FieldRequiredDescription
nameyesExecutable name (git, python3, clickup, …)
requiredyestrue / false
installed_byyesworkstation | plugin | user
versionnoSemver range hint (informational for v1)
verifynoShell command that exits 0 when present
installersnoMap of macos / linux / windows install hints (strings)

Capability vocabulary (v1 allowlist)

  • filesystem.read
  • filesystem.write
  • subprocess.execute
  • network.outbound
  • mcp.client
  • secrets.env — reads env vars; never writes secrets into git

Setup block

FieldDescription
interactivePrefer approval prompts before system changes
verification_commandOptional post-install check
never_auto_installWhen true, setup only reports gaps (default for workstation-owned binaries)

Doctor (read-only)

python3 scripts/doctor-contracts.py --contract nanlabs-core
python3 scripts/doctor-contracts.py          # all contracts

Never installs software; prints a Markdown gap/change-report template for /setup. 2. Workstation-owned tools (git, python3, OS package manager) use installed_by: workstation and should set never_auto_install: true unless IT policy says otherwise. 3. Plugin-owned optional tools may propose OS installers; setup must ask approval before running them. 4. spec.requirements.binaries[].verify must be a simple argv command (no shell metacharacters). The doctor runs it without a shell. 5. Validate with python3 scripts/validate-contracts.py.

See migration plan §4.4 and docs/AUTHORING.md.