xberg-typescript-toolchain

Applies repository-specific pnpm, Vitest, napi-rs, and wasm-pack conventions to TypeScript package changes.

9.2k|581|Updated Jan 31, 2025
One-click install
npx skills add https://github.com/kreuzberg-dev/kreuzberg --skill xberg-typescript-toolchain
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: xberg-typescript-toolchain
Source: https://github.com/kreuzberg-dev/kreuzberg/tree/main/.ai-rulez/skills/xberg-typescript-toolchain
Command: npx skills add https://github.com/kreuzberg-dev/kreuzberg --skill xberg-typescript-toolchain

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Working on the Xberg repository's TypeScript and JavaScript packages requires knowing its non-standard toolchain: poly for linting and formatting, a pnpm workspace with exceptions, and napi-rs/wasm-pack bindings. Generic TypeScript conventions lead to wrong commands, misplaced dependencies, and invalid assumptions about tooling.

Core Features & Use Cases

  • Toolchain Guardrails: Enforces poly lint and poly fmt instead of directly invoking oxlint, oxfmt, Prettier, ESLint, or Biome.
  • Workspace Boundary Awareness: Distinguishes packages inside the pnpm workspace (using workspace:* dependencies and the root lockfile) from integrations/node/ packages that use their own npm lockfiles.
  • Build and Test Conventions: Clarifies Vitest with @vitest/coverage-v8 for testing, tsup for integration packages, and napi-rs/wasm-pack for bindings without application bundlers.
  • Use Case: When adding a dependency or fixing a lint error in a TypeScript package, load this Skill to determine whether the package belongs to the pnpm workspace and which commands are valid before making changes.

Quick Start

Load this Skill before modifying any TypeScript or JavaScript package in the Xberg repository and ask it to verify the correct lint, test, and dependency workflow for that package.

Frequently Asked Questions about xberg-typescript-toolchain

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I lint and format TypeScript code in the Xberg repository?

Run `poly lint .` and `poly fmt .` from the repository. Poly embeds oxlint and oxfmt, so you must not install or invoke oxlint, oxfmt, Prettier, ESLint, or Biome directly, and per-package lint scripts should not be added.

How do I add a dependency to an Xberg TypeScript package?

First determine whether the package is inside the pnpm workspace. Workspace packages use the root lockfile and `workspace:*` for internal dependencies, while packages under `integrations/node/` have their own npm lockfiles and are managed separately.

What testing framework does the Xberg TypeScript toolchain use?

Testing uses Vitest with `@vitest/coverage-v8` for coverage reporting. No coverage threshold is enforced unless one is explicitly added to the current configuration.

Can I use Zod for schema validation in Xberg TypeScript packages?

No runtime schema-validator dependency is guaranteed in the repository. Use existing boundary guards or explicitly propose adding a dependency rather than assuming Zod is available.

How are the Node and WASM bindings built in Xberg?

The Node binding is built with napi-rs and the WASM binding with wasm-pack. Do not add an application bundler to either binding; the `integrations/node/` LangChain and LlamaIndex packages use tsup.