Conform or scaffold TypeScript packages and Nuxt modules. Use for workspace catalogs, package config, CI, ESLint, Vitest, playgrounds, fixtures, or Nuxt module setup.
Conform or scaffold TypeScript packages and Nuxt modules. Use for workspace catalogs, package config, CI, ESLint, Vitest, playgrounds, fixtures, or Nuxt module setup.
user_invocable
true
Package Conform Skill
Conform a package to standardized architecture, or scaffold a new one.
Worktree isolation
Before any edit, follow the worktree isolation contract. It provides the atomic live-agent claim used below.
An existing worktree alone does not prove another agent is active.
wt is the only worktree tool. Never run git worktree add, and never use a harness worktree option such as EnterWorktree or isolation: "worktree". Those write to .claude/worktrees/, which is banned. wt places every worktree at <parent>/<repo>.<branch-slug>.
Keep the primary checkout read only. Before mutation, run wt list --format=json. Reuse the task's worktree with wt switch <branch>, or create one with wt switch --create <branch> --base <base>. Read its absolute path from the JSON, then pass that path as workdir to every later command. Never share a mutation worktree between tasks.
Usage
/pkg-conform # conform existing project
/pkg-conform my-package # scaffold new package
Behavior
New project: scaffold with all standards below
Existing project: compare and offer to sync each component
Detection
Check for package.json in cwd to determine new vs existing.
Check for packages: in pnpm-workspace.yaml to detect monorepo vs single repo.
Check for @nuxt/module-builder in devDependencies to detect Nuxt module -> apply Nuxt-specific patterns.
Project Type Detection
Determine project type from the absolute path of the working directory:
Path pattern
Type
Description
*/pkg/*
Package
Published library/module -- needs exports, build, release
*/sites/* or */site/*
Site
Nuxt app -- private, no exports, deploy not publish
If path doesn't match either pattern, fall back to heuristics: private: true + nuxt in deps -> Site, otherwise Package.
The project type selects the rule set. Package-only rules (exports, obuild, test:attw, prepack, release) never apply to Sites. Site-only rules (nuxi scripts, generate, preview) never apply to Packages.
Gotchas
Catalog version conflicts -- when migrating deps to catalog:, check that the catalog version satisfies all consumers in the monorepo. A single catalog: entry shared across packages with different version requirements will break.
obuild vs tsc -- obuild doesn't do type-checking. If you remove tsc from the build, types won't be validated. Always keep typecheck as a separate script.
module: preserve in tsconfig -- this is correct for packages built with obuild, but breaks Nuxt apps that need module: esnext or defer to .nuxt/tsconfig.json. Don't apply package tsconfig rules to sites.
ESM-only exports trap -- removing CJS exports breaks consumers that haven't migrated to ESM. For public packages, confirm the audience before dropping .cjs.
pnpm install after catalog changes -- lockfile must be regenerated. If you edit pnpm-workspace.yaml catalogs, always run pnpm install before running any other commands.
Nuxt module dev:prepare order -- must run before typecheck or test. Missing this causes confusing "module not found" errors from auto-generated types.
Site vs Package misdetection -- path-based detection (*/pkg/* vs */sites/*) can fail for unusual directory structures. Always verify the detected type before applying rules.
Markdown-only CI: Test, build, and deploy events ignore **/*.md by default.
An explicit paths list may include Markdown.
GitHub forbids paths and paths-ignore on the same event.
UnJS Conventions
Always prefer UnJS ecosystem packages over Node.js builtins:
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: ESM-only, minimal deps, full TypeScript, universal (Node/browser/edge)
Package.json
Package (single repo / monorepo)
See references/pkg-package-json.md for single repo and monorepo root templates.
Site (Nuxt app)
See references/site-package-json.md for template, optional scripts, and rules.
See references/site-structure.md for Nuxt 4 directory layout.
See references/site-configs.md for nuxt.config.ts, tsconfig, eslint, .npmrc, .gitignore templates.
Test Structure
test/
unit/ # unit tests
*.test.ts
e2e/ # e2e/integration tests
*.test.ts
fixtures/ # test data
Nuxt Module (when @nuxt/module-builder detected)
Build-time vs Runtime
Context
Location
Access
Registration
Build-time
src/module.ts
@nuxt/kit, nuxt config
runs during nuxi build
App runtime
src/runtime/app/
Vue, useNuxtApp()
addPlugin(), addImports()
Server runtime
src/runtime/server/
H3, Nitro
addServerHandler(), addServerPlugin()
Shared
src/runtime/shared/
Pure JS only
import via alias
See references/nuxt-module-template.md for full module.ts template with registration examples.
See references/nuxt-module-structure.md for directory layout and runtime rules.
References
See references/ for detailed templates:
../../references/code-comments.md - the comment contract for any code this skill writes
references/pkg-package-json.md - single repo and monorepo package.json templates
Determine from cwd path whether this is a Package (*/pkg/*) or Site (*/sites/*, */site/*).
Phase 1: Config Review
Read the config files directly (one batch of parallel Read calls) and compare against the checklist. The comparison is cross-cutting (catalog ↔ lockfile ↔ exports ↔ tsconfig interact), so read inline to keep the whole picture in context. Exception: for a large monorepo where one read pass is unwieldy, delegate per-package walks to subagent_type=Explore.
Read for all project types:
pnpm-workspace.yaml, package.json — deps, catalogs, packageManager, type
.github/workflows/*.yml — action versions against v6 standards