-
-
Notifications
You must be signed in to change notification settings - Fork 222
Description
Is your feature request related to a problem? Please describe
As AI-powered coding assistants (GitHub Copilot, Cursor, Claude Code, Codex CLI, Gemini CLI, etc.) become standard tools in developer workflows, their usefulness depends entirely on the quality of structured, machine-readable knowledge available about a given tool.
Moon is a powerful but nuanced build system — it has a specific CLI surface, a layered configuration model (.moon/workspace.*, .moon/toolchains.*, .moon/tasks/**/*, moon.*), support for multiple config formats (YAML, TOML, JSON, PKL), and a set of concepts (projects, tasks, tags, toolchains, layers, stacks, the task graph, WASM plugins, remote caching, affected detection, execution plans) that are non-trivial and not well-represented in LLM training data.
In practice, this means:
- LLMs hallucinate Moon CLI flags that don't exist, or confuse them with Nx/Turborepo equivalents.
- Assistants generate
moon.*configs with invalid schema, wrong inheritance patterns, or missing required fields. - v1 → v2 breaking changes (camelCase → kebab-case flags,
toolchain.yml→toolchains.*, "touched files" → "changed files", moonbase sunset, WASM-based toolchains) are almost never reflected in LLM-generated output. - Concepts like
affected-files, task inheritance via.moon/tasks/**/*, tag-basedinherited-byconditions, and the distinction betweencommand+argsvsscriptare consistently explained incorrectly. - Developers waste time debugging AI-generated Moon configuration instead of building.
There is currently no official, canonical Agent Skill for LLMs to ground their understanding of Moon. While Moon already ships an llms.txt file on its website (added in v1.37.1), an MCP server via moon mcp, and a community skill exists (hyperb1iss/moonrepo-skill), none of these fully covers the gap: the llms.txt is a documentation index without procedural guidance, the MCP server provides dynamic tool access but not static knowledge grounding, and the community skill — while well-structured — is not versioned alongside Moon releases or maintained by the Moon team. An official Moon Skill — a structured, LLM-optimized knowledge document — would solve this gap directly, complementing the existing llms.txt and MCP server.
Describe the solution you'd like
An official Moon Skill published and maintained in the moonrepo/moon repository (or a dedicated moonrepo/moon-skills repo), structured for consumption by LLM coding assistants following the open Agent Skills specification published at agentskills.io. Additionally, improvements to the existing llms.txt on the Moon website to align with the llms.txt standard.
The Agent Skills standard uses a SKILL.md file with YAML frontmatter (name, description) that agents load with progressive disclosure: only the name and description are read at startup (zero context cost), and the full instructions are loaded only when the skill is triggered. This means a repository can have dozens of skills installed with no performance penalty. Skills are cross-platform by design — authored once, works everywhere the spec is implemented.
Proposed structure
Per the Agent Skills specification, each skill lives in a directory whose name must exactly match the name field in its SKILL.md frontmatter. The spec recommends keeping SKILL.md under 500 lines (< 5,000 tokens), with detailed reference material pushed to separate files that agents load only when needed (progressive disclosure). The spec does not mandate a single canonical skills directory — different agents scan different paths (.github/skills/, .claude/skills/, .agents/skills/, .opencode/skills/). The Skills CLI handles installation to each agent's expected path automatically.
skills/
├── moon/ # directory name MUST match frontmatter `name: moon`
│ ├── SKILL.md # Required: YAML frontmatter + entry instructions (<500 lines)
│ ├── references/ # Loaded on-demand — zero context cost until accessed
│ │ ├── concepts.md # workspace, project, task, toolchain, tag, layer, stack — precise definitions
│ │ ├── cli-reference.md # moon run, moon exec, moon check, moon ci, moon query, moon sync, moon init, moonx, moon mcp
│ │ ├── config-reference.md # Annotated schemas: workspace.*, toolchains.*, tasks/**/*.*, moon.*, extensions.*
│ │ ├── task-inheritance.md # inherited-by (toolchains, stacks, layers), extends, merge strategies, command vs script
│ │ ├── affected-mode.md # --affected, MOON_BASE/MOON_HEAD env vars, changed files, CI integration
│ │ ├── remote-caching.md # Depot, self-hosted gRPC (Bazel RE API), cache keys, outputs correctness
│ │ ├── docker.md # moon docker scaffold, moon docker setup, moon docker prune, Dockerfiles
│ │ ├── wasm-plugins.md # Toolchain WASM plugins, extensions, PDK API
│ │ ├── execution-plans.md # moon exec --plan, JSON plan format, CI job partitioning (v2.1+)
│ │ └── v2-migration.md # Breaking changes from v1 → v2, moon migrate v2, kebab-case flags
│ └── assets/
│ ├── workspace-config.md # Annotated real-world .moon/workspace.yml example
│ ├── project-config.md # Annotated moon.yml with tasks, deps, docker, and tags
│ └── ci-pipeline.md # Full GitHub Actions + moon ci / moon exec --plan integration example
└── proto/ # Optional: companion skill for proto version manager
├── SKILL.md # proto install, proto use, .prototools, plugin system
└── references/
├── commands.md
└── config.md
What each section should cover
The spec recommends keeping SKILL.md under 500 lines and moving detailed material into references/ files that are linked from the body and loaded on demand. This drives the split below.
SKILL.md (entry point — should stay under 500 lines)
- YAML frontmatter with
name: moon,description(1–1,024 chars, should include trigger keywords), optionallicense, optionalcompatibility, optionalmetadata(e.g.,metadata.moon-version: "2.1"— custom extension) - What Moon is and is not (vs. Nx, Turborepo, Bazel)
- Core concept glossary (workspace, project, task, toolchain, tag, layer, stack)
- Quick-reference table of the most common
moon run/moon execinvocations - Common mistakes / anti-patterns (critical for reducing hallucinations)
- v2-specific callouts: kebab-case flags, multi-format config,
command+argsvsscript, WASM toolchains - Links to each
references/*.mdfile with a one-line description of when to load it - Version of Moon this skill was written against
references/concepts.md
- Workspace, project, task, toolchain, tag, layer, stack — precise definitions with no ambiguity
- The task graph and how Moon evaluates execution order (DAG, topological order)
- Target syntax for CLI commands:
project:task,:task,~:task,#tag:task, glob patterns - Configuration-only scopes (not valid as CLI targets):
^:task(upstream dependencies),~:task(self-reference in deps/inputs) - The
.moonworkspace root (and.config/moonalternative for reduced clutter)
references/cli-reference.md
- Every primary command (
run,exec,check,ci,query,sync,init,mcp,docker,generate,ext,toolchain,setup,teardown,upgrade) with flags and common usage patterns - Global options:
--cache <MODE>(read-write/read/write/off),--log <LEVEL>(off/error/warn/info/debug/trace/verbose),--dump(trace profile),--theme(dark/light),--concurrency,--quiet - Special emphasis on v2 changes:
moon exec(low-level),moonx(shorthand binary),moon extension, interactive selection prompts when no identifier provided - Clear distinction:
moon runvsmoon checkvsmoon civsmoon exec moon mcpfor AI agent integration via MCP server
references/config-reference.md
- Annotated schemas for
.moon/workspace.*,.moon/toolchains.*,.moon/tasks/**/*,moon.*,.moon/extensions.* - Required vs. optional fields, valid value types, defaults
- Multi-format support (YAML, TOML, JSON, PKL) — note the
.*wildcard convention - Cross-referenced with common mistakes in the
SKILL.mdentry point
references/task-inheritance.md
- How global tasks in
.moon/tasks/**/*propagate to projects viainherited-byconditions inherited-bywithtoolchains,stacks,layers(supportsor,notoperators)extends, merge strategies (append,prepend,replace)command+argsfor simple commands;scriptfor compound commands (pipes, redirects, chaining)- Task presets (
server,utility) and their defaults
references/affected-mode.md
--affected,MOON_BASE/MOON_HEADenv vars, "changed files" (not "touched files" — renamed in v2)affected-filestask option: boolean,"args","env", or object form withfilter(glob patterns),passDotWhenNoResults(v2.1),passInputsWhenNoMatch- Full GitHub Actions integration example
references/remote-caching.md
- Depot (recommended hosted option) and self-hosted gRPC (Bazel RE API)
⚠️ moonbase has been sunset (v1.34.0) — do not reference as current- Cache key anatomy,
outputscorrectness requirements
references/docker.md
moon docker scaffold,moon docker setup,moon docker prune- Docker config in
moon.*(project-level):docker.file,docker.image,docker.build.setup,docker.build.prune,docker.build.run - Tera template support for custom Dockerfiles
references/wasm-plugins.md
- How toolchains are now WASM plugins (not hard-coded)
- Extension plugins with
define_extension_config,initialize_extension,extend_project_graph, etc. - How to reference community toolchain plugins
references/execution-plans.md (v2.1+)
- JSON plan format for
moon exec --plan - Four top-level blocks:
targets,pipeline,affected,graph - CI job partitioning with
--jobandpipeline.jobTotal - Dependency scope targeting:
^production:task,^development:task(v2.1)
references/v2-migration.md
- All breaking changes: camelCase → kebab-case,
toolchain.yml→toolchains.*,tasks.yml→tasks/**/*, "touched" → "changed" moon migrate v2commandcommand+argsrestrictions (simple commands only; usescriptfor compound)- Removed commands (
moon node,moon migrate from-package-json,moon query hash,moon query hash-diff) - Removed presets (
watcher— removed in v2) .envfile handling changes (deferred loading,*.localfiles)
Describe alternatives you've considered
1. Third-party community skills
The most notable existing effort is hyperb1iss/moonrepo-skill, a well-structured community skill covering both Moon and proto with references, examples, and slash commands. It demonstrates strong community demand for this capability. However, community skills are:
- Not versioned alongside Moon releases — they can drift as Moon evolves (e.g., the existing community skill references
.moon/tasks/*.ymlrather than the v2.moon/tasks/**/*directory structure, and uses.ymlextensions instead of the format-agnostic.*convention) - Not authoritative — they reflect one maintainer's understanding, not the Moon team's
- Not automatically discoverable by developers using
moon init
Other developers have created local skill files or Cursor rules for Moon. These share the same limitations.
2. Relying on the existing llms.txt, MCP server, and documentation site
Moon already ships an llms.txt on its website (added in v1.37.1), an MCP server via moon mcp (added in v1.37), and the documentation is comprehensive. However:
- The
llms.txtis a documentation index — it does not contain the procedural, anti-pattern-aware, task-specific guidance that an Agent Skill provides - The MCP server provides dynamic tool access (querying projects, running tasks) but not static knowledge grounding (correct config patterns, common mistakes, migration guidance)
- The documentation site is not structured for LLM consumption (no explicit "common mistakes" section, no machine-readable schema summaries)
- LLMs cannot reliably fetch and parse HTML documentation at inference time in most environments
- Neither format maps to the progressive disclosure model that Agent Skills use (metadata → instructions → references)
An official Skill is complementary to all three — the Skill handles procedural "how to use Moon correctly" knowledge; the llms.txt handles documentation discovery; the MCP server handles runtime interaction.
3. Auto-generated API reference
Moon generates JSON Schemas to .moon/cache/schemas for all config files (via moon sync config-schemas), and the VS Code extension auto-configures these. However, raw JSON Schema is poorly suited for LLM consumption — it lacks context, examples, and the explanatory prose that helps a model generate correct code. It also doesn't cover CLI usage, anti-patterns, or workflow guidance.
Additional context
Why this matters for adoption
Moon's learning curve is real. The configuration model is powerful but non-obvious, and the gap between "I know what Moon does" and "I can write correct Moon config from scratch" is wide. The v1 → v2 migration added another layer: developers and LLMs trained on v1 patterns will generate broken configs unless explicitly guided. LLM coding assistants are now the primary way many developers explore and adopt new tooling. If an LLM confidently generates broken Moon config (wrong file names, camelCase flags, moonbase references), that developer may abandon Moon before ever seeing its value.
A high-quality official Skill lowers that friction significantly.
Prior art in other projects
The industry has converged on two complementary standards for LLM-optimized documentation, and major tooling projects are already shipping both.
The llms.txt standard (the llms.txt proposal) — proposed by Answer.AI's Jeremy Howard in September 2024 — defines a curated, Markdown-formatted index at a project's root that tells AI agents which documentation to prioritize and where to find clean .md mirrors of each page. Notable adopters in the developer tooling space:
- Stripe (llms.txt) — ships multiple
llms.txtfiles with aninstructionssection that steers AI agents toward current API primitives. - Vercel (llms.txt) — publishes a
llms-full.txtcontaining their platform docs in a single file for AI tools. - Cloudflare (llms.txt) — ships one of the most extensive implementations with product-specific files and a
llms-full.txt. - Anthropic (llms.txt) — maintains a table of contents for their Claude API docs.
The Agent Skills standard (SKILL.md) — an open format maintained at Agent Skills, adopted across dozens of agent platforms including Claude Code, GitHub Copilot (VS Code + coding agent + CLI), Cursor, OpenAI Codex, Gemini CLI, Goose, Windsurf, Amp, OpenCode, Antigravity, Kilo Code, Kiro CLI, Roo Code, Trae, and more. Skills package procedural knowledge as a directory with a SKILL.md manifest that agents load progressively: metadata first, full instructions only when the skill is triggered. Key adopters include:
- Expo (expo/skills) — ships an official skill collection covering dev client setup, native UI patterns, SDK usage, and Tailwind/NativeWind configuration.
- Railway (railwayapp/railway-skills) — maintains a
use-railwayskill with route-first design, covering project setup, deployment, troubleshooting, and environment management via action-oriented references. - Microsoft (microsoft/skills) — publishes 130+ skills across Azure, AI, and SDK domains with comprehensive test scenarios, MCP server configurations, and custom agents. Also maintains microsoft/azure-skills as a focused plugin with 20 curated Azure workflow skills.
- Vercel Labs (vercel-labs/agent-skills) — hosts React, Next.js, and web design skills.
The Skills Directory is the open community registry for this ecosystem — built and maintained by Vercel Labs (vercel-labs/skills). It hosts thousands of published skills, discoverable and installable with a single command:
npx skills add <owner/repo>A Moon skill published under moonrepo/moon or moonrepo/moon-skills would be immediately discoverable by any developer running a skills-compatible agent. The existing community skill hyperb1iss/moonrepo-skill validates this demand and could serve as a starting point.
Moon would be well-positioned to lead in this space for the build tooling category.
Who would benefit
- Developers onboarding to Moon in an AI-assisted workflow (Cursor, Copilot, Claude Code, Codex CLI, Gemini CLI)
- Teams migrating from v1 to v2 who rely on AI for config refactoring
- Teams adopting Moon across a monorepo who use AI for config generation
- Contributors to Moon-adjacent tooling who need accurate conceptual references
- Anyone building Moon integrations who uses LLMs for boilerplate
Suggested ownership
A full implementation would cover two complementary surfaces:
1. Improve the existing moonrepo.dev/llms.txt — Audit the current file (added in v1.37.1) and expand it following the llms.txt specification with clean .md mirrors of key documentation pages, a curated table of contents, and an instructions section (like Stripe's approach) that steers AI agents toward v2 patterns and away from common v1 mistakes. This file should be updated automatically on each docs deployment.
2. An official Moon skill — Published under moonrepo/moon (or a dedicated moonrepo/moon-skills repo) following the Agent Skills specification. The structure is described above under "Proposed structure". Once published on the Skills registry, any developer can install it with a single command:
npx skills add moonrepo/moonThis makes the skill immediately available across all Agent Skills-compatible platforms with no per-platform configuration. The Skills CLI automatically installs to each agent's expected directory (.claude/skills/, .github/skills/, .agents/skills/, etc.). The skill can be version-tagged alongside Moon releases.
node_modules distribution (backwards-compatible)
Beyond the skills.sh registry, the Skills CLI natively supports crawling node_modules for bundled skills via npx skills experimental_sync. If Moon ships its skill directory under skills/moon/ inside its npm package (@moonrepo/cli), teams already running npm install @moonrepo/cli can wire the skill into all their agents with a single extra command — no separate registry install, no extra dependency:
# After npm install, sync any skills bundled in node_modules into all configured agents
npx skills experimental_syncThis is fully backwards compatible: projects not using a skills-compatible agent are completely unaffected.
moon init integration
For new projects, the moon init command is the natural place to offer skill installation. A --install-skill flag, or a simple opt-in prompt in the existing interactive flow, would remove any friction:
# Interactive (default) — prompt added to existing moon init flow
moon init
# → Detected Claude Code. Install the Moon agent skill? (Y/n)
# Non-interactive / CI-friendly
moon init --install-skillUnder the hood, this shells out to npx skills add moonrepo/moon -y. This is the same onboarding pattern Railway uses in their agent integration.
I maintain a Moon-based TypeScript monorepo in production and have direct experience with every gap described above. The existing community skill by hyperb1iss/moonrepo-skill validates that demand for this exists. I'm happy to open a draft PR with an initial
SKILL.mdandreferences/set — building on the community work and the Moon team's authoritative knowledge — if the team is open to the direction.