← Projects

Projectv0.2.2

Quartz

Quartz answers an agent's TypeScript questions with the compiler's own answers.

Your agent asks what a type contains, whether a snippet compiles, or whether a converter already exists, before it writes code instead of after tsc fails. The answers come from the TypeScript compiler, as JSON.

npm install -g @skastr0/quartz

01

The pain

  • It guesses types from text. Your agent greps for a declaration and rebuilds the type in its head, through generics and inference it can't see.
  • It finds out from tsc. Write, run tsc, read the error, try again. Many turns go to flailing on type errors.
  • It rewrites what already exists. Nothing tells it there's already a User → UserDTO function two files over.

02

See it run

What does this type contain?

quartz info '{"symbol":"TypeAnalyzer"}' --format pretty"name": "TypeAnalyzer", "kind": "interface","location": { "file": "packages/engine/src/contracts.ts", "line": 463 },"properties": [  { "name": "getPackages", "type": "() => Promise<readonly PackageInfo[]>" },  { "name": "getTypeInfo", "type": "(symbolName: string, packageName?: string) => Promise<TypeInfo | null>" },  …

Will this compile? Nothing is written to disk.

quartz check-snippet '{"code":"declare const analyzer: TypeAnalyzer;\nconst count: string = (await analyzer.getPackages()).length;"}'"valid": false,"errors": [{ "message": "Type 'number' is not assignable to type 'string'.", "line": 2, "column": 7 }]

Is there already a User → UserDTO function?

quartz transform-search '{"root":"test/fixtures","from":"User","to":"UserDTO","verifiedOnly":true}'{ "signature": "toDTO(from: User): UserDTO",     "file": "types/transforms.ts", "line": 30,  "verification": { "status": "verified" } }{ "signature": "transform(input: User): UserDTO", "file": "types/transforms.ts", "line": 211, "verification": { "status": "verified" } }… 3 more verified: toDTO(user), saveUser, deprecatedToDTO

Can toDTO convert a User here? Four checks, one answer.

quartz verify-contract '{"root":"test/fixtures","from":"User","to":"UserDTO","symbol":"toDTO","snippet":"declare const u: User;\nconst dto: UserDTO = toDTO(u);"}'"ok": truecompatibility  passed: false  "User is not directly assignable to UserDTO; verified transform evidence can still satisfy a conversion contract."snippet        passed: true   "Snippet compiles under the package TypeScript project."diagnostics    passed: true   "Package diagnostics are clean."transform      passed: true   "A compiler-verified transform satisfies the requested contract."

03

How it works

Quartz keeps one TypeScript 7 native compiler open per project. Snippets and transform checks compile as temporary virtual files, so your files are never touched. The CLI reuses one compiler across a batch; the OpenCode plugin keeps it warm for the session.

your agent wants to knowcommandit gets back
what a type containsinfo, expandresolved members and signatures
whether code compilescheck-snippeterrors with line and column
whether a converter existstransform-searchmatching functions, each test-compiled
whether a planned conversion is safeverify-contracteach check, passed or failed, and one overall answer

04

Where it fits

Every agent in a TypeScript repo gets the same answers about the code, from the compiler. Pulsar's TypeScript checks run on it.

05

Install

Version
0.2.2
Runs on
macOS and Linux, arm64 and x64
Install
npm install -g @skastr0/quartzRun it in a folder with a tsconfig.json.