一键导入
scaffold-package
Scaffold a new package in the monorepo with correct conventions, configs, and policy compliance
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Scaffold a new package in the monorepo with correct conventions, configs, and policy compliance
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Add a new OCLIF command to a CLI package with proper base class, flags, args, and post-creation steps
Create changesets for pending changes by analyzing git diff and commit history
Audit workspace dependencies for version mismatches, unused packages, and sync issues across all packages
Fix all repository policy violations
Run Nx affected commands for the current changes
Reference for Nx task architecture, orchestration patterns, and how to add or modify build tasks
| name | scaffold-package |
| description | Scaffold a new package in the monorepo with correct conventions, configs, and policy compliance |
| disable-model-invocation | true |
Create a new package in packages/ following all monorepo conventions.
Gather info - Ask the user for:
@tylerbu/ scope)library, cli (OCLIF), docs (Astro/Starlight), or remark-pluginCreate directory - packages/<folder-name>/
Create package.json matching existing conventions:
"type": "module""license": "MIT""author": "Tyler Butler <tyler@tylerbutler.com>""bugs": "https://github.com/tylerbutler/tools-monorepo/issues""repository": { "type": "git", "url": "git+https://github.com/tylerbutler/tools-monorepo.git", "directory": "packages/<name>" }"homepage" pointing to GitHub tree./esm/ output directory with typesclean, build:compile, format, check:format, lint, test as appropriate for the type"nx": { "targets": { "build": {} } } to enable Nx orchestrationbin, oclif config, build:manifest, build:readme scripts"private": true, build:site, dev, preview scripts, check:astroCreate tsconfig.json:
{
"extends": "../../config/tsconfig.strict.json",
"include": ["src/**/*"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./esm",
"types": ["node"]
}
}
Create vitest.config.ts (for non-docs packages):
import { defineConfig, mergeConfig } from "vitest/config";
import defaultConfig from "../../config/vitest.config";
const config = mergeConfig(defaultConfig, defineConfig({}));
export default config;
Create src/index.ts with a placeholder export
Create CLAUDE.md with package-specific guidance (keep it concise - 20-30 lines)
Run setup commands:
pnpm install
./packages/repopo/bin/dev.js check --fix
pnpm syncpack:fix
Verify - Run pnpm nx run <package>:build to confirm the package builds
.mts for TypeScript files if they need to be explicitly ESM (though .ts is fine with "type": "module").js file extensions - use .mjs or .cjsworkspace:^ protocol