debug-task

A diagnostic workflow for broken or unexpected moon tasks. moon is a tool for managing tasks across a monorepo, and the workflow starts by inspecting the task’s fully resolved configuration.

In plain words
What is it for?
Use it to debug a specific project task that fails, hangs, skips, reruns unnecessarily, uses stale results, or produces missing or incorrect output.
Why use it?
It helps identify whether inheritance, commands, caching, outputs, or task settings are causing the problem.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/moonrepo/moon/debug-task
Any agent
npx skills add moonrepo/moon --skill debug-task
Clone the repo
git clone --depth 1 https://github.com/moonrepo/moon

Made for: Claude Code, Codex.

Per session 231 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,467 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00231 $0.04467
Opus 5 $0.00115 $0.02233
Sonnet 5 $0.00046 $0.00893
Haiku 4.5 $0.00023 $0.00447

Measured 2d ago against content hash 959b01886e66, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

debug-task scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/debug-task/SKILL.md · 271 lines

How it starts

The opening of the file, as written. The whole thing — 271 lines — stays where its author put it; the contents beside it link to each section on GitHub.

moon task debugger

A workflow-oriented diagnostic skill for troubleshooting moon tasks. This is not a reference manual — it guides you through a structured debugging flow so you can isolate the problem quickly.

For conceptual background, see the moon documentation.

Before you start: Ask the user for the <project>:<task> target to debug. If they haven't provided a specific target, prompt them for it — the diagnostic flow requires a concrete target to inspect.


Quick-start: 5-step diagnostic flow

Work through these steps in order. Most issues resolve by step 3.

Step 1: Inspect the resolved task configuration

The first thing to check is whether the task is configured the way the user expects. moon merges configuration from multiple sources (global tasks, project config, inheritance), so the resolved result can surprise people.

# Show the fully resolved task config (with inheritance applied)
moon task <project>:<task>

# Machine-readable version for programmatic inspection
moon task <project>:<task> --json

What to verify:

  • command vs script — if the command contains pipes (|), redirects (>), chained commands (&&), or complex syntax, it must use script, not command.
  • inputs — are they too broad (**/* captures everything) or too narrow (missing source files)? Check state.defaultInputs (true = using default **/*) and state.emptyInputs (true = explicitly set to []). Both keys are omitted from the JSON entirely when false, as is state.setRunInCi.
  • outputs — are they declared for build tasks? Missing outputs means the cache can never hydrate artifacts. In v2.3+, outputs also affect the default cacheStrategy of any task that depends on this one (see Step 4).
  • toolchains — is the correct toolchain(s) assigned? An incorrect toolchain means wrong tool versions.
  • deps — are task dependencies correct and complete? In v2.3+, each dep entry can carry a cacheStrategy (hash / ignored / outputs) that controls whether the dep contributes to this task's cache hash. If omitted, the default depends on whether the dep declares outputs.
  • options — check persistent, runInCI, cache, affectedFiles, mutex, timeout, retryCount, allowFailure, and os.
  • env — in v2.5+, environment variables can also be inherited from a workspace-level env in .moon/tasks/**/* (merged into the project's env, project wins), and the project can change the merge behavior via workspace.mergeStrategies.env. A variable with a surprising value may come from a layer outside the task.
  • checks v2.4+ — shell scripts that run before the task. Their type determines the outcome: a requirement failing makes the task fail, all condition checks passing makes the task skip, and a fingerprint folds script output into the task hash. A surprising fail, skip, or cache invalidation often traces back to a check.
  • tags v2.3+ — labels for grouping tasks. Affects targets like :#quality and MQL taskTag queries. If a task isn't matched by a #tag target you expected, check this list.
  • typebuild (has outputs), test (default), or run (persistent)
  • presetserver or utility apply multiple option defaults at once.

Read the full file on GitHub · 271 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 271 lines · 231 tokens per session scan A 959b01886e66

Subscribe to this mod's changes

debug-task is a skill published in the GitHub repository moonrepo/moon (4,081 stars, last pushed 3d ago), licensed MIT. It adds 231 tokens to every session and 4,467 once invoked, about $0.0012 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

turborepo

Turborepo monorepo build system guidance. Triggers on: turbo.json, task pipelines, dependsOn, caching, remote cache, the "turbo" CLI, --filter, --affected, CI optimization, environment variables, internal packages, monorepo structure/best practices, and boundaries. Use when user: configures tasks/workflows/pipelines…

vercel/turborepo · 111 tokens

zuke-write-build

Write or edit a Zuke build (zuke.ts) — the code-first, strongly-typed build system for Deno/TypeScript. Use when adding or changing targets, wiring dependencies, calling a tool wrapper (DenoTasks, NpmTasks, DockerTasks, ...), generating CI, or authoring/refactoring a zuke.ts build file. For first-time project…

zuke-build/zuke · 93 tokens

zuke-setup

Set up Zuke — a code-first, strongly-typed build automation system for Deno/TypeScript — in a project. Use when the user wants to add Zuke to a repo, scaffold a zuke.ts build file, install the Zuke CLI, or bootstrap the ./zuke launcher. After scaffolding, switch to the zuke-write-build skill to author targets.

zuke-build/zuke · 82 tokens

review-pr

Review a Deno runtime pull request for correctness, tests, security, and conventions. Use when asked to review a PR or when a PR number/URL is provided for review.

denoland/deno · 39 tokens

node-compat

Run a Node.js compatibility test, diagnose failures, and either fix the implementation, skip, or ignore the test. Use when asked to work on node compat tests.

denoland/deno · 37 tokens

migrate-internal-package

Move a package from another TryGhost repository into Ghost as an internal-only workspace package while preserving its Git history. Use for package migrations from repositories such as TryGhost/SDK or TryGhost/framework, including the history import PR, exceptional merge-commit handoff, source-repository removal PR…

TryGhost/Ghost · 77 tokens