Moonrepo Run Tasks
Overview
Use this skill for routine execution of moonrepo tasks by project and target, with selector-driven filtering and failure triage.
When to Use
- Running one project target quickly.
- Running affected subsets instead of whole repo.
- Diagnosing common moon task execution failures.
- Running tasks in CI
Core Command Patterns
- Single project target
moon run app:build moon run api:test - Multiple targets/projects
moon run :lint moon run app:build api:test - Affected/scope workflows
moon run :test --affected moon run :lint --projects app,api - Inspect before running
moon query projects moon query tasks app
Running Commands in CI
when running tasks in CI, use ci instead of run.
moon ci :lint
moon ci app:build api:test
moon query projects
moon query tasks app
Triage Flow
- Unknown target/project
- Run
moon query projectsandmoon query tasks <project>.
- Run
- Unexpected dependencies or task fan-out
- Re-run with explicit project/target pair.
- Inspect task config and inheritance in
.moon/+ project configs.
- Tool/runtime mismatch
- Confirm runtime versions via project toolchain manager before retry.
- Cache confusion
- Capture run output first, then compare with clean run (
--updateCacheonly when needed by your policy).
- Capture run output first, then compare with clean run (
Caveats
- Prefer selectors over broad
moon run :targetwhen repo is large. - Avoid “just run everything” in CI-like local checks; it hides dependency problems.
- Always verify project and target names from query commands; don’t guess.
Quick Examples
# validate only one changed app
moon run app:test --affected
# lint two projects only
moon run :lint --projects app,dashboard