zuke
AGENTS.md49 starsChanged 4 months agoMITView on GitHub
Guidance for working in this repository. Read this before making changes. Zuke is a code-first, strongly-typed build automation system for TypeScript, on Node or Deno. This file, AGENTS.md, is the single source of truth for both humans and agents. CLAUDE.md is a thin pointer whose entire content is @AGENTS.md, so Claude Code loads this file and there is exactly one copy to maintain. If you are wiring Zuke into a project, do not guess the API and do not fall…
- Reads credentials
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 33,398 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository6 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- llms-full.txtllms.txt
- llms.txtllms.txt
- zuke-run-buildSkill
- zuke-setupSkill
- zuke-write-buildSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
14 rules. About 0 are common, 2 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
If you are wiring Zuke into a project, do not guess the API and do not fall back to Deno.Command/shell.
- Very specific: line 183
Never use any. The no-explicit-any lint rule is enabled.
- Very specific: line 184
Never use as to force a type or silence the compiler, and avoid the non-null assertion !
- Very specific: line 222
Tests are hermetic and fast: No network, no reliance on ambient tools.
- Very specific: line 223
When a test needs a subprocess, invoke RuntimeTasks.execPath() (the running runtime), which is always present and shell-free.
- Very specific: line 266
Prefer making the impossible state _unrepresentable_ — tighten the parameter's type, drop the ?, narrow with Exclude<...> — over keeping a …
- Very specific: line 282
Prefer .lock((s) => s.lockKey("deploy", repo).withTtl("4h").onConflict(...)) over .lock(key, { ttl, onConflict }).
- Distinctive: line 293
Reuse the helper; never paste a second copy: Before writing a helper, look for the one that exists.
- Very specific: line 345
Do not unify what only looks alike.
- Very specific: line 398
When a test needs something of the runtime that core has no task for, add the task to core, as EnvTasks.set and RuntimeTasks.chdir were …
- Very specific: line 499
Read build.ts's ci target for the current, authoritative list — this is a snapshot, not a second source of truth.
- Very specific: line 502
The lock is part of the gate: Every entrypoint that loads build.ts — both launchers (once a deno.lock exists, which in this repository is …
- Distinctive: line 632
Update docs with code: If behaviour changes, update README.md, JSDoc, and the spec/acceptance criteria in the same PR.
- Very specific: line 652
Run ./zuke pluginSync to regenerate plugins/zuke/skills/.
≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
Guidance for working in this repository. Read this before making changes.
Zuke is a code-first, strongly-typed build automation system for TypeScript, on Node or Deno.
This file,
AGENTS.md, is the single source of truth for both humans and agents.CLAUDE.mdis a thin pointer whose entire content is@AGENTS.md, so Claude Code loads this file and there is exactly one copy to maintain.
Using Zuke — the API, without guessing
If you are wiring Zuke into a project, do not guess the API and do not fall
back to Deno.Command/shell. Every operation has a typed wrapper, and the
exact signatures are published — read them:
- Check the package catalogue before writing any command.
llms.txt's## Packagescatalogue (raw: https://raw.githubusercontent.com/zuke-build/zuke/master/llms.txt) and the grouped list inskills/zuke-write-build/references/catalogue.mdare the only ways to answer "does a@zuke/<tool>wrapper exist for this CLI?" — per-packagedeno doc jsr:@zuke/<package>can only describe a package whose name you already know; it cannot reveal that a package exists. Reaching forCmdTasks.exec(jsr:@zuke/cmd) or a raw$/Deno.Commandfor a tool that has a@zuke/<tool>package is a bug, not a style choice — it discards typed flags, argv purity, and tool resolution. - One file with the whole typed surface of every package:
llms-full.txtat the repo root.llms.txtis the short index. - A single wrapper on the command line:
deno doc jsr:@zuke/<package>(e.g.deno doc jsr:@zuke/deno). - On each package's JSR page / README: a generated
## APIsection. - The CLI surface — commands, flags, and a build's actual targets: run
./zuke --help(ordeno run -A build.ts --help). It prints the usage grammar, every reserved command (graph,generate-ci,completions <print|install> <shell>,mcp,resume,runs,cancel,register,doc) and flag, plus the current build's targets — with descriptions and dependencies — and its parameters. So an agent asked to set up or run a build discovers the real command surface live instead of guessing;zuke --listis the targets-only view andzuke --list --jsonemits the whole surface (commands, flags, targets, parameters) as JSON for tools. The written reference isdocs/cli.md, andllms.txtcarries a generated## CLIsection; the same data is available in code via the exporteddescribeCli(build).
The mental model:
- A build is a class that extends
Build. Each target is a class field built withtarget():.description(...),.dependsOn(...),.executes(async () => { … }). - Dependencies are
this.<field>references, not strings —dependsOn(this.lint), neverdependsOn("lint")— so renames and typos are compile-time errors. A target may only depend on siblings declared above it (fields initialise top-to-bottom). - Make the file runnable with
await run(MyBuild)at the bottom — noif (import.meta.main)guard;runno-ops when the module is imported. - Import
@zuke/*by bare specifier, declaring it inpackage.json(Node, the default) ordeno.json(Deno) —import { DenoTasks } from "@zuke/deno";with the alias"@zuke/deno": "npm:@zuke-build/deno@^1"inpackage.json'sdependencies(whatnpm install @zuke/deno@npm:@zuke-build/denowrites), or on Deno"@zuke/deno": "jsr:@zuke/deno@^1"in theimportsblock, which is whatdeno add jsr:@zuke/denowrites for you. The launchers bootstrap the project's runtime. On Deno, never inline thejsr:specifier in the import statement: Deno's default lint set (the one that applies whendeno.jsonconfigures nolint.rules, which is whatzuke setupscaffolds) rejects it underno-import-prefix, so an inlined one fails the project's owndeno task lint. The caret major is pinned in the map instead, so a future@zukemajor cannot land unannounced. A subpath such as@zuke/core/shellresolves through the same entry. Every external tool is a namespaced
*Tasksobject (DenoTasks,NpmTasks,DockerTasks,GitTasks, …) configured with a settings lambda that mirrors the real CLI's flags:import { Build, run, target } from "@zuke/core"; import { DenoTasks } from "@zuke/deno"; class CI extends Build { lint = target().executes(async () => { await DenoTasks.lint(); }); test = target().dependsOn(this.lint) .executes(async () => { await DenoTasks.test((s) => s.allowAll().coverage("cov_profile")); }); } await run(CI);
These three artifacts (llms.txt, llms-full.txt, and every package's README
## API block) are generated from deno doc by ./zuke apiDocs, and CI
fails (./zuke apiDocsCheck) if they drift — so any change to a public API must
regenerate them in the same PR.
Tech stack
- Runtime & toolchain: Node runs the gate (
node build.ts ci); Deno (2.x) is the second lane, with its test runner, type-checker and coverage, and itsdeno lint. Formatting is dprint (dprint.json), and the gate also lints with Oxlint (.oxlintrc.json) and type-checks withtsc(tsconfig.json); all three are pinned in the npm workspace (package.json), which the gate'snpmInstalltarget installs.npmBuildalso uses npm, to installtscand compile the packages for npm. The steps that still run Deno itself (apiDocs,docLint,apiReferenceandpublishJsr) use the Deno release the launchers pin, which the build installs, checksum-verified, into.zuke/tools(build/deno_tool.ts). - Language: TypeScript, strict mode.
- Distribution: JSR as a workspace of 72 packages:
@zuke/core(exports.,./shell,./tooling,./tooling/conformance,./render,./conformance) plus the@zuke/clicommand, a generic@zuke/cmdfallback, and 50+ typed tool wrappers and plugins (@zuke/deno,@zuke/npm,@zuke/docker,@zuke/ai, …). Every package except@zuke/engineis also published to npm as@zuke-build/<name>(compiled bynpmBuild, published bypublishNpm; seeRELEASING.md) and consumed there through an alias as@zuke/<name>. - No runtime dependencies. The library is dependency-free; tests use a local
assertion helper (
tests/_assert.ts) rather than a third-party assert library so the suite runs with zero network access. This is a claim about the published packages — everypackages/*/deno.json— and it is enforced by them declaring none. The build layer is separate and does have dependencies: cspell is pinned in the npm workspace like dprint, release-please is installed from npm on demand byinstallCli, and the rootdeno.jsonimports@std/yamlforbuild/. Nothing underpackages/may import any of them.
TypeScript 7 / tsgo
The request is to use tsgo (the native TypeScript port) if Deno supports
it. Status as of 2026-07-30:
- TypeScript 7.0 shipped (2026-07-08) and the native Go compiler is no
longer a side channel: it is the
tscin the ordinarytypescriptpackage.@typescript/native-previewand thetsgobinary name now mean the bleeding-edge nightly channel, not "the native compiler". - Deno can use it, but only unstably.
deno check --unstable-tsgo(DENO_UNSTABLE_TSGO=1, or"unstable": ["tsgo"]indeno.json) runs the native compiler with Deno's own module resolution. Deno's docs call it "an unstable, preview feature" that is not feature-complete — programs that pass the default checker can report different results — and say "Don't rely on it for CI or release builds yet."
Therefore: deno check (default compiler) stays the type-checker of the
check task and the Deno lane. Try --unstable-tsgo locally when a type-check
feels slow, but do not put it in the check task or the gate until Deno drops
the unstable flag.
The gate also runs TypeScript 7's own tsc, pinned in package.json, as the
Node gate's type-checker (#993): the tsc target checks what tsconfig.json
includes, the same roots as deno check except the examples, which
examplesCheck checks with Deno. It sees the same module graph Deno does. The
npm workspace links every package into node_modules as @zuke/<name>, and
tsconfig.json's paths send the jsr:@zuke/* specifiers a test reaches
through an example to the same workspace members.
Each SDK runs on its own stack (hard requirement)
A Zuke build in one language never needs another language's toolchain. A Python user never needs Deno, just as a TypeScript user never needs Python. Not to install Zuke, not to scaffold, not to run a build, not on CI. This holds for every SDK, and every change must keep it:
- A build another SDK hosts (a
zuke.jsonwith no TypeScript build file) runs on the standalonezukebinary, which carries@zuke/engineand every wrapper.zuke setup --sdkwrites launchers that download the pinnedzukerelease, checksum-verified, never a Deno (packages/cli/src/binary_launcher.ts). - The binary never falls back to Deno for such a build. A pin it cannot serve
goes to the project's launcher, or is refused with how to get a
zukethat serves it (packages/cli/src/dispatch.ts). - What setup, import and the generated CI write for an SDK project (launchers,
.mcp.json, workflows, docs) names no tool from another stack. Neither does a message the user sees.packages/cli/tests/binary_launcher_test.tsand the setup tests fail on a launcher that mentions Deno. - Documentation and skills for an SDK user describe their own stack only.
Coding guidelines (non-negotiable)
- Strict, strongly-typed TypeScript.
- Never use
any. Theno-explicit-anylint rule is enabled. - Never use
asto force a type or silence the compiler, and avoid the non-null assertion!. Narrow with control flow and type guards instead (e.g.value instanceof Error ? value.message : String(value)). - The single sanctioned escape is a
// @ts-expect-errorin a test that deliberately exercises a runtime guard against type-unsafe input, with a comment explaining why. Do not use it insrc/.
- Never use
- All linting, formatting, type-checking, and tests must always pass. Run
npm cithennode build.ts ci(the same gate CI runs;deno task ci/./zuke ciis the Deno lane) before committing; it must be green. - Keep test coverage at 95%+ (lines and branches) at all times. Enforced
twice in CI, on Linux, where the whole suite runs: the gate's
nodeTesttarget runs the suite on Vitest with the thresholds invitest.config.ts, and the Deno lane runs thecoveragetarget, whoseDenoTasks.coverage.threshold()parses the lcov report and fails the build (locally,deno task cov). Both also hold each file to a 50% line floor; Node's leaves outbuild/, whose tests are mostly Deno-only. New code needs new tests in the same change — see Testing for the required layers (always unit + integration; e2e for bigger features). - Document every public symbol — JSDoc on ALL of it. A JSDoc comment is
required on every exported symbol and on every public member of an exported
class or interface: methods, fields (including the trailing-underscore
internal fields that are still public on an exported class), constructors,
and the
override name = "…"line on an error class. A first-party type that appears in a public signature must itself be exported and documented — never leave aprivate-type-refto one of the package's own types. Verify withdeno doc --lintrun over all of a package's entrypoints in one invocation (a multi-entrypoint package like@zuke/corehas.,./shell,./tooling,./tooling/conformance,./render,./conformance, sodeno doc --lint packages/core/mod.ts packages/core/src/shell.ts …— linting them together lets cross-entrypoint references resolve). The bar: zeromissing-jsdocand zeroprivate-type-refto a first-party type. The one acceptable residual is aprivate-type-refinto another published@zuke/*package (e.g. a wrapper referencingConfigure/CommandOutputfrom@zuke/core) — that dependency documents the type and JSR links to it, exactly as the existing tool wrappers do; do not re-export a dependency's type just to silence the lint. Bothmissing-jsdocand first-partyprivate-type-reflower the package's JSR documentation score. Match the existing density and tone when adding docs. - Tests are hermetic and fast. No network, no reliance on ambient tools.
When a test needs a subprocess, invoke
RuntimeTasks.execPath()(the running runtime), which is always present and shell-free. - Public API is task-shaped — no standalone utility functions. A package
exposes its operations through a namespaced
*Tasksobject (FileTasks,DenoTasks,JsrTasks, …), never as bare exported helper functions. CLI wrappers build argv through the settings-lambda style (ToolSettings/buildArgs); task groups that run no subprocess (e.g.FileTasks) take direct arguments plus an options object. Group related operations under one task object rather than adding a loose function tomod.ts, and keep internal helpers unexported. (The framework primitives a build is defined with —Build,target,group,run— are the deliberate exception.) - Mirror the real CLI. Name a wrapper's task methods and settings after the
actual subcommands and flags they invoke —
CspellTasks.lintrunscspell lint, not a prettier alias likecheck. Staying close to the tool's own vocabulary keeps the wrapper predictable for anyone who knows the CLI. - One domain per file — never the whole implementation in one module. Split
a package's source into small, cohesive files by class and concern (types,
errors, each fluent settings class, the transport/provider layer, parsing,
the orchestrator), and re-export the public surface from
mod.ts. A single file accreting every class and helper is a smell — break it up as it grows, not later. Prefer reusing core primitives (FileTasks,glob/globToRegExp, the$/Commandshell, the HTTP helpers) over re-implementing them in a package. Every source file starts with the copyright and license header. ALL new files — every
.tsfile (tests, fixtures, and generated-file templates included), and any launcher or script — open with these two lines (after the shebang, where one exists), before everything else:// Copyright (c) 2026 the Zuke contributors // SPDX-License-Identifier: MITShell/PowerShell files use
#comments for the same two lines. This is the per-file copyright and license identification the OpenSSF Best Practices criteria require, and it is enforced:tests/license_headers_test.tsfails the suite on any source file missing the header. A generated file gets its header from its template (seeinternal/hcl_tool.ts.tmpl) — put the header in the template, never hand-edit generated output.- No dead code. Code that cannot execute does not ship: remove unreachable
branches, unused helpers and exports, and fallbacks whose condition can
never fire (e.g. a
?? defaultbehind a parameter no call site ever omits). Prefer making the impossible state unrepresentable — tighten the parameter's type, drop the?, narrow withExclude<...>— over keeping a loose signature guarded by an arm that never runs. Keep the line straight, though: narrowing that the type system forces (map.get(x) ?? fallback,value instanceof Error ? value.message : String(value), anundefinedcheck after.find(...)) is not dead code — guideline 1 bans the!/asshortcuts that would replace it. A branch is dead only when it is unreachable after the types are as tight as the call sites allow. And never write a test whose sole purpose is to "cover" a dead arm — an uncoverable branch is the signal to delete the branch, not to feed the coverage gate. - Configuration is a fluent settings lambda, not an options object. When
an API takes more than a trivial amount of configuration, expose it as a
chainable settings class configured through a lambda — the
Configure<S> = (s: S) => Sshape the tool wrappers use — not a positional options bag. Prefer.lock((s) => s.lockKey("deploy", repo).withTtl("4h").onConflict(...))over.lock(key, { ttl, onConflict }). Each setter returnsthis, the fields use the trailing-underscore internal convention (and are still JSDoc'd), and the lambda defers evaluation until call time — so a value derived fromthis.<param>.valuesees the resolved value. This keeps the whole authoring surface consistent withDenoTasks.test((s) => …),service(), and the CI builder, and lets options grow without churning call sites. A single required scalar (a path, a name) can still be a direct argument; reach for the lambda once there are options to set. Reuse the helper; never paste a second copy. Before writing a helper, look for the one that exists. The shared surface to check first:
packages/core/src/internal.ts(messageOf,readEnv,sha256Hex, the read-or-null and write-with-mkdir file helpers),packages/core/src/tooling.ts(ToolSettings,SubcommandSettings,defineTool,ToolNotFoundError),shell.ts($,Command),file.ts(FileTasks), pluspath.ts,glob.ts,http.ts,yaml.ts,secret.ts,render.tsandcompression.ts. In a wrapper or plugin package, check that package's own unexported modules —packages/gh/src/api.tsandcredentials.tsare the pattern: one transport, one credential resolution, imported by every task in the package.A near-copy that differs by a constant, a flag name, or a message is a copy-paste, not a variation. Parameterise the difference and keep one implementation. This is not a style preference — the copies drift, and the drift is where the bugs live. Every one of these was real: two implementations of the zip-slip guard, two Markdown escapers where only one collapsed newlines (so a model-supplied string could inject block-level Markdown into a PR comment), two loopback checks that disagreed about
[::1], twoenv()readers that disagreed about an empty token, and aJSON.parseguard that landed in one of two twin stores. A guard or an escape whose whole value is being applied everywhere must have exactly one implementation.Where a shared unit belongs, in order of preference:
- an unexported module in the same package, imported by its call sites — the default, and what keeps a dedup free of release consequences;
- an existing
@zuke/coreexport, if one already covers it; - a new
@zuke/coreexport only when the need is genuinely cross-package — it brings JSDoc on every symbol, a cleandeno doc --lint, and regeneratedllms.txt/llms-full.txt/README API blocks in the same change.
Two constraints shape the choice. A wrapper package may depend only on
@zuke/core— never on another wrapper, never on@std/*— so "share it between two wrappers" means core or nothing. The one exception is a rich feature package: one that orchestrates other tools rather than wrapping one (@zuke/cli,@zuke/ai). Such a package should call the wrapper that already exists —@zuke/aiposts its reactions throughGhTasks— rather than grow a second, drifting copy of it. Each exemption is named inPACKAGE_DEPENDENCIES(build/packages.ts), andtests/package_dependencies_test.tsfails on any@zuke/*import that is not listed, so adding one is a reviewed decision. Expect the list to grow as more such packages appear; a plain tool wrapper never belongs on it. A dependent must come after its dependencies inPACKAGES, the publish order, and the core-floor check resolves a listed sibling from the local workspace (it is released from the same commit) while still pinning core to its published floor. Anddeno doc --lintreportsprivate-type-refwhen an exported class extends an unexported one, so prefer sharing the logic as plain internal functions over introducing a base class an exported settings class would extend.Do not unify what only looks alike. Two wrappers each having a
.cwd()is them mirroring two real CLIs (guideline 7), not duplication. Reject the abstraction when it would be larger than the duplication it removes, when it needs a parameter no call site varies (that is dead flexibility, guideline 10), or when it would reorder generated output. Prefer few, large, certain consolidations over many speculative ones.- SOLID, in the shapes this codebase actually takes. The principles are
not decoration here; each one has a concrete form:
- Single responsibility — one domain per file (guideline 8). A class that fuses unrelated concerns, or a method long enough to hold several sequential phases, is split so each part can be read and tested alone. Length is a symptom, not the defect: name the responsibilities before splitting, and if there is genuinely one, leave it.
- Open/closed — extend through the settings lambda (guideline 11) and
through new
*Tasksmethods, not by adding a flag that switches an existing function between two behaviours. - Liskov — a settings subclass must not weaken what its base promises;
buildArgs()stays pure in every implementation. - Interface segregation — a task takes the narrow type it needs. Passing
a whole settings object where a resolved
stringand aGhCallwould do is what forces the next caller to construct state it has no use for. - Dependency inversion — depend on the seam, not the implementation:
StateHost/StateStoreover directDeno.*calls, an injectedfetchover the global,EnvReaderoverDeno.env. This is also what keeps the tests hermetic (guideline 5), so the two rules reinforce each other.
Testing
Zuke has three test layers. Every change ships tests in the same PR — at minimum a unit test and an integration test; a bigger feature (a new flow mechanism, or anything with cross-process or cross-OS behaviour) also adds an e2e test. All three obey guideline 5: hermetic and fast, no network, no ambient tools.
The Deno lane's test target splits the *_test.ts files across one deno
test process per CPU (build/test_shards.ts), so files run concurrently with
each other in separate processes, while the tests inside one file still run in
order. A test may set the environment or change the working directory, which
only affect its own process, but it must not write to a fixed path that another
file could also use: work in a withTemp directory instead. Name every test
module *_test.ts, because the shards run explicit file lists and a test
enforces the naming convention.
Tests reach the runtime and the test framework only through seams of our own,
never directly. A test calls neither Deno.* nor a node: module, and never
imports a test library, so moving to another runtime or framework is a change to
those seams, not to every test:
- Runtime operations go through core's tasks, the same seams the code uses:
FileTasks,EnvTasks,RuntimeTasks,ProcessTasksandNetTasks. - Tests register with
test()fromtests/_testing.ts, which hands them to Deno's runner or to Vitest, and assert withtests/_assert.ts. - When a test needs something of the runtime that core has no task for, add the
task to core, as
EnvTasks.setandRuntimeTasks.chdirwere added. Only what serves tests alone (temp scopes, the integration harness's unhandled-rejection guard) lives in a root helper,tests/_*.ts. Those helpers are the only test code that may call the runtime directly, and they too use core wherever it reaches.
The exceptions are the tests whose subject is the boundary itself (core's own file, stream and stdio layers), and fixture scripts that a test runs as a subprocess.
A test that needs Deno itself, because it runs deno publish or deno run, or
checks Deno's permissions, says why with denoOnly, and the Node lane skips it.
Mark the test, not its file: the rest of the file still runs on both runtimes.
- Unit —
packages/<pkg>/tests/*_test.ts. One module in isolation, with fakes and the localtests/_assert.tshelper (never a third-party assert library). For a tool wrapper, assert the purebuildArgs()argv — do not run the real tool — and callassertWrapperConformancefrom@zuke/core/tooling/conformance, which asserts the wrapper's binary name, its declared resolution mode — theresolutionoption is required,"node_modules"for a JS-ecosystem tool and"path"for a native one, so every wrapper states its mode rather than inheriting a default that could hide a missingdefaultResolution()— and itsToolNotFoundErrorpath, so a wrapper cannot silently omit those checks. This layer covers a module's branches and a wrapper's flags, and carries the bulk of the 95% coverage gate. - Integration —
tests/integration/*_test.ts. Drive a real build end-to-end through the CLImain()entry point using the harness intests/integration/_harness.ts:runCli(BuildClass, args)returns{ code, out, err }, andwithStateDir(fn)provides an isolated temporaryZUKE_STATE_DIRfor durable-state features (waitsFor,lock, run records). Fixtures are smallBuildsubclasses defined inside the test, recording execution into a local array. Prove the executor / graph / params / CLI / wait-resume-state flow works as a whole, not just a unit seam. These are ordinary*_test.tsfiles, so they run in the normal test lanes — on Node in the gate (ci.yml'sciandgatejobs) and on Deno in itstestjob, each on all three OSes — and count toward coverage. - E2E —
tests/e2e/*_e2e.ts(+tests/e2e/fixtures/). For the one thing an in-process test cannot prove: genuine inter-process behaviour (e.g. two real processes racing a resume's compare-and-swap) and real OS boundaries (Windows file-locking). Spawn realdenosubprocesses withRuntimeTasks.execPath()(guideline 5) against a tempZUKE_STATE_DIR; the fixture is a runnableBuildending inawait run(...). Name these files*_e2e.tsso defaultdeno testdiscovery skips them — they stay out of the fast gate. They run only via theintegrationbuild target inbuild.ts, which the generated.github/workflows/integration.ymlfans out over the three OS runners. That target globstests/e2e/*_e2e.ts, so a new file is picked up on its own — there is no list to add it to.
Naming wrinkle to keep straight: the in-process suite lives in
tests/integration/ but runs in the normal test lane; the build target named
integration runs the e2e suite. They are different things.
Adversarial review (every feature)
Every feature ships an adversarial review before the PR is finalized — not just a green gate. After the implementation and its tests pass, run a review pass that actively tries to break the change: bypasses, leaks, race conditions, unhandled throws, and untested security branches. Have independent reviewers attack each dimension, verify every finding against the real code (reproduce the exact path — default to refuted if you can't), then fix the confirmed defects and add a regression test for each before opening the PR.
This is not optional polish: on the MCP authz/audit work an adversarial pass caught a real authorization bypass, a secret-redaction gap, and a transport-crashing throw that all passed lint, types, and 95%+ coverage. Fixing pre-PR beats churning through review findings. It complements — never replaces — the three test layers above and the "read every reviewer comment" rule below.
Commands
| Task | Command |
| Run tests | deno task test |
| Coverage + gate (95%) | deno task cov |
| Human-readable coverage table | deno task cov:report |
| Type-check everything | deno task check |
| Format / check formatting | deno task fmt / deno task fmt:check |
| Lint | deno task lint |
| Spell-check | deno task spell |
| Pre-commit gate (same as CI) | node build.ts ci (Deno lane: deno task ci) |
Regenerate deno.lock | deno task lock |
| Verify declared core floors | ./zuke coreFloorCheck (needs network) |
node build.ts ci is the exact gate the ci job in ci.yml runs, so there is
one gate, not a hand-maintained subset that can drift from it. CI runs it on
Node (#993), on all three OSes, after npm ci installs the workspace. deno
task ci (deno run -A --frozen build.ts ci) is the same gate on Deno. Its Deno
steps fetch the pinned Deno themselves (build/deno_tool.ts), and the Tests
jobs are the Deno lane: deno check and the whole suite on Deno on the same
three OSes, with Deno's coverage gate on Linux (./zuke coverage). build.ts's
ci target depends on: format (dprint check), lint (deno lint),
oxlint, tsc, spell (cspell), nodeTest (the suite on Vitest with the 95%
coverage gate), coverageUpload (skips locally without a CODECOV_TOKEN),
apiDocsCheck, docLint, snippetsCheck, examplesCheck, hclSyncCheck,
pluginSyncCheck, launcherSyncCheck, packageJsonSyncCheck, skillsCheck,
graphDocCheck, toolSpecCheck, pluginVersionCheck, prBodyLint,
actionPinCheck, npmSmoke, npmSigstoreCheck, security, and lockCheck.
Read build.ts's ci target for the current, authoritative list — this is a
snapshot, not a second source of truth.
The lock is part of the gate. Every entrypoint that loads build.ts — both
launchers (once a deno.lock exists, which in this repository is always) and
the root tasks — passes --frozen, so a run cannot quietly heal a stale
deno.lock by writing the resolutions it is missing. That mattered: a green
gate used to be able to mean "the lock resolves now that we fixed it" while
CI, whose checkout has the committed lock, failed with "The lockfile is out of
date". deno task resolves the workspace before running its command, so it can
still rewrite the lock ahead of a frozen run; lockCheck closes that from the
other side by failing if the run left the lock modified. When you deliberately
change a dependency, run deno task lock, review the diff, and commit the lock
in the same change.
Repository layout
deno.json # workspace root: tasks, fmt/lint config
packages/
core/ # @zuke/core — mod.ts, src/, tests/ (+ ./shell, ./tooling, ./tooling/conformance, ./render, ./conformance)
deno/ # @zuke/deno — DenoTasks
npm/ # @zuke/npm — NpmTasks
cmd/ # @zuke/cmd — CmdTasks (generic fallback)
… # + the rest: @zuke/cli, @zuke/docs, @zuke/ai, and tool wrappers (72 total)
tests/
integration/ # in-process: real builds via the CLI main() + _harness.ts
e2e/ # subprocess: *_e2e.ts + fixtures/ (run by the `integration` target)
examples/ # cloneable mini projects, type-checked and listed by `examplesCheck`
build.ts # Zuke's own build (runnable example); zuke.json names it
build/ # reusable helpers behind build.ts's targets (docs, publish, snippets, …)
zuke, zuke.ps1 # bootstrap launchers (install the project's runtime, run the build) — GENERATED from packages/cli/src/launcher.ts by `./zuke launcherSync`; zuke.json names the build class
docs/ # long-form guides (linked from the README)
skills/ # agent skills: zuke-setup, zuke-write-build, zuke-run-build
plugins/zuke/ # Claude Code + Codex plugin wrapping the skills
gemini-extension.json # Gemini CLI extension manifest (serves skills/)
.agents/plugins/ # Codex-native marketplace catalog
.github/workflows/ci.yml # PR checks (ci gate, coreFloorCheck, test matrix)
.github/workflows/integration.yml # e2e suite on the OS matrix (generated)
.github/workflows/ai-review.yml # @zuke/ai PR review
.github/workflows/release.yml # release-please automation
.github/workflows/scorecard.yml # OpenSSF supply-chain scorecard
.github/workflows/security.yml # security scanners
.github/workflows/codeql.yml # CodeQL static analysis (SAST)Architecture notes
- Targets are class fields. Dependencies are passed as
this.xreferences, not strings, for compile-time safety and rename support. Because class fields initialise top-to-bottom, a target may only depend on siblings declared above it — a forward reference isundefinedand is reported as an error byvalidateReferences. - Naming is recovered by
discoverTargets, which introspects the instance's own enumerable properties after construction. - Ordering is a DFS topological sort in
graph.tsthat also honours the softbefore/afterhints and detects cycles (reporting the path). - The shell
$tokenises interpolated values into discrete argv entries (never a concatenated shell string), so command construction is injection-free. - The global
zukecommand forwards to the project's build.@zuke/clikeepssetup,import,doc,upgrade,--helpand--versionfor itself and forwards everything else to the nearestzuke.jsonabove the working directory, running the build file beside it exactly as./zukewould. The walk-up discovery is the accepted design (#578) — it is how npm, Deno and git find their roots — bounded by a trust gate modelled on git'ssafe.directory(packages/cli/src/dispatch.ts). Review the gate's implementation; the forwarding itself is not a finding. - Tool wrappers (
@zuke/deno,@zuke/npm,@zuke/cmd) follow a settings-lambda style. Settings classes extendToolSettingsfrom@zuke/core/tooling;buildArgs()must stay pure (no I/O) so argv construction is unit-testable. Execution reusesCommandfromshell.ts. New wrapper packages are workspace siblings that depend only on core (the rich feature packages listed inPACKAGE_DEPENDENCIESaside — see guideline 12).
Good open-source practices to follow
- Every change starts with an issue. Feature, bugfix, documentation,
refactor, or chore — file the issue first, then open the pull request that
closes it. The issue is where the problem, the proposed shape, and the
acceptance criteria are agreed before the effort is spent, and it is the
trail that explains a change to whoever reads it a year later. Use the
templates in
.github/ISSUE_TEMPLATE/:feature_request.yml(feat: …) for a new capability,bug_report.yml(bug: …) for something not working as documented, andchore.yml(chore: …) for docs, tests, refactoring, and repository work. Blank issues are disabled on purpose, so pick the closest template rather than skipping the step. The PR body then links it withCloses #<n>. This applies to agent-authored work exactly as it does to a human's: an agent that is asked to implement something files the issue as its first step, and never opens a PR that closes nothing. - Small, focused changes with clear, descriptive commit messages (imperative mood; explain the why). Keep PRs reviewable.
- Conventional, semantic versioning for releases; keep a changelog as the project grows.
- PR titles are the release trigger — make them conventional commits. This
repo always squash-merges, so the squashed commit's subject is the PR
title, and that single subject is the only thing release-please parses for the
merge. A title that is not a conventional commit (e.g.
Add announce tasks) is silently ignored — no version is bumped and no release PR is cut. Title every PRtype(scope): summaryso the squash carries the right artifact:feat(core): …for a new feature (minor bump),fix(deno): …for a fix (patch). The scope is cosmetic; release-please attributes the bump to a package by the files the PR changes underpackages/<name>/, so a PR that should release a package must touch a file under that package's path with afeat/fixtitle. (docs/chore/refactor/testtitles never bump.) - Keep code snippets out of commit message bodies. release-please parses
every merged commit with a strict conventional-commits parser, and a code
fragment containing parentheses (e.g. an arrow function) makes it fail to
parse the whole commit — which silently drops it from the release, so no
version is bumped. The repo squash-merges, so the squash body comes from the
PR description/commits: put illustrative code in the PR discussion, and keep
commit bodies to prose. See
RELEASING.md. - A new package must be added everywhere. Membership is declared in six
places that must stay in lock-step: the
deno.jsonworkspace,.release-please-config.json,.release-please-manifest.json, thePACKAGESarray inbuild/packages.ts(the JSR publish loop), the package table inREADME.md, and the landing-page catalogue inbuild/website_tools.ts(TOOL_GROUPSfor a CLI wrapper,CORE_PACKAGESfor an engine or plugin package).tests/release_config_test.tsimportsPACKAGESrather than keeping its own copy, sobuild/packages.tsis the single list the tests compare everything else against.tests/release_config_test.tsandtests/build_tools_test.tsenforce that all six agree — run them after adding a package. Register a new package at version0.0.0— in.release-please-manifest.jsonand itsdeno.jsonalike. release-please reads the manifest as the last released version, so anything but0.0.0makes it bump from there: a package added at1.0.0is first released as1.1.0, and1.0.0never exists. At0.0.0the first release is1.0.0, andpublishJsrskips the package until then.tests/release_config_test.tsfails on a package with noCHANGELOG.mdthat is not at0.0.0. Omittingbuild/packages.tsmeans the package is released but never published; omitting theREADME.mdtable means it is invisible to anyone browsing the repo; omittingbuild/website_tools.tsfails the gate, because the website's package grid is generated from it bysyncWebsite. - Update docs with code. If behaviour changes, update
README.md, JSDoc, and the spec/acceptance criteria in the same PR. The agent skills are docs too — and they ship to a marketplace.
skills/is the source of truth forzuke-setup,zuke-write-buildandzuke-run-build, published to three harnesses:plugins/zuke/is the Claude Code plugin (whose manifests Codex also reads, alongside the Codex-nativeplugins/zuke/.codex-plugin/plugin.jsonand.agents/plugins/marketplace.json), and the rootgemini-extension.jsonmakes the repo a Gemini CLI extension that auto-discoversskills/. TheskillsCheckgate target validatesskills/against the Agent Skills spec (frontmatternamemust match the folder), since Codex and Gemini load those folders directly. Any change to the authoring surface or to a documented guarantee — a newtarget()method, a newBuildoverride, changed CLI or authorization semantics — must be reflected in the skill it concerns in the same PR:skills/zuke-write-build/SKILL.mdand the matching file underskills/zuke-write-build/references/for the authoring surface,skills/zuke-run-build/for CLI, run and MCP semantics. Keep eachSKILL.mdshort and put detail in a reference file an agent reads only when it needs it.references/catalogue.mdis one of the two canonical answers to "does a wrapper exist?", so a new package belongs in it as well. Then, in order:- Run
./zuke pluginSyncto regenerateplugins/zuke/skills/. Never hand-edit the copies —pluginSyncCheckfails on drift. - Bump the plugin version by hand, in all four manifests:
plugins/zuke/.claude-plugin/plugin.json,plugins/zuke/.codex-plugin/plugin.json, the entry in.claude-plugin/marketplace.json, and the rootgemini-extension.json(theVERSIONED_MANIFESTSlist inbuild/plugin_version_check.ts). Clients use the version to decide whether an installed plugin is stale, so skills edited without a bump simply never reach agents that already hold the old copy. release-please does not manageplugins/— it is not a workspace package and has nodeno.json. Additive skill content is a minor bump; a correction is a patch.
Two gate targets hold this up, so a miss fails the build rather than shipping quietly:
pluginVersionCheckfails when a published skill changed against the base branch and the version did not move up, andtests/plugin_manifest_test.tsfails when the manifests disagree.pluginVersionCheckis the one part of the gate that needs history — it compares againstorigin/<PR base>, orZUKE_PLUGIN_BASE_REFwhen you set one — and it reports itself skipped, never passed, in a local clone that has no base to compare against. On CI a skip is fatal, because a gate that cannot run is not a gate: it went unnoticed for months that the job's shallow checkout left it with no base ref at all.Two things it insists on beyond "the version differs". It must go up, so that resolving a version conflict by keeping the lower number is refused. And on a push to master it compares the merge commit against its parent (
ZUKE_PLUGIN_BASE_REF=HEAD^), which is the only place a collision is visible: two branches that both bump1.2.0to1.3.0merge without a conflict — each side made the identical edit — and neither pull request's check ever saw the other, because GitHub does not re-run a PR's checks when its base moves. When you have several skill-touching PRs open at once, give each a distinct version, or bump once more after the last one lands.- Run
- Always read the reviewer comments on every PR. This repo runs AI reviewers
(
@zuke/ai) that post their assessments as PR comments (and human reviewers do too). Before considering a PR done — and again after each push — fetch and read every review comment on it (the AI-review bot comments included), and address or explicitly respond to each finding. Don't rely on the checks being green alone; a passing gate can still carry comments worth acting on. - Quote the finding's id whenever you answer or fix one. Each
@zuke/aifinding carries a short id (theDismiss a false positiveblock lists them, e.g.`m5aqoc5dxg5g`). Name it in the reply comment, and in the commit message of any fix it prompted. The id is how the reviewer's discussion feature anchors your reply: a maintainer comment quoting a finding's id is weighed as a rebuttal on the next run, and an accepted refutation stays dismissed instead of resurfacing. It is also what makes a reply attributable — the reviewers post in append mode, so every run's assessment stays on the thread as history, and the id ties a reply to the exact finding (and round) it answers, telling a genuinely new finding apart from the same concern reworded. The ids in thesuppressions(...)list inbuild.tsare the same identifiers, used there as the hard override for cross-branch false positives. - A reply with no push needs
@zuke-build reviewafter it. The reviewers run on a push, so a reply that only answers a finding, a rebuttal above all, is read by nobody until the next run. After posting such a reply, add one new general comment on the pull request whose text is@zuke-build reviewand nothing else: it starts a run with no push, and that run adjudicates every rebuttal and answers it where it was made. On a same-repository pull request the command re-runs the pull request's ownAI reviewrun, so that check follows the new verdict; a fork's pull request is reviewed by the command job itself. Skip it when a push follows the reply anyway, since the push starts the same run. - No secrets or machine-specific paths in the repo or commits. Don't commit
coverage artifacts (
cov_profile/,cov.lcov) — they're git-ignored. - Deterministic output. Topological order is declaration-stable; keep it
that way so
graph/--listoutput doesn't churn. - Friendly errors. Validation failures should name the offending target and explain the fix (see the cycle and forward-reference messages for the bar).
- Don't expand the public API casually. Internal fields use a trailing
underscore (
name_,dependsOn_); only add tomod.tsdeliberately. When a type does belong in a public signature, though, export and document it rather than leaving it an undocumented private-type reference (see guideline 4).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

