scaffold-package
Scaffold a new package in the monorepo with correct conventions, configs, and policy compliance
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 3
- Forks
- 1
01 前言 Front Matter
- name
- scaffold-package
- description
- Scaffold a new package in the monorepo with correct conventions, configs, and policy compliance
- disable-model-invocation
- true
03 SKILL.md 正文
Scaffold a New Package
Create a new package in packages/ following all monorepo conventions.
Workflow
-
Gather info - Ask the user for:
- Package name (with or without
@tylerbu/scope) - Package type:
library,cli(OCLIF),docs(Astro/Starlight), orremark-plugin - Brief description
- Whether it should be private (default: false, except docs sites which are always private)
- Package name (with or without
-
Create directory -
packages/<folder-name>/- Folder name should match the unscoped package 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- Exports using
./esm/output directory with types - Scripts:
clean,build:compile,format,check:format,lint,testas appropriate for the type "nx": { "targets": { "build": {} } }to enable Nx orchestration- For CLIs: add
bin,oclifconfig,build:manifest,build:readmescripts - For docs sites: add
"private": true,build:site,dev,previewscripts,check:astro
-
Create 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>:buildto confirm the package builds
Key Constraints
- Use tabs for indentation (not spaces)
- Use
.mtsfor TypeScript files if they need to be explicitly ESM (though.tsis fine with"type": "module") - No
.jsfile extensions - use.mjsor.cjs - Sort package.json keys (repopo enforces this)
- Internal deps use
workspace:^protocol
04 同仓库更多 Skills
unslop
Cut AI tells from any writing.
storytelling
Make sure all prose sentences contribute to a coherent narrative, forming a small story rather than a series of disconnected statements.
stop-slop
Remove AI writing patterns from prose. Use when drafting, editing, or reviewing text to eliminate predictable AI tells.
prose-banlist
A skill that bans certain phrases from being used in prose writing.
ponytail
Lazy senior dev mode: the smallest change that fully solves the task, and a reply a busy human understands in one read. Use on any coding task (writing, fixing, refactoring, reviewing, choosing dependencies) and when the user says "ponytail", "be lazy", "simplest solution", "yagni", or complains about over-engineering or bloat. Levels: lite, full (default), ultra.
ponytail-review
Quality review of a change: is the logic right, is it safe, does it hold under real load, is risky code tested, is it fast enough, and is every line needed. Reads the connected code, not only the diff. Each finding is explained in plain English. Use for "review this", "code review", "review the last commit", "review my PR", "is this over-engineered", /ponytail-review.