moonrepo
moonrepoは、JavaScript/TypeScriptのプロジェクトにおけるモノレポ管理とタスク実行を効率化するツールで、依存関係の解析やキャッシュを活用し、高速なビルドやCI最適化を実現するSkill。
📜 元の英語説明(参考)
Manage monorepos and task orchestration with moonrepo — a Rust-based build system for JavaScript/TypeScript projects. Use when someone asks to "manage a monorepo", "moonrepo", "task runner for monorepo", "faster than Turborepo", "build system with dependency graph", or "monorepo tooling". Covers project configuration, task orchestration, dependency graph, caching, CI optimization, and toolchain management.
🇯🇵 日本人クリエイター向け解説
moonrepoは、JavaScript/TypeScriptのプロジェクトにおけるモノレポ管理とタスク実行を効率化するツールで、依存関係の解析やキャッシュを活用し、高速なビルドやCI最適化を実現するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o moonrepo.zip https://jpskill.com/download/15142.zip && unzip -o moonrepo.zip && rm moonrepo.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/15142.zip -OutFile "$d\moonrepo.zip"; Expand-Archive "$d\moonrepo.zip" -DestinationPath $d -Force; ri "$d\moonrepo.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
moonrepo.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
moonrepoフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
moonrepo
概要
moonrepo (moon) は、Rust で構築されたモノレポ管理ツール兼タスクランナーです。プロジェクトの依存関係グラフを理解し、キャッシュを利用してタスクを正しい順序で実行し、ツールチェーンのバージョン(Node.js、Bun など)を管理し、CI パイプラインを自動的に生成します。Turborepo よりも高速かつ決定論的であり、Nx にはないツールチェーン管理機能が組み込まれています。
どのような時に使うか
- 複数のパッケージ/アプリケーションを持つモノレポを管理する場合
- 依存関係を考慮した順序で、決定論的なタスク実行が必要な場合
- チーム全体で一貫したツールチェーンのバージョンを使用したい場合
- すべての PR で全てをビルドするため、CI が遅い場合
- npm scripts よりも優れたキャッシュが必要な場合
手順
セットアップ
# moon CLI をインストール
npm install -D @moonrepo/cli
# モノレポ内で初期化
moon init
ワークスペースの設定
# .moon/workspace.yml — モノレポのルート設定
projects:
- "apps/*"
- "packages/*"
vcs:
manager: git
defaultBranch: main
runner:
cacheLifetime: 7d
logStyle: stream
ツールチェーンの管理
# .moon/toolchain.yml — Node.js とパッケージマネージャーのバージョンを固定
node:
version: "20.11.0"
packageManager: pnpm
pnpm:
version: "9.1.0"
# これらの正確なバージョンを自動的にダウンロードして使用します
# もう「私の環境では動く」ということはありません — 誰もが同じツールチェーンを使用します
プロジェクトの設定
# apps/web/moon.yml — プロジェクトレベルの設定
type: application
language: typescript
dependsOn:
- "packages/ui"
- "packages/shared"
tasks:
dev:
command: next dev
local: true # ローカルでのみ実行、CI では実行しない
build:
command: next build
inputs:
- "src/**/*"
- "package.json"
- "next.config.js"
outputs:
- ".next"
deps:
- "packages/ui:build" # 最初に ui パッケージをビルド
- "packages/shared:build"
test:
command: vitest run
inputs:
- "src/**/*"
- "tests/**/*"
lint:
command: oxlint src/
inputs:
- "src/**/*"
# packages/ui/moon.yml — 共有 UI ライブラリ
type: library
language: typescript
tasks:
build:
command: tsup
inputs:
- "src/**/*"
- "tsup.config.ts"
outputs:
- "dist"
test:
command: vitest run
inputs:
- "src/**/*"
- "tests/**/*"
タスクの実行
# 特定のプロジェクトでタスクを実行
moon run web:build
# タスクを持つすべてのプロジェクトでタスクを実行
moon run :test
# 依存関係グラフを使用して実行 (最初に依存関係をビルド)
moon run web:build # 自動的に packages/ui を最初にビルド
# 何が実行されるかを確認 (ドライラン)
moon run web:build --dryRun
# 影響を受けたタスクのみを実行 (git diff に基づく)
moon run :test --affected
CI の最適化
# .github/workflows/ci.yml — 変更されたもののみを実行
name: CI
on: [pull_request]
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # 影響を受けたものを検出するための完全な履歴
- uses: moonrepo/setup-toolchain@v0
- run: moon ci # 最適な順序で影響を受けたすべてのタスクを実行
# moon ci は以下を行います:
# 1. PR で変更されたファイルを検出
# 2. 影響を受けるプロジェクトを特定
# 3. 依存関係の順序で影響を受けたタスクのみを実行
# 4. 変更されていない出力にはキャッシュを使用
例
例 1: 新しいモノレポのセットアップ
ユーザープロンプト: "Next.js アプリと 3 つの共有パッケージがあります。適切なタスクオーケストレーションを備えたモノレポをセットアップしてください。"
エージェントは moon を初期化し、ワークスペースプロジェクトを設定し、適切な inputs/outputs/deps を持つタスクを定義し、影響を受けたものを検出する CI をセットアップします。
例 2: Turborepo からの移行
ユーザープロンプト: "Turborepo のセットアップが複雑になってきました。moonrepo に移行してください。"
エージェントは turbo.json パイプラインを moon タスク設定に変換し、ツールチェーン管理をセットアップし、moon の影響を受けたものを検出する CI を設定します。
ガイドライン
- キャッシュのための
inputsとoutputs— タスクに影響を与えるファイルと、タスクが生成するものを定義します - タスクの順序付けのための
deps—"packages/ui:build"は"web:build"の前に実行されます - CI のための
--affected— 変更されたプロジェクトのタスクのみを実行します moon ciは CI コマンド — 影響を受けたものの検出、順序付け、キャッシュを処理します- ツールチェーンの固定 — 誰もがまったく同じ Node.js/pnpm バージョンを使用します
type: applicationvslibrary— 依存関係グラフの動作に影響します- 開発タスクのための
local: true— CI では自動的にスキップされます dependsOnによるプロジェクト参照 — moon はモノレポグラフを理解します- キャッシュはコンテンツアドレス指定 — 同じ
inputs= ブランチに関係なくキャッシュヒット
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
moonrepo
Overview
moonrepo (moon) is a Rust-based monorepo management tool and task runner. It understands your project dependency graph, runs tasks in the correct order with caching, manages toolchain versions (Node.js, Bun, etc.), and generates CI pipelines automatically. Faster and more deterministic than Turborepo, with built-in toolchain management that Nx doesn't have.
When to Use
- Managing a monorepo with multiple packages/apps
- Need deterministic task execution with dependency-aware ordering
- Want consistent toolchain versions across the team
- CI is slow because it builds everything on every PR
- Need better caching than npm scripts provide
Instructions
Setup
# Install moon CLI
npm install -D @moonrepo/cli
# Initialize in your monorepo
moon init
Workspace Configuration
# .moon/workspace.yml — Monorepo root config
projects:
- "apps/*"
- "packages/*"
vcs:
manager: git
defaultBranch: main
runner:
cacheLifetime: 7d
logStyle: stream
Toolchain Management
# .moon/toolchain.yml — Pin Node.js and package manager versions
node:
version: "20.11.0"
packageManager: pnpm
pnpm:
version: "9.1.0"
# Automatically downloads and uses these exact versions
# No more "works on my machine" — everyone uses the same toolchain
Project Configuration
# apps/web/moon.yml — Project-level config
type: application
language: typescript
dependsOn:
- "packages/ui"
- "packages/shared"
tasks:
dev:
command: next dev
local: true # Only runs locally, not in CI
build:
command: next build
inputs:
- "src/**/*"
- "package.json"
- "next.config.js"
outputs:
- ".next"
deps:
- "packages/ui:build" # Build ui package first
- "packages/shared:build"
test:
command: vitest run
inputs:
- "src/**/*"
- "tests/**/*"
lint:
command: oxlint src/
inputs:
- "src/**/*"
# packages/ui/moon.yml — Shared UI library
type: library
language: typescript
tasks:
build:
command: tsup
inputs:
- "src/**/*"
- "tsup.config.ts"
outputs:
- "dist"
test:
command: vitest run
inputs:
- "src/**/*"
- "tests/**/*"
Run Tasks
# Run a task in a specific project
moon run web:build
# Run task across all projects that have it
moon run :test
# Run with dependency graph (builds deps first)
moon run web:build # Automatically builds packages/ui first
# Check what would run (dry run)
moon run web:build --dryRun
# Run affected tasks only (based on git diff)
moon run :test --affected
CI Optimization
# .github/workflows/ci.yml — Only run what changed
name: CI
on: [pull_request]
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history for affected detection
- uses: moonrepo/setup-toolchain@v0
- run: moon ci # Runs all affected tasks in optimal order
# moon ci does:
# 1. Detects which files changed in the PR
# 2. Determines which projects are affected
# 3. Runs only the affected tasks in dependency order
# 4. Uses cache for unchanged outputs
Examples
Example 1: Set up a new monorepo
User prompt: "I have a Next.js app and 3 shared packages. Set up a monorepo with proper task orchestration."
The agent will initialize moon, configure workspace projects, define tasks with proper inputs/outputs/deps, and set up CI with affected detection.
Example 2: Migrate from Turborepo
User prompt: "Our Turborepo setup is getting complex. Migrate to moonrepo."
The agent will translate turbo.json pipeline to moon task configs, set up toolchain management, and configure CI with moon's affected detection.
Guidelines
inputsandoutputsfor caching — define what files affect a task and what it producesdepsfor task ordering —"packages/ui:build"runs before"web:build"--affectedfor CI — only run tasks for changed projectsmoon ciis the CI command — handles affected detection, ordering, and caching- Toolchain pinning — everyone uses exactly the same Node.js/pnpm version
type: applicationvslibrary— affects dependency graph behaviorlocal: truefor dev tasks — skipped in CI automatically- Project references via
dependsOn— moon understands the monorepo graph - Cache is content-addressed — same inputs = cache hit, regardless of branch