一键导入
migrate-package-to-standalone
Migrates a monorepo sub-package to a standalone package (copy with excludes, then apply config changes).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Migrates a monorepo sub-package to a standalone package (copy with excludes, then apply config changes).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Add or review RTL compatibility for Orderly Web pages and components. Use this skill whenever the user asks to make a page/component support RTL, Arabic/Farsi/Hebrew, direction switching, mirrored layout, RTL bugs, or compatibility with the feature/rtl implementation in this repository.
Generate extend/en.json, translate it into 19 locales, and merge into main locale JSON files.
Standardizes how to create and expose Orderly Plugin Interceptor Targets with typed props, injectable wiring, and package entry registration. Use when adding a new interceptor target, refactoring a component to be interceptable, or wiring InterceptorTargetPropsMap module augmentation.
Improve TypeScript/JSDoc and extraction metadata feeding apps/ai-docs generators (hooks, components, types)—before or alongside doc-template work.
Implement source-level quality improvements for component and hook docs generated by apps/ai-docs.
Execute MCP Inspector testing workflow for @orderly.network/sdk-docs. Use when user asks to test MCP tools, validate stdio inspector setup, run smoke/regression checks, or troubleshoot MCP JSON parse issues.
| name | migrate-package-to-standalone |
| description | Migrates a monorepo sub-package to a standalone package (copy with excludes, then apply config changes). |
| disable-model-invocation | true |
When to use: This skill has disable-model-invocation: true; it is only run when the user explicitly invokes /migrate-package-to-standalone.
Before running, obtain from the user or conversation:
| Input | Description | Example |
|---|---|---|
| Source directory | Subpackage root to migrate (monorepo path) | packages/trading-leaderboard |
| Destination directory | Root where the standalone package will live; all rules apply here | Same as source = in-place; else e.g. standalone/trading-leaderboard |
All paths in the steps below are relative to the destination (target) directory.
.git/node_modules/dist/babel.config.jsCHANGELOG.md
(The destination is typically a new repo; the user can run git init there if needed.)babel.config.js and CHANGELOG.md if they exist..gitignore file..cursor/skills/migrate-package-to-standalone/templates/.gitignore (relative to the workspace root) and write its contents to the destination’s .gitignore.In package.json:
@orderly.network from dependencies to peerDependencies.workspace:* with a version range (e.g. ^x.y.z or >=x.y.z) compatible with published versions. Get versions only from published npm (or your team’s published prerelease tags when applicable).@orderly.network dependencies in dependencies.Example:
// Before (dependencies)
"@orderly.network/ui": "workspace:*",
// After: remove from dependencies, add to peerDependencies
"peerDependencies": {
"@orderly.network/ui": "^2.0.0",
...
}
When babel.config.js was removed (copy exclude or in-place delete):
@babel/core, @babel/preset-env, @babel/preset-typescript.Recommended for standalone publish flow:
"prepublishOnly": "pnpm build" (or equivalent if the package uses a different package manager) so publishing always runs a fresh build.files beyond "dist" when you want npm tarballs to include metadata consumers expect, e.g. ["dist", "package.json", "README.md"]. Monorepo packages often list only "dist"; adjust as needed.tsconfig.json and tsuptsconfig.json may only extends ./tsconfig.build.json and add compilerOptions.paths pointing at sibling packages for local development.tsconfig.build.json may extends a workspace package such as tsconfig/react-library.json and include compilerOptions.typeRoots.tsconfig.json that extends: "@orderly.network/ts-config/react-library.json"."@orderly.network/ts-config": "<version>". Use a version from the monorepo root, other packages, or published npm.tsconfig entry (e.g. "tsconfig": "workspace:*"). It is replaced by @orderly.network/ts-config.compilerOptions.paths (consumers resolve @orderly.network/* from node_modules).compilerOptions.typeRoots: Usually drop it when it only mirrored monorepo defaults (./node_modules/@types plus ./src/@types with no real custom declarations). If the package relies on custom ambient types under e.g. ./src/@types, keep or re-add typeRoots (e.g. ["./node_modules/@types", "./src/@types"]) so TypeScript still resolves those files.tsconfig.build.json after merging any still-needed include / exclude / compilerOptions into tsconfig.json.tsup.config.tstsconfig: "tsconfig.build.json", remove that field (tsup defaults to tsconfig.json) or set tsconfig: "tsconfig.json" explicitly.Example tsconfig.json:
{
"extends": "@orderly.network/ts-config/react-library.json",
"include": ["./src/**/*.ts", "./src/**/*.tsx"],
"exclude": [
"dist",
"build",
"node_modules",
"**/*.test.tsx",
"**/*.test.ts",
"**/*.test.js",
"**/*.spec.tsx",
"**/*.spec.ts",
"**/*.spec.js",
"**/*.stories.tsx"
],
"compilerOptions": {
"jsx": "react-jsx",
"sourceMap": false,
"module": "esnext",
"outDir": "dist",
"declarationDir": "types",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"moduleResolution": "node"
}
}
(Default: omit typeRoots unless the package needs ./src/@types or equivalent custom type roots.)
tailwind.config.cjs that references a local UI preset, replace that preset with the package reference:
presets: [require(path.resolve(__dirname, "../ui/tailwind.config.js"))]presets: [require("@orderly.network/ui/tailwind.config.js")]const path = require("path"); is no longer used in the file, remove it.Example:
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/*.{ts,js,tsx,jsx,mdx}"],
presets: [require("@orderly.network/ui/tailwind.config.js")],
};
If pnpm run build:css (or equivalent) fails because a plugin required by @orderly.network/ui’s Tailwind preset is not installed in the standalone repo (e.g. missing module tailwindcss-animate), add that package to devDependencies so the CLI can resolve it.
tsup code splittingSome packages set splitting: true in tsup when the bundle uses dynamic import() or ships separate chunks (e.g. per-locale files). Others keep splitting: false. Do not assume the monorepo value is always correct for standalone—e.g. a package may move from splitting: false to true when adding locale chunks. Preserve the old value only when output layout should stay the same; enable splitting when chunking is required.
If a package stops relying solely on centralized locale data and vendors translations under something like src/i18n (locales + small provider glue), that is package-specific—not mandatory for every migration. Use prior art (e.g. a migrated trading-leaderboard standalone repo) only as a reference.
.gitlab-ci.yml file..cursor/skills/migrate-package-to-standalone/templates/.gitlab-ci.yml (relative to the workspace root) and write its contents to the destination’s .gitlab-ci.yml.After migration, verify:
.gitignore and .gitlab-ci.yml exist in the destination root.@orderly.network deps are in peerDependencies with version ranges (no workspace:*).@orderly.network/ts-config and no longer lists workspace tsconfig.tsconfig.json extends @orderly.network/ts-config/react-library.json, has no monorepo paths; typeRoots is removed unless custom ./src/@types (or equivalent) still requires it.tsconfig.build.json removed (or not used); tsup.config.ts does not point at a removed tsconfig.build.json.babel.config.js was dropped.prepublishOnly and files in package.json match your publish expectations.tailwind.config.cjs uses presets: [require("@orderly.network/ui/tailwind.config.js")].build:css failed on a missing Tailwind plugin, the plugin was added to devDependencies.