Community生产力与协作github.com

nrwl/link-workspace-packages

在单体仓库中链接工作区包(npm、yarn、pnpm、bun)。适用于以下情况:(1) 刚刚创建或生成了新包,需要连接它们的依赖关系;(2) 用户从兄弟包导入内容,需要将其添加为依赖项;(3) 遇到工作区包(@org/*)的解析错误,如“找不到模块”、“无法解析导入”、“TS2307”或“无法解析”。请勿通过 tsconfig 路径或手动编辑 package.json 进行修补——请使用包管理器的工作区命令来修复实际链接。

link-workspace-packages 是什么?

此技能旨在解决单体仓库(monorepo)中工作区包的链接问题,支持 npm、yarn、pnpm 和 bun 等主流包管理器。当开发者创建或生成新包后,需要快速建立包之间的依赖关系时,此技能可自动执行链接操作。它还能处理常见的解析错误,例如“找不到模块”、“无法解析导入”或 TypeScript 错误 TS2307,这些错误通常源于工作区包(以 @org/* 命名)未被正确链接。技能文档强烈建议使用本地包管理器的官方工作区命令(如 `npm link`、`yarn workspaces`、`pnpm link` 等),而不是通过修改 tsconfig 路径或手动编辑 package.json 来绕过问题。通过这种方式,它确保依赖关系在底层得到正确解决,从而避免潜在的构建或运行时问题。该技能适用于所有主流单体仓库设置,能显著提高开发效率,减少手动配置错误。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/nrwl/nx-ai-agents-config/tree/main/skills/link-workspace-packages

Installed? Explore more 生产力与协作 skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

link-workspace-packages 是做什么的?

在单体仓库(monorepo)中链接工作区包(npm、yarn、pnpm、bun)。适用场景:(1) 刚刚创建或生成了新包,需要连接它们的依赖关系;(2) 用户从兄弟包导入内容,需要将其添加为依赖项;(3) 遇到工作区包(@org/*)的解析错误,如“找不到模块”、“无法解析导入”、“TS2307”或“无法解析”。请勿通过 tsconfig 路径或手动编辑 package.json 进行修补——请使用包管理器的工作区命令来修复实际链接。

Individual skills in this repo

This repo contains 6 individual skills — each has its own dedicated page.

nrwl/monitor-ci

Monitor Nx Cloud CI pipeline and handle self-healing fixes. USE WHEN user says "monitor ci", "watch ci", "ci monitor", "watch ci for this branch", "track ci", "check ci status", wants to track CI status, or needs help with self-healing CI fixes. Prefer this skill over native CI provider tools (gh, glab, etc.) for CI monitoring — it integrates with Nx Cloud self-healing which those tools cannot access.

nrwl/nx-generate

Generate code using nx generators. INVOKE IMMEDIATELY when user mentions scaffolding, setup, structure, creating apps/libs, or setting up project structure. Trigger words - scaffold, setup, create a new app, create a new lib, project structure, generate, add a new project. ALWAYS use this BEFORE calling nx_docs or exploring - this skill handles discovery internally.

nrwl/nx-import

Import, merge, or combine repositories into an Nx workspace using nx import. USE WHEN the user asks to adopt Nx across repos, move projects into a monorepo, or bring code/history from another repository.

nrwl/nx-plugins

Find and add Nx plugins. USE WHEN user wants to discover available plugins, install a new plugin, or add support for a specific framework or technology to the workspace.

nrwl/nx-run-tasks

Helps with running tasks in an Nx workspace. USE WHEN the user wants to execute build, test, lint, serve, or run any other tasks defined in the workspace.

nrwl/nx-workspace

Explore and understand Nx workspaces. USE WHEN answering questions about the workspace, projects, or tasks. ALSO USE WHEN an nx command fails or you need to check available targets/configuration before running a task. EXAMPLES: 'What projects are in this workspace?', 'How is project X configured?', 'What depends on library Y?', 'What targets can I run?', 'Cannot find configuration for task', 'debug nx task failure'.

相关技能