Agent skill

Bun Nextjs

by secondsky in secondsky/claude-skills

This skill should be used when the user asks about "Next.js with Bun", "Bun and Next", "running Next.js on Bun", "Next.js development with Bun", "create-next-app with Bun", or building Next.js…

MITAuto-check: notesDevOps & Cloud

Install Bun Nextjs

skills CLI
$ npx skills add secondsky/claude-skills --skill bun-nextjs -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install secondsky/claude-skills bun-nextjs --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/secondsky/claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/bun/skills/bun-nextjs .claude/skills/bun-nextjs && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
bun-nextjs
GitHub stars
227
Token cost
~1.9k tokens
SKILL.md length
353 words
Files
1
Skills in repo
169
Repo updated
First seen
Licence
MIT

At a glance

This skill should be used when the user asks about "Next.js with Bun", "Bun and Next", "running Next.js on Bun", "Next.js development with Bun", "create-next-app with Bun", or building Next.js…

  • Works in 4 steps: Turbopack is the default in Next.js 16… → Prefer Server Components - Less… → Use Bun SQLite instead of external… → …
  • Asks about Next.js with Bun
  • SKILL.md covers Quick Start, Secure Installation, Project Setup and Configuration, plus 8 more sections
  • Calls bun, bunx and vercel; needs API_SECRET

What it does

Bun Nextjs is an agent skill from secondsky/claude-skills. This skill should be used when the user asks about "Next.js with Bun", "Bun and Next", "running Next.js on Bun", "Next.js development with Bun", "create-next-app with Bun", or building Next.js applications using Bun as the runtime.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in DevOps & Cloud. It works with Next.js, npm, Vercel and Node.js. The repository describes itself as: Production-ready skills for Claude Code CLI - Cloudflare, React, Tailwind v4, and AI integrations. The licence is MIT.

When your agent uses it

  • Asks about Next.js with Bun
  • Running Next.js on Bun
  • Next.js development with Bun
  • Create-next-app with Bun

Example prompts

  • “Next.js with Bun”
  • “Bun and Next”
  • “running Next.js on Bun”
  • “/bun-nextjs”

Requirements

  • Node.js
  • Docker
  • A credential in API_SECRET

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Turbopack is the default in Next.js 16 (no flag needed)
  2. Prefer Server Components - Less JavaScript sent to client
  3. Use Bun SQLite instead of external databases for simple apps
  4. Enable compression

What it can do on your machine

Read from SKILL.md and the folder at commit 8837836. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • bun
    • bunx
    • vercel

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use bunx and vercel, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • API_SECRET

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Bun Nextjs loads about 1.9k tokens when it runs. Until then it costs about 61 tokens; SKILL.md has 353 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~61
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:229
    # .env.local
  • NoteMentions a .env fileSKILL.md:240
    // .env.local

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from secondsky/claude-skills at commit 8837836, republished under its MIT licence (© secondsky). 353 words, ~1,857 tokens.

Download SKILL.mdSave it as .claude/skills/bun-nextjs/SKILL.md (or your agent's skills folder).
name
bun-nextjs
description
This skill should be used when the user asks about "Next.js with Bun", "Bun and Next", "running Next.js on Bun", "Next.js development with Bun", "create-next-app with Bun", or building Next.js applications using Bun as the runtime.
metadata.version
1.0.0
license
MIT

Bun Next.js

Run Next.js applications with Bun for faster development and builds.

Quick Start

bash
# Create new Next.js project with Bun
bunx create-next-app@latest my-app
cd my-app

# Install dependencies
bun install

# Development
bun run dev

# Build
bun run build

# Production
bun run start

Secure Installation

Scaffolding tools like bunx create-next-app download and execute remote code. Multiple install contexts (local, Docker) require pinning versions in both. Before running, follow supply chain security best practices:

  • Block post-install scripts — Bun disables them by default; allow specific packages via trustedDependencies in package.json
  • Cooldown period — Configure minimumReleaseAge in bunfig.toml to wait 7 days for new versions
  • Audit before installing — Run socket package score npm <pkg> or use socket npm install <pkg> to check packages

Load the dependency-upgrade skill for full security configuration including Socket CLI integration, cooldown setup, lockfile validation, and CI enforcement.

Project Setup

package.json
json
{
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "eslint ."
  },
  "dependencies": {
    "next": "^16.2.0",
    "react": "^19.2.0",
    "react-dom": "^19.2.0"
  }
}
Use Bun as Runtime
json
{
  "scripts": {
    "dev": "bun --bun next dev",
    "build": "bun --bun next build",
    "start": "bun --bun next start"
  }
}

