Skip to content
Skillv1.0.0

bun-validator

Validate Bun workspace configuration and detect common monorepo issues. Ensures proper workspace setup, dependency catalogs, isolated installs, and Bun 1.3+ best practices. Use when setting up a Bun m

by shipshitdev(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from shipshitdev/skills (skills/bun-validator/SKILL.md). Install upstream with npx skills add shipshitdev/skills --skill bun-validator. Copyright stays with the author.

Bun Validator

When This Activates

  • Setting up a new Bun monorepo
  • Before adding dependencies to workspaces
  • Auditing existing Bun workspaces
  • After AI generates package.json files
  • CI/CD pipeline validation

Quick Start

python3 scripts/validate.py --root .
python3 scripts/validate.py --root . --strict

What Gets Checked

1. Bun Version

# GOOD: v1.3+
bun --version  # 1.3.0 or higher

# BAD: v1.2 or earlier
bun --version  # 1.2.x

2. Root package.json

GOOD - Monorepo root:

{
  "name": "my-monorepo",
  "private": true,
  "workspaces": ["apps/*", "packages/*"]
}

BAD - Dependencies in root:

{
  "workspaces": ["apps/*"],
  "dependencies": {
    "react": "^19.0.0"  // BAD: Don't put deps in root
  }
}

3. Workspace Structure

GOOD: See references/full-guide.md (§ Workspace Structure Example) for the full tree — root package.json + bun.lockb, each app/package owns its own package.json.

BAD:

my-monorepo/
├── package.json
├── apps/
│   └── web/
│       ├── package.json
│       └── bun.lockb     # BAD: Lockfile in workspace

4. Workspace Dependencies

GOOD - Using workspace protocol:

{
  "dependencies": {
    "@myorg/ui": "workspace:*",
    "@myorg/config": "workspace:^1.0.0"
  }
}

BAD - Hardcoded versions:

{
  "dependencies": {
    "@myorg/ui": "1.0.0"  // BAD: Use workspace:*
  }
}

5. Dependency Catalogs (Bun 1.3+)

GOOD - Centralized versions:

// Root package.json
{
  "catalog": {
    "react": "^19.0.0",
    "typescript": "^5.7.0",
    "@types/node": "^22.0.0"
  }
}
// apps/web/package.json
{
  "dependencies": {
    "react": "catalog:"  // Uses version from catalog
  }
}

6. Isolated Installs

GOOD - Default in Bun 1.3: Packages can only access dependencies they explicitly declare.

BAD - Hoisted dependencies:

// Don't disable isolation
{
  "workspaces": {
    "packages": ["apps/*"],
    "nohoist": ["**"]  // Don't do this
  }
}

Bun 1.3+ Features

Dependency Catalogs

See § Dependency Catalogs (Bun 1.3+) above for the catalog syntax.

Interactive Updates

bun update --interactive  # Selectively update deps

Dependency Chains

bun why react  # Explain why a package is installed

Workspace Commands

# Install in specific workspace
bun add express --cwd apps/api

# Run script in workspace
bun run --cwd apps/web dev

# Run in all workspaces
bun run --filter '*' build

Common Issues

Issue: "Cannot find module"

Cause: Dependency not declared in workspace package.json

Fix:

bun add <package> --cwd <workspace>

Issue: Multiple lockfiles

Cause: Running bun install in workspace directory

Fix:

rm apps/*/bun.lockb packages/*/bun.lockb
bun install  # From root only

Issue: Version conflicts

Cause: Same package with different versions across workspaces

Fix: Use dependency catalogs:

{
  "catalog": {
    "problematic-package": "^1.0.0"
  }
}

Validation Output

See references/full-guide.md (§ Validation Output Example) for a sample report.

Best Practices

  • Always use the workspace protocol: "@myorg/shared": "workspace:*"
  • Use --cwd for workspace operations: bun add lodash --cwd apps/web (not cd apps/web && bun add)
  • Run bun install only from the root — keep a single lockfile
  • Use dependency catalogs for shared versions (see § Dependency Catalogs above)
  • Declare all dependencies explicitly per workspace — don't rely on hoisting

CI/CD Integration

# .github/workflows/validate.yml
- name: Validate Bun Workspace
  run: |
    python3 scripts/validate.py \
      --root . \
      --strict \
      --ci

Integration

  • linter-formatter-init - Sets up Biome with Bun
  • project-init-orchestrator - Creates workspace structure
  • nextjs-validator - Validates Next.js in workspace

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/shipshitdev-skills-bun-validator/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

shipshitdev-skills-bun-validator.ocm.jsonjson
{
  "ocm": "1",
  "id": "shipshitdev-skills-bun-validator",
  "kind": "skill",
  "name": "bun-validator",
  "description": "Validate Bun workspace configuration and detect common monorepo issues. Ensures proper workspace setup, dependency catalogs, isolated installs, and Bun 1.3+ best practices. Use when setting up a Bun monorepo, before adding workspace dependencies, auditing an existing Bun workspace, or validating package.json in CI.",
  "publisher": "shipshitdev",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "math"
    ],
    "tags": [
      "skill-md",
      "bun",
      "monorepo",
      "workspace",
      "validation",
      "package-manager",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Validate Bun workspace configuration and detect common monorepo issues. Ensures proper workspace setup, dependency catalogs, isolated installs, and Bun 1.3+ best practices. Use when setting up a Bun monorepo, before adding workspace dependencies, auditing an existing Bun workspace, or validating package.json in CI."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/shipshitdev/skills",
      "path": "skills/bun-validator/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/shipshitdev/skills/blob/HEAD/skills/bun-validator/SKILL.md",
      "key": "shipshitdev/skills/skills/bun-validator/SKILL.md"
    }
  },
  "instructions": "# Bun Validator\n\n## When This Activates\n\n- Setting up a new Bun monorepo\n- Before adding dependencies to workspaces\n- Auditing existing Bun workspaces\n- After AI generates package.json files\n- CI/CD pipeline validation\n\n## Quick Start\n\n```bash\npython3 scripts/validate.py --root .\npython3 scripts/validate.py --root . --strict\n```\n\n## What Gets Checked\n\n### 1. Bun Version\n\n```bash\n# GOOD: v1.3+\nbun --version  # 1.3.0 or higher\n\n# BAD: v1.2 or earlier\nbun --version  # 1.2.x\n```\n\n### 2. Root package.json\n\n**GOOD - Monorepo root:**\n\n```json\n{\n  \"name\": \"my-monorepo\",\n  \"private\": true,\n  \"workspace",
  "cost": {
    "context_tokens": 1003
  }
}

Fetch it by URL: GET /api/v1/registry/shipshitdev-skills-bun-validator/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.