ccppccpp home

Profiles

Backend TypeScript

Trustworthy contracts, explicit ownership, bounded work, consistent data and inspectable failures for TypeScript services, APIs and workers. Rule IDs TS/AR/IO/AS/DB/SE/QA; NEED TO blocks on demonstrated violations, SHOULD warns.

Set this profile

ccpp cpo profile set backend-typescript

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

48 policies, grouped by what they guard.

Secrets & private data 2

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

  • se04-sensitive-logging

    SE04 · Logs should not receive secrets, credentials or whole request payloads

  • se05-secret-defaults

    SE05 · Secrets have no hardcoded value and no insecure fallback in production code

Authentication & authorization 1

Who may do what, from roles, privileges and permissions to CSRF, CORS and verified tokens.

  • se03-identity-from-input

    SE03 · Security-sensitive identity comes from the verified principal, not the request payload

Untrusted input 4

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

  • db01-raw-sql-interpolation

    DB01/DB02 · The user confirms SQL built by interpolating values or identifiers into a raw query

  • io02-cast-as-validation

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

  • io09-raw-payload-writes

    IO09 · Persistence writes select permitted fields instead of storing the raw request payload

  • se08-dynamic-code-and-shell

    SE08 · No eval, Function constructor or shell command built from strings

Network & TLS 1

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

  • se07-request-controlled-url

    SE07 · Outbound calls do not take their destination straight from the request

Weakened checks 4

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

  • ts01-strict-config

    TS01/TS05 · tsconfig files may not turn strict type checking or unknown catch variables off

  • ts03-unchecked-index

    TS03 · tsconfig files should keep unchecked-index protection (noUncheckedIndexedAccess)

  • ts04-exact-optional

    TS04 · tsconfig files should distinguish absent optional properties from explicit undefined

  • ts12-suppressions

    TS12 · No broad diagnostic suppression; a scoped one states its reason, owner and review date

Type safety 6

No escapes from the type checker (any, unchecked casts, non-null assertions) and explicit contracts.

  • ts05-catch-unknown

    TS05 · Catch variables keep unknown until narrowed

  • ts06-explicit-any

    TS06 · No explicit any in authored production code

  • ts08-double-assertion

    TS08 · Casts may not bridge incompatible types through any or unknown

  • ts09-non-null-assertion

    TS09 · Non-null assertions should become narrowing or an invariant check

  • ts10-exported-return-types

    TS10 · Exported functions should declare their return contract

  • ts13-object-literal-assertion

    TS13 · Object literals should be checked against their type, not asserted

Error handling 3

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

  • as05-swallowed-errors

    AS05 · Catch handlers implement a failure policy instead of swallowing errors or faking success

  • as06-error-cause

    AS06 · An error translated in a catch keeps the original as its cause

  • io05-truthy-fallback

    IO05 · A truthy fallback should not collapse valid zero or false values

Async & concurrency 4

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

  • as01-floating-promises

    AS01 · A promise created by a statement has a rejection owner (await, return or handler)

  • as02-async-callback-ignored

    AS02 · Async callbacks go only to consumers that handle the promise they return

  • as04-return-await-in-try

    AS04 · A try block awaits the promise whose rejection it means to catch

  • as07-sync-io-in-handlers

    AS07 · Request and job handlers avoid synchronous filesystem, process and crypto calls

Performance & resource bounds 7

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

  • as08-unbounded-fan-out

    AS08 · Input-dependent fan-out has an enforced concurrency bound

  • as09-fetch-deadline

    AS09 · Outbound fetch calls carry a finite deadline (an abort signal)

  • as11-promise-race-timeout

    AS11 · A timeout race does not leave the losing work running unowned

  • as12-endless-retry

    AS12 · Retries are bounded; a loop does not retry a failing operation forever

  • as13-release-in-finally

    AS13 · A connection acquired and released in one block is released in finally

  • db08-unbounded-reads

    DB08 · Collection reads should state a result bound (Prisma findMany without take)

  • db09-pagination-order

    DB09 · Paginated reads should have a deterministic order

Architecture & boundaries 3

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

  • ar04-framework-free-domain

    AR04 · Modules declared framework-independent import no transport, persistence or framework package

  • ar06-import-time-side-effects

    AR06 · Module imports and constructors do not start servers, connections, timers or jobs

  • ar07-clients-per-call

    AR07 · Pooled clients should be created at the composition root, not on every call

HTTP & APIs 1

Request and response contracts, schemas, status codes, error bodies and published API surfaces.

  • io11-error-details-exposed

    IO11 · Public error responses carry no stack trace or raw internal error

Databases & queries 3

Schemas, queries, transactions and the ORM used as intended.

  • db04-transaction-client

    DB04 · Inside an interactive transaction, queries use the transaction-scoped client

  • db05-remote-io-in-transaction

    DB05 · Database transactions should not wait on remote HTTP calls

  • db11-ack-before-processing

    DB11 · A job is acknowledged only after its required effects complete

Schema migrations 1

Migrations come from the tool, applied history stays immutable and risky changes are rolled out safely.

  • db12-schema-without-migration

    DB12 · A Prisma schema change ends the turn with a matching migration

Configuration 1

Settings read once at a boundary, validated, with units and without unsafe defaults.

  • se06-environment-outside-config

    SE06 · Runtime configuration is read and validated centrally, not through process.env across the code

Tests 2

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

  • qa01-focused-tests

    QA01 · Committed tests are never focused (only, fit, fdescribe)

  • qa03-tautological-assertions

    QA03 · Assertions compare behavior, not a value with itself

Completion evidence 5

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

  • qa07-placeholder-success

    QA07 · Production paths do not return a placeholder success marked as a stub

  • qa10-completion-claims

    QA10 · A final message claiming passing checks needs a successful check after Claude's last edit

  • qa10-evidence-ledger

    QA10 · Records, per session, Claude's edits and the checks (tests, types, lint, build) that succeeded after them

  • ts02-new-type-errors

    TS02 · Claude does not end a turn with compiler errors it introduced

  • ts02-turn-baseline

    TS02 · Records the work tree when a prompt starts, the baseline for new compiler errors