Skip to content
Back to skills

Local Layers

ASecurity

The `plutoLayer` helper keeps the `extends` of an app clean. It is for Pluto development, layer development, and an app that needs local layers instead of npm. A normal app does not need it.

  • 4 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 7, 2026
developmentgonodegit

Security analysis

A100/100

Scanned November 24, 2026

npx -y skills add plutocms/pluto --skill local-layers --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Local Layers?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Local Layers
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/plutocms-local-layers/badge)](https://www.skillsdirectory.com/skills/plutocms-local-layers)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Local layers

The `plutoLayer` helper keeps the `extends` of an app clean. It is for Pluto development, layer
development, and an app that needs local layers instead of npm. A normal app does not need it.

## Use

```ts
// nuxt.config.ts
import { plutoLayer } from '@plutocms/core/layers'

export default defineNuxtConfig({
  extends: [plutoLayer('@plutocms/docs')],
})
```

`plutoLayer(name, options?)` returns the source: the local path or the package name. It has no
`install` option: Nuxt uses `install` only for a layer that it downloads from Git, and an npm
layer comes with its dependencies. Option: `root` (the folder with the checkouts; it wins over
`PLUTO_LOCAL_ROOT`).

## Files

- `layers.ts` (at the package root) — the helper. Node built-ins only (`node:fs`, `node:path`,
  `node:process`). No Nuxt import, because Nuxt loads `nuxt.config.ts` before any module runs.
- `test/layers.test.ts` — the unit tests, with a temp dir of fake checkouts.

## Import path

The app imports `@plutocms/core/layers`. The package has `main: ./nuxt.config.ts` and no `exports`
field, so Node and jiti resolve a deep path to the file `layers.ts` in the package. An `exports`
field would block the other deep imports that layers and tests use, so do not add one. `.npmignore`
is a denylist, so `layers.ts` ships to npm.

With a strict package manager (pnpm), the app must list `@plutocms/core` in its own dependencies
to import the helper. With npm and Bun, the copy that a layer brings is hoisted, and the import
works.

## Rules

- Local mode is on when `PLUTO_LOCAL_ROOT` (or `options.root`) is set, unless
  `PLUTO_USE_LOCAL=false`. A relative root resolves from the current working directory.
- `PLUTO_LAYER_PATHS` maps each layer (the package name without the scope) to its checkout under
  the root. Two repos are monorepos: `pluto` (`core` is `pluto/packages/core`, `docs` is
  `pluto/packages/layers/docs`, `3d`, `shop` and `seo` are `pluto/packages/layers/addons/<name>`) and `supabase`
  (`supabase`, `supabase-shop` and `supabase-blog` are `supabase/packages/<name>`). A layer that is
  not in the map has a folder of its name.
- A checkout exists when its `nuxt.config.ts` exists.
- The helper sets `PLUTO_<NAME>_PATH` (upper case, `-` to `_`; core is `PLUTO_CORE_PATH`) for each checkout that exists and
  is not set yet. The `nuxt.config.ts` of each layer reads that variable, so the upstream layers go
  local too.
- An explicit `PLUTO_<NAME>_PATH` always wins, in local mode and in default mode.
- When the checkout of `name` is missing, the helper returns the package name.
- A production host has no `.env`, so it uses the npm packages.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.