Reference
Define once under .moon/tasks/**, inherit many places.
Mission: stop copy-pasting lint/test/format.
.moon/tasks/**/* — inherited by
matching projects
<project>/moon.* — unique
tasks + merge/override
Paths/globs in inherited tasks are relative to the
project root, not the workspace root (unless prefixed
/ for workspace-relative).
# .moon/tasks/node-frontend-library.yml
inheritedBy:
toolchain: 'node'
stack: 'frontend'
layer: 'library'
tags / toolchains: clauses
and / or / not
# project moon.yml
workspace:
inheritedTasks:
include: ['lint', 'test'] # allow-list (optional)
exclude: ['format'] # drop after include
rename:
buildApplication: 'build'
Order: include → exclude → rename.
Global + local task with same ID → merge. Strategies on args/deps/env/inputs/outputs/toolchains:
append (default) — local after globalprepend — local before globalreplace — local wins entirely for that fieldpreserve — keep global only (rare)tasks:
build:
args: '--no-stats'
options:
mergeArgs: 'append'
mergeInputs: 'replace'
Prefer command (mergeable) over script
(replace-only) when inheriting.
implicitDeps — e.g. ^:build on every
inherited task
implicitInputs — e.g. package.json always
invalidates