The --bun flag forces Next.js to use Bun's runtime instead of Node.js.

Configuration

next.config.js
javascript
/** @type {import('next').NextConfig} */
const nextConfig = {
  // Turbopack is the default bundler in Next.js 16 (top-level, not under experimental)
  turbopack: {},

  // Server-side Bun APIs
  serverExternalPackages: ["bun:sqlite"],

  // Note: a `webpack` key is no longer supported in Next.js 16 — Turbopack is the
  // default bundler and a `webpack` config will fail `next build`. Bun-specific
  // imports (`bun:sqlite`, `bun:ffi`) are handled via `serverExternalPackages`
  // above. If you truly need the webpack bundler, run `next build --webpack`.
};

module.exports = nextConfig;

Using Bun APIs in Next.js

Server Components
typescript
// app/page.tsx (Server Component)
import { Database } from "bun:sqlite";

export default async function Home() {
  const db = new Database("data.sqlite");
  const users = db.query("SELECT * FROM users").all();
  db.close();

  return (
    <div>
      {users.map((user) => (
        <p key={user.id}>{user.name}</p>
      ))}
    </div>
  );
}
API Routes
typescript
// app/api/users/route.ts
import { Database } from "bun:sqlite";

export async function GET() {
  const db = new Database("data.sqlite");
  const users = db.query("SELECT * FROM users").all();
  db.close();

  return Response.json(users);
}

export async function POST(request: Request) {
  const body = await request.json();

  const db = new Database("data.sqlite");
  db.run("INSERT INTO users (name) VALUES (?)", [body.name]);
  db.close();

  return Response.json({ success: true });
}
File Operations
typescript
// app/api/files/route.ts
export async function GET() {
  const file = Bun.file("./data/config.json");
  const config = await file.json();

  return Response.json(config);
}

export async function POST(request: Request) {
  const data = await request.json();
  await Bun.write("./data/config.json", JSON.stringify(data, null, 2));

  return Response.json({ saved: true });
}

Server Actions

typescript
// app/actions.ts
"use server";

import { Database } from "bun:sqlite";
import { revalidatePath } from "next/cache";

export async function createUser(formData: FormData) {
  const name = formData.get("name") as string;

  const db = new Database("data.sqlite");
  db.run("INSERT INTO users (name) VALUES (?)", [name]);
  db.close();

  revalidatePath("/users");
}

export async function deleteUser(id: number) {
  const db = new Database("data.sqlite");
  db.run("DELETE FROM users WHERE id = ?", [id]);
  db.close();

  revalidatePath("/users");
}

Proxy (formerly Middleware)

In Next.js 16, middleware.ts is renamed to proxy.ts (the middleware name still works but is deprecated). Proxy runs on the Node.js runtime, not the Edge runtime.

⚠️ Deploying to Cloudflare via OpenNext? Keep middleware.ts. @opennextjs/cloudflare does not yet recognize the proxy.ts filename — renaming will silently disable your middleware on Cloudflare. Until OpenNext adds support, deploy with the classic middleware.ts (it still works in Next 16, just deprecated upstream). This caveat does not apply to Node.js/Vercel/Bun-native deployments.

typescript
// proxy.ts (renamed from middleware.ts in Next.js 16)
import { NextResponse } from "next/server";
import type { NextRequest } from "next/server";

export function proxy(request: NextRequest) {
  // Check auth
  const token = request.cookies.get("token");

  if (!token && request.nextUrl.pathname.startsWith("/dashboard")) {
    return NextResponse.redirect(new URL("/login", request.url));
  }

  return NextResponse.next();
}

export const config = {
  matcher: ["/dashboard/:path*"],
};
Show full SKILL.md (141 more words)Show less

Environment Variables

bash
# .env.local
DATABASE_URL=./data.sqlite
API_SECRET=your-secret-key
typescript
// Access in server components/actions
const dbUrl = process.env.DATABASE_URL;
const secret = process.env.API_SECRET;

