Remote OpenClaw

Remote OpenClaw Blog

How to Use OpenClaw Skills With Monorepos

5 min read ·

Monorepos bring their own set of challenges for AI agent configuration. When you have a dozen packages sharing a single repository, you need skills that apply globally and skills that are scoped to specific packages. You need shared conventions that stay consistent and package-specific behaviors that do not leak across boundaries.

OpenClaw supports monorepo workflows out of the box. This guide covers how to structure your skill configuration for workspace-level and package-level needs, how to share configs without duplication, and how to integrate with Turborepo and Nx.

The Monorepo Skill Problem

In a standard single-project repo, you install skills at the root and they apply to everything. Simple. In a monorepo, the picture gets complicated:

  • Your packages/api directory uses Express and needs backend-focused skills
  • Your packages/web directory uses Next.js and needs frontend-focused skills
  • Your packages/shared directory is a utility library that needs strict TypeScript skills but no framework-specific ones
  • All packages share the same linting and formatting conventions

Installing every skill at the root means your agent receives conflicting instructions when working in different packages. The Next.js skill tells it to use server components when it is editing an Express route handler. The Express skill suggests middleware patterns when the agent is building a React page.

You need skill scoping.

Workspace-Level vs Package-Level Skills

OpenClaw uses a hierarchical configuration system. Skills defined at the workspace root apply globally. Skills defined inside a package directory apply only when the agent is working within that package.

Workspace Root Configuration

Your monorepo root gets the shared skills:

monorepo/
├── .openclaw/
│   └── skills/
│       ├── typescript-strict-mode/
│       ├── eslint-conventions/
│       └── git-commit-standards/
├── openclaw.config.toml
├── packages/
│   ├── api/
│   ├── web/
│   └── shared/
└── package.json

The root openclaw.config.toml:

[project]
name = "my-monorepo"
type = "monorepo"

[skills]
active = [
  "typescript-strict-mode",
  "eslint-conventions",
  "git-commit-standards",
]

[workspace]
packages = ["packages/*"]
inherit = true   # Packages inherit root skills by default

Setting type = "monorepo" tells OpenClaw to look for package-level configurations. The inherit = true flag means every package automatically gets the root skills unless it explicitly overrides them.

Package-Level Configuration

Each package can have its own openclaw.config.toml and .openclaw/skills/ directory:

packages/
├── api/
│   ├── .openclaw/
│   │   └── skills/
│   │       └── express-api-patterns/
│   ├── openclaw.config.toml
│   └── src/
├── web/
│   ├── .openclaw/
│   │   └── skills/
│   │       └── next-app-router-expert/
│   ├── openclaw.config.toml
│   └── src/
└── shared/
    └── src/       # No package-level config; inherits root only

The packages/api/openclaw.config.toml:

[package]
name = "api"
description = "Express REST API with PostgreSQL"

[skills]
active = ["express-api-patterns"]

[skills.override]
# Override root skill priority for this package
typescript-strict-mode = 12

The packages/web/openclaw.config.toml:

[package]
name = "web"
description = "Next.js 15 frontend with App Router"

[skills]
active = ["next-app-router-expert"]

[skills.exclude]
# Do not load this root skill in this package
disabled = ["git-commit-standards"]

How Skill Resolution Works

When the agent works on a file in packages/web/src/, OpenClaw resolves skills in this order:

  1. Load root-level active skills (typescript-strict-mode, eslint-conventions, git-commit-standards)
  2. Check for a package-level config in packages/web/
  3. Add package-level skills (next-app-router-expert)
  4. Apply exclusions (remove git-commit-standards)
  5. Apply priority overrides
  6. Feed the merged skill set to the agent

The agent ends up with typescript-strict-mode, eslint-conventions, and next-app-router-expert — exactly the right combination for working on the Next.js frontend.

Sharing Skill Configurations Without Duplication

If multiple packages need the same package-level skill, you do not want to install it separately in each one. Use the shared_skills feature:

# Root openclaw.config.toml

[workspace]
packages = ["packages/*"]
inherit = true

