Get started

What Carrick covers

Which protocols, frameworks and repositories Carrick reads, what a repository needs, and what it does not cover.

Carrick reads your TypeScript and JavaScript services to index the operations they serve, the calls they make to each other, and the request and response types on both sides.

Connect a repository with the Quickstart. It needs no carrick.json, because Carrick writes and keeps its configuration itself. Add one only to set service boundaries yourself.

Protocols

Protocol Served side Calling side Matched on
HTTP Route handlers Client calls such as fetch, axios, got and ky Method and path
GraphQL Schema fields Queries and mutations in documents Operation kind and top-level field
WebSockets socket.on("event", ...) listeners socket.emit("event", ...) calls Direction and event name
Pub/sub and queues Topic subscribers Topic publishers Topic string

Carrick does not index gRPC, custom binary RPC protocols or tRPC over WebSockets. These are gaps.

HTTP

Carrick pairs route handlers with the client calls that reach them by HTTP method and path. It resolves the TypeScript request and response types on both sides.

GraphQL

Carrick reads schemas written in SDL (.graphql, .gql, and gql or graphql tagged templates) as the served side. It reads queries and mutations in .graphql files or tagged templates as the calling side. A deterministic parser does this, not a model.

Code-first schemas, persisted query manifests, and Relay compiled artefacts work when you commit a generated schema.graphql to the repository. If a printed schema sits in a build folder or outside the service directory, name it in graphqlSchemas. Documents written against a committed schema that the repository does not serve, such as a downloaded vendor schema, are not indexed as calls (see GraphQL documents for another team’s API).

When a .graphql or .gql file compiles into a typed declaration such as OrdersDocument, Carrick indexes the call where code passes that declaration to a client, such as useQuery(OrdersDocument). Carrick follows the import through relative paths, tsconfig path aliases, and workspace packages. Operations that no call executes remain indexed at their line in the document file, while gql templates remain indexed where written in source.

WebSockets

Carrick indexes events by name and direction. Socket.IO is the most widely tested client, but any realtime library that uses on and emit call shapes can match.

  • Use string literals for all event names.
  • Dynamic event names, custom namespaces (io.of(...)), and the lifecycle events connect and disconnect are not tracked.

Pub/sub and queues

Carrick reads topics on Kafka, NATS, Redis pub/sub and BullMQ. A handler registered for a topic is the served side, and a call that sends to the topic is the calling side. Topics match on literal strings. When a payload is decoded with a declared TypeScript type, Carrick compares the payload shape.

Broker behaviour such as consumer groups, delayed retries, exchange bindings and dead-letter queues is a gap. Carrick does not model it.

tRPC

Carrick indexes tRPC procedures and the calls to them. tRPC over WebSockets is a gap.

Frameworks

Carrick detects frameworks from imported symbols and call shapes and not from package manifests alone. It reads these frameworks:

  • Express 4 and 5, including path and query parameters, request bodies and response types.
  • Koa, Fastify, Hapi and NestJS.
  • Hono.
  • Next.js App Router. Carrick reads app/**/route.ts (or src/app/**/route.ts) from the file layout. The directory chain gives the route path, including dynamic segments ([id]), catch-all segments ([...slug]) and route groups. Each exported method function (GET, POST and so on) is one operation.
  • Custom routers that follow Express-style conventions (app.get, router.use, route decorators).

What a repository needs

  • TypeScript or JavaScript source. Carrick reads .ts, .tsx, .mts, .cts, .js, .jsx, .mjs and .cjs files and skips test paths. It infers types from your code in both languages, so annotations are not required. JavaScript files are read for their types but not checked for errors.
  • A manifest. Node projects need a package.json. Deno projects need a deno.json or deno.jsonc. To read a Deno service on your machine, the CLI needs Deno 2.9.4 or newer (see Deno).
  • Routes in source. Routes must be string literals or expressions that resolve statically.
  • Source files. Carrick reads original source, not .d.ts-only packages, pre-compiled bundles, or build output in .gitignore, unless the generated source is committed.

Carrick installs dependencies from the lockfile (npm, pnpm, Yarn, Bun, or deno install --frozen --node-modules-dir=none) with lifecycle scripts disabled.

Monorepos

  • Workspace monorepos. Carrick splits repositories managed with npm, pnpm, Yarn or Deno workspaces into services using the workspace package manifests.
  • Single-package monorepos. For repositories with multiple services under one root package.json, list them in a services array in carrick.json. Carrick type-checks and indexes each service on its own, then checks the contracts between them.

Limits

  • Other languages. Python, Go, Rust, Java and Ruby services are not scanned. In a mixed system, Carrick indexes the TypeScript and JavaScript services and skips the rest.
  • Routes built at runtime. Carrick cannot index routes read from feature flags or databases at startup. It also skips routes registered in loops with non-literal string concatenation, or routes registered by plugins after startup.
  • Deno scopes. Carrick uses Deno’s standard module graph (deno.window and deno.ns). Supply explicit declarations for worker scopes, unusual runtime library combinations, and ambient Node types that deno types omits.
  • How it works describes the index and the four places Carrick answers: when your agent asks, while your agent edits, in your editor, and on pull requests.
  • carrick.json covers service boundaries, monorepos and environment variable classification.