// Expose to client (prefix with NEXT_PUBLIC_)
// .env.local
NEXT_PUBLIC_API_URL=https://api.example.com

Deployment

Build for Production
bash
bun run build
bun run start
Docker
dockerfile
FROM oven/bun:1

WORKDIR /app

COPY package.json bun.lockb ./
RUN bun install --frozen-lockfile

COPY . .
RUN bun run build

EXPOSE 3000

CMD ["bun", "run", "start"]
Vercel
bash
# Install Vercel CLI
bun add -g vercel

# Deploy
vercel

Note: Vercel's edge runtime uses V8, not Bun. Bun APIs work in:

  • Server Components (Node.js runtime)
  • API Routes (Node.js runtime)
  • Server Actions (Node.js runtime)

Performance Tips

  1. Turbopack is the default in Next.js 16 (no flag needed):

    bash
    bun run dev
  2. Prefer Server Components - Less JavaScript sent to client

  3. Use Bun SQLite instead of external databases for simple apps

  4. Enable compression:

    javascript
    // next.config.js
    module.exports = {
      compress: true,
    };

Common Errors

ErrorCauseFix
Cannot find bun:sqliteWrong runtimeUse bun --bun next dev
Module not foundMissing dependencyRun bun install
Hydration mismatchServer/client diffCheck data fetching
Edge runtime errorBun API on edgeUse Node.js runtime

When to Load References

Load references/app-router.md when:

  • App Router patterns
  • Route groups
  • Parallel routes

Load references/caching.md when:

  • Data caching strategies
  • Revalidation patterns
  • Static generation

© secondsky, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/bun/skills/bun-nextjs of secondsky/claude-skills.

Open the folder on GitHubat commit 8837836

Compare with similar skills

Bun Nextjs next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Bun Nextjs compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Bun Nextjs this skillsecondsky/claude-skills227—~1.9kAutomated safety check: NotesMIT
Portaljs Deploydatopian/portaljs2.4k1 repos~1.4kAutomated safety check: PassMIT
Cicd Pipeline Generatorailabs-393/ai-labs-claude-skills454—~2.7kAutomated safety check: PassMIT
Deploy Agentsundial-org/awesome-openclaw-skills663—~1.6kAutomated safety check: PassNone
Vercel Upgrade Migrationjeremylongshore/tons-of-skills-marketplace2.8k—~1.5kAutomated safety check: PassMIT
Vercel Functionsvercel/vercel-plugin301—~12kAutomated safety check: NotesCustom licence

Similar skills

  • Portaljs Deploy

    datopian/portaljs

    Deploy a PortalJS portal to PortalJS Arc — Datopian-managed static hosting on Cloudflare.

    2.4k GitHub starsUsed in 1 repo~1.4k tokens
    DevOps & CloudAuto-check passed
  • Cicd Pipeline Generator

    ailabs-393/ai-labs-claude-skills

    This skill should be used when creating or configuring CI/CD pipeline files for automated testing, building, and deployment.

    454 GitHub stars~2.7k tokensUpdated 11 mo ago
    DevOps & CloudAuto-check passed
  • Deploy Agent

    sundial-org/awesome-openclaw-skills

    Multi-step deployment agent for full-stack apps. An agent skill from sundial-org/awesome-openclaw-skills.

    663 GitHub stars~1.6k tokensUpdated 7 mo ago
    DevOps & CloudAuto-check passed
  • Vercel Upgrade Migration

    jeremylongshore/tons-of-skills-marketplace

    Upgrade Vercel CLI, Node.js runtime, and Next.js framework versions with breaking change detection.

    2.8k GitHub stars~1.5k tokensUpdated today
    Data & AnalyticsAuto-check passed
  • Vercel Functions

    vercel/vercel-plugin

    Official

    Vercel Functions expert guidance — Node.js/Bun/Python runtimes, Fluid Compute, long-duration (30 min) functions, large functions (5 GB bundles), Docker/OCI container images, plan limits, streaming…

    301 GitHub stars~12k tokensUpdated today
    Backend & APIsAuto-check: notes
  • Nextjs On Cloudflare

    cloudflare/skills

    Official

    Build, migrate, and deploy Next.js apps on Cloudflare Workers with vinext.

    3k GitHub starsUsed in 2 repos~678 tokens
    DevOps & CloudAuto-check passed

