Schmock Package Generator Skill
Package Anatomy
Every @schmock/* package needs these files:
code
packages/<name>/
package.json # Name, version, exports, scripts, peer deps
tsconfig.json # Extends root, NodeNext module resolution
vitest.config.ts # Unit test config
vitest.config.bdd.ts # BDD test config
src/
index.ts # Entry point with exports
package.json
Based on the express/angular adapter pattern:
- •
"type": "module"— ESM only - •Exports:
"."withtypesandimportconditions - •Scripts:
build,build:lib,build:types,test,test:bdd,lint,check:publish - •Build:
bun build --minifyfor JS,tscfor declarations - •Peer dep on
@schmock/core: ^1.0.0 - •Dev deps:
vitest,@amiceli/vitest-cucumber,typescript
tsconfig.json
Extends root config with package-specific overrides:
- •
module: "NodeNext",moduleResolution: "NodeNext" - •
rootDir: "./src",outDir: "./dist" - •Excludes:
*.test.ts,*.steps.ts - •References
../core
vitest.config.ts (unit)
typescript
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
globals: true,
environment: "node",
include: ["src/**/*.test.ts"],
exclude: ["**/*.steps.ts"],
},
});
vitest.config.bdd.ts
typescript
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
globals: true,
environment: "node",
include: ["src/**/*.steps.ts"],
reporters: [['default', { summary: false }]],
},
});
Registration
After generating the package, these files need updating:
- •Root
tsconfig.json— Add path alias:"@schmock/<name>": ["packages/<name>/src"] - •Root
package.json— Add tobuildandtypecheckscripts - •
.release-please-manifest.json— Add"packages/<name>": "1.0.0"
The generate script handles all of this automatically.
Conventions
- •Build:
bun build --minifyfor JS output +tscfor type declarations - •ESM-only output (no CJS)
- •Strict TypeScript (inherited from root config)
- •Author:
Khalic Lab, License:MIT
Post-Generation Steps
After scaffolding a new package:
- •Create a
.featurefile for the package behavior (/development scaffold <name> <pkg>) - •Add to CI workflow matrix if needed (
.github/workflows/) - •Install any specific dependencies:
bun add -D <dep> --cwd packages/<name> - •Start implementing!
Command
code
/package-generator <name>
Example:
code
/package-generator fastify
Creates packages/fastify/ with full structure and registers it in the workspace.