{
  "schemaVersion": "1.0",
  "item": {
    "slug": "monorepo",
    "name": "Monorepo Management",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/wpank/monorepo",
    "canonicalUrl": "https://clawhub.ai/wpank/monorepo",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/monorepo",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=monorepo",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "README.md",
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/monorepo"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/monorepo",
    "agentPageUrl": "https://openagent3.xyz/skills/monorepo/agent",
    "manifestUrl": "https://openagent3.xyz/skills/monorepo/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/monorepo/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Monorepo Management",
        "body": "Build efficient, scalable monorepos that enable code sharing, consistent tooling, and atomic changes across multiple packages and applications."
      },
      {
        "title": "When to Use",
        "body": "Setting up a new monorepo or migrating from multi-repo\nOptimizing build and test performance\nManaging shared dependencies across packages\nConfiguring CI/CD for monorepos\nVersioning and publishing packages"
      },
      {
        "title": "Why Monorepos?",
        "body": "Advantages: Shared code and dependencies, atomic commits across projects, consistent tooling, easier refactoring, better code visibility.\n\nChallenges: Build performance at scale, CI/CD complexity, access control, large Git history."
      },
      {
        "title": "Package Managers",
        "body": "ManagerRecommendationNotespnpmRecommendedFast, strict, excellent workspace supportnpmAcceptableBuilt-in workspaces, slower installsYarnAcceptableMature, but pnpm surpasses in most areas"
      },
      {
        "title": "Build Systems",
        "body": "ToolBest ForTrade-offTurborepoMost projectsSimple config, fast caching, Vercel integrationNxLarge orgs, complex graphsFeature-rich but steeper learning curveLernaLegacy projectsMaintenance mode — migrate away\n\nGuidance: Start with Turborepo unless you need Nx's code generation, dependency graph visualization, or plugin ecosystem."
      },
      {
        "title": "Workspace Structure",
        "body": "my-monorepo/\n├── apps/\n│   ├── web/              # Next.js app\n│   ├── api/              # Backend service\n│   └── docs/             # Documentation site\n├── packages/\n│   ├── ui/               # Shared UI components\n│   ├── utils/            # Shared utilities\n│   ├── types/            # Shared TypeScript types\n│   ├── config-eslint/    # Shared ESLint config\n│   └── config-ts/        # Shared TypeScript configs\n├── turbo.json            # Turborepo pipeline config\n├── pnpm-workspace.yaml   # Workspace definition\n└── package.json          # Root package.json\n\nConvention: apps/ for deployable applications, packages/ for shared libraries."
      },
      {
        "title": "Root Configuration",
        "body": "# pnpm-workspace.yaml\npackages:\n  - \"apps/*\"\n  - \"packages/*\"\n\n// package.json (root)\n{\n  \"name\": \"my-monorepo\",\n  \"private\": true,\n  \"scripts\": {\n    \"build\": \"turbo run build\",\n    \"dev\": \"turbo run dev\",\n    \"test\": \"turbo run test\",\n    \"lint\": \"turbo run lint\",\n    \"type-check\": \"turbo run type-check\",\n    \"clean\": \"turbo run clean && rm -rf node_modules\"\n  },\n  \"devDependencies\": {\n    \"turbo\": \"^2.0.0\",\n    \"prettier\": \"^3.0.0\"\n  },\n  \"packageManager\": \"pnpm@9.0.0\"\n}"
      },
      {
        "title": "Pipeline Configuration",
        "body": "// turbo.json\n{\n  \"$schema\": \"https://turbo.build/schema.json\",\n  \"globalDependencies\": [\"**/.env.*local\"],\n  \"tasks\": {\n    \"build\": {\n      \"dependsOn\": [\"^build\"],\n      \"outputs\": [\"dist/**\", \".next/**\", \"!.next/cache/**\"],\n      \"inputs\": [\"src/**\", \"package.json\", \"tsconfig.json\"]\n    },\n    \"test\": {\n      \"dependsOn\": [\"build\"],\n      \"outputs\": [\"coverage/**\"]\n    },\n    \"lint\": {\n      \"outputs\": []\n    },\n    \"type-check\": {\n      \"dependsOn\": [\"^build\"],\n      \"outputs\": []\n    },\n    \"dev\": {\n      \"cache\": false,\n      \"persistent\": true\n    }\n  }\n}\n\nKey concepts:\n\ndependsOn: [\"^build\"] — build dependencies first (topological)\noutputs — what to cache (omit for side-effect-only tasks)\ninputs — what invalidates cache (default: all files)\npersistent: true — for long-running dev servers\ncache: false — disable caching for dev tasks"
      },
      {
        "title": "Package Configuration",
        "body": "// packages/ui/package.json\n{\n  \"name\": \"@repo/ui\",\n  \"version\": \"0.0.0\",\n  \"private\": true,\n  \"exports\": {\n    \".\": { \"import\": \"./dist/index.js\", \"types\": \"./dist/index.d.ts\" },\n    \"./button\": { \"import\": \"./dist/button.js\", \"types\": \"./dist/button.d.ts\" }\n  },\n  \"scripts\": {\n    \"build\": \"tsup src/index.ts --format esm,cjs --dts\",\n    \"dev\": \"tsup src/index.ts --format esm,cjs --dts --watch\"\n  },\n  \"devDependencies\": {\n    \"@repo/config-ts\": \"workspace:*\",\n    \"tsup\": \"^8.0.0\"\n  }\n}"
      },
      {
        "title": "Nx Setup",
        "body": "npx create-nx-workspace@latest my-org\n\n# Generate projects\nnx generate @nx/react:app my-app\nnx generate @nx/js:lib utils\n\n// nx.json\n{\n  \"targetDefaults\": {\n    \"build\": {\n      \"dependsOn\": [\"^build\"],\n      \"inputs\": [\"production\", \"^production\"],\n      \"cache\": true\n    },\n    \"test\": {\n      \"inputs\": [\"default\", \"^production\"],\n      \"cache\": true\n    }\n  },\n  \"namedInputs\": {\n    \"default\": [\"{projectRoot}/**/*\"],\n    \"production\": [\"default\", \"!{projectRoot}/**/*.spec.*\"]\n  }\n}\n\n# Nx-specific commands\nnx build my-app\nnx affected:build --base=main    # Only build what changed\nnx graph                          # Visualize dependency graph\nnx run-many --target=build --all --parallel=3\n\nNx advantage: nx affected computes exactly which projects changed, skipping unaffected ones entirely."
      },
      {
        "title": "Dependency Management (pnpm)",
        "body": "# Install in specific package\npnpm add react --filter @repo/ui\npnpm add -D typescript --filter @repo/ui\n\n# Install workspace dependency\npnpm add @repo/ui --filter web\n\n# Install in root (shared dev tools)\npnpm add -D eslint -w\n\n# Run script in specific package\npnpm --filter web dev\npnpm --filter @repo/ui build\n\n# Run in all packages\npnpm -r build\n\n# Filter patterns\npnpm --filter \"@repo/*\" build\npnpm --filter \"...web\" build    # web + all its dependencies\n\n# Update all dependencies\npnpm update -r"
      },
      {
        "title": ".npmrc",
        "body": "# Hoist shared dependencies for compatibility\nshamefully-hoist=true\n\n# Strict peer dependency management\nauto-install-peers=true\nstrict-peer-dependencies=true"
      },
      {
        "title": "TypeScript",
        "body": "// packages/config-ts/base.json\n{\n  \"compilerOptions\": {\n    \"strict\": true,\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true,\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"bundler\",\n    \"resolveJsonModule\": true,\n    \"isolatedModules\": true,\n    \"declaration\": true\n  }\n}\n\n// apps/web/tsconfig.json\n{\n  \"extends\": \"@repo/config-ts/base.json\",\n  \"compilerOptions\": { \"outDir\": \"dist\", \"rootDir\": \"src\" },\n  \"include\": [\"src\"]\n}"
      },
      {
        "title": "Remote Caching",
        "body": "# Turborepo + Vercel remote cache\nnpx turbo login\nnpx turbo link\n\n# Now builds share cache across CI and all developers\n# First build: 2 minutes. Cache hit: 0 seconds."
      },
      {
        "title": "Cache Configuration",
        "body": "{\n  \"tasks\": {\n    \"build\": {\n      \"dependsOn\": [\"^build\"],\n      \"outputs\": [\"dist/**\", \".next/**\"],\n      \"inputs\": [\"src/**/*.tsx\", \"src/**/*.ts\", \"package.json\"]\n    }\n  }\n}\n\nCritical: Define inputs precisely. If a build only depends on src/, don't let changes to README.md invalidate the cache."
      },
      {
        "title": "GitHub Actions",
        "body": "name: CI\non:\n  push:\n    branches: [main]\n  pull_request:\n    branches: [main]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          fetch-depth: 0    # Required for affected commands\n\n      - uses: pnpm/action-setup@v4\n        with:\n          version: 9\n\n      - uses: actions/setup-node@v4\n        with:\n          node-version: 20\n          cache: \"pnpm\"\n\n      - run: pnpm install --frozen-lockfile\n      - run: pnpm turbo run build test lint type-check"
      },
      {
        "title": "Deploy Affected Only",
        "body": "- name: Deploy affected apps\n  run: |\n    AFFECTED=$(pnpm turbo run build --dry-run=json --filter='[HEAD^1]' | jq -r '.packages[]')\n    if echo \"$AFFECTED\" | grep -q \"web\"; then\n      pnpm --filter web deploy\n    fi"
      },
      {
        "title": "Publishing Packages",
        "body": "# Setup Changesets\npnpm add -Dw @changesets/cli\npnpm changeset init\n\n# Workflow\npnpm changeset          # Create changeset (describe what changed)\npnpm changeset version  # Bump versions based on changesets\npnpm changeset publish  # Publish to npm\n\n# .github/workflows/release.yml\n- name: Create Release PR or Publish\n  uses: changesets/action@v1\n  with:\n    publish: pnpm changeset publish\n  env:\n    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n    NPM_TOKEN: ${{ secrets.NPM_TOKEN }}"
      },
      {
        "title": "Best Practices",
        "body": "Lock dependency versions — Use exact versions or lock files across the workspace\nCentralize configs — ESLint, TypeScript, Prettier in shared packages\nKeep the graph acyclic — No circular dependencies between packages\nDefine cache inputs/outputs precisely — Incorrect cache config wastes time or serves stale builds\nShare types between frontend/backend — Single source of truth for contracts\nUnit tests in packages, E2E in apps — Match test scope to package scope\nREADME in each package — What it does, how to develop, how to use\nUse changesets for versioning — Automated, reviewable release process"
      },
      {
        "title": "Common Pitfalls",
        "body": "PitfallFixCircular dependenciesRefactor shared code into a third packagePhantom dependencies (using deps not in package.json)Use pnpm strict modeIncorrect cache inputsAdd missing files to inputs arrayOver-sharing codeOnly share genuinely reusable codeMissing fetch-depth: 0 in CIRequired for affected commands to compare historyCaching dev tasksSet cache: false and persistent: true"
      },
      {
        "title": "NEVER Do",
        "body": "NEVER use * for workspace dependency versions — Use workspace:* with pnpm\nNEVER skip --frozen-lockfile in CI — Ensures reproducible builds\nNEVER cache dev server tasks — They're long-running, not cacheable\nNEVER create circular package dependencies — Breaks build ordering\nNEVER hoist without understanding — shamefully-hoist is a compatibility escape hatch, not a default"
      },
      {
        "title": "Related Skills",
        "body": "Related: service-layer-architecture — API patterns within monorepo apps\nRelated: postgres-job-queue — Background jobs for monorepo services"
      }
    ],
    "body": "Monorepo Management\n\nBuild efficient, scalable monorepos that enable code sharing, consistent tooling, and atomic changes across multiple packages and applications.\n\nWhen to Use\nSetting up a new monorepo or migrating from multi-repo\nOptimizing build and test performance\nManaging shared dependencies across packages\nConfiguring CI/CD for monorepos\nVersioning and publishing packages\nWhy Monorepos?\n\nAdvantages: Shared code and dependencies, atomic commits across projects, consistent tooling, easier refactoring, better code visibility.\n\nChallenges: Build performance at scale, CI/CD complexity, access control, large Git history.\n\nTool Selection\nPackage Managers\nManager\tRecommendation\tNotes\npnpm\tRecommended\tFast, strict, excellent workspace support\nnpm\tAcceptable\tBuilt-in workspaces, slower installs\nYarn\tAcceptable\tMature, but pnpm surpasses in most areas\nBuild Systems\nTool\tBest For\tTrade-off\nTurborepo\tMost projects\tSimple config, fast caching, Vercel integration\nNx\tLarge orgs, complex graphs\tFeature-rich but steeper learning curve\nLerna\tLegacy projects\tMaintenance mode — migrate away\n\nGuidance: Start with Turborepo unless you need Nx's code generation, dependency graph visualization, or plugin ecosystem.\n\nWorkspace Structure\nmy-monorepo/\n├── apps/\n│   ├── web/              # Next.js app\n│   ├── api/              # Backend service\n│   └── docs/             # Documentation site\n├── packages/\n│   ├── ui/               # Shared UI components\n│   ├── utils/            # Shared utilities\n│   ├── types/            # Shared TypeScript types\n│   ├── config-eslint/    # Shared ESLint config\n│   └── config-ts/        # Shared TypeScript configs\n├── turbo.json            # Turborepo pipeline config\n├── pnpm-workspace.yaml   # Workspace definition\n└── package.json          # Root package.json\n\n\nConvention: apps/ for deployable applications, packages/ for shared libraries.\n\nTurborepo Setup\nRoot Configuration\n# pnpm-workspace.yaml\npackages:\n  - \"apps/*\"\n  - \"packages/*\"\n\n// package.json (root)\n{\n  \"name\": \"my-monorepo\",\n  \"private\": true,\n  \"scripts\": {\n    \"build\": \"turbo run build\",\n    \"dev\": \"turbo run dev\",\n    \"test\": \"turbo run test\",\n    \"lint\": \"turbo run lint\",\n    \"type-check\": \"turbo run type-check\",\n    \"clean\": \"turbo run clean && rm -rf node_modules\"\n  },\n  \"devDependencies\": {\n    \"turbo\": \"^2.0.0\",\n    \"prettier\": \"^3.0.0\"\n  },\n  \"packageManager\": \"pnpm@9.0.0\"\n}\n\nPipeline Configuration\n// turbo.json\n{\n  \"$schema\": \"https://turbo.build/schema.json\",\n  \"globalDependencies\": [\"**/.env.*local\"],\n  \"tasks\": {\n    \"build\": {\n      \"dependsOn\": [\"^build\"],\n      \"outputs\": [\"dist/**\", \".next/**\", \"!.next/cache/**\"],\n      \"inputs\": [\"src/**\", \"package.json\", \"tsconfig.json\"]\n    },\n    \"test\": {\n      \"dependsOn\": [\"build\"],\n      \"outputs\": [\"coverage/**\"]\n    },\n    \"lint\": {\n      \"outputs\": []\n    },\n    \"type-check\": {\n      \"dependsOn\": [\"^build\"],\n      \"outputs\": []\n    },\n    \"dev\": {\n      \"cache\": false,\n      \"persistent\": true\n    }\n  }\n}\n\n\nKey concepts:\n\ndependsOn: [\"^build\"] — build dependencies first (topological)\noutputs — what to cache (omit for side-effect-only tasks)\ninputs — what invalidates cache (default: all files)\npersistent: true — for long-running dev servers\ncache: false — disable caching for dev tasks\nPackage Configuration\n// packages/ui/package.json\n{\n  \"name\": \"@repo/ui\",\n  \"version\": \"0.0.0\",\n  \"private\": true,\n  \"exports\": {\n    \".\": { \"import\": \"./dist/index.js\", \"types\": \"./dist/index.d.ts\" },\n    \"./button\": { \"import\": \"./dist/button.js\", \"types\": \"./dist/button.d.ts\" }\n  },\n  \"scripts\": {\n    \"build\": \"tsup src/index.ts --format esm,cjs --dts\",\n    \"dev\": \"tsup src/index.ts --format esm,cjs --dts --watch\"\n  },\n  \"devDependencies\": {\n    \"@repo/config-ts\": \"workspace:*\",\n    \"tsup\": \"^8.0.0\"\n  }\n}\n\nNx Setup\nnpx create-nx-workspace@latest my-org\n\n# Generate projects\nnx generate @nx/react:app my-app\nnx generate @nx/js:lib utils\n\n// nx.json\n{\n  \"targetDefaults\": {\n    \"build\": {\n      \"dependsOn\": [\"^build\"],\n      \"inputs\": [\"production\", \"^production\"],\n      \"cache\": true\n    },\n    \"test\": {\n      \"inputs\": [\"default\", \"^production\"],\n      \"cache\": true\n    }\n  },\n  \"namedInputs\": {\n    \"default\": [\"{projectRoot}/**/*\"],\n    \"production\": [\"default\", \"!{projectRoot}/**/*.spec.*\"]\n  }\n}\n\n# Nx-specific commands\nnx build my-app\nnx affected:build --base=main    # Only build what changed\nnx graph                          # Visualize dependency graph\nnx run-many --target=build --all --parallel=3\n\n\nNx advantage: nx affected computes exactly which projects changed, skipping unaffected ones entirely.\n\nDependency Management (pnpm)\n# Install in specific package\npnpm add react --filter @repo/ui\npnpm add -D typescript --filter @repo/ui\n\n# Install workspace dependency\npnpm add @repo/ui --filter web\n\n# Install in root (shared dev tools)\npnpm add -D eslint -w\n\n# Run script in specific package\npnpm --filter web dev\npnpm --filter @repo/ui build\n\n# Run in all packages\npnpm -r build\n\n# Filter patterns\npnpm --filter \"@repo/*\" build\npnpm --filter \"...web\" build    # web + all its dependencies\n\n# Update all dependencies\npnpm update -r\n\n.npmrc\n# Hoist shared dependencies for compatibility\nshamefully-hoist=true\n\n# Strict peer dependency management\nauto-install-peers=true\nstrict-peer-dependencies=true\n\nShared Configurations\nTypeScript\n// packages/config-ts/base.json\n{\n  \"compilerOptions\": {\n    \"strict\": true,\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true,\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"bundler\",\n    \"resolveJsonModule\": true,\n    \"isolatedModules\": true,\n    \"declaration\": true\n  }\n}\n\n// apps/web/tsconfig.json\n{\n  \"extends\": \"@repo/config-ts/base.json\",\n  \"compilerOptions\": { \"outDir\": \"dist\", \"rootDir\": \"src\" },\n  \"include\": [\"src\"]\n}\n\nBuild Optimization\nRemote Caching\n# Turborepo + Vercel remote cache\nnpx turbo login\nnpx turbo link\n\n# Now builds share cache across CI and all developers\n# First build: 2 minutes. Cache hit: 0 seconds.\n\nCache Configuration\n{\n  \"tasks\": {\n    \"build\": {\n      \"dependsOn\": [\"^build\"],\n      \"outputs\": [\"dist/**\", \".next/**\"],\n      \"inputs\": [\"src/**/*.tsx\", \"src/**/*.ts\", \"package.json\"]\n    }\n  }\n}\n\n\nCritical: Define inputs precisely. If a build only depends on src/, don't let changes to README.md invalidate the cache.\n\nCI/CD\nGitHub Actions\nname: CI\non:\n  push:\n    branches: [main]\n  pull_request:\n    branches: [main]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          fetch-depth: 0    # Required for affected commands\n\n      - uses: pnpm/action-setup@v4\n        with:\n          version: 9\n\n      - uses: actions/setup-node@v4\n        with:\n          node-version: 20\n          cache: \"pnpm\"\n\n      - run: pnpm install --frozen-lockfile\n      - run: pnpm turbo run build test lint type-check\n\nDeploy Affected Only\n- name: Deploy affected apps\n  run: |\n    AFFECTED=$(pnpm turbo run build --dry-run=json --filter='[HEAD^1]' | jq -r '.packages[]')\n    if echo \"$AFFECTED\" | grep -q \"web\"; then\n      pnpm --filter web deploy\n    fi\n\nPublishing Packages\n# Setup Changesets\npnpm add -Dw @changesets/cli\npnpm changeset init\n\n# Workflow\npnpm changeset          # Create changeset (describe what changed)\npnpm changeset version  # Bump versions based on changesets\npnpm changeset publish  # Publish to npm\n\n# .github/workflows/release.yml\n- name: Create Release PR or Publish\n  uses: changesets/action@v1\n  with:\n    publish: pnpm changeset publish\n  env:\n    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n    NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n\nBest Practices\nLock dependency versions — Use exact versions or lock files across the workspace\nCentralize configs — ESLint, TypeScript, Prettier in shared packages\nKeep the graph acyclic — No circular dependencies between packages\nDefine cache inputs/outputs precisely — Incorrect cache config wastes time or serves stale builds\nShare types between frontend/backend — Single source of truth for contracts\nUnit tests in packages, E2E in apps — Match test scope to package scope\nREADME in each package — What it does, how to develop, how to use\nUse changesets for versioning — Automated, reviewable release process\nCommon Pitfalls\nPitfall\tFix\nCircular dependencies\tRefactor shared code into a third package\nPhantom dependencies (using deps not in package.json)\tUse pnpm strict mode\nIncorrect cache inputs\tAdd missing files to inputs array\nOver-sharing code\tOnly share genuinely reusable code\nMissing fetch-depth: 0 in CI\tRequired for affected commands to compare history\nCaching dev tasks\tSet cache: false and persistent: true\nNEVER Do\nNEVER use * for workspace dependency versions — Use workspace:* with pnpm\nNEVER skip --frozen-lockfile in CI — Ensures reproducible builds\nNEVER cache dev server tasks — They're long-running, not cacheable\nNEVER create circular package dependencies — Breaks build ordering\nNEVER hoist without understanding — shamefully-hoist is a compatibility escape hatch, not a default\nRelated Skills\nRelated: service-layer-architecture — API patterns within monorepo apps\nRelated: postgres-job-queue — Background jobs for monorepo services"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/wpank/monorepo",
    "publisherUrl": "https://clawhub.ai/wpank/monorepo",
    "owner": "wpank",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/monorepo",
    "downloadUrl": "https://openagent3.xyz/downloads/monorepo",
    "agentUrl": "https://openagent3.xyz/skills/monorepo/agent",
    "manifestUrl": "https://openagent3.xyz/skills/monorepo/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/monorepo/agent.md"
  }
}