Initialize or sync npm package architecture (catalogs, GH actions, configs)
Initializes or syncs npm packages to standardized UnJS architecture with pnpm catalogs, GitHub Actions, and TypeScript configs.
/plugin marketplace add harlan-zw/harlan-claude-code/plugin install harlan-zw-harlan-claude-code-harlan-claude-code@harlan-zw/harlan-claude-codeThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Initialize a new package or sync an existing one to standardized architecture.
Always prefer UnJS ecosystem packages over Node.js builtins and common alternatives:
| Instead of | Use | Import |
|---|---|---|
path | pathe | import { join, resolve } from 'pathe' |
console.log/warn/error | consola | import { consola } from 'consola' |
fetch | ofetch | import { $fetch } from 'ofetch' |
fs.readFile (JSON) | pkg-types | import { readPackageJSON } from 'pkg-types' |
Object.assign defaults | defu | import { defu } from 'defu' |
require.resolve | mlly | import { resolveImports } from 'mlly' |
EventEmitter | hookable | import { createHooks } from 'hookable' |
yargs/commander | citty | import { defineCommand } from 'citty' |
cosmiconfig | c12 | import { loadConfig } from 'c12' |
git clone templates | giget | import { downloadTemplate } from 'giget' |
Principles:
/pkg-init # sync existing project
/pkg-init my-package # init new package
Check for package.json in cwd to determine new vs existing.
Use named catalogs only (no default catalog:). Max 5 catalogs.
packages:
- playground
# - packages/* # for monorepos
catalogMode: prefer
shellEmulator: true
trustPolicy: no-downgrade
catalogs:
# Runtime dependencies (usually peer deps)
deps:
defu: ^6.1.4
pathe: ^2.0.3
ufo: ^1.6.2
ohash: ^2.0.11
hookable: ^6.0.1
# Linting
dev-lint:
'@antfu/eslint-config': ^6.7.3
eslint: ^9.39.2
# Testing
dev-test:
vitest: ^4.0.16
# Build tooling
dev-build:
typescript: ^5.9.3
unbuild: ^3.6.1
bumpp: ^10.3.2
'@arethetypeswrong/cli': ^0.18.2
onlyBuiltDependencies:
- '@parcel/watcher'
- esbuild
- vue-demi
{
"devDependencies": {
"eslint": "catalog:dev-lint",
"@antfu/eslint-config": "catalog:dev-lint",
"vitest": "catalog:dev-test",
"typescript": "catalog:dev-build"
},
"dependencies": {
"defu": "catalog:deps"
}
}
name: Test
on:
push:
paths-ignore:
- '**/README.md'
- 'docs/**'
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: lts/*
cache: pnpm
- run: pnpm i
- name: Lint
run: pnpm lint
- name: Typecheck
run: pnpm typecheck
- name: Build
run: pnpm build
- name: Test
run: pnpm test:run
name: Release
permissions:
contents: write
id-token: write
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: lts/*
cache: pnpm
registry-url: https://registry.npmjs.org
- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- run: pnpm i
- run: pnpm build
- run: pnpm publish -r --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
shamefully-hoist=true
strict-peer-dependencies=false
ignore-workspace-root-check=true
root = true
[*]
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
# Dependencies
node_modules
# Build output
dist
.output
# IDE
.idea
.vscode
*.swp
# OS
.DS_Store
Thumbs.db
# Logs
*.log
# Test
coverage
# Local
.env
.env.*
!.env.example
import antfu from '@antfu/eslint-config'
export default antfu({
type: 'lib', // or 'app' for applications
ignores: [
'CLAUDE.md',
],
})
import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
globals: true,
reporters: 'dot',
},
})
For projects with unit + e2e separation:
import { defineConfig, defineProject } from 'vitest/config'
export default defineConfig({
test: {
globals: true,
reporters: 'dot',
projects: [
defineProject({
test: {
name: 'unit',
include: ['test/unit/**/*.test.ts'],
},
}),
defineProject({
test: {
name: 'e2e',
include: ['test/e2e/**/*.test.ts'],
},
}),
],
},
})
{
"compilerOptions": {
"target": "ESNext",
"module": "Preserve",
"moduleResolution": "bundler",
"moduleDetection": "force",
"strict": true,
"skipLibCheck": true,
"declaration": true,
"noUnusedLocals": true,
"noEmit": true
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
}
import { defineBuildConfig } from 'unbuild'
export default defineBuildConfig({
declaration: true,
entries: [
'src/index',
],
externals: [
// add runtime externals here
],
})
{
"name": "my-package",
"version": "0.0.0",
"description": "",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/harlan-zw/my-package.git"
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": ["dist"],
"packageManager": "pnpm@10.28.0"
}
{
"scripts": {
"build": "unbuild",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"typecheck": "tsc --noEmit",
"test": "vitest",
"test:run": "vitest run",
"release": "bumpp && pnpm publish"
}
}
test/
unit/ # unit tests
*.test.ts
e2e/ # e2e/integration tests
*.test.ts
When syncing existing project, check and update:
pnpm-workspace.yaml - catalogs structure, onlyBuiltDependencies (not ignoredBuiltDependencies)package.json - migrate deps to catalog:* format, add packageManager field.github/workflows/test.yml - action versions (checkout@v6, setup-node@v6, pnpm/action-setup@v4).github/workflows/release.yml - action versions.npmrc - standard settings.editorconfig - standard config.gitignore - standard patternseslint.config.mjs - antfu config with ignoresvitest.config.ts - standard config with projects if neededtsconfig.json - modern options (module: Preserve, moduleDetection: force)build.config.ts - externals definedlint:fix# 1. Check current state
cat pnpm-workspace.yaml
cat package.json | jq '.devDependencies'
# 2. Update catalogs
# Edit pnpm-workspace.yaml with standard catalogs
# 3. Migrate package.json deps to catalog:* format
# 4. Update GH actions to latest versions
# 5. Verify
pnpm install
pnpm lint
pnpm typecheck
pnpm build
pnpm test:run
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.