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.
What this skill does
# Bun Validator
Validates Bun workspace configuration and prevents common monorepo issues. Ensures Bun 1.3+ patterns and proper workspace isolation.
## 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
```bash
python3 scripts/validate.py --root .
python3 scripts/validate.py --root . --strict
```
## What Gets Checked
### 1. Bun Version
```bash
# 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:**
```json
{
"name": "my-monorepo",
"private": true,
"workspaces": ["apps/*", "packages/*"]
}
```
**BAD - Dependencies in root:**
```json
{
"workspaces": ["apps/*"],
"dependencies": {
"react": "^19.0.0" // BAD: Don't put deps in root
}
}
```
### 3. Workspace Structure
**GOOD:**
```
my-monorepo/
├── package.json # Root with workspaces, private: true
├── bun.lockb # Single lockfile at root
├── apps/
│ ├── web/
│ │ └── package.json # Own dependencies
│ └── api/
│ └── package.json # Own dependencies
└── packages/
├── ui/
│ └── package.json # Shared package
└── config/
└── package.json # Shared config
```
**BAD:**
```
my-monorepo/
├── package.json
├── apps/
│ └── web/
│ ├── package.json
│ └── bun.lockb # BAD: Lockfile in workspace
```
### 4. Workspace Dependencies
**GOOD - Using workspace protocol:**
```json
{
"dependencies": {
"@myorg/ui": "workspace:*",
"@myorg/config": "workspace:^1.0.0"
}
}
```
**BAD - Hardcoded versions:**
```json
{
"dependencies": {
"@myorg/ui": "1.0.0" // BAD: Use workspace:*
}
}
```
### 5. Dependency Catalogs (Bun 1.3+)
**GOOD - Centralized versions:**
```json
// Root package.json
{
"catalog": {
"react": "^19.0.0",
"typescript": "^5.7.0",
"@types/node": "^22.0.0"
}
}
```
```json
// 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:**
```json
// Don't disable isolation
{
"workspaces": {
"packages": ["apps/*"],
"nohoist": ["**"] // Don't do this
}
}
```
## Bun 1.3+ Features
### Dependency Catalogs
Centralize version management:
```json
// Root package.json
{
"catalog": {
"react": "^19.0.0",
"next": "^16.0.0",
"typescript": "^5.7.0"
}
}
```
### Interactive Updates
```bash
bun update --interactive # Selectively update deps
```
### Dependency Chains
```bash
bun why react # Explain why a package is installed
```
### Workspace Commands
```bash
# 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:**
```bash
bun add <package> --cwd <workspace>
```
### Issue: Multiple lockfiles
**Cause:** Running `bun install` in workspace directory
**Fix:**
```bash
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:
```json
{
"catalog": {
"problematic-package": "^1.0.0"
}
}
```
## Validation Output
```
=== Bun Workspace Validation Report ===
Bun Version: 1.3.2 ✓
Root package.json:
✓ private: true
✓ workspaces defined
✗ Found dependencies in root (should be empty)
Workspace Structure:
✓ apps/web - valid workspace
✓ apps/api - valid workspace
✓ packages/ui - valid workspace
✗ apps/web/bun.lockb - lockfile should only be at root
Dependencies:
✓ Using workspace:* protocol
✗ @myorg/ui uses hardcoded version "1.0.0"
Catalogs:
✗ No dependency catalog found (recommended for Bun 1.3+)
Summary: 3 issues found
```
## Best Practices
### 1. Always use workspace protocol
```json
"@myorg/shared": "workspace:*"
```
### 2. Use --cwd for workspace operations
```bash
bun add lodash --cwd apps/web # NOT: cd apps/web && bun add
```
### 3. Single lockfile at root
```bash
# Only run bun install from root
bun install
```
### 4. Use catalogs for shared dependencies
```json
{
"catalog": {
"typescript": "^5.7.0",
"vitest": "^3.0.0"
}
}
```
### 5. Declare all dependencies explicitly
Each workspace should list all its dependencies - don't rely on hoisting.
## CI/CD Integration
```yaml
# .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
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.