ccppccpp home

Profiles

Bun loose

Bun-first projects (Bun 1.4.3) that stay friendly to the Node ecosystem. Bun substitutions warn; reproducible installs, type safety, failure handling, tests and evidenced completion block. Rule IDs G/D/N/T/S/R/Q/C.

Set this profile

ccpp cpo profile set bun-loose

Inside Claude Code, prefix the command with ! to run it in the session. Downloading a profile needs a Builder or Team plan; listing them does not.

Policies

82 policies, grouped by what they guard.

Secrets & private data 2

Credentials, keys and personal data stay out of files, logs, commands and the conversation.

  • bun-n14-fast-hash-passwords

    N14 · Passwords are never hashed with Bun.hash or a fast digest (SHA, MD5, CryptoHasher, createHash)

  • bun-r10-inline-env

    R10 · Browser bundles never inline the whole environment (bun build --env=inline, env: "inline")

Untrusted input 3

Requests, downloads and tool output are validated before they reach SQL, a shell, eval or a deserializer.

  • bun-r07-sql-interpolation

    R07 · SQL text is never built by interpolating or concatenating values (bind them)

  • bun-r08-shell-injection

    R08 · Strings never become shell syntax: no sh -c with interpolation, no raw Bun Shell input, no exec of built strings

  • bun-t10-cast-as-validation

    T10 · Parsed JSON and request payloads are validated, not cast to a type

Network & TLS 2

Outbound data, verified certificates, destinations taken from requests and services exposed to others.

  • bun-r09-tls-bypass

    R09 · Certificate verification stays on in production code (no rejectUnauthorized: false, no NODE_TLS_REJECT_UNAUTHORIZED=0)

  • bun-r09-tls-environment

    R09 · Commands, env files and CI never set NODE_TLS_REJECT_UNAUTHORIZED=0

Weakened checks 10

Suppressions, disabled lint or CI steps and relaxed strictness need a reason or the user's approval.

  • bun-c05-ci-gates

    C05/G07 · CI keeps its check steps: no removed test/check/lint step, no continue-on-error or || true on one

  • bun-c05-noop-scripts

    C05 · package.json check scripts keep running real checks (no echo/exit 0/|| true, no pass-with-no-tests added)

  • bun-c05-swallowed-exit

    C05 · Commands and the scripts they run never hide a failing check (|| true, ; exit 0, --pass-with-no-tests)

  • bun-g07-exceptions-file

    G07 · The user approves every change Claude makes to the G03 exceptions file (file tools ask)

  • bun-g07-exceptions-shell

    G07 · Shell commands never write the G03 exceptions file (undone and refused)

  • bun-q01-focused-commits

    Q01 · A commit never records focused tests; CI and package scripts never run bun test --only

  • bun-q09-coverage-threshold

    Q09 · Declared coverage thresholds are never lowered or removed (bunfig.toml [test], package.json jest)

  • bun-t04-tsconfig-strict

    T04 · tsconfig keeps its strictness floor; a new tsconfig enables strict, noUncheckedIndexedAccess, noFallthroughCasesInSwitch, noImplicitOverride

  • bun-t08-type-escapes

    T08 · New explicit any, as-unknown-as bridges and non-null assertions become unknown plus narrowing (warns)

  • bun-t09-suppressions

    T09 · No blanket diagnostic suppression; a targeted @ts-expect-error or disable states its reason

Error handling 2

Failures are propagated or handled, never swallowed or turned into fake success.

  • bun-r03-swallowed-errors

    R03 · Catch handlers do not silently swallow errors or fake success

  • bun-r04-subprocess-exit

    R04 · Subprocess results are observed: no discarded Bun.spawn/spawnSync or .nothrow() shell result

Async & concurrency 2

Owned tasks, awaited promises, preserved cancellation and no blocking on event loops.

  • bun-r01-floating-promises

    R01 · A promise created by a statement has a rejection owner (await, return or handler; language server types)

  • bun-r02-async-foreach

    R02 · No async callback in forEach: completion and failures must propagate

Performance & resource bounds 2

Timeouts, bounded retries and fan-out, reused clients, closed resources, no N+1 queries.

  • bun-r05-sync-in-handlers

    R05 · Request handlers avoid synchronous filesystem, process and hashing work (warns)

  • bun-r06-fetch-deadline

    R06 · Outbound fetch calls carry a deadline (an abort signal) (warns)

Architecture & boundaries 4