More from secondsky/claude-skills

All 169 skills in this repo
  • Tanstack AI

    secondsky/claude-skills

    TanStack AI (alpha) provider-agnostic type-safe chat with streaming for OpenAI, Anthropic, Gemini, Ollama.

    227 GitHub starsUsed in 1 repo~3.6k tokens
    Auto-check: notes
  • Auto Animate

    secondsky/claude-skills

    AutoAnimate (@formkit/auto-animate) zero-config animations for React.

    227 GitHub stars~2.9k tokensUpdated 10 days ago
    Auto-check passed
  • Base UI React

    secondsky/claude-skills

    MUI Base UI unstyled React components with Floating UI. An agent skill from secondsky/claude-skills.

    227 GitHub stars~1.9k tokensUpdated 10 days ago
    Auto-check passed
  • Cloudflare Images

    secondsky/claude-skills

    This skill should be used when the user asks to "upload images to Cloudflare", "implement direct creator upload", "configure image transformations", "optimize WebP/AVIF", "create image variants"…

    227 GitHub stars~3.6k tokensUpdated 10 days ago
    Auto-check: notes
  • Cloudflare Nextjs

    secondsky/claude-skills

    Deploy Next.js to Cloudflare Workers via the OpenNext adapter (@opennextjs/cloudflare).

    227 GitHub stars~5.3k tokensUpdated 10 days ago
    Auto-check: notes
  • Cloudflare Sandbox

    secondsky/claude-skills

    Cloudflare Sandboxes SDK for secure code execution in Linux containers at edge.

    227 GitHub stars~4.5k tokensUpdated 10 days ago
    Auto-check passed

Categories

Questions about Bun Nextjs

What does Bun Nextjs do?

This skill should be used when the user asks about "Next.js with Bun", "Bun and Next", "running Next.js on Bun", "Next.js development with Bun", "create-next-app with Bun", or building Next.js…. Bun Nextjs is an agent skill from secondsky/claude-skills.js applications using Bun as the runtime.

When should I use Bun Nextjs?

Bun Nextjs fits situations like: asks about Next.js with Bun; running Next.js on Bun; Next.js development with Bun; create-next-app with Bun.

How do I install Bun Nextjs in Claude Code?

Run `npx skills add secondsky/claude-skills --skill bun-nextjs -a claude-code`. Or copy the skill folder (plugins/bun/skills/bun-nextjs in secondsky/claude-skills) into .claude/skills/bun-nextjs in your project. Claude Code loads it when a task matches its description.

How do I install Bun Nextjs in Codex?

Run `npx skills add secondsky/claude-skills --skill bun-nextjs -a codex`. Or copy the skill folder (plugins/bun/skills/bun-nextjs in secondsky/claude-skills) into .agents/skills/bun-nextjs in your project. Codex loads it when a task matches its description.

Can I use Bun Nextjs in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add secondsky/claude-skills --skill bun-nextjs -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bun-nextjs, .gemini/skills/bun-nextjs, .github/skills/bun-nextjs and .opencode/skills/bun-nextjs in your project.

What does Bun Nextjs need to run?

Going by SKILL.md and its folder, Bun Nextjs needs the command-line tools its instructions call (bun, bunx and vercel) and credentials named API_SECRET. Our summary lists: Node.js; Docker; A credential in API_SECRET.

Does Bun Nextjs access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Bun Nextjs safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Bun Nextjs use?

Bun Nextjs is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Bun Nextjs use?

About 1.9k tokens (SKILL.md is roughly 7.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Bun Nextjs?

Skills that share tags, products or a category with Bun Nextjs: Portaljs Deploy (datopian/portaljs, 2.4k stars), Cicd Pipeline Generator (ailabs-393/ai-labs-claude-skills, 454 stars), Deploy Agent (sundial-org/awesome-openclaw-skills, 663 stars) and Vercel Upgrade Migration (jeremylongshore/tons-of-skills-marketplace, 2.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Bun Nextjs?

secondsky (a GitHub user) maintains it in secondsky/claude-skills, which has 227 GitHub stars. The repository holds 169 skills in this directory. The repository was last updated on September 28, 2026.

Source: secondsky/claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.