[workspace.shared_skills]
frontend = ["next-app-router-expert", "react-testing-library"]
backend = ["express-api-patterns", "postgresql-queries"]

Then reference the group in a package config:

# packages/web/openclaw.config.toml

[package]
name = "web"

[skills]
use_shared = "frontend"
# packages/api/openclaw.config.toml

[package]
name = "api"

[skills]
use_shared = "backend"

The skills are installed once at the root in .openclaw/skills/ and referenced by group name. No duplication, single source of truth.

Marketplace

Free skills and AI personas for OpenClaw — browse the marketplace.

Browse the Marketplace →

Turborepo Integration

If you use Turborepo for your build pipeline, you can add OpenClaw skill validation as a pipeline task. This ensures skills stay consistent across packages during CI.

Add a validation task to turbo.json:

{
  "pipeline": {
    "build": {
      "dependsOn": ["^build"]
    },
    "lint": {
      "dependsOn": ["^build"]
    },
    "openclaw:validate": {
      "inputs": [
        "openclaw.config.toml",
        ".openclaw/skills/**"
      ],
      "cache": true
    }
  }
}

Then add a script to your root package.json:

{
  "scripts": {
    "openclaw:validate": "openclaw skill validate --workspace"
  }
}

Running turbo openclaw:validate checks every package for:

  • Missing skills referenced in config files
  • Version mismatches between shared skills
  • Conflicting priority definitions across packages
  • Skills that are installed but not referenced in any config

Turborepo's caching means this validation runs instantly when nothing has changed.

Nx Integration

Nx users can add OpenClaw validation as a project target. Create an executor in your root project.json or add it per-project:

{
  "targets": {
    "openclaw-validate": {
      "executor": "nx:run-commands",
      "options": {
        "command": "openclaw skill validate --package {projectRoot}"
      },
      "inputs": [
        "{projectRoot}/openclaw.config.toml",
        "{projectRoot}/.openclaw/**",
        "{workspaceRoot}/openclaw.config.toml",
        "{workspaceRoot}/.openclaw/**"
      ]
    }
  }
}

Run validation across affected packages using Nx's dependency graph:

nx affected --target=openclaw-validate

This only validates packages where skill configurations or skill files have actually changed — efficient for large monorepos with many packages.

Best Practices for Monorepo Skill Management

Keep root skills minimal. Only install skills at the root that genuinely apply to every package. TypeScript conventions and commit message standards are good candidates. Framework-specific skills are not.

Use shared skill groups. If three packages all need the same set of skills, define a group in the root config rather than duplicating the list in three package configs.

Version-pin shared skills. In a monorepo, a skill update that breaks one package might go unnoticed if other packages mask the issue. Pin versions in your root config:

[skills.versions]
typescript-strict-mode = "1.3.4"
eslint-conventions = "2.0.1"

Document package skill expectations. Add a brief note to each package's README explaining which skills are active and why. This helps new team members understand why the agent behaves differently in different packages.

Test skill resolution in CI. Add openclaw skill resolve --dry-run to your CI pipeline for each package. This prints the final merged skill set without starting the agent, so you can verify the resolution logic is correct.

cd packages/web && openclaw skill resolve --dry-run
# Output:
# Resolved skills for packages/web:
#   1. typescript-strict-mode (root, priority 8)
#   2. eslint-conventions (root, priority 5)
#   3. next-app-router-expert (package, priority 10)

Monorepo skill management adds a layer of configuration, but the payoff is an agent that understands context boundaries. When it is working in your API package, it thinks in Express and SQL. When it switches to your frontend, it thinks in React and server components. That context-awareness is what makes the difference between a generic AI assistant and one that actually fits your architecture.


Browse the Skills Directory

Find the right skill for your workflow. The OpenClaw Bazaar skills directory has over 2,300 community-rated skills — searchable, sortable, and free to install.

Browse Skills →

Built a Skill? List It on the Bazaar

If you have built a skill that others would find useful, publish it on the Bazaar. Reach thousands of developers and get feedback from the community.

Learn how to publish →