Declared layers and dependency directions, no import cycles, small modules, explicit dependencies.

  • bun-s01-cross-package-imports

    S01 · Shipped code does not reach into another workspace package through a relative path (use its declared entrypoint)

  • bun-s02-import-cycle

    S02 · A new runtime import does not close a two-module cycle (the imported module imports this one) (warns)

  • bun-s03-import-side-effects

    S03 · Reusable modules do not start servers, spawn processes or write files at import time (warns)

  • bun-s04-unused-private

    S04 · New module-private functions and constants are used somewhere in the module (warns)

Versions & deprecated APIs 1

Code matches the installed version, without removed, renamed or deprecated APIs.

  • bun-g01-pinned-version

    G01/D01 · Tells Claude, at session start, which Bun version capability claims are judged against

Dependencies & toolchain 38

Packages change through the package manager, lockfiles stay consistent and the project's tools are used.

  • bun-c01-build-target

    C01 · bun build of code that uses Bun APIs targets Bun (--target=bun); the default target is the browser

  • bun-c04-node-exports-typescript

    C04 · A package that promises Node (engines.node) does not export TypeScript sources Node cannot load

  • bun-d01-ci-bun-version

    D01 · CI and images run an exact Bun version, the one the project pins (setup-bun, oven/bun images)

  • bun-d02-package-manager

    D02 · Prefer Bun for installs and scripts; npm, pnpm or yarn may stay when the chosen workflow is consistent (warns)

  • bun-d03-package-manager-mismatch

    D03 · Dependencies change only through the package manager the project declares (packageManager field, lockfile)

  • bun-d03-second-lockfile

    D03 · No second lockfile next to another package manager's lockfile

  • bun-d04-ci-frozen-install

    D04 · CI and image builds install from the lockfile and fail on drift (bun install --frozen-lockfile, bun ci)

  • bun-d04-stale-lockfile

    D04 · A turn that changes package.json dependencies also updates the lockfile next to it (once per stop)

  • bun-d05-auto-install

    D05 · Shipped entrypoints and CI never rely on Bun's runtime auto-install (-i, --install=fallback|force, install.auto)

  • bun-d05-versioned-imports

    D05 · Code never imports a package with a version in the specifier (Bun auto-install syntax)

  • bun-d06-undeclared-imports

    D06 · Code imports only packages its own package.json declares (hoisting and neighbouring manifests do not count)

  • bun-d07-trust-all

    D07 · Dependency lifecycle scripts are trusted one by one, never all at once

  • bun-d07-trusted-dependencies

    D07 · Packages added to trustedDependencies by hand are named with the reason they need install scripts (warns)

  • bun-d08-dev-only-runtime-import

    D08 · Production code does not import packages declared only in devDependencies (warns: bundled output may inline them)

  • bun-d08-tooling-in-dependencies

    D08 · Test, lint and type tooling goes to devDependencies: a package.json listing it in dependencies is refused (shell writes undone)

  • bun-d08-tooling-install

    D08 · Test, lint and type tooling is installed as a development dependency (bun add -d), never as a production one

  • bun-d09-workspace-references

    D09 · Local packages are referenced through workspaces (workspace:*), not file:/link: copies or registry ranges (warns)

  • bun-d10-unpinned-runners

    D10 · One-off tools run pinned or from the lockfile; project tools are not installed globally (warns)

  • bun-d11-overlapping-libraries

    D11 · A new dependency does not duplicate a responsibility an existing one already covers (warns, for review)

  • bun-n01-test-runner

    N01 · Prefer Bun for unit and integration tests; Vitest, Jest or Mocha may stay when compatible with the project's runtime (warns)

  • bun-n02-typescript-execution

    N02 · Prefer Bun for running TypeScript and JSX; tsx, ts-node or Babel loaders may stay when compatible with the project's runtime (warns)

  • bun-n03-bundler

    N03 · Prefer Bun for bundling; esbuild, Rollup, Webpack, Vite, Parcel or tsup may stay when compatible with the project's runtime (warns)

  • bun-n04-env-loading

    N04 · Prefer Bun for loading .env files; dotenv loaders may stay when compatible with the project's runtime (warns)

  • bun-n05-watch-mode

    N05 · Prefer Bun for restarting or reloading on change; nodemon or ts-node-dev may stay when compatible with the project's runtime (warns)

  • bun-n06-http-client

    N06 · Prefer Bun for HTTP requests; node-fetch, axios or got may stay when compatible with the project's runtime (warns)

  • bun-n07-http-server

    N07 · Prefer Bun for HTTP servers and routing; Express, Koa, Fastify or another Node server framework may stay when compatible with the project's runtime (warns)

  • bun-n08-websocket

    N08 · Prefer Bun for WebSocket servers and clients; ws or another WebSocket package may stay when compatible with the project's runtime (warns)

  • bun-n09-file-io

    N09 · Prefer Bun for whole-file reads and writes; fs-extra, rimraf, mkdirp or JSON file wrappers may stay when compatible with the project's runtime (warns)

  • bun-n10-process-execution

    N10 · Prefer Bun for running processes and shell commands; execa, cross-spawn, shelljs, zx or cross-env may stay when compatible with the project's runtime (warns)

  • bun-n11-glob

    N11 · Prefer Bun for file globbing and pattern matching; glob, fast-glob, globby or minimatch may stay when compatible with the project's runtime (warns)

  • bun-n12-sql-driver

    N12 · Prefer Bun for PostgreSQL, MySQL and SQLite access; pg, postgres, mysql2 or SQLite drivers may stay when compatible with the project's runtime (warns)

  • bun-n13-redis-client

    N13 · Prefer Bun for Redis access; redis or ioredis may stay when compatible with the project's runtime (warns)

  • bun-n14-password-hashing

    N14 · Prefer Bun for password hashing; bcrypt or argon2 packages may stay when compatible with the project's runtime (warns)

  • bun-n15-s3-client

    N15 · Prefer Bun for S3 object storage; the AWS S3 SDK or MinIO client may stay when compatible with the project's runtime (warns)

  • bun-n16-uuid-v4

    N16 · Prefer crypto.randomUUID() and Bun.randomUUIDv7() to the uuid package for v4/v7 ids; uuid may stay (warns)

  • bun-t01-typecheck-tool

    T01 · Prefer bun check for type checking; a pinned TypeScript checker may stay (warns)

  • bun-t05-module-resolution

    T05 · A tsconfig for Bun code resolves modules like Bun (bundler or nodenext), not node10/classic

  • bun-t06-bun-types

    T06 · TypeScript using Bun APIs has Bun's type declarations (@types/bun) in its package

