Skip to content
Back to search

zig-anything

Rewrite your app in Zig, one piece at a time, checked against the original's recorded behavior at every step. Functions in JavaScript, TypeScript and Python, and CLIs in any language.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/layfate--zig-anything/badge.svg)](/listings/layfate--zig-anything)

HTML

<a href="/listings/layfate--zig-anything"><img src="/api/listings/layfate--zig-anything/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

**Prebuilt binaries.** Download the archive for your platform from the [releases page](https://github.com/Layfate/zig-anything/releases). Builds exist for Linux (x86_64, aarch64; static musl), macOS (x86_64, Apple Silicon) and Windows (x86_64, aarch64). Put `zig-anything` on your `PATH`.

**From source** (needs [Zig 0.17.1](https://ziglang.org/download/)):

git clone https://github.com/Layfate/zig-anything
cd zig-anything
zig build -Doptimize=fast
# binary: zig-out/bin/zig-anything

**Runtime requirements.** These are needed only for the commands that use them:

| Needed for | Tool | | --- | --- | | building and diffing ports | `zig` 0.17.1 on `PATH` (or `ZIG=/path/to/zig`) | | recording JavaScript | Node.js 22.6+ | | recording TypeScript | Node.js 23.6+ (native type stripping), or a loader configured in [`node`](#configuration) | | recording Python | Python 3.8+ |

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 390 lines
  1. <p align="center">
  2. <img src="docs/assets/logo.png" alt="zig-anything logo" width="160">
  3. </p>
  4. <h1 align="center">zig-anything</h1>
  5. <p align="center">
  6. <strong>Port JavaScript, TypeScript and Python functions, and whole command-line programs, to Zig one piece at a time, and prove every port behaves exactly like the original.</strong>
  7. </p>
  8. <p align="center">
  9. <a href="https://github.com/Layfate/zig-anything/actions/workflows/ci.yml"><img src="https://github.com/Layfate/zig-anything/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
  10. <img src="https://img.shields.io/badge/zig-0.17.1-f7a41d" alt="Zig 0.17.1">
  11. <img src="https://img.shields.io/badge/license-MIT-blue" alt="License: MIT">
  12. </p>
  13. <p align="center">
  14. <img src="docs/assets/demo.gif" alt="A Python Levenshtein function and its Zig port running the same 253 recorded cases: 134.6 ms versus 6.5 ms" width="880">
  15. <br>
  16. <sub>Measured with <code>zig-anything bench</code> on <a href="examples/levenshtein-py">examples/levenshtein-py</a>. Regenerate with <code>python scripts/make_demo_gif.py</code>.</sub>
  17. </p>
  18. zig-anything records what a function in your existing code actually does (on generated edge cases, semantic traps and inputs you supply), scaffolds a Zig port of it, and replays every recorded case against the port until they all match. A single command, `gate`, decides when a port is done.
  19. ```text
  20. $ zig-anything diff fuzzyScore
  21. case 22: different value
  22. args ["🎉","emoji 🎉 ok"]
  23. expected {"ok":0.75}
  24. got {"ok":0.7}
  25. 285/288 cases match [zig-port/fuzzyScore]
  26. ```
  27. *That mismatch is real: the first Zig port counted bytes, but JavaScript counts UTF-16 code units. The recording caught it.*
  28. - **One static binary**, about 0.4–0.8 MB, with no runtime dependencies. Written in Zig with only the standard library.
  29. - **Language-agnostic replay.** The original runs in its own runtime (Node or Python) through a small embedded recorder. The port runs as a native Zig harness. Results meet as JSON lines.
  30. - **Semantic comparison.** `1`, `1.0` and `1e0` are equal, object key order is ignored, and NaN/±Infinity survive the round trip. Thrown errors match returned Zig errors.
  31. - **Measured, not claimed.** `bench` times both sides on the same recorded inputs and reports a verdict, including when the port is *slower*.
  32. - **Agent-ready.** `zig-anything mcp` exposes every command as a Model Context Protocol tool.
  33. ## Contents
  34. - [Benchmarks](#benchmarks)
  35. - [Install](#install)
  36. - [Quick start](#quick-start)
  37. - [Commands](#commands)
  38. - [How it works](#how-it-works)
  39. - [Calling the port from your code](#calling-the-port-from-your-code)
  40. - [Porting whole programs](#porting-whole-programs)
  41. - [Writing a port](#writing-a-port)
  42. - [Configuration](#configuration)
  43. - [MCP server](#mcp-server)
  44. - [Scope and limitations](#scope-and-limitations)
  45. - [Building from source](#building-from-source)
  46. - [Contributing](#contributing) · [Changelog](CHANGELOG.md) · [License](#license)
  47. ## Benchmarks
  48. <p align="center">
  49. <img src="docs/assets/bars.gif" alt="fuzzyScore, JavaScript vs Zig port: peak memory 47.2 MB vs 4.1 MB, one process over 288 cases 40.7 ms vs 5.6 ms, per call 61.3 ns vs 31.6 ns" width="880">
  50. <br>
  51. <sub>Memory and one-process time: <code>python bench/peakmem.py --runs 15 -- &lt;command&gt;</code>, running the recorder and the Zig harness directly. Per call: <code>zig-anything bench fuzzyScore</code>. Regenerate with <code>python scripts/make_bars_gif.py</code>.</sub>
  52. </p>
  53. All numbers below were measured on one machine: AMD Ryzen 7 5700X, 32 GB RAM, Windows 11, Zig 0.17.1, Node.js 24.21, Python 3.12.10. Each row is a median of 5 runs. Reproduce them with the commands shown; your numbers will differ.
  54. **Example ports** (`zig-anything bench <unit>`):
  55. | Unit | Original | Per call: original | Per call: Zig | Per call: speedup | One process, all cases: original | One process, all cases: Zig |
  56. | --- | --- | --- | --- | --- | --- | --- |
  57. | [`levenshtein`](examples/levenshtein-py) | Python 3.12 | 51.1 µs | 0.31 µs | **164x** | 134.6 ms | 6.5 ms |
  58. | [`fuzzyScore`](examples/fuzzy-js) | Node.js 24 (V8 JIT) | 61.3 ns | 32.5 ns | **1.9x** | 43.6 ms | 6.9 ms |
  59. | `wc` ([program unit](#porting-whole-programs), test fixture) | Python 3.12 | — | — | — | 92.9 ms per run | 6.1 ms per run |
  60. "Per call" excludes runtime startup: both sides parse the inputs first, run one untimed warm-up pass, then run calibrated timed passes. "One process" is wall time for a fresh process that loads the code and runs every case once. Cases that throw are excluded from benchmarks, because exceptions cost much more in most runtimes than errors in Zig, and that would flatter the port.
  61. A JIT is a strong baseline. The first `fuzzyScore` port matched every case but ran 2.6x *slower* than V8 (164 ns per call), because it converted both strings to UTF-16 buffers on every call. Profiling showed the conversion, not allocation, was the cost. JavaScript knows string lengths in O(1), while the port scanned whole strings to learn them. The final port streams UTF-16 units straight from the UTF-8 input, with an inline ASCII fast path, and drops the redundant length check. That brought it to 31.6 ns. The recorded cases stayed 288/288 green throughout, which is what made the rewrite safe. The story is in [examples/fuzzy-js](examples/fuzzy-js).
  62. **The tool itself**:
  63. | Measurement | Result | Reproduce |
  64. | --- | --- | --- |
  65. | binary size, size-optimized, x86_64 Linux / macOS / Windows | 462 KB / 438 KB / 768 KB | `zig build release` |
  66. | startup, `zig-anything --version` (Windows, includes process creation) | 4.0 ms median | `python bench/startup.py -- zig-out/bin/zig-anything --version` |
  67. | peak memory of a port harness running 288 cases (`fuzzyScore`) | 4.1 MB, vs 47.2 MB for Node running the original | `python bench/peakmem.py -- <command>` |
  68. | scan JavaScript | 137 MiB/s | `zig build microbench` |
  69. | scan Python | 200 MiB/s | `zig build microbench` |
  70. | parse and compare 100,000 recorded cases | 228 ms (70 MiB/s) | `zig build microbench` |
  71. | generate 1,000 random cases for 3 parameters | 0.30 ms | `zig build microbench` |
  72. ## Install
  73. **Prebuilt binaries.** Download the archive for your platform from the [releases page](https://github.com/Layfate/zig-anything/releases). Builds exist for Linux (x86_64, aarch64; static musl), macOS (x86_64, Apple Silicon) and Windows (x86_64, aarch64). Put `zig-anything` on your `PATH`.
  74. **From source** (needs [Zig 0.17.1](https://ziglang.org/download/)):
  75. ```sh
  76. git clone https://github.com/Layfate/zig-anything
  77. cd zig-anything
  78. zig build -Doptimize=fast
  79. # binary: zig-out/bin/zig-anything
  80. ```
  81. **Runtime requirements.** These are needed only for the commands that use them:
  82. | Needed for | Tool |
  83. | --- | --- |
  84. | building and diffing ports | `zig` 0.17.1 on `PATH` (or `ZIG=/path/to/zig`) |
  85. | recording JavaScript | Node.js 22.6+ |
  86. | recording TypeScript | Node.js 23.6+ (native type stripping), or a loader configured in [`node`](#configuration) |
  87. | recording Python | Python 3.8+ |
  88. ## Quick start
  89. This walks through the [`examples/fuzzy-js`](examples/fuzzy-js) project.
  90. ```sh
  91. cd examples/fuzzy-js
  92. # 1. Find candidates: top-level functions with inferred parameter types.
  93. zig-anything scan src
  94. # src/fuzzy.mjs (javascript)
  95. # 7 fuzzyScore(query: string, text: string)
  96. # 2. Scaffold a port unit: manifest, Zig stub, harness and build files.
  97. zig-anything init src/fuzzy.mjs fuzzyScore
  98. # 3. Record the original's behavior on edge cases plus your own inputs.
  99. zig-anything record fuzzyScore
  100. # recorded 288 cases -> zig-port/fuzzyScore/cases.jsonl
  101. # returned 288 (number 288)
  102. # 4. Write zig-port/fuzzyScore/src/port.zig, then compare. Repeat until green.
  103. zig-anything diff fuzzyScore
  104. # 288/288 cases match
  105. # 5. Done means this passes (exit code 0).
  106. zig-anything gate fuzzyScore
  107. # [ok] manifest fuzzyScore
  108. # [ok] port written no TODO marker
  109. # [ok] cases recorded 288 deterministic case(s)
  110. # [ok] builds -Doptimize=safe
  111. # [ok] port tests zig build test
  112. # [ok] behavior 288/288 cases match
  113. # PASSED: fuzzyScore is a faithful port
  114. # 6. Is it faster?
  115. zig-anything bench fuzzyScore
  116. ```
  117. `zig-anything status` lists every unit in the project with its state (`stub`, `unrecorded`, `untested`, `failing`, `stale` or `passing`), its last diff and its speedup.
  118. > **Safety:** `record` and `bench` **run your original code**, once or more per case. If it writes files, talks to a database or calls the network, it will do so. Record pure functions, or run on a copy with test credentials.
  119. ## Commands
  120. | Command | What it does |
  121. | --- | --- |
  122. | `profile <script> [-- args]` | Run a JS/TS/Python script under its runtime's profiler (`node --cpu-prof`, `cProfile`), rank your functions by time and mark the portable ones. `--top N`, `--all`, `--json`. |
  123. | `scan [path]` | List top-level functions in a file or project, with inferred parameter and return types. `--all` includes non-exported functions; `--json` gives machine-readable output. |
  124. | `init <file> <function>` | Create a port unit (default `zig-port/<function>/`). `--out DIR` chooses the directory. `--force` regenerates the manifest and harness; your `port.zig` and `build.zig` are never overwritten. |
  125. | `record <unit>` | Run the original on generated cases plus `inputs.jsonl`, twice, and write `cases.jsonl`. Cases whose results differ between the two runs are marked flaky and skipped by `diff`. Flags: `--samples N`, `--seed N`, `--max-cases N`, `--no-verify`, `--no-generate`. |
  126. | `build <unit>` | Compile the port and harness. `--optimize debug\|safe\|fast\|small` (default `safe`). |
  127. | `diff <unit>` | Build, replay every case, and report mismatches with arguments, expected and actual results. Detects crashes and points at the crashing case. Flags: `--tolerance X`, `--strict-errors`, `--limit N`, `--no-build`, `--json`. |
  128. | `bench <unit>` | Time the original against the port (built with `-Doptimize=fast`) on the recorded inputs and give a verdict. Flags: `--runs N`, `--target-ms MS`, `--json`. |
  129. | `gate <unit>` | Every check must pass: port written, cases recorded, builds, `zig build test` passes, every case matches. `--bench` also requires the port to be at least as fast. |
  130. | `status [dir]` | Overview of all units. `--json` is available. |
  131. | `bridge <unit>` | Make a finished port callable from the original code: WebAssembly + `index.mjs` (+ `index.d.ts`) for JS/TS, a native library + `port.py` for Python. Replays every recorded case through the binding. `--optimize MODE`, `--no-verify`. |
  132. | `init-cli <name> -- <command...>` | Create a [program unit](#porting-whole-programs) for a whole command-line program in any language. `--cwd DIR`, `--out DIR`, `--force`. |
  133. | `mcp` | Serve the commands as MCP tools over stdio. `--print-config` prints a registration snippet. |
  134. A `<unit>` is a unit directory (`zig-port/slugify`) or just its name (`slugify`), which is looked up in the configured units directory.
  135. **Exit codes:** `0` success · `1` a check failed (mismatches, compile errors, gate) · `2` usage error · `3` runtime or environment error (missing tool, unreadable file).
  136. Every command has `--help`. Typos in commands and flags get suggestions.
  137. ## How it works
  138. ```text
  139. ┌──────────── record ────────────┐ ┌──────────── diff ─────────────┐
  140. inputs.jsonl ─┐ │ │ │
  141. generated ──┼─► args ─► node/python recorder ─► cases.jsonl ─► zig harness ─► port.zig │
  142. edge cases ──┘ (embedded script) │ (args + │ (generic, (your code) │
  143. │ expected)│ comptime) │
  144. └─────────────────────────────────┘ └──► semantic compare ─► report ┘
  145. ```
  146. A **port unit** is a directory:
  147. ```text
  148. zig-port/fuzzyScore/
  149. ├── unit.json what is being ported and from where (source path, params, types)
  150. ├── cases.jsonl recorded behavior; commit it, it is the spec
  151. ├── inputs.jsonl optional hand-written inputs, one argument array per line
  152. ├── build.zig generated once; extend freely
  153. └── src/
  154. ├── port.zig the port: yours to write
  155. ├── harness.zig generated: feeds cases to the port
  156. └── rt.zig generated: JSON ⇄ Zig conversion
  157. ```
  158. **Input generation.** Each parameter type has a pool of edge values and semantic traps:
  159. - numbers: `0`, `-1`, `0.5`, `1e-9`, `2^31-1`, `2^53`, `0.1`, `NaN`, `±Infinity`
  160. - strings: empty, whitespace, `"null"`, `"0"`, newlines, tabs, accents, CJK, emoji, a 300-character string, quotes and backslashes
  161. - arrays: empty, singleton, unsorted, duplicates
  162. Every parameter is driven through its whole pool while the others hold typical values. Then seeded random combinations are added. Recordings are reproducible: the same seed gives the same `cases.jsonl` byte for byte, and an unchanged recording is not rewritten.
  163. **Type inference.** Parameter types come from TypeScript annotations, Python annotations and default values. When those are missing, they come from how the body uses the parameter: `x.toLowerCase()` means a string, `x * 2` or `Math.min(x, …)` a number, `range(n)` or `n // 2` an int. Parameter names are the last resort (`isEnabled` → bool, `count` → int). Inference only shapes the generated inputs and the stub signature, and you can override both.
  164. **Comparison rules** (`diff`):
  165. | Situation | Result |
  166. | --- | --- |
  167. | both returned values | match if semantically equal: numbers by value (`--tolerance` for floats), objects ignoring key order, arrays element by element |
  168. | original threw, port returned an error | match (`--strict-errors` also requires equal names, e.g. `error.RangeError` for a `RangeError`) |
  169. | one threw, the other did not | mismatch |
  170. | port crashed | mismatch on that case; the remaining cases are reported as not run |
  171. | result flaky across the two recording runs | skipped and reported |
  172. **Value encoding.** Results travel as JSON. Non-finite floats are written as `{"$num":"NaN"}`, `{"$num":"Infinity"}` or `{"$num":"-Infinity"}`. `undefined` becomes `null`. `Map` and `Set` become objects and arrays, `Date` an ISO string, and Python tuples become arrays. Values JSON cannot carry (functions, symbols, BigInt) are flagged by `record`.
  173. More detail is in [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).
  174. ## Calling the port from your code
  175. `zig-anything bridge <unit>` turns a passing port into something the original code can import today, without waiting for the rest of the migration:
  176. ```js
  177. // JavaScript / TypeScript: WebAssembly, loaded by Node with no build tools
  178. import { fuzzyScore, fuzzyScoreBatch } from './zig-port/fuzzyScore/bridge/index.mjs';
  179. ```
  180. ```python
  181. # Python: a native library loaded with the standard library's ctypes.
  182. # `zig-anything bridge` prints the exact import snippet for your source file.
  183. levenshtein = _mod.levenshtein # from zig-port/levenshtein/bridge/port.py
  184. ```
  185. The bindings keep the original name and parameters, raise matching exceptions (`RangeError`, `ValueError`, …) for errors the port returns, and are verified: `bridge` replays every recorded case through them.
  186. Each call crosses the boundary as JSON, which has a cost. Measured on the examples (same machine as [Benchmarks](#benchmarks)):
  187. | | Original | Through the bridge | Batched (`…Batch` / `…_batch`) |
  188. | --- | --- | --- | --- |
  189. | `levenshtein`, Python | 48 µs per call | 6.8 µs (7x faster) | 3.1 µs (15x faster) |
  190. | `fuzzyScore`, Node.js | 60 ns per call | 1.8 µs (30x slower) | 1.0 µs (17x slower) |
  191. The bridge pays off when the function does real work. A 60 ns function in a JIT is cheaper than any crossing: port its caller too, or call it in batches. `bridge` warns when `bench` shows this.
  192. ## Porting whole programs
  193. A program unit ports an entire command-line program, written in any language, by recording invocations instead of function calls:
  194. ```sh
  195. zig-anything init-cli wc --cwd tools -- python wc.py
  196. # edit zig-port/wc/inputs.jsonl: one invocation per line, e.g.
  197. # ["-l", "notes.txt"]
  198. # {"args": ["-w"], "stdin": "some text"}
  199. zig-anything record wc # stdout, stderr and exit code of each run
  200. # write zig-port/wc/src/main.zig
  201. zig-anything diff wc # compares stdout and exit code per invocation
  202. zig-anything gate wc
  203. zig-anything bench wc # whole-process time, startup included
  204. ```
  205. Both programs run from the same working directory. Line endings are normalized unless you pass `--exact-newlines`, and `--compare-stderr` also compares stderr.
  206. ## Writing a port
  207. The stub `init` writes looks like this:
  208. ```zig
  209. // TODO(zig-anything): port this function, then delete this line.
  210. pub fn slugify(allocator: std.mem.Allocator, text: []const u8) ![]const u8 {
  211. ...
  212. }
  213. ```
  214. - **Any signature works.** The harness reads your function's parameter types at compile time and decodes each recorded argument into them. Supported types: `bool`, integers, floats, `[]const u8`, slices of any supported type, optionals, structs (from JSON objects), enums (from strings) and `std.json.Value`.
  215. - **Allocation is free.** A `std.mem.Allocator` parameter receives a per-call arena that is reset after every call. Remove the parameter if you don't need it.
  216. - **Throws become errors.** Return an error wherever the original throws or raises.
  217. - **Return anything encodable**: the same types as parameters, plus tuples and fixed arrays.
  218. - **Delete the TODO marker.** `gate` refuses a port that still carries it.
  219. - **`port.zig` is plain Zig.** The unit's `build.zig` exposes it as the module `port`, so a Zig program can depend on it directly once the migration is complete.
  220. Inferred types map like this: `number` → `f64`, `int` → `i64`, `string` → `[]const u8`, `bool` → `bool`, `number_array` → `[]const f64`, `int_array` → `[]const i64`, `string_array` → `[]const []const u8`, and anything else → `std.json.Value`.
  221. ## Configuration
  222. Configuration is optional. zig-anything looks for a `zig-anything.json` in the current directory or the unit's directory, then in each parent directory. Unknown fields are rejected, so typos surface immediately.
  223. ```json
  224. {
  225. "units_dir": "zig-port",
  226. "node": ["node"],
  227. "python": ["python3"],
  228. "zig": "zig",
  229. "samples": 64,
  230. "seed": 1,
  231. "max_cases": 2000,
  232. "timeout": 300,
  233. "tolerance": 0
  234. }
  235. ```
  236. | Field | Meaning |
  237. | --- | --- |
  238. | `units_dir` | where `init` puts units, relative to the config file |
  239. | `node`, `python` | command plus leading arguments used to run the original, e.g. `["node", "--import", "tsx"]` for TypeScript that needs a loader |
  240. | `zig` | compiler used to build units |
  241. | `samples`, `seed`, `max_cases` | case generation |
  242. | `timeout` | seconds before any child process is stopped |
  243. | `tolerance` | default float tolerance for `diff` |
  244. Environment overrides: `ZIG_ANYTHING_NODE`, `ZIG_ANYTHING_PYTHON`, `ZIG`, `NO_COLOR`. Run `zig-anything help config` to see the defaults for your platform.
  245. ## MCP server
  246. `zig-anything mcp` speaks the Model Context Protocol over stdio. It exposes eight tools: `zig_anything_scan`, `_init`, `_record`, `_build`, `_diff`, `_bench`, `_gate` and `_status`. With them, a coding agent can drive the whole loop: scan, init, record, write the port, diff until green, gate.
  247. ```sh
  248. zig-anything mcp --print-config
  249. ```
  250. That prints a snippet like this for your MCP client's configuration:
  251. ```json
  252. {
  253. "mcpServers": {
  254. "zig-anything": { "command": "/path/to/zig-anything", "args": ["mcp"] }
  255. }
  256. }
  257. ```
  258. ## Scope and limitations
  259. zig-anything is honest about what it can and cannot check:
  260. - **Languages:** JavaScript, TypeScript and Python sources. The scanners are lightweight tokenizers, not full parsers. They handle the declaration forms in common use (functions, arrow functions, `export` lists, CommonJS exports, TS overloads, Python annotations and multi-line signatures).
  261. - **Units are functions or whole programs.** A function unit is one top-level function with JSON-representable inputs and outputs; classes, closures, generators, callbacks and functions that mutate shared state need a wrapper function. A program unit compares stdout, stderr and exit codes, not files the program writes.
  262. - **Side effects are not recorded.** Only return values and thrown errors are compared. A port that prints, writes files or mutates its arguments differently is not caught.
  263. - **Coverage is only as good as the inputs.** Generated cases find many edge cases, but meaningful inputs for domain logic belong in `inputs.jsonl` (see [examples/fuzzy-js](examples/fuzzy-js)). A passing gate means "equal on every recorded case", not "proven equal".
  264. - **Nondeterminism:** results that depend on time, randomness or I/O are detected (flaky) and skipped, not compared.
  265. - **TypeScript** runs through Node's native type stripping, which supports erasable syntax only (no `enum` or `namespace` declarations). Configure a loader such as `tsx` for anything else.
  266. - **Per-call speed is not end-to-end speed.** Calling a port through `bridge` costs about 1 µs (Node) to 3–7 µs (Python) per call, so tiny functions can get slower. `bench` and `bridge` warn when that is likely.
  267. - **Not supported:** recording side effects (files, network, email) of function units, whole HTTP servers, and source languages other than JavaScript, TypeScript and Python for function units.
  268. ## Building from source
  269. ```sh
  270. zig build # debug build -> zig-out/bin/zig-anything
  271. zig build -Doptimize=fast # optimized for speed
  272. zig build -Doptimize=small # optimized for size
  273. zig build -Doptimize=safe # optimized, with safety checks kept
  274. zig build test # unit tests
  275. zig build e2e # end-to-end tests (needs node, python, zig)
  276. zig build microbench # micro benchmarks of the tool's hot paths
  277. zig build release # size-optimized binaries for all six targets
  278. ```
  279. Source layout:
  280. ```text
  281. src/
  282. ├── main.zig command table, help, dispatch
  283. ├── cli.zig context, styled output, errors, flag parsing
  284. ├── config.zig zig-anything.json
  285. ├── scan.zig JS/TS/Python function scanners and type inference
  286. ├── gen.zig edge-case and random input generation
  287. ├── unit.zig unit manifest, scaffolding, builds
  288. ├── cases.zig cases.jsonl
  289. ├── runtime.zig running the original through node/python
  290. ├── jsonx.zig semantic JSON equality
  291. ├── proc.zig child processes
  292. ├── mcp.zig MCP server
  293. ├── cmd/ scan+init, record, build+diff, bench, gate+status, bridge, program units, profile
  294. └── assets/ files embedded in the binary: recorders, runtime, unit build.zig
  295. ```
  296. ## Contributing
  297. Contributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for the development workflow, test expectations and the rule about benchmarks (verified numbers only).
  298. ## License
  299. [MIT](LICENSE)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.