scaffold-library

SkillWeb & browsing

Setup library project structure with src, build config, exports, and tests

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the scaffold-library skill

What this skill tells your AI

The instructions your AI receives, as published by porcupine-md/anoa-browser in .claude/skills/core/scaffold-library/SKILL.md and read by ahel’s review.

Context

You will create a library "{{input.name}}" targeting {{input.runtime}}. Output format: {{input.format}}.

Instructions

  1. Setup package.json

    • name, version, description, license
    • main (CJS), module (ESM), types
    • exports field for dual package
    • scripts: build, test, lint, prepublishOnly
    • peerDependencies (not dependencies) for shared libs
  2. Setup TypeScript config

    • tsconfig.json for source
    • tsconfig.build.json for build output
    • Strict mode enabled
    • Declaration files enabled
  3. Setup build tool

    • tsup or unbuild (simple, near-zero-config)
    • Config for ESM + CJS output
    • Source maps
    • DTS generation
  4. Create source structure

    src/
    ├── index.ts          # Public API exports
    ├── types.ts           # Shared types
    └── [modules]/         # Feature modules
    
  5. Setup testing

    • Vitest config
    • Example test file
    • Coverage config
  6. Setup linting

    • ESLint config (if not already present)
    • Prettier config (if not already present)
  7. Create README stub

    • Installation
    • Quick start
    • API reference placeholder
  8. Setup CI (if jonggrang.json ci.provider != none)

    • Build + test on PR
    • Publish on tag/release

Script

#!/bin/bash
# Initialize if no package.json
if [ ! -f "package.json" ]; then
  npm init -y
fi

# Install dev dependencies
npm install -D typescript tsup vitest @types/node

Validation

  • npm run build succeeds
  • npm run test passes
  • Output files generated (dist/)
  • Types generated (.d.ts)
  • ESM import works
  • CJS require works (if format includes cjs)
  • Exports field correct in package.json

Signals

GitHub stars
23
Forks
2
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
scaffold-library
Source
github.com/porcupine-md/anoa-browser