Tests 8

Tests assert behavior, stay deterministic and are not removed or skipped silently.

  • bun-q01-focused-tests

    Q01 · Claude does not finish a turn with focused tests (.only, fit, fdescribe) in the test files it changed (once per stop)

  • bun-q02-skipped-tests

    Q02 · A newly skipped or todo test says why on the line before it (warns)

  • bun-q03-untested-change

    Q03 · A turn that changes production code also changes or adds a test, or says why none is needed (warns, once per stop)

  • bun-q04-tautological-assertions

    Q04 · Assertions compare behavior, not a value with itself or a constant with itself (warns, for review)

  • bun-q06-unawaited-assertions

    Q06 · Asynchronous assertions (.resolves, .rejects) are awaited or returned

  • bun-q07-test-state

    Q07 · Tests restore what they change: spies, fake time, environment variables; module mocks are isolated (warns)

  • bun-q08-fixed-sleeps

    Q08 · Tests wait on readiness and use ephemeral ports, not fixed sleeps or fixed ports (warns)

  • bun-q10-snapshot-updates

    Q10 · Updated snapshots are reviewed against intended behavior (bun test -u, hand-edited .snap files) (warns)

Completion evidence 8

A turn ends with its checks run and passing; claims of success need proof after the last edit.

  • bun-c02-check-call

    Records which checks (typecheck, test, lint) a shell call runs, scripts and task runners (turbo) included, when they cover the changed packages (C02 ledger)

  • bun-c02-completion-claims

    C02/C05 · A final message claiming passing tests, types or lint needs a successful run after Claude's last edit

  • bun-c02-evidence-ledger

    Records, per session, Claude's code edits (file tools and shell writes) and the checks that succeeded after them (C02)

  • bun-c02-required-checks

    C02 · A turn that changed code ends only after the required checks succeeded on the final files (once per stop)

  • bun-pm-call

    Records that a shell call runs a package-manager operation, so the manifest and lockfile writes it causes are not hand edits (D02, D06)

  • bun-s07-placeholders

    S07 · Newly shipped behavior has no placeholder returns or not-implemented stubs (warns)

  • bun-t07-new-type-errors

    T07 · A turn adds no TypeScript errors to the changed files or their importers (language server, once per stop)

  • bun-turn-baseline

    Records the work tree when a prompt starts: the baseline of the end-of-turn rules (D04, T07, Q03, C02)