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-typescriptInside 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-loggingSE04 · Logs should not receive secrets, credentials or whole request payloads
se05-secret-defaultsSE05 · 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-inputSE03 · 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-interpolationDB01/DB02 · The user confirms SQL built by interpolating values or identifiers into a raw query
io02-cast-as-validationIO02 · Parsed JSON and request payloads are validated, not cast to a type
io09-raw-payload-writesIO09 · Persistence writes select permitted fields instead of storing the raw request payload
se08-dynamic-code-and-shellSE08 · 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-urlSE07 · 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-configTS01/TS05 · tsconfig files may not turn strict type checking or unknown catch variables off
ts03-unchecked-indexTS03 · tsconfig files should keep unchecked-index protection (noUncheckedIndexedAccess)
ts04-exact-optionalTS04 · tsconfig files should distinguish absent optional properties from explicit undefined
ts12-suppressionsTS12 · 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-unknownTS05 · Catch variables keep unknown until narrowed
ts06-explicit-anyTS06 · No explicit any in authored production code
ts08-double-assertionTS08 · Casts may not bridge incompatible types through any or unknown
ts09-non-null-assertionTS09 · Non-null assertions should become narrowing or an invariant check
ts10-exported-return-typesTS10 · Exported functions should declare their return contract
ts13-object-literal-assertionTS13 · 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-errorsAS05 · Catch handlers implement a failure policy instead of swallowing errors or faking success
as06-error-causeAS06 · An error translated in a catch keeps the original as its cause
io05-truthy-fallbackIO05 · 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-promisesAS01 · A promise created by a statement has a rejection owner (await, return or handler)
as02-async-callback-ignoredAS02 · Async callbacks go only to consumers that handle the promise they return
as04-return-await-in-tryAS04 · A try block awaits the promise whose rejection it means to catch
as07-sync-io-in-handlersAS07 · 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-outAS08 · Input-dependent fan-out has an enforced concurrency bound
as09-fetch-deadlineAS09 · Outbound fetch calls carry a finite deadline (an abort signal)
as11-promise-race-timeoutAS11 · A timeout race does not leave the losing work running unowned
as12-endless-retryAS12 · Retries are bounded; a loop does not retry a failing operation forever
as13-release-in-finallyAS13 · A connection acquired and released in one block is released in finally
db08-unbounded-readsDB08 · Collection reads should state a result bound (Prisma findMany without take)
db09-pagination-orderDB09 · 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-domainAR04 · Modules declared framework-independent import no transport, persistence or framework package
ar06-import-time-side-effectsAR06 · Module imports and constructors do not start servers, connections, timers or jobs
ar07-clients-per-callAR07 · 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-exposedIO11 · 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-clientDB04 · Inside an interactive transaction, queries use the transaction-scoped client
db05-remote-io-in-transactionDB05 · Database transactions should not wait on remote HTTP calls
db11-ack-before-processingDB11 · 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-migrationDB12 · 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-configSE06 · 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-testsQA01 · Committed tests are never focused (only, fit, fdescribe)
qa03-tautological-assertionsQA03 · 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-successQA07 · Production paths do not return a placeholder success marked as a stub
qa10-completion-claimsQA10 · A final message claiming passing checks needs a successful check after Claude's last edit
qa10-evidence-ledgerQA10 · Records, per session, Claude's edits and the checks (tests, types, lint, build) that succeeded after them
ts02-new-type-errorsTS02 · Claude does not end a turn with compiler errors it introduced
ts02-turn-baselineTS02 · Records the work tree when a prompt starts, the baseline for new compiler errors