Skip to content
zigordevPublic

About

The shared base of every zigordev repository: packages, the product template, pipelines, rules and the handbook

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

toolkit

The shared base of every zigordev repository: the packages published as @zigordev/*, the product template, the pipelines the other repos call, the rules and the handbook. It deploys nothing.

The repo is being built step by step, and each step arrives as its own pull request. This page describes what exists today.

What it is

Path What it holds
packages/dev @zigordev/dev: the zigordev command, the Biome config, the TypeScript bases, the git hooks and the commit rules that every repo shares
packages/config @zigordev/config: one function that reads an app's settings from the environment through a Zod schema, and stops the app as it starts when one is missing or wrong
packages/otel @zigordev/otel: telemetry for a service: traces and metrics through OpenTelemetry, log lines that carry the trace, and the answer of the health route
packages/test @zigordev/test: a real PostgreSQL for tests, with one migrated copy per test file, a real Kafka with a signed-in user, and the harness that builds an app for its API tests
packages/api @zigordev/api: the Fastify base of every API: the error format, paging, sign-in checks, a rate limit, the OpenAPI pages, the health route, the database and a clean stop
packages/auth @zigordev/auth: sign-in on Better Auth, with email and a password, passkeys, two-factor and Google, sessions in the app's own database, and account deletion
packages/email @zigordev/email: emails on the design tokens, rendered with React Email when an app builds, and filled in when it sends, in English and Spanish
packages/events @zigordev/events: events between services over Kafka: typed events, the transactional outbox, the consumer with retries and a dead-letter topic, skipped duplicates, trace headers, health and metrics
packages/flags @zigordev/flags: feature flags through OpenFeature, read in each app from its own flags.json by flagd's provider
packages/tokens @zigordev/tokens: the design tokens of one brand, dark by default, built by Terrazzo into CSS custom properties
packages/ui @zigordev/ui: the design system's components, starting with the Button on Base UI, and one stylesheet bundled by Lightning CSS. Its Storybook stories are its browser tests
template/ The product template: a minimal product that runs on the packages of this checkout. An API with its notes on its own PostgreSQL, a web app, the API's generated client, their images, and the compose files that run them as containers
.claude/ The rules, skills, hooks and permissions that every Claude Code session works under. Every other repo links to the rules and skills in its installed @zigordev/dev, and holds a copy of the rest
CLAUDE.md What a session needs to know about this repo: where things live, its commands and its own rules
mise.toml The pinned versions of Node.js, pnpm, gitleaks and zizmor
pnpm-workspace.yaml The workspace, the single version of each dependency, and the supply-chain settings
.github/workflows The pipeline. check.yml is the part every repo calls, release.yml tags and publishes after a merge, publish.yml and deploy.yml deliver a product, and ci.yml runs the first two for this repo
renovate/default.json The Renovate preset that every repo extends: how dependency updates are proposed, and when they merge by themselves
docs/ The standard docs, the handbook with its reading order, and the decision records

Every pull request runs the pipeline. It runs pnpm check, exactly as on a laptop, and three jobs that only GitHub can run: the pull request's title, the dependencies it adds, and a scan of the code. A fifth job builds the images of the product template on an arm64 machine, and holds both apps to the platform contract. A sixth runs the design system's stories in the pinned Playwright image. One job named check passes only when all of them passed, and it is the only check main requires.

After a merge, the release works out the next version from the titles that were merged, and publishes every public package under it.

Why it exists

Every zigordev repo is built with the same tools, set up the same way. Keeping that setup in one versioned place means a repo receives a change as a dependency update, not as a copy made by hand, so the repos cannot drift apart.

What it is built with

Tool What it does here
mise Installs the exact Node.js, pnpm, gitleaks and zizmor versions that mise.toml pins
Node.js 26 Runs every script and every test
pnpm 12 Installs dependencies and links the workspace. It takes every version from one catalog, waits one day before it accepts a new release, blocks the install scripts of dependencies, and refuses a package whose publisher became less trusted
TypeScript 7 Checks types in strict mode
Biome 2 Lints and formats TypeScript, JavaScript, JSON and CSS, and formats YAML and Markdown
markdownlint Lints the Markdown
lefthook Runs the hooks before a commit and before a push
commitlint Keeps commit titles in the Conventional Commits format, and refuses attribution lines
gitleaks Stops a commit that contains something shaped like a secret
Vitest 5 Runs the tests and holds coverage above a 90% floor
zizmor Lints the pipeline files for unsafe patterns, such as an action that is not pinned to a commit
zigordev Our own command. zigordev check verifies the rules a machine can verify: no comments, no attribution lines, pinned actions, links that lead somewhere, the standard scripts, the commit identity and the shared files. zigordev sync copies the shared files into a repo. zigordev contract starts a product's built images and holds each app to the first six promises of the platform contract
Zod 4 The schema library that @zigordev/config checks an app's settings with
OpenTelemetry The standard for traces and metrics, and the library that @zigordev/otel records them with
pino The logger that @zigordev/otel writes its JSON log lines with
Apache Kafka 4 The broker that @zigordev/events sends and reads through. The tests run it in a container, through @zigordev/test/kafka
@platformatic/kafka The Kafka client inside @zigordev/events, and nowhere else
Better Auth The sign-in library inside @zigordev/auth, with its passkey plugin
Storybook 10 The showroom of @zigordev/ui. Its stories run as browser tests in Chromium through Playwright, in light and in dark, with axe
Terrazzo and Lightning CSS Build the tokens into CSS custom properties, and bundle the design system's CSS into one file
Base UI The behaviour under each component of @zigordev/ui: keyboard, focus and roles, with no styles of its own
Fastify 5 The web server framework of the template's API
Next.js 16 with React 19 The template's web app
Docker Compose Describes the template as two containers. The check only reads its files, which needs the docker command and no running Docker. Running the containers needs Docker itself. The shared services they stand behind come from npm, as the package @zigordev/stack of platform
GitHub Actions Runs the pipeline on every pull request and on every merge to main
CodeQL Scans our own code for vulnerable patterns, in the pipeline
Dependency Review Fails a pull request that adds a dependency with a known flaw
semantic-release Works out the next version from the merged titles, tags it and writes the release notes. The pipeline then publishes the packages with npm
Renovate Opens a pull request for each newer version of a package, a tool or an action. It merges patch and minor updates by itself, on weekdays between 08:00 and 18:00
Claude Code Does the building, under the rules, skills and hooks in .claude/

The check needs no other repo and no running service. Running the template in containers needs Docker, and one command: template/README.md says how.

Quick start

Install mise and activate it in your shell. Then:

git clone https://github.com/zigordev/toolkit.git
cd toolkit
mise install
pnpm install
pnpm check

mise install installs the pinned tools. pnpm install installs the dependencies and the git hooks. pnpm check runs the full check, and on a clean clone it must end with check took and a number of seconds, with no error above it.

Command What it does
pnpm check The full check: lint, build, type check, and tests with coverage. It prints how long it took
pnpm check:quick The part of the check that needs no containers. The push hook runs it
pnpm format Fixes the formatting, the import order and the Markdown problems that have a safe fix
pnpm lint Reports lint and formatting problems without changing a file
pnpm typecheck Checks the types
pnpm test Runs the tests with coverage
pnpm build Compiles the packages that are published
pnpm --dir template run local:up Starts the shared services and the template in containers, at http://template.localhost. It needs Docker running
pnpm --dir template run check:contract Builds the template's two images and holds them to the platform contract. It needs Docker running

packages/dev explains what each git hook does, and what the session rules and their guard hook do. packages/config explains how an app reads its settings, and packages/otel what a service reports about itself. template explains the product template, and how to run it.

Where to read more

You want to Read
Run it on a clean laptop, step by step docs/local-first-start.md
Know how its work reaches the other repos, and how to look after it docs/cloud-first-deploy.md
Use it from another repo docs/user-manual.md
Understand the whole platform docs/handbook/
Know why something was decided docs/adr/

About

The shared base of every zigordev repository: packages, the product template, pipelines, rules and the handbook

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages