Reference

Task inheritance

Define once under .moon/tasks/**, inherit many places. Mission: stop copy-pasting lint/test/format.

Where tasks live

Paths/globs in inherited tasks are relative to the project root, not the workspace root (unless prefixed / for workspace-relative).

inheritedBy (who gets this file)

# .moon/tasks/node-frontend-library.yml
inheritedBy:
  toolchain: 'node'
  stack: 'frontend'
  layer: 'library'

Project filters (after inherit)

# project moon.yml
workspace:
  inheritedTasks:
    include: ['lint', 'test']   # allow-list (optional)
    exclude: ['format']         # drop after include
    rename:
      buildApplication: 'build'

Order: include → exclude → rename.

Same-name merge

Global + local task with same ID → merge. Strategies on args/deps/env/inputs/outputs/toolchains:

tasks:
  build:
    args: '--no-stats'
    options:
      mergeArgs: 'append'
      mergeInputs: 'replace'

Prefer command (mergeable) over script (replace-only) when inheriting.

Implicit extras (global task files)

Inputs / outputs (why inheritance still needs them)