agentleFS
leaf76leaf76/agent-skills/bundle/SKILL.md

bundle

Skill0 starsChanged 3 months agoMITView on GitHub

Bundle and package projects for distribution. Supports frontend apps (Vite/Webpack), libraries (npm/PyPI), executables (Go/Rust binaries), and web extensions (Chrome/Firefox). Use when preparing releases, packaging for distribution, or creating deployable artifacts.

The file

Files
SKILL.md

Bundle Project

Package projects for distribution across different formats.

Bundle Type Detection

IndicatorBundle TypeOutput
vite.config.* / webpack.config.*Frontend Appdist/ static files
package.json with main/exportsnpm Librarydist/ + package.json
pyproject.toml with [build-system]PyPI Librarydist/*.whl
go.mod with main packageGo BinarySingle executable
Cargo.toml with [[bin]]Rust BinarySingle executable
manifest.json (v3)Web Extension.zip for store upload

Frontend App Bundle

Vite

# Production build
pnpm build  # or npm run build

# Preview locally
pnpm preview

Output: dist/ with optimized static files

Webpack

# Production build
NODE_ENV=production npx webpack

# Analyze bundle size
npx webpack-bundle-analyzer dist/stats.json

Optimization Checklist

  • Tree shaking enabled
  • Code splitting configured
  • Assets minified (JS/CSS/images)
  • Source maps for production (hidden)
  • Gzip/Brotli compression ready

Library Bundle

npm Package

# Build library
pnpm build

# Check package contents before publish
npm pack --dry-run

# Verify exports
node -e "console.log(require('./dist'))"

package.json requirements:

{
  "main": "./dist/index.cjs",
  "module": "./dist/index.mjs",
  "types": "./dist/index.d.ts",
  "exports": {
    ".": {
      "import": "./dist/index.mjs",
      "require": "./dist/index.cjs",
      "types": "./dist/index.d.ts"
    }
  },
  "files": ["dist"]
}

PyPI Package

# Build with poetry
poetry build

# Build with uv
uv build

# Check package
twine check dist/*

Output: dist/package-version.whl and dist/package-version.tar.gz

Executable Bundle

Go Binary

# Build for current platform
go build -ldflags="-s -w" -o bin/app ./cmd/app

# Cross-compile all platforms
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o bin/app-linux-amd64 ./cmd/app
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o bin/app-darwin-arm64 ./cmd/app
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o bin/app-windows-amd64.exe ./cmd/app

Optimization flags:

  • -s - Strip symbol table
  • -w - Strip DWARF debug info
  • -trimpath - Remove file paths from binary

Rust Binary

# Release build
cargo build --release

# Optimized for size
RUSTFLAGS="-C opt-level=s" cargo build --release

# Strip symbols (Linux/macOS)
strip target/release/app

Cargo.toml optimizations:

[profile.release]
lto = true
codegen-units = 1
panic = "abort"
strip = true

Web Extension Bundle

Chrome Extension (Manifest V3)

# Build extension
pnpm build

# Create zip for Chrome Web Store
cd dist && zip -r ../extension-chrome.zip . -x "*.map"

Firefox Extension

# Build with web-ext
npx web-ext build --source-dir=dist --artifacts-dir=artifacts

# Or manual zip
cd dist && zip -r ../extension-firefox.zip . -x "*.map"

Extension Checklist

  • manifest.json version updated
  • Icons included (16, 48, 128px)
  • Permissions minimized
  • Content Security Policy set
  • No dynamic code execution (prohibited by CSP)
  • Source maps excluded from zip

Bundle Verification

After bundling, verify:

# Check bundle size
du -sh dist/

# List contents
ls -la dist/

# For zip files
unzip -l extension.zip

Common Issues

IssueCauseSolution
Bundle too largeNo tree shakingCheck imports, use named exports
Missing assetsWrong public pathFix base in vite.config
Runtime errorsMissing polyfillsAdd core-js or specific polyfills
Extension rejectedCSP violationRemove dynamic code execution

Output

Report bundle results:

  1. Bundle type and output location
  2. Total size (before/after compression)
  3. Files included
  4. Any warnings or optimization suggestions

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.