pnpm-catalogs

Configure and maintain named pnpm catalogs in pnpm-workspace.yaml for this Citado monorepo. Use whenever the task involves centralizing shared dependency versions, moving package.json entries to catalog:<name>, reviewing or extending the catalogs taxonomy, or aligning versions across frontend/viewer packages. Also use for prompts like “整理 catalogs”, “统一依赖版本”, “把依赖收进 pnpm-workspace.yaml”, or “按 frontend/lint/test/build 分类依赖”.

Namepnpm-catalogs
Pathpnpm-catalogs
Version1.0.0
Originlocal
SourceSkillHub
Authorseekthought
Projectcitado
Tagspnpm catalogs monorepo dependencies workspace
LicenseMIT

Install

skillctl install -r skillhub pnpm-catalogs

Purpose

Use pnpm-workspace.yaml as the single source of truth for shared third-party dependency versions.

This skill follows the official pnpm catalogs model and the named-catalog grouping approach described by Anthony Fu. In Citado, prefer named catalogs over the default catalog because the catalog name carries architectural meaning during reviews.

Primary references

Core pnpm facts

Citado repo rules

Current taxonomy in this repo

Read pnpm-workspace.yaml first and preserve the existing group names unless the user requests a reorganization.

Classification heuristics

Choose the catalog by why the package exists, not by whether it sits in dependencies or devDependencies.

If a dependency does not fit an existing catalog, check whether it is:

Workflow

1. Read the current workspace state

2. Decide whether cataloging is appropriate

Catalog a dependency when at least one of these is true:

Keep a direct version when the package is package-local, unlikely to be shared, or still exploratory.

3. Update pnpm-workspace.yaml

4. Replace manifest versions

Update affected manifests from explicit versions to catalog:<name>.

Examples:

{
  "dependencies": {
    "react": "catalog:frontend",
    "lucide-react": "catalog:ui"
  },
  "devDependencies": {
    "vite": "catalog:build",
    "vitest": "catalog:test"
  }
}

Keep dependencies vs devDependencies semantically correct. Catalogs centralize versions; they do not replace dependency-kind decisions.

5. Refresh lockfile

Prefer one of these:

If private registry authentication or offline metadata blocks lockfile refresh, say so explicitly and report whether the lockfile still changed.

6. Verify affected packages

Use the real package-local checks after manifest changes.

Review checklist

Before finishing, verify all of the following:

Output expectations

When using this skill, report results in this order:

  1. Which catalogs were added or changed.
  2. Which manifests were moved to catalog:<name>.
  3. Whether versions are now aligned across the touched packages.
  4. Lockfile status.
  5. Verification commands run and whether they passed.

Examples

Example: moving a shared build tool

Input:

"把几个前端包里的 vite 和 typescript 统一到 pnpm-workspace.yaml"

Expected approach:

Example: deciding against a new catalog

Input:

"这个单独只在一个包里用到的小工具要不要进 catalogs?"

Expected approach:

Back to all skills